summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-07 15:45:25 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2020-10-16 11:09:31 +0200
commitb0602de78f76c3e064e9228498a659ad1b1413a3 (patch)
tree0eee1c5e9c8ce1dcf5e75fe59297a2445d7e3fd9
parent52f8d3f1c9cda7008785dbeb21a4ffdbf1137c93 (diff)
oox: VML export: produce bottom-to-top in a better way
Replace code added in 090c61eb93db4302d4565d5f11f7673190835fdb with something that uses the already generated ESCHER property; this lets a warning about the unhandled property disappear too. Change-Id: Ieed83dd8e17e92eea9901124fce5e6da2a17196a
-rw-r--r--include/oox/export/vmlexport.hxx3
-rw-r--r--oox/source/export/vmlexport.cxx36
2 files changed, 29 insertions, 10 deletions
diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
index 83b5b91c0d41..7c2d3a62da6f 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -99,6 +99,9 @@ class OOX_DLLPUBLIC VMLExport : public EscherEx
/// Remember style, the most important shape attribute ;-)
OStringBuffer m_ShapeStyle;
+ /// style for textbox
+ OStringBuffer m_TextboxStyle;
+
/// Remember the generated shape id.
OString m_sShapeId;
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 6fcc83a66da6..555796c47a9c 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -430,6 +430,28 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
break;
+ case ESCHER_Prop_txflTextFlow: // 136
+ {
+ // at least "bottom-to-top" only has an effect when it's on the v:textbox element, not on v:shape
+ assert(m_TextboxStyle.isEmpty());
+ switch (opt.nPropValue)
+ {
+ case ESCHER_txflHorzN:
+ m_TextboxStyle.append("layout-flow:horizontal");
+ break;
+ case ESCHER_txflTtoBA:
+ m_TextboxStyle.append("layout-flow:vertical");
+ break;
+ case ESCHER_txflBtoT:
+ m_TextboxStyle.append("mso-layout-flow-alt:bottom-to-top");
+ break;
+ default:
+ assert(false); // unimplemented in escher export
+ break;
+ }
+ }
+ break;
+
// coordorigin
case ESCHER_Prop_geoLeft: // 320
case ESCHER_Prop_geoTop: // 321
@@ -1345,6 +1367,8 @@ sal_Int32 VMLExport::StartShape()
// start of the shape
m_pSerializer->startElementNS( XML_v, nShapeElement, XFastAttributeListRef( m_pShapeAttrList ) );
+ OString const textboxStyle(m_TextboxStyle.makeStringAndClear());
+
// now check if we have some editeng text (not associated textbox) and we have a text exporter registered
const SdrTextObj* pTxtObj = dynamic_cast<const SdrTextObj*>( m_pSdrObject );
if (pTxtObj && m_pTextExport && msfilter::util::HasTextBoxContent(m_nShapeType) && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject))
@@ -1369,19 +1393,11 @@ sal_Int32 VMLExport::StartShape()
if( pParaObj )
{
- uno::Reference<beans::XPropertySet> xPropertySet(const_cast<SdrObject*>(m_pSdrObject)->getUnoShape(), uno::UNO_QUERY);
sax_fastparser::FastAttributeList* pTextboxAttrList = FastSerializerHelper::createAttrList();
sax_fastparser::XFastAttributeListRef xTextboxAttrList(pTextboxAttrList);
- if (xPropertySet->getPropertySetInfo()->hasPropertyByName("RotateAngle"))
+ if (!textboxStyle.isEmpty())
{
- sal_Int32 nTextRotateAngle = sal_Int32();
- if (xPropertySet->getPropertyValue("RotateAngle") >>= nTextRotateAngle)
- {
- if (nTextRotateAngle == 9000)
- {
- pTextboxAttrList->add(XML_style, "mso-layout-flow-alt:bottom-to-top");
- }
- }
+ pTextboxAttrList->add(XML_style, textboxStyle);
}
// this is reached only in case some text is attached to the shape