summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-05-09 20:56:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-23 11:49:42 +0200
commit685917c74983061b36b0c5bbe40c89692efa863c (patch)
tree2ea5dca6da56ba57599d8bf42bf6b15bb6afade1
parent37dd39eb2e3086f7412a84727cfa69765065d2dd (diff)
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@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117624 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--oox/inc/drawingml/textbody.hxx3
-rw-r--r--oox/inc/drawingml/textliststyle.hxx10
-rw-r--r--oox/source/drawingml/textliststyle.cxx1
-rw-r--r--oox/source/drawingml/textliststylecontext.cxx1
4 files changed, 15 insertions, 0 deletions
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index d82dc7e4b3fd..8b600a862211 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -81,6 +81,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 52cb29330877..c13c7a103266 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -47,6 +47,14 @@ public:
};
TextParagraphPropertiesVector& 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
@@ -54,6 +62,8 @@ public:
private:
TextParagraphPropertiesVector maListStyle;
TextParagraphPropertiesVector 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 d900e3cef338..749cc17268e4 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -23,6 +23,7 @@
namespace oox::drawingml {
TextListStyle::TextListStyle()
+ : mbHasListStyleOnImport(false)
{
for ( int i = 0; i < 9; i++ )
{
diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx
index c1d865b2adc9..183a710f7431 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