[Libreoffice-commits] .: 2 commits - oox/source
Muthu Subramanian
sumuthu at kemper.freedesktop.org
Wed Aug 24 08:48:54 PDT 2011
oox/source/drawingml/textbodypropertiescontext.cxx | 45 +++++++++++++--------
oox/source/ppt/conditioncontext.cxx | 1
2 files changed, 29 insertions(+), 17 deletions(-)
New commits:
commit 67b79b6ada570f83fb1f8fc5aaeddd91d8517c19
Author: Muthu Subramanian <sumuthu at novell.com>
Date: Wed Aug 24 13:38:04 2011 +0530
Code review: Removed unnecessary header.
diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx
index 6be6b1f..e9956b7 100644
--- a/oox/source/ppt/conditioncontext.cxx
+++ b/oox/source/ppt/conditioncontext.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/animations/EventTrigger.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/contexthandler.hxx"
#include "oox/ppt/animationspersist.hxx"
#include "animationtypes.hxx"
commit f1a2b0cb3c221c6cc09fd2d1091d20254ddbcb3a
Author: Muthu Subramanian <sumuthu at novell.com>
Date: Wed Aug 24 13:34:37 2011 +0530
n#592912: When text is vertical, horiz & vert aligns are swapped.
- vert270 doesn't seem to be supported by LO.
- vert270 would be WritingMode_TB_LR ? otherwise we need to support it
by doing other operations like rotation or flip. Is that necessary ?
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 7cc7aff..ed95ee7 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -86,21 +86,6 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
mrTextBodyProp.maPropertyMap[ PROP_TextLowerDistance ] <<= static_cast< sal_Int32 >( nBottonInset );
}
- // ST_TextAnchoringType
- if( xAttributes->hasAttribute( XML_anchor ) ) {
- drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
- switch( xAttributes->getOptionalValueToken( XML_anchor, XML_t ) )
- {
- case XML_b : eVA = drawing::TextVerticalAdjust_BOTTOM; break;
- case XML_dist :
- case XML_just :
- case XML_ctr : eVA = drawing::TextVerticalAdjust_CENTER; break;
- default:
- case XML_t : eVA = drawing::TextVerticalAdjust_TOP; break;
- }
- mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA;
- }
-
bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
if( xAttributes->hasAttribute( XML_anchorCtr ) ) {
if( bAnchorCenter )
@@ -139,11 +124,39 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
// workaround for TB_LR as using WritingMode2 doesn't work
if( !bAnchorCenter )
mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
- TextHorizontalAdjust_LEFT;
+ (tVert == XML_vert270) ? TextHorizontalAdjust_RIGHT : TextHorizontalAdjust_LEFT;
+ // Default for vert270
+ if( tVert == XML_vert270 )
+ mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= drawing::TextVerticalAdjust_BOTTOM;
} else
mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
<<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB );
}
+
+ // ST_TextAnchoringType
+ if( xAttributes->hasAttribute( XML_anchor ) ) {
+ drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
+ switch( xAttributes->getOptionalValueToken( XML_anchor, XML_t ) )
+ {
+ case XML_b : eVA = drawing::TextVerticalAdjust_BOTTOM; break;
+ case XML_dist :
+ case XML_just :
+ case XML_ctr : eVA = drawing::TextVerticalAdjust_CENTER; break;
+ default:
+ case XML_t : eVA = drawing::TextVerticalAdjust_TOP; break;
+ }
+ if( !xAttributes->hasAttribute( XML_vert ) )
+ mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA;
+ else
+ {
+ if( ( mrTextBodyProp.moVert.get( XML_horz ) == XML_vert && eVA == drawing::TextVerticalAdjust_TOP ) ||
+ ( mrTextBodyProp.moVert.get( XML_horz ) == XML_vert270 && eVA == drawing::TextVerticalAdjust_BOTTOM ) )
+ {
+ mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
+ TextHorizontalAdjust_RIGHT;
+ }
+ }
+ }
}
// --------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list