summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorArmin Le Grand (Allotropia) <Armin.Le.Grand@me.com>2022-02-22 19:39:04 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2022-02-25 09:48:14 +0100
commitec635b62af9424eddb32cc4646bc425559f4a622 (patch)
treed67108b25234233cb5fa7893c09bbcd3f8d32def /oox
parent56c871c247b84d7c2cddf685c13e8355db50da46 (diff)
Advanced Diagram support: cleanup/consolidate with existing code
Reorganized and streamlined, use IDiagramHelper as main interface now also for existing code. Had to adapt oox::Shape && Diagram handling since there the import gets handled very different. This ensures that a Diagram is detected at export and that the same happens for now as before Had to add a detection that resetting the GrabBag is meant to disable the Diagam functionality. That is very indirect, but has to stay for compaibility reasons for now Change-Id: I620b7d61cd84b5f9dd8ae4dc890ebf70ce779cdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130389 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx6
-rw-r--r--oox/source/drawingml/diagram/datamodel.hxx13
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx59
-rw-r--r--oox/source/drawingml/diagram/diagram.hxx1
-rw-r--r--oox/source/drawingml/diagram/diagramhelper.cxx211
-rw-r--r--oox/source/drawingml/diagram/diagramhelper.hxx21
-rw-r--r--oox/source/drawingml/shape.cxx39
-rw-r--r--oox/source/export/drawingml.cxx23
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx4
-rw-r--r--oox/source/shape/ShapeFilterBase.cxx5
10 files changed, 220 insertions, 162 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 9625f0f509ba..fa9811f4e7fa 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -213,6 +213,12 @@ XmlFilterBase::~XmlFilterBase()
mxImpl->maFastParser.clearDocumentHandler();
}
+std::shared_ptr<::oox::drawingml::Theme> XmlFilterBase::getCurrentThemePtr() const
+{
+ // default returns empty ptr
+ return std::shared_ptr<::oox::drawingml::Theme>();
+}
+
void XmlFilterBase::checkDocumentProperties(const Reference<XDocumentProperties>& xDocProps)
{
mbMSO2007 = mbMSO = false;
diff --git a/oox/source/drawingml/diagram/datamodel.hxx b/oox/source/drawingml/diagram/datamodel.hxx
index a3d71718a74d..b10287904c65 100644
--- a/oox/source/drawingml/diagram/datamodel.hxx
+++ b/oox/source/drawingml/diagram/datamodel.hxx
@@ -29,7 +29,6 @@
#include <oox/drawingml/drawingmltypes.hxx>
#include <oox/helper/helper.hxx>
#include <oox/token/tokens.hxx>
-#include <svx/DiagramDataInterface.hxx>
namespace oox::drawingml {
@@ -143,7 +142,8 @@ typedef std::vector< Point > Points;
}
-class DiagramData : public DiagramDataInterface
+// class DiagramData : public DiagramDataInterface
+class DiagramData
{
public:
typedef std::map< OUString, dgm::Point* > PointNameMap;
@@ -178,10 +178,11 @@ public:
{ return maExtDrawings; }
const dgm::Point* getRootPoint() const;
void dump() const;
- OUString getString() const override;
- std::vector<std::pair<OUString, OUString>> getChildren(const OUString& rParentId) const override;
- OUString addNode(const OUString& rText) override;
- bool removeNode(const OUString& rNodeId) override;
+
+ OUString getString() const;
+ std::vector<std::pair<OUString, OUString>> getChildren(const OUString& rParentId) const;
+ OUString addNode(const OUString& rText);
+ bool removeNode(const OUString& rNodeId);
private:
void getChildrenString(OUStringBuffer& rBuf, const dgm::Point* pPoint, sal_Int32 nLevel) const;
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index e23ce68a14a8..6c6578ae4067 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -168,6 +168,11 @@ uno::Sequence<beans::PropertyValue> Diagram::getDomsAsPropertyValues() const
return aValue;
}
+void Diagram::newTargetShape(ShapePtr& pTarget)
+{
+ mpShape = pTarget;
+}
+
static uno::Reference<xml::dom::XDocument> loadFragment(
core::XmlFilterBase& rFilter,
const OUString& rFragmentPath )
@@ -361,16 +366,10 @@ void loadDiagram( ShapePtr const & pShape,
// diagram loaded. now lump together & attach to shape
pDiagram->addTo(pShape);
- pShape->setDiagramData(pData);
pShape->setDiagramDoms(pDiagram->getDomsAsPropertyValues());
- // We need the shared_ptr to oox::Theme here, so do something direct when
- // we can identify the expected type of the used import filter
- oox::ppt::PowerPointImport* pFilter(dynamic_cast<oox::ppt::PowerPointImport*>(&rFilter));
- const std::shared_ptr<::oox::drawingml::Theme> aThemePtr(pFilter ? pFilter->getCurrentThemePtr() : nullptr);
-
// Prepare support for the advanced DiagramHelper using Diagram & Theme data
- pShape->prepareDiagramHelper(pDiagram, aThemePtr);
+ pShape->prepareDiagramHelper(pDiagram, rFilter.getCurrentThemePtr());
}
void loadDiagram(ShapePtr const& pShape,
@@ -418,52 +417,6 @@ void loadDiagram(ShapePtr const& pShape,
pDiagram->addTo(pShape);
}
-void reloadDiagram(SdrObject* pObj, core::XmlFilterBase& rFilter)
-{
- DiagramDataPtr pDiagramData = std::dynamic_pointer_cast<DiagramData>(pObj->GetDiagramData());
- if (!pDiagramData)
- return;
-
- pObj->getChildrenOfSdrObject()->ClearSdrObjList();
-
- uno::Reference<css::drawing::XShape> xShape(pObj->getUnoShape());
- uno::Reference<beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY_THROW);
-
- uno::Reference<xml::dom::XDocument> layoutDom;
- uno::Reference<xml::dom::XDocument> styleDom;
- uno::Reference<xml::dom::XDocument> colorDom;
-
- // retrieve the doms from the GrabBag
- uno::Sequence<beans::PropertyValue> propList;
- xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList;
- for (const auto& rProp : std::as_const(propList))
- {
- OUString propName = rProp.Name;
- if (propName == "OOXLayout")
- rProp.Value >>= layoutDom;
- else if (propName == "OOXStyle")
- rProp.Value >>= styleDom;
- else if (propName == "OOXColor")
- rProp.Value >>= colorDom;
- }
-
- ShapePtr pShape = std::make_shared<Shape>();
- pShape->setDiagramType();
- pShape->setSize(
- awt::Size(o3tl::convert(xShape->getSize().Width, o3tl::Length::mm100, o3tl::Length::emu),
- o3tl::convert(xShape->getSize().Height, o3tl::Length::mm100, o3tl::Length::emu)));
-
- loadDiagram(pShape, pDiagramData, layoutDom, styleDom, colorDom, rFilter);
-
- uno::Reference<drawing::XShapes> xShapes(xShape, uno::UNO_QUERY_THROW);
- basegfx::B2DHomMatrix aTransformation;
- aTransformation.translate(
- o3tl::convert(xShape->getPosition().X, o3tl::Length::mm100, o3tl::Length::emu),
- o3tl::convert(xShape->getPosition().Y, o3tl::Length::mm100, o3tl::Length::emu));
- for (auto const& child : pShape->getChildren())
- child->addShape(rFilter, rFilter.getCurrentTheme(), xShapes, aTransformation, pShape->getFillProperties());
-}
-
const oox::drawingml::Color&
DiagramColor::getColorByIndex(const std::vector<oox::drawingml::Color>& rColors, sal_Int32 nIndex)
{
diff --git a/oox/source/drawingml/diagram/diagram.hxx b/oox/source/drawingml/diagram/diagram.hxx
index f9f2b7d8a05a..3b42a834951a 100644
--- a/oox/source/drawingml/diagram/diagram.hxx
+++ b/oox/source/drawingml/diagram/diagram.hxx
@@ -150,6 +150,7 @@ public:
css::uno::Sequence<css::beans::PropertyValue> getDomsAsPropertyValues() const;
ShapePtr getShape() const { return mpShape.lock(); }
+ void newTargetShape(ShapePtr& pTarget);
private:
WeakShapePtr mpShape;
diff --git a/oox/source/drawingml/diagram/diagramhelper.cxx b/oox/source/drawingml/diagram/diagramhelper.cxx
index 61179993461d..268c7bb43f71 100644
--- a/oox/source/drawingml/diagram/diagramhelper.cxx
+++ b/oox/source/drawingml/diagram/diagramhelper.cxx
@@ -30,10 +30,15 @@ using namespace ::com::sun::star;
namespace oox::drawingml {
+bool AdvancedDiagramHelper::hasDiagramData() const
+{
+ return mpDiagramPtr && mpDiagramPtr->getData();
+}
+
AdvancedDiagramHelper::AdvancedDiagramHelper(
const std::shared_ptr< Diagram >& rDiagramPtr,
const std::shared_ptr<::oox::drawingml::Theme>& rTheme)
-: DiagramHelper()
+: IDiagramHelper()
, mpDiagramPtr(rDiagramPtr)
, mpThemePtr(rTheme)
{
@@ -45,85 +50,137 @@ AdvancedDiagramHelper::~AdvancedDiagramHelper()
void AdvancedDiagramHelper::reLayout()
{
- if(mpDiagramPtr)
+ if(!mpDiagramPtr)
{
- // Get the oox::Shape that represents the Diagram GraphicObject
- const ShapePtr & pParentShape = mpDiagramPtr->getShape();
+ return;
+ }
- // Remove it's children which represent the oox::Shapes created by
- // the layout process as preparation to re-creation. These should
- // already be cleared, but make sure.
- pParentShape->getChildren().clear();
+ // Get the oox::Shape that represents the Diagram GraphicObject
+ const ShapePtr & pParentShape = mpDiagramPtr->getShape();
- // Re-create the oox::Shapes for the diagram content
- mpDiagramPtr->addTo(pParentShape);
-
- // Access the GroupObject representing the SmartArt in DrawingLayer
- SdrObjGroup* pAnchorObj(dynamic_cast<SdrObjGroup*>(SdrObject::getSdrObjectFromXShape(pParentShape->getXShape())));
-
- // Rescue/remember geometric transformation of existing Diagram
- basegfx::B2DHomMatrix aTransformation;
- basegfx::B2DPolyPolygon aPolyPolygon;
- pAnchorObj->TRGetBaseGeometry(aTransformation, aPolyPolygon);
-
- // Delete all existing shapes in that group to prepare re-creation
- pAnchorObj->getChildrenOfSdrObject()->ClearSdrObjList();
-
- // For re-creation we need to use ::addShape functionality from the
- // oox import filter since currently Shape import is very tightly
- // coupled to Shape creation. It converts a oox::Shape representation
- // combined with an oox::Theme to incarrnated XShapes representing the
- // Diagram.
- // To use that functionality, we have to create a temporary filter
- // (based on ShapeFilterBase). Problems are that this needs to know
- // the oox:Theme and a ComponentModel from TargetDocument.
- // The DiagramHelper holds/delivers the oox::Theme to use, so
- // it does not need to be re-imported from oox repeatedly.
- // The ComponentModel can be derived from the existing XShape/GroupShape
- // when knowing where to get it from, making it independent from app.
- //
- // NOTE: Using another (buffered) oox::Theme would allow to re-create
- // using another theming in the future.
- // NOTE: The incarnation of import filter (ShapeFilterBase) is only
- // used for XShape creation, no xml snippets/data gets imported
- // here. XShape creation may be isolated in the future.
- SdrModel& rModel(pAnchorObj->getSdrModelFromSdrObject());
- uno::Reference< uno::XInterface > const & rUnoModel(rModel.getUnoModel());
- css::uno::Reference<css::uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
- rtl::Reference<oox::shape::ShapeFilterBase> xFilter(new oox::shape::ShapeFilterBase(xContext));
- xFilter->setCurrentTheme(mpThemePtr);
- css::uno::Reference< css::lang::XComponent > aComponentModel( rUnoModel, uno::UNO_QUERY );
- xFilter->setTargetDocument(aComponentModel);
-
- // Prepare the target for the to-be-created XShapes
- uno::Reference<drawing::XShapes> xShapes(pParentShape->getXShape(), uno::UNO_QUERY_THROW);
-
- for (auto const& child : pParentShape->getChildren())
- {
- // Create all sub-shapes. This will recursively create needed geometry using
- // filter-internal ::createShapes
- child->addShape(
- *xFilter,
- xFilter->getCurrentTheme(),
- xShapes,
- aTransformation,
- pParentShape->getFillProperties());
- }
-
- // Re-apply remembered geometry
- pAnchorObj->TRSetBaseGeometry(aTransformation, aPolyPolygon);
-
- // Delete oox::Shapes that represented the content of the
- // diagram. These were needed for creating the XShapes/SdrObjects
- // (created by ::addTo above) but are no longer needed, so free
- // the memory
- pParentShape->getChildren().clear();
+ if(!pParentShape)
+ {
+ return;
+ }
+
+ // Remove it's children which represent the oox::Shapes created by
+ // the layout process as preparation to re-creation. These should
+ // already be cleared, but make sure.
+ pParentShape->getChildren().clear();
+
+ // Re-create the oox::Shapes for the diagram content
+ mpDiagramPtr->addTo(pParentShape);
+
+ // Access the GroupObject representing the SmartArt in DrawingLayer
+ SdrObjGroup* pAnchorObj(dynamic_cast<SdrObjGroup*>(SdrObject::getSdrObjectFromXShape(pParentShape->getXShape())));
+
+ // Rescue/remember geometric transformation of existing Diagram
+ basegfx::B2DHomMatrix aTransformation;
+ basegfx::B2DPolyPolygon aPolyPolygon;
+ pAnchorObj->TRGetBaseGeometry(aTransformation, aPolyPolygon);
+
+ // Delete all existing shapes in that group to prepare re-creation
+ pAnchorObj->getChildrenOfSdrObject()->ClearSdrObjList();
+
+ // For re-creation we need to use ::addShape functionality from the
+ // oox import filter since currently Shape import is very tightly
+ // coupled to Shape creation. It converts a oox::Shape representation
+ // combined with an oox::Theme to incarrnated XShapes representing the
+ // Diagram.
+ // To use that functionality, we have to create a temporary filter
+ // (based on ShapeFilterBase). Problems are that this needs to know
+ // the oox:Theme and a ComponentModel from TargetDocument.
+ // The DiagramHelper holds/delivers the oox::Theme to use, so
+ // it does not need to be re-imported from oox repeatedly.
+ // The ComponentModel can be derived from the existing XShape/GroupShape
+ // when knowing where to get it from, making it independent from app.
+ //
+ // NOTE: Using another (buffered) oox::Theme would allow to re-create
+ // using another theming in the future.
+ // NOTE: The incarnation of import filter (ShapeFilterBase) is only
+ // used for XShape creation, no xml snippets/data gets imported
+ // here. XShape creation may be isolated in the future.
+ SdrModel& rModel(pAnchorObj->getSdrModelFromSdrObject());
+ uno::Reference< uno::XInterface > const & rUnoModel(rModel.getUnoModel());
+ css::uno::Reference<css::uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
+ rtl::Reference<oox::shape::ShapeFilterBase> xFilter(new oox::shape::ShapeFilterBase(xContext));
+ xFilter->setCurrentTheme(mpThemePtr);
+ css::uno::Reference< css::lang::XComponent > aComponentModel( rUnoModel, uno::UNO_QUERY );
+ xFilter->setTargetDocument(aComponentModel);
+
+ // Prepare the target for the to-be-created XShapes
+ uno::Reference<drawing::XShapes> xShapes(pParentShape->getXShape(), uno::UNO_QUERY_THROW);
+
+ for (auto const& child : pParentShape->getChildren())
+ {
+ // Create all sub-shapes. This will recursively create needed geometry using
+ // filter-internal ::createShapes
+ child->addShape(
+ *xFilter,
+ xFilter->getCurrentTheme(),
+ xShapes,
+ aTransformation,
+ pParentShape->getFillProperties());
+ }
+
+ // Re-apply remembered geometry
+ pAnchorObj->TRSetBaseGeometry(aTransformation, aPolyPolygon);
+
+ // Delete oox::Shapes that represented the content of the
+ // diagram. These were needed for creating the XShapes/SdrObjects
+ // (created by ::addTo above) but are no longer needed, so free
+ // the memory
+ pParentShape->getChildren().clear();
+}
+
+OUString AdvancedDiagramHelper::getString() const
+{
+ if(hasDiagramData())
+ {
+ return mpDiagramPtr->getData()->getString();
}
+
+ return OUString();
+}
+
+std::vector<std::pair<OUString, OUString>> AdvancedDiagramHelper::getChildren(const OUString& rParentId) const
+{
+ if(hasDiagramData())
+ {
+ return mpDiagramPtr->getData()->getChildren(rParentId);
+ }
+
+ return std::vector<std::pair<OUString, OUString>>();
+}
+
+OUString AdvancedDiagramHelper::addNode(const OUString& rText)
+{
+ if(hasDiagramData())
+ {
+ return mpDiagramPtr->getData()->addNode(rText);
+ }
+
+ return OUString();
+}
+
+bool AdvancedDiagramHelper::removeNode(const OUString& rNodeId)
+{
+ if(hasDiagramData())
+ {
+ return mpDiagramPtr->getData()->removeNode(rNodeId);
+ }
+
+ return false;
}
void AdvancedDiagramHelper::doAnchor(SdrObjGroup& rTarget)
{
- const ShapePtr & pParentShape = mpDiagramPtr->getShape();
+ if(!mpDiagramPtr)
+ {
+ return;
+ }
+
+ const ShapePtr& pParentShape(mpDiagramPtr->getShape());
if(pParentShape)
{
@@ -135,6 +192,16 @@ void AdvancedDiagramHelper::doAnchor(SdrObjGroup& rTarget)
anchorToSdrObjGroup(rTarget);
}
+void AdvancedDiagramHelper::newTargetShape(ShapePtr& pTarget)
+{
+ if(!mpDiagramPtr)
+ {
+ return;
+ }
+
+ mpDiagramPtr->newTargetShape(pTarget);
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/diagram/diagramhelper.hxx b/oox/source/drawingml/diagram/diagramhelper.hxx
index c6bd507f32e6..9c4d4cfadb37 100644
--- a/oox/source/drawingml/diagram/diagramhelper.hxx
+++ b/oox/source/drawingml/diagram/diagramhelper.hxx
@@ -41,19 +41,36 @@ class Diagram;
// - deliver representative data from the Diagram-Model
// - modify it eventually
// - im/export Diagram model to other representations
-class AdvancedDiagramHelper final : public DiagramHelper
+class AdvancedDiagramHelper final : public IDiagramHelper
{
const std::shared_ptr< Diagram > mpDiagramPtr;
const std::shared_ptr<::oox::drawingml::Theme> mpThemePtr;
+ bool hasDiagramData() const;
+
public:
AdvancedDiagramHelper(
const std::shared_ptr< Diagram >& rDiagramPtr,
const std::shared_ptr<::oox::drawingml::Theme>& rTheme);
virtual ~AdvancedDiagramHelper();
- virtual void reLayout();
+ // re-create XShapes
+ virtual void reLayout() override;
+
+ // get text representation of data tree
+ virtual OUString getString() const override;
+
+ // get children of provided data node
+ // use empty string for top-level nodes
+ // returns vector of (id, text)
+ virtual std::vector<std::pair<OUString, OUString>> getChildren(const OUString& rParentId) const override;
+
+ // add/remove new top-level node to data model, returns its id
+ virtual OUString addNode(const OUString& rText) override;
+ virtual bool removeNode(const OUString& rNodeId) override;
+
void doAnchor(SdrObjGroup& rTarget);
+ void newTargetShape(ShapePtr& pTarget);
};
}
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 97f87a2683ab..bd69137003ec 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -237,6 +237,36 @@ void Shape::propagateDiagramHelper()
}
}
+void Shape::migrateDiagramHelperToNewShape(ShapePtr& pTarget)
+{
+ if(!mpDiagramHelper)
+ {
+ return;
+ }
+
+ if(!pTarget)
+ {
+ // no migrate target, but cleanup helper
+ delete mpDiagramHelper;
+ mpDiagramHelper = nullptr;
+ return;
+ }
+
+ if(pTarget->mpDiagramHelper)
+ {
+ // this should no happen, bu if there is already a helper, clean it up
+ delete pTarget->mpDiagramHelper;
+ pTarget->mpDiagramHelper = nullptr;
+ }
+
+ // DiagramHelper has references to this, these need to be replaced
+ static_cast<AdvancedDiagramHelper*>(mpDiagramHelper)->newTargetShape(pTarget);
+
+ // exchange and reset to nullptr
+ pTarget->mpDiagramHelper = mpDiagramHelper;
+ mpDiagramHelper = nullptr;
+}
+
table::TablePropertiesPtr const & Shape::getTableProperties()
{
if ( !mpTablePropertiesPtr )
@@ -375,6 +405,9 @@ void Shape::addShape(
{
keepDiagramCompatibilityInfo();
+ // set DiagramHelper at SdrObjGroup
+ propagateDiagramHelper();
+
// Check if this is the PPTX import, so far converting SmartArt to a non-editable
// metafile is only implemented for DOCX.
bool bPowerPoint = dynamic_cast<oox::ppt::PowerPointImport*>(&rFilterBase) != nullptr;
@@ -1805,12 +1838,6 @@ void Shape::keepDiagramCompatibilityInfo()
if ( !xSetInfo.is() )
return;
- if (mpDiagramData)
- {
- if (SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mxShape))
- pObj->SetDiagramData(mpDiagramData);
- }
-
const OUString aGrabBagPropName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
if( !xSetInfo->hasPropertyByName( aGrabBagPropName ) )
return;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index cb5383104a61..6e4197fa69c3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2865,29 +2865,6 @@ bool DrawingML::IsGroupShape( const Reference< XShape >& rXShape )
return bRet;
}
-bool DrawingML::IsDiagram(const Reference<XShape>& rXShape)
-{
- uno::Reference<beans::XPropertySet> xPropSet(rXShape, uno::UNO_QUERY);
- if (!xPropSet.is())
- return false;
-
- // if the shape doesn't have the InteropGrabBag property, it's not a diagram
- uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if (!xPropSetInfo->hasPropertyByName(aName))
- return false;
-
- uno::Sequence<beans::PropertyValue> propList;
- xPropSet->getPropertyValue(aName) >>= propList;
- return std::any_of(std::cbegin(propList), std::cend(propList),
- [](const beans::PropertyValue& rProp) {
- // if we find any of the diagram components, it's a diagram
- OUString propName = rProp.Name;
- return propName == "OOXData" || propName == "OOXLayout" || propName == "OOXStyle"
- || propName == "OOXColor" || propName == "OOXDrawing";
- });
-}
-
sal_Int32 DrawingML::getBulletMarginIndentation (const Reference< XPropertySet >& rXPropSet,sal_Int16 nLevel, std::u16string_view propName)
{
if (nLevel < 0 || !GetProperty(rXPropSet, "NumberingRules"))
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index cacd46d82d14..e88637fc4714 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -427,6 +427,10 @@ ShapeContextHandler::getShape()
pShapePtr->setDiagramDoms(mpShape->getDiagramDoms());
pShapePtr->keepDiagramDrawing(*mxShapeFilterBase, aFragmentPath);
+ // migrate IDiagramHelper to new oox::Shape (from mpShape which was loaded
+ // to pShapePtr where the geometry is now constructed)
+ mpShape->migrateDiagramHelperToNewShape(pShapePtr);
+
if (!mpShape->getChildren().empty())
{
// first child is diagram background - we want to keep it, as drawingML fallback doesn't contain it
diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx
index 38c310b47663..ebd47d83e9d5 100644
--- a/oox/source/shape/ShapeFilterBase.cxx
+++ b/oox/source/shape/ShapeFilterBase.cxx
@@ -54,6 +54,11 @@ const ::oox::drawingml::Theme* ShapeFilterBase::getCurrentTheme() const
return mpTheme.get();
}
+std::shared_ptr<::oox::drawingml::Theme> ShapeFilterBase::getCurrentThemePtr() const
+{
+ return mpTheme;
+}
+
void ShapeFilterBase::setCurrentTheme(const ::oox::drawingml::ThemePtr& pTheme)
{
mpTheme = pTheme;