diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-17 16:53:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-18 21:53:35 +0200 |
commit | bafec47847a0b9697b3bbe9358e53f8118af3024 (patch) | |
tree | 60268134d3df0060b5a6118194cca3d904539e0d /xmloff | |
parent | 02379929bd0e1d1676635f0ca1920422702ebb7c (diff) |
create the FloatingFrameShape in a separate step to inserting it
this is derived from the path taken by the AddShape(const OUString&)
function for this case. No change in behavior is intended.
Change-Id: Id09ae0c65a55a37743ad7c184070fb8dd97d8a7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150526
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.hxx | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 5b671ab1caf4..552414b06c9a 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3133,10 +3133,21 @@ SdXMLFloatingFrameShapeContext::~SdXMLFloatingFrameShapeContext() { } +uno::Reference<drawing::XShape> SdXMLFloatingFrameShapeContext::CreateFloatingFrameShape() const +{ + uno::Reference<lang::XMultiServiceFactory> xServiceFact(GetImport().GetModel(), uno::UNO_QUERY); + if (!xServiceFact.is()) + return nullptr; + uno::Reference<drawing::XShape> xShape( + xServiceFact->createInstance("com.sun.star.drawing.FrameShape"), uno::UNO_QUERY); + return xShape; +} + void SdXMLFloatingFrameShapeContext::startFastElement (sal_Int32 /*nElement*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/) { - AddShape("com.sun.star.drawing.FrameShape"); + uno::Reference<drawing::XShape> xShape(SdXMLFloatingFrameShapeContext::CreateFloatingFrameShape()); + AddShape(xShape); if( !mxShape.is() ) return; diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index 217c773c9785..64b28df579a0 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -528,6 +528,8 @@ private: OUString maFrameName; OUString maHref; + css::uno::Reference<css::drawing::XShape> CreateFloatingFrameShape() const; + public: SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, |