diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2021-05-09 20:56:41 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-06-15 09:54:31 +0200 |
commit | 2cfccfba09faa5c3bb973136ffe99d534d09c881 (patch) | |
tree | 8ecd03038b83197d95ea72011596f201fc0e6570 | |
parent | 7882f2425499e6d12894a74696f30b718468c4a4 (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>
-rw-r--r-- | oox/inc/drawingml/textbody.hxx | 3 | ||||
-rw-r--r-- | oox/inc/drawingml/textliststyle.hxx | 10 | ||||
-rw-r--r-- | oox/source/drawingml/textliststyle.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/textliststylecontext.cxx | 1 |
4 files changed, 15 insertions, 0 deletions
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 |