[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - include/oox oox/source

Sarper Akdemir (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 23 09:48:45 UTC 2021


 include/oox/ppt/pptshape.hxx                 |    7 +++++++
 oox/source/ppt/pptshape.cxx                  |    1 +
 oox/source/ppt/pptshapepropertiescontext.cxx |    5 +++++
 3 files changed, 13 insertions(+)

New commits:
commit cfc46a1a5703785eda258a4cfec02941df2ec9c6
Author:     Sarper Akdemir <sarper.akdemir at collabora.com>
AuthorDate: Sun May 9 20:08:47 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Jun 23 11:48:06 2021 +0200

    tdf#59323: ooxml import: hasNonInheritedShapeProperties
    
    Introduces hasNonInheritedShapeProperties helper to PPTShape.
    
    If the shape has something imported from it's spPr tag
    mbHasNoninheritedShapeProperties set to true.
    
    Change-Id: I0529f1def8d2c32d5bf06172ce44facdde92893c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117003
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117620
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/oox/ppt/pptshape.hxx b/include/oox/ppt/pptshape.hxx
index f452e585abcf..d27a116e2783 100644
--- a/include/oox/ppt/pptshape.hxx
+++ b/include/oox/ppt/pptshape.hxx
@@ -51,6 +51,8 @@ class PPTShape final : public oox::drawingml::Shape
     bool                        mbReferenced;           // placeholdershapes on Layout are displayed only, if they are not referenced
                                                         // placeholdershapes on Slide are displayed always
     oox::drawingml::ShapePtr mpPlaceholder;
+    /// Set if spPr tag is non empty for the shape
+    bool mbHasNoninheritedShapeProperties;
 
 public:
 
@@ -73,6 +75,11 @@ public:
     void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
     void setModelId( const OUString& rId ) { msModelId = rId; }
 
+    /// Flags shape as having a non-empty spPr tag
+    void setHasNoninheritedShapeProperties() { mbHasNoninheritedShapeProperties = true; }
+    /// Returns whether or not the shape had a non-empty spPr tag
+    bool hasNonInheritedShapeProperties() const { return mbHasNoninheritedShapeProperties; }
+
     static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nFirstSubType,
             const sal_Int32 nSecondSubType, const OptValue< sal_Int32 >& oSubTypeIndex,
             std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false );
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index e326cba50464..bd47dd0fae7a 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -48,6 +48,7 @@ PPTShape::PPTShape( const oox::ppt::ShapeLocation eShapeLocation, const char* pS
 : Shape( pServiceName )
 , meShapeLocation( eShapeLocation )
 , mbReferenced( false )
+, mbHasNoninheritedShapeProperties( false )
 {
 }
 
diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx
index 128272054b21..70ef2fcef872 100644
--- a/oox/source/ppt/pptshapepropertiescontext.cxx
+++ b/oox/source/ppt/pptshapepropertiescontext.cxx
@@ -20,6 +20,7 @@
 #include <oox/ppt/pptshapepropertiescontext.hxx>
 #include <oox/token/namespaces.hxx>
 #include <oox/token/properties.hxx>
+#include <oox/ppt/pptshape.hxx>
 
 using namespace oox::core;
 using namespace ::com::sun::star;
@@ -35,6 +36,10 @@ PPTShapePropertiesContext::PPTShapePropertiesContext( ContextHandler2Helper cons
 
 ContextHandlerRef PPTShapePropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
+    PPTShape* pPPTShape = dynamic_cast<PPTShape*>(&mrShape);
+    if (pPPTShape)
+        pPPTShape->setHasNoninheritedShapeProperties();
+
     switch( aElementToken )
     {
         case A_TOKEN( xfrm ):


More information about the Libreoffice-commits mailing list