writerfilter/source/dmapper/StyleSheetTable.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
New commits: commit acc671ec74c874ffd22803bb2ee54a1f2c027155 Author: Yong Lin Ma <mayo...@apache.org> Date: Thu Jun 7 11:25:56 2012 +0000 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 diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 8aca45e..8766d73 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"); + } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits