[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - oox/inc oox/source

Sarper Akdemir (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 23 21:30:58 UTC 2021


 oox/inc/drawingml/textbody.hxx           |    7 +++++++
 oox/source/drawingml/textbody.cxx        |    1 +
 oox/source/drawingml/textbodycontext.cxx |    4 ++++
 3 files changed, 12 insertions(+)

New commits:
commit b74b439cb637c48763d693366b243d356a258eed
Author:     Sarper Akdemir <sarper.akdemir at collabora.com>
AuthorDate: Sun May 9 20:55:17 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Jun 23 23:30:18 2021 +0200

    tdf#59323: ooxml import: hasNoninheritedBodyProperties
    
    Introduces hasNoninheritedBodyProperties.
    
    Change-Id: Id108f692005455376537e515f41528cc66a8c25c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117006
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117533
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index ba9fde01227a..27bd7856bcbc 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -77,6 +77,11 @@ public:
     /// Returns whether the textbody had a pPr tag in it
     bool hasParagraphProperties() const;
 
+    /// Returns whether the textbody had a non-empty bodyPr tag in it
+    bool hasNoninheritedBodyProperties() const { return mbHasNoninheritedBodyProperties; }
+    /// Flags textbody as having a non-empty bodyPr tag
+    void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties = true; }
+
     void                ApplyStyleEmpty(
                             const ::oox::core::XmlFilterBase& rFilterBase,
                             const css::uno::Reference < css::text::XText > & xText,
@@ -85,6 +90,8 @@ public:
 protected:
     TextParagraphVector maParagraphs;
     TextBodyProperties  maTextProperties;
+    /// Set if bodyPr tag in this textbody is non-empty during import
+    bool                mbHasNoninheritedBodyProperties;
     TextListStyle       maTextListStyle;
     Text3DProperties    ma3DProperties;
 };
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index 534440cf0042..9458f9de82ab 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -32,6 +32,7 @@ using namespace ::com::sun::star::beans;
 namespace oox { namespace drawingml {
 
 TextBody::TextBody()
+    : mbHasNoninheritedBodyProperties( false )
 {
 }
 
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index c636899121a4..3e0637c87f91 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -28,6 +28,8 @@
 #include <oox/drawingml/shape.hxx>
 #include <oox/token/namespaces.hxx>
 #include <oox/token/tokens.hxx>
+#include <oox/helper/attributelist.hxx>
+#include <sax/fastattribs.hxx>
 
 #include <oox/mathml/import.hxx>
 
@@ -176,6 +178,8 @@ ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, con
     switch( aElementToken )
     {
         case A_TOKEN( bodyPr ):     // CT_TextBodyPropertyBag
+            if (sax_fastparser::FastAttributeList::castToFastAttributeList(rAttribs.getFastAttributeList())->getFastAttributeTokens().size() > 0)
+                mrTextBody.setHasNoninheritedBodyProperties();
             if ( mpShapePtr )
                 return new TextBodyPropertiesContext( *this, rAttribs, mpShapePtr );
             else


More information about the Libreoffice-commits mailing list