summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx37
1 files changed, 7 insertions, 30 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 5df335be727d..b4c50a91f730 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -95,7 +95,6 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <com/sun/star/document/XActionLockable.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
-#include <com/sun/star/text/GraphicCrop.hpp>
#include <officecfg/Office/Common.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdotable.hxx>
@@ -1539,35 +1538,6 @@ Reference< XShape > const & Shape::createAndInsert(
propertySet->setPropertyValue("InteropGrabBag",uno::Any(aGrabBag));
}
- // If the shape is a picture placeholder.
- if (aServiceName == "com.sun.star.presentation.GraphicObjectShape" && !bClearText)
- {
- // Placeholder text should be in center of the shape.
- aShapeProps.setProperty(PROP_TextContourFrame, false);
-
- /* Placeholder icon should be at the center of the parent shape.
- * We use negative graphic crop property because of that we don't
- * have padding support.
- */
- uno::Reference<beans::XPropertySet> xGraphic(xSet->getPropertyValue("Graphic"), uno::UNO_QUERY);
- if (xGraphic.is())
- {
- awt::Size aBitmapSize;
- xGraphic->getPropertyValue("Size100thMM") >>= aBitmapSize;
- sal_Int32 nXMargin = (aShapeRectHmm.Width - aBitmapSize.Width) / 2;
- sal_Int32 nYMargin = (aShapeRectHmm.Height - aBitmapSize.Height) / 2;
- if (nXMargin > 0 && nYMargin > 0)
- {
- text::GraphicCrop aGraphicCrop;
- aGraphicCrop.Top = nYMargin * -1;
- aGraphicCrop.Bottom = nYMargin * -1;
- aGraphicCrop.Left = nXMargin * -1;
- aGraphicCrop.Right = nXMargin * -1;
- aShapeProps.setProperty(PROP_GraphicCrop, aGraphicCrop);
- }
- }
- }
-
PropertySet( xSet ).setProperties( aShapeProps );
if (mpTablePropertiesPtr && aServiceName == "com.sun.star.drawing.TableShape")
@@ -1873,6 +1843,13 @@ Reference< XShape > const & Shape::createAndInsert(
aPropertySet.setAnyProperty( PROP_VertOrientPosition, Any( maPosition.Y ) );
}
+ // Make sure to not set text to placeholders. Doing it here would eventually call
+ // SvxTextEditSourceImpl::UpdateData, SdrObject::SetEmptyPresObj(false), and that
+ // would make the object behave like a standard outline object.
+ // TODO/FIXME: support custom prompt text in placeholders.
+ if (rServiceName == "com.sun.star.presentation.GraphicObjectShape")
+ mpTextBody.reset();
+
// in some cases, we don't have any text body.
if( mpTextBody && ( !bDoNotInsertEmptyTextBody || !mpTextBody->isEmpty() ) )
{