diff options
author | Yong Lin Ma <mayongl@apache.org> | 2012-06-07 11:25:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-11 12:10:05 +0100 |
commit | acc671ec74c874ffd22803bb2ee54a1f2c027155 (patch) | |
tree | fda22587b2499f1d6918d5c55f61952f05f09df0 /writerfilter | |
parent | Get soffice.cfg from its new location for Android, too (diff) | |
download | core-acc671ec74c874ffd22803bb2ee54a1f2c027155.tar.gz core-acc671ec74c874ffd22803bb2ee54a1f2c027155.zip |
Resolves: #i119464# Update default alignment value for docx [Sub]Title
Patch by: Ying Zhang
Review by: mayongl
(cherry picked from commit 22602686933abaa1512ebd3bca77dbb9987b6ad5)
Change-Id: I04cf1bbbeadf23147fa2cbc1c08c850288ef943a
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 8aca45eff6fb..8766d73fcbda 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XStyle.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <map> @@ -835,7 +836,23 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT )); xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT_ASIAN )); xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT_COMPLEX)); - + } + else if (sConvertedStyleName == "Title" || sConvertedStyleName == "Subtitle") + { + //set the default adjust for ParaStyle Title and Subtitle to left + try + { + uno::Reference< beans::XPropertySet > xProp( xStyle, uno::UNO_QUERY ); + if( xProp.is() ) + { + uno::Any aMSDefaultVal = uno::makeAny( (sal_Int16)style::ParagraphAdjust_LEFT ); + xProp->setPropertyValue( rPropNameSupplier.GetName( PROP_PARA_ADJUST), aMSDefaultVal ); + } + } + catch(...) + { + OSL_ENSURE( false, "Default ParaAdjust style property could not be set"); + } } } |