Author: mayongl
Date: Thu Jun 7 12:25:56 2012
New Revision: 1347586
URL: http://svn.apache.org/viewvc?rev=1347586&view=rev
Log:
119464: Update default alignment value for Title and Subtitle style in docx
Patch by: Ying Zhang
Review by: mayongl
Modified:
incubator/ooo/trunk/main/writerfilter/source/dmapper/StyleSheetTable.cxx
Modified:
incubator/ooo/trunk/main/writerfilter/source/dmapper/StyleSheetTable.cxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/StyleSheetTable.cxx?rev=1347586&r1=1347585&r2=1347586&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/StyleSheetTable.cxx
(original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/StyleSheetTable.cxx
Thu Jun 7 12:25:56 2012
@@ -37,6 +37,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>
@@ -893,7 +894,23 @@ void StyleSheetTable::ApplyStyleSheets(
xState->setPropertyToDefault(rPropNameSupplier.GetName(
PROP_CHAR_PROP_HEIGHT_ASIAN ));
xState->setPropertyToDefault(rPropNameSupplier.GetName(
PROP_CHAR_PROP_HEIGHT_COMPLEX));
- }
+ } else if(sConvertedStyleName.equalsAscii( "Title" ) ||
+
sConvertedStyleName.equalsAscii( "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");
+ }
+ }
}
if(bAddFollowStyle || aPropValues.getLength())