From 718203e37025fc1cc1e28f9e52f05bee79684811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= Date: Sat, 8 Feb 2014 01:49:39 +0100 Subject: [PATCH] drawingML export/import: text frames with vertical alignment Change-Id: I469da0a8234dd2979facfed3d66907aad1a138ab --- include/oox/drawingml/drawingmltypes.hxx | 6 +++ oox/source/drawingml/drawingmltypes.cxx | 39 ++++++++++++++++++ .../drawingml/textbodypropertiescontext.cxx | 13 ++---- oox/source/export/drawingml.cxx | 13 +----- oox/source/shape/WpsContext.cxx | 8 ++++ .../data/dml-textframe-vertadjust.docx | Bin 0 -> 18296 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 16 +++++++ sw/source/filter/ww8/docxsdrexport.cxx | 6 +++ 8 files changed, 80 insertions(+), 21 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/dml-textframe-vertadjust.docx diff --git a/include/oox/drawingml/drawingmltypes.hxx b/include/oox/drawingml/drawingmltypes.hxx index aa00f2a28d98..20c8c988ea43 100644 --- a/include/oox/drawingml/drawingmltypes.hxx +++ b/include/oox/drawingml/drawingmltypes.hxx @@ -126,6 +126,12 @@ sal_Int16 GetCaseMap( sal_Int32 nToken ); /** converts a paragraph align to a ParaAdjust */ sal_Int16 GetParaAdjust( sal_Int32 nAlign ); +// Convert vertical adjust tokens to a TextVerticalAdjust item +::com::sun::star::drawing::TextVerticalAdjust GetTextVerticalAdjust( sal_Int32 nToken ); + +// Convert a TextVerticalAdjust item to string value appearing in ooxml +SAL_DLLPUBLIC const char* GetTextVerticalAdjust( ::com::sun::star::drawing::TextVerticalAdjust eAdjust ); + // ============================================================================ // CT_IndexRange diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx index 9dd42eb01595..a96eaf382ffd 100644 --- a/oox/source/drawingml/drawingmltypes.cxx +++ b/oox/source/drawingml/drawingmltypes.cxx @@ -187,6 +187,45 @@ sal_Int16 GetParaAdjust( sal_Int32 nAlign ) return nEnum; } +TextVerticalAdjust GetTextVerticalAdjust( sal_Int32 nToken ) +{ + TextVerticalAdjust aVertAdjust; + switch( nToken ) + { + case XML_b: + aVertAdjust = TextVerticalAdjust_BOTTOM; + break; + case XML_dist: + case XML_just: + case XML_ctr: + aVertAdjust = TextVerticalAdjust_CENTER; + break; + case XML_t: + default: + aVertAdjust = TextVerticalAdjust_TOP; + break; + } + return aVertAdjust; +} + +const char* GetTextVerticalAdjust( TextVerticalAdjust eAdjust ) +{ + const char* sVerticalAdjust = 0; + switch( eAdjust ) + { + case TextVerticalAdjust_BOTTOM: + sVerticalAdjust = "b"; + break; + case TextVerticalAdjust_CENTER: + sVerticalAdjust = "ctr"; + break; + case TextVerticalAdjust_TOP: + default: + sVerticalAdjust = "t"; + break; + } + return sVerticalAdjust; +} TabAlign GetTabAlign( sal_Int32 aToken ) { diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 358db9f9c987..81a99e824215 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -96,16 +96,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper& rPa } // ST_TextAnchoringType - if( rAttribs.hasAttribute( XML_anchor ) ) { - switch( rAttribs.getToken( XML_anchor, XML_t ) ) - { - case XML_b : mrTextBodyProp.meVA = drawing::TextVerticalAdjust_BOTTOM; break; - case XML_dist : - case XML_just : - case XML_ctr : mrTextBodyProp.meVA = drawing::TextVerticalAdjust_CENTER; break; - default: - case XML_t : mrTextBodyProp.meVA = drawing::TextVerticalAdjust_TOP; break; - } + if( rAttribs.hasAttribute( XML_anchor ) ) + { + mrTextBodyProp.meVA = GetTextVerticalAdjust( rAttribs.getToken( XML_anchor, XML_t ) ); mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= mrTextBodyProp.meVA; } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 11fd26afd01f..f2dd046a3cf7 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1541,17 +1541,8 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b TextVerticalAdjust eVerticalAlignment( TextVerticalAdjust_TOP ); const char* sVerticalAlignment = NULL; GET( eVerticalAlignment, TextVerticalAdjust ); - switch( eVerticalAlignment ) { - case TextVerticalAdjust_BOTTOM: - sVerticalAlignment = "b"; - break; - case TextVerticalAdjust_CENTER: - sVerticalAlignment = "ctr"; - break; - case TextVerticalAdjust_TOP: - default: - ; - } + if( eVerticalAlignment != TextVerticalAdjust_TOP ) + sVerticalAlignment = GetTextVerticalAdjust(eVerticalAlignment); const char* sWritingMode = NULL; sal_Bool bVertical = sal_False; diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 04e8a232332c..7d37fc19f54f 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -11,6 +11,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -86,6 +87,13 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken for (size_t i = 0; i < SAL_N_ELEMENTS(aProps); ++i) if (oInsets[i]) xPropertySet->setPropertyValue(aProps[i], uno::makeAny(*oInsets[i])); + + // Handle text vertical adjustment inside a text frame + if( rAttribs.hasAttribute( XML_anchor ) ) + { + drawing::TextVerticalAdjust eAdjust = drawingml::GetTextVerticalAdjust( rAttribs.getToken( XML_anchor, XML_t ) ); + xPropertySet->setPropertyValue("TextVerticalAdjust", uno::makeAny(eAdjust)); + } return this; } break; diff --git a/sw/qa/extras/ooxmlexport/data/dml-textframe-vertadjust.docx b/sw/qa/extras/ooxmlexport/data/dml-textframe-vertadjust.docx new file mode 100644 index 0000000000000000000000000000000000000000..bf5dcdde43a12ce8093443328a3efa6beb3d1d09 GIT binary patch literal 18296 zcmeIagMVe)vIe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parVzi;mS7nZ>1OBw!StMA|0 z|6X+SFZN#q|6u=n3C`ak{+`_Y7sLShKOp`+)%kb!zo%FJ#qLY}5B9$$TmFvl_hiGr z5E^OzDZqbAJ^UT#uPYV*LiwD=SO9?kShx5)``@24{{_I$_7^e!m;nFI{C6k$FXmp} ue=z^WW&WN2uM_USxB-Ah{(qDGAJea#B-rOL0{~z@f1o}`s+!OrpZ*^KLXiOg literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 1284699ca6e1..27fba459a20e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -2868,6 +2869,21 @@ DECLARE_OOXMLEXPORT_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx") CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").match("6138")); } +DECLARE_OOXMLEXPORT_TEST(testDMLTextFrameVertAdjust, "dml-textframe-vertadjust.docx") +{ + // DOCX textboxes with text are imported as text frames but in Writer text frames did not have + // TextVerticalAdjust attribute so far. + + // 1st frame's context is adjusted to the top + uno::Reference xFrame(getTextFrameByName("Rectangle 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty(xFrame, "TextVerticalAdjust")); + // 2nd frame's context is adjusted to the center + xFrame.set(getTextFrameByName("Rectangle 2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_CENTER, getProperty(xFrame, "TextVerticalAdjust")); + // 3rd frame's context is adjusted to the bottom + xFrame.set(getTextFrameByName("Rectangle 3"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty(xFrame, "TextVerticalAdjust")); +} #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index cd2bd55e4563..6278a29f4bb0 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -881,6 +881,12 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId) FSEND); m_pImpl->m_bDMLTextFrameSyntax = true; m_pImpl->m_pBodyPrAttrList = pFS->createAttrList(); + { + drawing::TextVerticalAdjust eAdjust = drawing::TextVerticalAdjust_TOP; + if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("TextVerticalAdjust") ) + xPropertySet->getPropertyValue("TextVerticalAdjust") >>= eAdjust; + m_pImpl->m_pBodyPrAttrList->add(XML_anchor, oox::drawingml::GetTextVerticalAdjust(eAdjust)); + } m_pImpl->m_rExport.OutputFormat(pParentFrame->GetFrmFmt(), false, false, true); m_pImpl->m_bDMLTextFrameSyntax = false; writeDMLEffectLst(rFrmFmt);