summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-05-09 20:55:17 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-23 11:49:26 +0200
commit37dd39eb2e3086f7412a84727cfa69765065d2dd (patch)
treeb0b57d3a8d338a06e288fdecd5edb3ffc1e6cbd6
parentb05dfa46865f52583cfe370e153b44c7c57788b0 (diff)
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@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117623 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--oox/inc/drawingml/textbody.hxx7
-rw-r--r--oox/source/drawingml/textbody.cxx1
-rw-r--r--oox/source/drawingml/textbodycontext.cxx4
3 files changed, 12 insertions, 0 deletions
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 66dcf4239c6b..d82dc7e4b3fd 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -76,6 +76,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,
@@ -84,6 +89,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 9d420e67dee3..a419a41d0d83 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -30,6 +30,7 @@ using namespace ::com::sun::star::beans;
namespace oox::drawingml {
TextBody::TextBody()
+ : mbHasNoninheritedBodyProperties( false )
{
}
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 60d8ea8a8af2..d725aaa57bab 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -27,6 +27,8 @@
#include <drawingml/textfieldcontext.hxx>
#include <oox/drawingml/shape.hxx>
#include <oox/token/namespaces.hxx>
+#include <oox/helper/attributelist.hxx>
+#include <sax/fastattribs.hxx>
#include <oox/mathml/import.hxx>
@@ -179,6 +181,8 @@ ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, con
switch( aElementToken )
{
case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag
+ if (sax_fastparser::castToFastAttributeList(rAttribs.getFastAttributeList()).getFastAttributeTokens().size() > 0)
+ mrTextBody.setHasNoninheritedBodyProperties();
if ( mpShapePtr )
return new TextBodyPropertiesContext( *this, rAttribs, mpShapePtr );
else