diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2021-05-09 20:17:20 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-06-15 09:28:55 +0200 |
commit | 4a3b9d2092ff5ce8336cc87cacbdc421f3d26ea7 (patch) | |
tree | 16c7427bca7902391e4296f4d7b851dcc03bfa36 /oox/inc/drawingml | |
parent | 21405a65c3056fe8c827f3999e5c79f6083d8229 (diff) |
tdf#59323: ooxml import: hasVisualRunProperties
Introduces helper functions to determine whether a shape has non inherited run
properties that change it visually.
mbHasVisualRunProperties is set on import if there was a run property that
alters visual appearance.
Change-Id: Ie1e8e22d2757dc8594e7c6c3b8fc1dd7973c92af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117004
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/inc/drawingml')
-rw-r--r-- | oox/inc/drawingml/textbody.hxx | 6 | ||||
-rw-r--r-- | oox/inc/drawingml/textcharacterproperties.hxx | 4 | ||||
-rw-r--r-- | oox/inc/drawingml/textparagraph.hxx | 6 | ||||
-rw-r--r-- | oox/inc/drawingml/textrun.hxx | 6 |
4 files changed, 22 insertions, 0 deletions
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index ac6c66b49515..8d0ce417f6b9 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -66,6 +66,12 @@ public: bool isEmpty() const; OUString toString() const; + /** Returns whether the textbody had a rPr tag in it that alters it visually + * + * For instance _lang_ doesn't have a visual effect. + */ + bool hasVisualRunProperties() const; + void ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText > & xText, diff --git a/oox/inc/drawingml/textcharacterproperties.hxx b/oox/inc/drawingml/textcharacterproperties.hxx index 90d01ec9cde1..2724af43051b 100644 --- a/oox/inc/drawingml/textcharacterproperties.hxx +++ b/oox/inc/drawingml/textcharacterproperties.hxx @@ -58,6 +58,8 @@ struct TextCharacterProperties OptValue< bool > moUnderlineLineFollowText; OptValue< bool > moUnderlineFillFollowText; FillProperties maFillProperties; + /// Set if there was a property set that alters run visually during import + bool mbHasVisualRunProperties; std::vector<css::beans::PropertyValue> maTextEffectsProperties; @@ -78,6 +80,8 @@ struct TextCharacterProperties void pushToPropSet( PropertySet& rPropSet, const ::oox::core::XmlFilterBase& rFilter ) const; + + TextCharacterProperties() : mbHasVisualRunProperties(false) {} }; diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx index df39f8841c76..4424eadf2cab 100644 --- a/oox/inc/drawingml/textparagraph.hxx +++ b/oox/inc/drawingml/textparagraph.hxx @@ -79,6 +79,12 @@ public: } formulaimport::XmlStreamBuilder & GetMathXml(); + /** Returns whether textparagraph had a rPr tag in it that alters it visually + * + * For instance _lang_ doesn't have a visual effect. + */ + bool hasVisualRunProperties() const; + private: TextParagraphProperties maProperties; TextCharacterProperties maEndProperties; diff --git a/oox/inc/drawingml/textrun.hxx b/oox/inc/drawingml/textrun.hxx index 355b8a684cc1..b3d1fe041ff8 100644 --- a/oox/inc/drawingml/textrun.hxx +++ b/oox/inc/drawingml/textrun.hxx @@ -43,6 +43,12 @@ public: void setLineBreak() { mbIsLineBreak = true; } bool isLineBreak() const { return mbIsLineBreak; } + /** Returns whether the textrun had properties that alter it visually in its rPr tag + * + * For instance _lang_ doesn't have a visual effect. + */ + bool hasVisualRunProperties() const { return maTextCharacterProperties.mbHasVisualRunProperties; } + virtual sal_Int32 insertAt( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText >& xText, |