diff options
-rw-r--r-- | include/oox/vml/vmlshape.hxx | 11 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 13 | ||||
-rw-r--r-- | sc/source/filter/oox/commentsbuffer.cxx | 7 |
3 files changed, 13 insertions, 18 deletions
diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index 2aa2163653de..e95e44053330 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -267,9 +267,11 @@ public: const css::uno::Reference< css::drawing::XShapes >& rxShapes, const ShapeParentAnchor* pParentAnchor = nullptr ) const; - /** Converts formatting into the passed existing XShape and returns position. */ - css::awt::Rectangle convertFormatting( - const css::uno::Reference< css::drawing::XShape >& rxShape ) const; + /** Returns bounds of Shape */ + css::awt::Rectangle getShapeRectangle() const; + + /** Collects common shape properties such as formatting attributes. */ + oox::drawingml::ShapePropertyMap makeShapePropertyMap() const; void setContainer(ShapeContainer* pContainer); ShapeContainer* getContainer() const; @@ -295,9 +297,6 @@ protected: css::awt::Rectangle calcShapeRectangle( const ShapeParentAnchor* pParentAnchor ) const; - /** Collects common shape properties such as formatting attributes. */ - oox::drawingml::ShapePropertyMap makeShapePropertyMap() const; - /** Converts common shape properties such as formatting attributes. */ void convertShapeProperties( const css::uno::Reference< css::drawing::XShape >& rxShape ) const; diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index c297fc1563bb..81ba42ba0a48 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -484,20 +484,11 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS return xShape; } -awt::Rectangle ShapeBase::convertFormatting( const Reference< XShape >& rxShape ) const +awt::Rectangle ShapeBase::getShapeRectangle() const { - if( !rxShape.is() ) - return awt::Rectangle(); - /* Calculate shape rectangle. Applications may do something special according to some imported shape client data (e.g. Excel cell anchor). */ - awt::Rectangle aShapeRect = calcShapeRectangle( nullptr ); - - // convert the shape, if the calculated rectangle is not empty - if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) ) - convertShapeProperties( rxShape ); - - return aShapeRect; + return calcShapeRectangle(nullptr); } void ShapeBase::setContainer(ShapeContainer* pContainer) { mpContainer = pContainer; } diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index 555ddad3a924..55bcb7e2cc73 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/text/XText.hpp> #include <osl/diagnose.h> +#include <oox/drawingml/shapepropertymap.hxx> #include <oox/helper/attributelist.hxx> #include <oox/vml/vmlshape.hxx> #include <addressconverter.hxx> @@ -183,11 +184,15 @@ void Comment::finalizeImport() if( const ::oox::vml::ShapeBase* pVmlNoteShape = getVmlDrawing().getNoteShape( maModel.maRange.aStart ) ) { // position and formatting - css::awt::Rectangle aShapeRect = pVmlNoteShape->convertFormatting(xAnnoShape); + css::awt::Rectangle aShapeRect = pVmlNoteShape->getShapeRectangle(); if (aShapeRect.Width > 0 || aShapeRect.Height > 0) { xAnnoShape->setPosition(css::awt::Point(aShapeRect.X, aShapeRect.Y)); xAnnoShape->setSize(css::awt::Size(aShapeRect.Width, aShapeRect.Height)); + + ::oox::drawingml::ShapePropertyMap aPropMap(pVmlNoteShape->makeShapePropertyMap()); + css::uno::Reference<css::drawing::XShape> xShape(xAnnoShape); + PropertySet(xShape).setProperties(aPropMap); } // visibility bVisible = pVmlNoteShape->getTypeModel().mbVisible; |