incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1358218 - /incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
Date Fri, 06 Jul 2012 14:02:07 GMT
Author: af
Date: Fri Jul  6 14:02:06 2012
New Revision: 1358218

URL: http://svn.apache.org/viewvc?rev=1358218&view=rev
Log:
#i119884# Fixed export of fontwork alignment.

          Reported by: Li Feng Wang
          Patch by: SunYing
          Review by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx

Modified: incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx?rev=1358218&r1=1358217&r2=1358218&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx Fri Jul  6 14:02:06 2012
@@ -77,6 +77,7 @@
 #include <com/sun/star/drawing/ProjectionMode.hpp>
 #include <com/sun/star/text/XSimpleText.hpp>
 #include <com/sun/star/drawing/ShadeMode.hpp>
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
 #include <vcl/hatch.hxx>
 #include <com/sun/star/awt/XGraphics.hpp>
 #include <com/sun/star/awt/FontSlant.hpp>
@@ -3113,6 +3114,42 @@ void EscherPropertyContainer::CreateCust
 										nTextPathFlags &=~0x20;
 								}
 							}
+							//export gTextAlign attr
+							if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM(
"TextHorizontalAdjust" ) ), sal_True ) )
+							{
+								MSO_GeoTextAlign  gTextAlign = mso_alignTextCenter;
+								SdrFitToSizeType  eFTS( ((SdrTextFitToSizeTypeItem&)pCustoShape->GetMergedItem(
SDRATTR_TEXT_FITTOSIZE )).GetValue() );
+								drawing::TextHorizontalAdjust	eHA( drawing::TextHorizontalAdjust_LEFT );
+								aAny >>= eHA;
+								switch( eHA )
+								{
+								case drawing::TextHorizontalAdjust_LEFT :
+									gTextAlign = mso_alignTextLeft;
+									break;
+								case drawing::TextHorizontalAdjust_CENTER:
+									gTextAlign = mso_alignTextCenter;
+									break;
+								case drawing::TextHorizontalAdjust_RIGHT:
+									gTextAlign = mso_alignTextRight;
+									break;
+								case drawing::TextHorizontalAdjust_BLOCK:
+									{
+										SdrFitToSizeType  eFTS( ((SdrTextFitToSizeTypeItem&)pCustoShape->GetMergedItem(
SDRATTR_TEXT_FITTOSIZE )).GetValue() );
+										if ( eFTS == SDRTEXTFIT_ALLLINES)
+										{
+											gTextAlign = mso_alignTextStretch;
+										}
+										else
+										{
+											gTextAlign = mso_alignTextWordJust;
+										}
+										break;
+									}
+								default:
+									break;
+								}
+								AddOpt(DFF_Prop_gtextAlign,gTextAlign);
+							}
 						}
 						if((nTextPathFlags & 0x4000) != 0)  //Is Font work
 						{



Mime
View raw message