download.lst | 4 ++-- editeng/source/editeng/impedit3.cxx | 9 +++++++++ editeng/source/items/frmitems.cxx | 6 ++++++ include/editeng/frmdir.hxx | 3 +++ offapi/com/sun/star/text/WritingMode2.idl | 10 ++++++++++ oox/source/drawingml/textbodypropertiescontext.cxx | 7 ++++++- oox/source/drawingml/textparagraph.cxx | 10 ++++++++++ oox/source/export/drawingml.cxx | 2 ++ oox/source/shape/WpsContext.cxx | 14 ++++++++++---- 9 files changed, 58 insertions(+), 7 deletions(-)
New commits: commit f846efa507252b0584d2753a251f2dd99c34541a Author: Attila Szűcs <[email protected]> AuthorDate: Thu Feb 8 15:46:07 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Feb 16 13:07:18 2024 +0100 tdf#67347 pptx import: stacked text, minimal impl. Display Stacked text, and Import/Export Stacked property from/to pptx. It is a minimal implementation, it does not import/export to .odp, there is no user interface to set this property. Multiline Stacked text is rendered as 1 line text. XML_wordArtVertRtl is mapped to XML_wordArtVert. Editing of text containing space character seems to not work correctly. Change-Id: I535da45e3a2f2d1550bad2a40e9909e0d561d0ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163121 Tested-by: Jenkins Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 51c922ce0b3f..54a7745eca7a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -42,6 +42,7 @@ #include <editeng/wghtitem.hxx> #include <editeng/postitem.hxx> #include <editeng/langitem.hxx> +#include <editeng/frmdiritem.hxx> #include <editeng/scriptspaceitem.hxx> #include <editeng/charscaleitem.hxx> #include <editeng/numitem.hxx> @@ -694,6 +695,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) return false; } + //If the paragraph SvxFrameDirection is Stacked, use ONECHARPERLINE + const SvxFrameDirectionItem* pFrameDirItem = &GetParaAttrib(nPara, EE_PARA_WRITINGDIR); + bool bStacked = pFrameDirItem->GetValue() == SvxFrameDirection::Stacked; + if (bStacked) + maStatus.TurnOnFlags(EEControlBits::ONECHARPERLINE); + else + maStatus.TurnOffFlags(EEControlBits::ONECHARPERLINE); + // Initialization... // Always format for 100%: diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index e84ae2140e33..fa393ff4ccd8 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -4675,6 +4675,9 @@ bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal, case text::WritingMode2::PAGE: SetValue( SvxFrameDirection::Environment ); break; + case text::WritingMode2::STACKED: + SetValue(SvxFrameDirection::Stacked); + break; default: bRet = false; break; @@ -4714,6 +4717,9 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal, case SvxFrameDirection::Environment: nVal = text::WritingMode2::PAGE; break; + case SvxFrameDirection::Stacked: + nVal = text::WritingMode2::STACKED; + break; default: OSL_FAIL("Unknown SvxFrameDirection value!"); bRet = false; diff --git a/include/editeng/frmdir.hxx b/include/editeng/frmdir.hxx index 270ab62c626d..94972ebff0b0 100644 --- a/include/editeng/frmdir.hxx +++ b/include/editeng/frmdir.hxx @@ -56,6 +56,9 @@ enum class SvxFrameDirection /** Vertical, from top to bottom, from right to left (vert="vert"). */ Vertical_RL_TB90 = css::text::WritingMode2::TB_RL90, + + /** Stacked, from top to bottom, 1 char per line (vert="wordArtVert"). */ + Stacked = css::text::WritingMode2::STACKED, }; TranslateId getFrmDirResId(size_t nIndex); diff --git a/offapi/com/sun/star/text/WritingMode2.idl b/offapi/com/sun/star/text/WritingMode2.idl index f75108337a69..065912858de5 100644 --- a/offapi/com/sun/star/text/WritingMode2.idl +++ b/offapi/com/sun/star/text/WritingMode2.idl @@ -91,6 +91,16 @@ published constants WritingMode2 @since LibreOffice 7.5 */ const short TB_RL90 = 6; + + /** 'T' text within a line is written top-to-bottom, but characters are + 'E' not rotated. + 'X' This is like LR_TB where 1 Character fit in every line. + 'T' Only 1 line display is implemented. + This corresponds to OOXML attribute vert="wordArtVert" for shapes. + + @since LibreOffice 24.8 + */ + const short STACKED = 7; }; 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 commit 4897792975453024db8369c3d8c5f2e65c956d73 Author: Mike Kaganski <[email protected]> AuthorDate: Fri Feb 16 13:43:20 2024 +0600 Commit: Mike Kaganski <[email protected]> CommitDate: Fri Feb 16 13:06:52 2024 +0100 OpenSSL: upgrade to 3.0.13 Change-Id: Ib03c99a2dbf0f7c932b8a6b953ac9eb9c43f978f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163475 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/download.lst b/download.lst index 626891289b59..87350bfbcb8e 100644 --- a/download.lst +++ b/download.lst @@ -508,8 +508,8 @@ OPENLDAP_TARBALL := openldap-2.6.6.tgz # three static lines # so that git cherry-pick # will not run into conflicts -OPENSSL_SHA256SUM := b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55 -OPENSSL_TARBALL := openssl-3.0.11.tar.gz +OPENSSL_SHA256SUM := 88525753f79d3bec27d2fa7c66aa0b92b3aa9498dafd93d7cfa4b3780cdae313 +OPENSSL_TARBALL := openssl-3.0.13.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts
