[Libreoffice-commits] core.git: oox/inc oox/source

Sarper Akdemir (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 15 07:55:30 UTC 2021


 oox/inc/drawingml/textbody.hxx                |    3 +++
 oox/inc/drawingml/textliststyle.hxx           |   10 ++++++++++
 oox/source/drawingml/textliststyle.cxx        |    1 +
 oox/source/drawingml/textliststylecontext.cxx |    1 +
 4 files changed, 15 insertions(+)

New commits:
commit 2cfccfba09faa5c3bb973136ffe99d534d09c881
Author:     Sarper Akdemir <sarper.akdemir at collabora.com>
AuthorDate: Sun May 9 20:56:41 2021 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jun 15 09:54:31 2021 +0200

    tdf#59323: ooxml import: hasListStyleOnImport
    
    Introduces hasListStyleOnImport to determine whether or not the textbody had a
    non-empty lstStyle tag in it on import.
    
    Change-Id: Iccb8cfb20e4402e7cadb8e2f2b9a1f6fa178ade4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117007
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index f89e069d5ffe..2ac96011f3c8 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -80,6 +80,9 @@ public:
     /// Flags textbody as having a non-empty bodyPr tag
     void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties = true; }
 
+    /// Returns whether the textbody had a non-empty lstStyle tag in it
+    bool hasListStyleOnImport() const { return maTextListStyle.hasListStyleOnImport(); }
+
     void                ApplyStyleEmpty(
                             const ::oox::core::XmlFilterBase& rFilterBase,
                             const css::uno::Reference < css::text::XText > & xText,
diff --git a/oox/inc/drawingml/textliststyle.hxx b/oox/inc/drawingml/textliststyle.hxx
index cd770457575f..7fe071af669b 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -50,6 +50,14 @@ public:
     };
     TextParagraphPropertiesArray& getAggregationListStyle() { return maAggregationListStyle; };
 
+    /// Flags ListStyle as having a non-empty lstStyle tag on import
+    void setHasListStyleOnImport() { mbHasListStyleOnImport = true; }
+    /** Returns whether the lstStyle tag was non-empty on import
+     *
+     *  @return true if list style has it's own noninherited properties.
+     */
+    bool hasListStyleOnImport() const { return mbHasListStyleOnImport; }
+
 #ifdef DBG_UTIL
     void dump() const;
 #endif
@@ -57,6 +65,8 @@ public:
 private:
     TextParagraphPropertiesArray maListStyle;
     TextParagraphPropertiesArray maAggregationListStyle;
+    /// Set if ListStyle has a non-empty lstStyle tag on import
+    bool mbHasListStyleOnImport;
 };
 }
 
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index 0b757159e5bc..175b6caf879b 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -23,6 +23,7 @@
 namespace oox::drawingml {
 
 TextListStyle::TextListStyle()
+    : mbHasListStyleOnImport(false)
 {
 }
 
diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx
index f2abd9b91c21..62d81f9c7f4a 100644
--- a/oox/source/drawingml/textliststylecontext.cxx
+++ b/oox/source/drawingml/textliststylecontext.cxx
@@ -41,6 +41,7 @@ TextListStyleContext::~TextListStyleContext()
 
 ContextHandlerRef TextListStyleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
+    mrTextListStyle.setHasListStyleOnImport();
     switch( aElementToken )
     {
         case A_TOKEN( defPPr ):     // CT_TextParagraphProperties


More information about the Libreoffice-commits mailing list