diff options
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/textbodypropertiescontext.cxx | 7 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraph.cxx | 10 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 2 | ||||
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 14 |
4 files changed, 28 insertions, 5 deletions
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 46576c069c8e..a08ae8fb9f6d 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -146,7 +146,12 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper cons { mrTextBodyProp.maPropertyMap.setProperty(PROP_WritingMode, text::WritingMode2::BT_LR); } - else { + else if (tVert == XML_wordArtVert) // what about XML_wordArtVertRtl ? + { + mrTextBodyProp.maPropertyMap.setProperty(PROP_WritingMode, text::WritingMode2::STACKED); + } + else + { bool bRtl = rAttribs.getBool( XML_rtl, false ); mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWritingMode, ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB )); diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index e33cbb690ee9..860a9a4adf57 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <com/sun/star/text/WritingMode2.hpp> #include <drawingml/textparagraph.hxx> #include <oox/drawingml/drawingmltypes.hxx> #include <drawingml/textcharacterproperties.hxx> @@ -31,6 +32,7 @@ #include <com/sun/star/text/ControlCharacter.hpp> #include <oox/token/properties.hxx> +using namespace ::com::sun::star; using namespace ::com::sun::star::text; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -175,6 +177,14 @@ void TextParagraph::insertAt( aioBulletList.setProperty( PROP_GraphicSize, aBulletSize); } + // If the shape is Stacked then set Stacked into the TextParagraphProperties + Reference<XPropertySet> xProps2(xText, UNO_QUERY); + sal_Int16 nWritingMode = xProps2->getPropertyValue("WritingMode").get<sal_Int16>(); + if (nWritingMode == text::WritingMode2::STACKED) + { + aParaProp.getTextParagraphPropertyMap().setProperty(PROP_WritingMode, nWritingMode); + } + float fCharacterSize = nCharHeight > 0 ? GetFontHeight ( nCharHeight ) : pTextParagraphStyle->getCharHeightPoints( 12 ); aParaProp.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), true, fCharacterSize, true ); } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 9cd97d0b5f3e..20dba5b60de9 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3774,6 +3774,8 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo sWritingMode = "vert"; else if (nWritingMode == text::WritingMode2::TB_LR) sWritingMode = "mongolianVert"; + else if (nWritingMode == text::WritingMode2::STACKED) + sWritingMode = "wordArtVert"; } } diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index fae704856371..f0d5ed8133cf 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -607,20 +607,26 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken uno::Reference<lang::XServiceInfo> xServiceInfo(mxShape, uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY); sal_Int32 nVert = rAttribs.getToken(XML_vert, XML_horz); - // Values 'wordArtVert' and 'wordArtVertRtl' are not implemented. - // Map them to other vert values. - if (nVert == XML_eaVert || nVert == XML_wordArtVertRtl) + if (nVert == XML_eaVert) { xPropertySet->setPropertyValue("TextWritingMode", uno::Any(text::WritingMode_TB_RL)); xPropertySet->setPropertyValue("WritingMode", uno::Any(text::WritingMode2::TB_RL)); } - else if (nVert == XML_mongolianVert || nVert == XML_wordArtVert) + else if (nVert == XML_mongolianVert) { xPropertySet->setPropertyValue("WritingMode", uno::Any(text::WritingMode2::TB_LR)); } + else if (nVert == XML_wordArtVert || nVert == XML_wordArtVertRtl) + { + // Multiline wordArtVert is not implemented yet. + // It will render all the text in 1 line. + // Map 'wordArtVertRtl' to 'wordArtVert', as they are the same now. + xPropertySet->setPropertyValue("WritingMode", + uno::Any(text::WritingMode2::STACKED)); + } else if (nVert != XML_horz) // cases XML_vert and XML_vert270 { // Hack to get same rendering as after the fix for tdf#87924. If shape rotation |