diff options
-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"); + } } } |