Commits

Anonymous committed 76aaac7

textalignment01: #i105270# - enhancement of text alignment UNO-API in reportdesign

  • Participants
  • Parent commits 6b8e541

Comments (0)

Files changed (12)

File offapi/com/sun/star/report/XReportControlFormat.idl

 #include <com/sun/star/lang/IllegalArgumentException.idl> 
 #include <com/sun/star/lang/Locale.idl>
 #include <com/sun/star/style/ParagraphAdjust.idl>
+#include <com/sun/star/style/ParagraphTextAlignment.idl>
 #include <com/sun/star/style/VerticalAlignment.idl>
 #include <com/sun/star/util/Color.idl>
 //============================================================================= 
 
 	/** specifies the horizontal alignment of the text. 
         @see ::com::sun::star::style::ParagraphAdjust
+            
+        @deprecated in favor of property <member>ParaTextAlign</member>
 	 */
 	[attribute,bound] short ParaAdjust
-    {
+        {
 		set raises ( com::sun::star::beans::UnknownPropertyException );
 		get raises ( com::sun::star::beans::UnknownPropertyException );
 	};
 
+        /** specifies the text alignment of the text. 
+        @see ::com::sun::star::style::ParagraphTextAlignment
+        
+        <p>introduced to replace property <member>ParaAdjust</member></p>
+         
+        @since OOo 3.4
+         */
+        [attribute, bound] com::sun::star::style::ParagraphTextAlignment ParaTextAlign
+        {
+                set raises ( com::sun::star::beans::UnknownPropertyException );
+                get raises ( com::sun::star::beans::UnknownPropertyException );
+        };
 	//------------------------------------------------------------------------- 
 
 	/** specifies the font attributes of the text in the control.

File reportdesign/inc/ReportHelperDefines.hxx

     virtual void SAL_CALL setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
     virtual ::sal_Int16 SAL_CALL getParaAdjust() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
     virtual void SAL_CALL setParaAdjust( ::sal_Int16 _paraadjust ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+    virtual ::com::sun::star::style::ParagraphTextAlignment SAL_CALL getParaTextAlign() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+    virtual void SAL_CALL setParaTextAlign( ::com::sun::star::style::ParagraphTextAlignment _paratextalign ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
     virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
     virtual void SAL_CALL setFontDescriptor( const ::com::sun::star::awt::FontDescriptor& _fontdescriptor ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
     virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptorAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\

File reportdesign/source/core/api/FixedLine.cxx

             ,PROPERTY_MASTERFIELDS
             ,PROPERTY_DETAILFIELDS
             ,PROPERTY_PARAADJUST
+            // --> OD #i105270#
+            ,PROPERTY_PARATEXTALIGN
+            // <--
 
             , PROPERTY_CHAREMPHASISASIAN
             , PROPERTY_CHARFONTNAMEASIAN

File reportdesign/source/core/api/FixedText.cxx

 #include "FormatCondition.hxx"
 #include <com/sun/star/text/ParagraphVertAlign.hpp>
 #include "ReportHelperImpl.hxx"
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/style/ParagraphTextAlignment.hpp>
+
 // =============================================================================
 namespace reportdesign
 {

File reportdesign/source/core/api/FormatCondition.cxx

 #include "Tools.hxx"
 #include <com/sun/star/text/ParagraphVertAlign.hpp>
 #include "ReportHelperImpl.hxx"
+#include <com/sun/star/style/ParagraphAdjust.hpp>
 #include "corestrings.hrc"
 // =============================================================================
 namespace reportdesign

File reportdesign/source/core/api/FormattedField.cxx

 #include "FormatCondition.hxx"
 #include <com/sun/star/text/ParagraphVertAlign.hpp>
 #include "ReportHelperImpl.hxx"
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/style/ParagraphTextAlignment.hpp>
+
 // =============================================================================
 namespace reportdesign
 {
 
 uno::Sequence< ::rtl::OUString > lcl_getFormattedFieldOptionals()
 {
-	::rtl::OUString pProps[] = { PROPERTY_MASTERFIELDS,PROPERTY_DETAILFIELDS };
+    ::rtl::OUString pProps[] = { 
+        PROPERTY_MASTERFIELDS
+        ,PROPERTY_DETAILFIELDS
+    };
 	return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
 }
 DBG_NAME( rpt_OFormattedField )

File reportdesign/source/core/api/ImageControl.cxx

             ,PROPERTY_MASTERFIELDS
             ,PROPERTY_DETAILFIELDS
             ,PROPERTY_PARAADJUST
+            // --> OD #i105270#
+            ,PROPERTY_PARATEXTALIGN
+            // <--
             , PROPERTY_CHAREMPHASISASIAN
             , PROPERTY_CHARFONTNAMEASIAN
             , PROPERTY_CHARFONTSTYLENAMEASIAN

File reportdesign/source/core/api/Shape.cxx

 #include "RptObject.hxx"
 #include "FormatCondition.hxx"
 #include "ReportHelperImpl.hxx"
+#include <com/sun/star/style/ParagraphAdjust.hpp>
 // =============================================================================
 namespace reportdesign
 {

File reportdesign/source/core/inc/ReportHelperImpl.hxx

 	set(PROPERTY_PARAADJUST,_align,varName.nAlign); \
 } \
  \
+style::ParagraphTextAlignment SAL_CALL clazz::getParaTextAlign() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+    const style::ParagraphAdjust eParaAdjust = static_cast<style::ParagraphAdjust>(getParaAdjust()); \
+    style::ParagraphTextAlignment eParaTextAlign = style::ParagraphTextAlignment_START; \
+    switch ( eParaAdjust ) \
+    { \
+        case style::ParagraphAdjust_LEFT: \
+            eParaTextAlign = style::ParagraphTextAlignment_START; \
+        break; \
+        case style::ParagraphAdjust_RIGHT: \
+            eParaTextAlign = style::ParagraphTextAlignment_END; \
+        break; \
+        case style::ParagraphAdjust_BLOCK: \
+            eParaTextAlign = style::ParagraphTextAlignment_BLOCK; \
+        break; \
+        case style::ParagraphAdjust_CENTER: \
+            eParaTextAlign = style::ParagraphTextAlignment_CENTER; \
+        break; \
+        case style::ParagraphAdjust_STRETCH: \
+            eParaTextAlign = style::ParagraphTextAlignment_BLOCK; \
+        break; \
+        default: \
+            ; \
+    } \
+    return eParaTextAlign; \
+} \
+ \
+void SAL_CALL clazz::setParaTextAlign( style::ParagraphTextAlignment _textalign ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+    sal_Int16 eParaAdjust = style::ParagraphAdjust_LEFT; \
+    switch ( _textalign ) \
+    { \
+        case style::ParagraphTextAlignment_START: \
+            eParaAdjust = style::ParagraphAdjust_LEFT; \
+        break; \
+        case style::ParagraphTextAlignment_END: \
+            eParaAdjust = style::ParagraphAdjust_RIGHT; \
+        break; \
+        case style::ParagraphTextAlignment_BLOCK: \
+            eParaAdjust = style::ParagraphAdjust_BLOCK; \
+        break; \
+        case style::ParagraphTextAlignment_CENTER: \
+            eParaAdjust = style::ParagraphAdjust_CENTER; \
+        break; \
+        default: \
+            ; \
+    } \
+    setParaAdjust( eParaAdjust ); \
+} \
+ \
 awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() throw (beans::UnknownPropertyException,uno::RuntimeException) \
 { \
 	::osl::MutexGuard aGuard(m_aMutex); \
 {\
 	throw beans::UnknownPropertyException();\
 }\
+style::ParagraphTextAlignment SAL_CALL clazz::getParaTextAlign() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+    throw beans::UnknownPropertyException();\
+} \
+ \
+void SAL_CALL clazz::setParaTextAlign( style::ParagraphTextAlignment /*the_value*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+    throw beans::UnknownPropertyException();\
+} \
+ \
 ::sal_Int16 SAL_CALL clazz::getCharStrikeout() throw (uno::RuntimeException, beans::UnknownPropertyException)\
 {\
 	throw beans::UnknownPropertyException();\

File reportdesign/source/filter/xml/xmlfilter.cxx

             { MAP_LEN("PrivateData"), 0,    &::getCppuType( (uno::Reference<XInterface> *)0 ),  beans::PropertyAttribute::MAYBEVOID, 0 },
             { MAP_LEN( "BaseURI"),    0,    &::getCppuType( (::rtl::OUString *)0 ),             beans::PropertyAttribute::MAYBEVOID, 0 },
             { MAP_LEN( "StreamRelPath"), 0, &::getCppuType( (::rtl::OUString *)0 ),             beans::PropertyAttribute::MAYBEVOID, 0 },
+            // --> OD #i105270#
+            { MAP_LEN( "BuildId" ), 0,      &::getCppuType( (::rtl::OUString *)0 ),             beans::PropertyAttribute::MAYBEVOID, 0 },
+            // <--
             { NULL, 0, 0, NULL, 0, 0 }
 		};
         ::comphelper::MediaDescriptor aDescriptor(rDescriptor);

File reportdesign/source/inc/stringconstants.hrc

 DECLARE_CONSTASCII_USTRING(PROPERTY_POSITIONX			);
 DECLARE_CONSTASCII_USTRING(PROPERTY_POSITIONY			);
 DECLARE_CONSTASCII_USTRING(PROPERTY_DATAFIELD			);
-DECLARE_CONSTASCII_USTRING(PROPERTY_PARAADJUST				);
+DECLARE_CONSTASCII_USTRING(PROPERTY_PARAADJUST                          );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PARATEXTALIGN);
 DECLARE_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTOR		);
 DECLARE_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTORASIAN );
 DECLARE_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTORCOMPLEX);

File reportdesign/source/shared/stringconstants.cxx

 
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATAFIELD				, "DataField");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PARAADJUST			, "ParaAdjust");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PARATEXTALIGN         , "ParaTextAlign");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALIGN					, "Align");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTOR		, "FontDescriptor");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTORASIAN	, "FontDescriptorAsian");