diff options
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index fdfbbc2562a8..aab00a6b724b 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -87,6 +87,7 @@ #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/vector/b2dvector.hxx> +#include <tools/urlobj.hxx> #include <o3tl/any.hxx> #include <o3tl/safeint.hxx> @@ -3248,31 +3249,34 @@ void SdXMLFloatingFrameShapeContext::StartElement( const css::uno::Reference< cs { AddShape("com.sun.star.drawing.FrameShape"); - if( mxShape.is() ) - { - SetLayer(); + if( !mxShape.is() ) + return; - // set pos, size, shear and rotate - SetTransformation(); + SetLayer(); - uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY ); - if( xProps.is() ) - { - if( !maFrameName.isEmpty() ) - { - xProps->setPropertyValue("FrameName", Any(maFrameName) ); - } + // set pos, size, shear and rotate + SetTransformation(); - if( !maHref.isEmpty() ) - { - xProps->setPropertyValue("FrameURL", Any(maHref) ); - } + uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY ); + if( xProps.is() ) + { + if( !maFrameName.isEmpty() ) + { + xProps->setPropertyValue("FrameName", Any(maFrameName) ); } - SetStyle(); + if( !maHref.isEmpty() ) + { + if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro) + GetImport().NotifyMacroEventRead(); - GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes ); + xProps->setPropertyValue("FrameURL", Any(maHref) ); + } } + + SetStyle(); + + GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes ); } // this is called from the parent group for each unparsed attribute in the attribute list |