summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/textbodyproperties.cxx
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-02-14 19:49:31 +0530
committerMuthu Subramanian <sumuthu@suse.com>2012-02-14 19:50:40 +0530
commit8167b8f3d9ca506a30bd8454d934d713033cb8b4 (patch)
tree8fb620f1bf32db36ccfa15bb50c41161d0be1c14 /oox/source/drawingml/textbodyproperties.cxx
parentcc459ea8c1d2d398c0bad5e52591af93ebc4db38 (diff)
n744510: Improved 'vert' text imports.
Diffstat (limited to 'oox/source/drawingml/textbodyproperties.cxx')
-rw-r--r--oox/source/drawingml/textbodyproperties.cxx32
1 files changed, 30 insertions, 2 deletions
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 43acd8c19bfd..b79883a2d12d 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -26,16 +26,22 @@
*
************************************************************************/
-#include "oox/drawingml/textbodyproperties.hxx"
#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/token/tokens.hxx"
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::text;
+
namespace oox {
namespace drawingml {
// ============================================================================
-TextBodyProperties::TextBodyProperties()
+TextBodyProperties::TextBodyProperties():
+ meVA( TextVerticalAdjust_TOP )
{
}
@@ -44,6 +50,28 @@ void TextBodyProperties::pushToPropMap( PropertyMap& rPropMap ) const
rPropMap.insert( maPropertyMap.begin(), maPropertyMap.end() );
}
+/* For Legacy purposes: TODO: Check if it is required at all! */
+void TextBodyProperties::pushVertSimulation()
+{
+ sal_Int32 tVert = moVert.get( XML_horz );
+ if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) {
+ // #160799# fake different vertical text modes by top-bottom writing mode
+ maPropertyMap[ PROP_TextWritingMode ] <<= WritingMode_TB_RL;
+
+ // workaround for TB_LR as using WritingMode2 doesn't work
+ if( meVA != TextVerticalAdjust_CENTER )
+ maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
+ (tVert == XML_vert270) ? TextHorizontalAdjust_RIGHT : TextHorizontalAdjust_LEFT;
+ if( tVert == XML_vert270 )
+ maPropertyMap[ PROP_TextVerticalAdjust ] <<= TextVerticalAdjust_BOTTOM;
+ if( ( tVert == XML_vert && meVA == TextVerticalAdjust_TOP ) ||
+ ( tVert == XML_vert270 && meVA == TextVerticalAdjust_BOTTOM ) )
+ maPropertyMap[ PROP_TextHorizontalAdjust ] <<= TextHorizontalAdjust_RIGHT;
+ else if( meVA == TextVerticalAdjust_CENTER )
+ maPropertyMap[ PROP_TextHorizontalAdjust ] <<= TextHorizontalAdjust_CENTER;
+ }
+}
+
// ============================================================================
} // namespace drawingml