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-08-07 18:26:00 +0200
commit2af2b9be05a4733c691db7201e76b4058516c47b (patch)
tree6ff2c10eab1a70caf9d025d62ade997309f3c49f
parent2cb90a5c87fe46737c8d840967d8836284f92ffd (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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100332 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-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 c010436499f9..06dbbc57a21c 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -96,6 +96,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 22dcc871ab83..bb5e2b8eee50 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