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>
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index f89e069..2ac9601 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 cd77045..7fe071a 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 0b75715..175b6ca 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 f2abd9b..62d81f9 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