summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/dmapper/OLEHandler.cxx41
-rw-r--r--writerfilter/source/dmapper/OLEHandler.hxx8
2 files changed, 30 insertions, 19 deletions
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index ae1967a4a7eb..46cb83f4c732 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -105,23 +105,22 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
if( xTempShape.is() )
{
m_xShape.set( xTempShape );
- uno::Reference< beans::XPropertySet > xShapeProps( xTempShape, uno::UNO_QUERY );
- try
- {
- // Shapes in the header or footer should be in the background, since the default is WrapTextMode_THROUGH.
- if (m_rDomainMapper.IsInHeaderFooter())
- xShapeProps->setPropertyValue("Opaque", uno::makeAny(false));
-
- m_aShapeSize = xTempShape->getSize();
+ // No need to set the wrapping here as it's either set in oox or will be set later
- xShapeProps->getPropertyValue( getPropertyName( PROP_BITMAP ) ) >>= m_xReplacement;
- }
- catch( const uno::Exception& )
+ // Shapes in the header or footer should be in the background, since the default is WrapTextMode_THROUGH.
+ if (m_rDomainMapper.IsInHeaderFooter())
{
- TOOLS_WARN_EXCEPTION("writerfilter", "Exception in OLE Handler");
+ try
+ {
+ uno::Reference<beans::XPropertySet> xShapeProps(m_xShape, uno::UNO_QUERY);
+ xShapeProps->setPropertyValue("Opaque", uno::makeAny(false));
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("writerfilter", "Exception in OLE Handler");
+ }
}
- // No need to set the wrapping here as it's either set in oox or will be set later
}
}
break;
@@ -130,6 +129,22 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
}
}
+css::awt::Size OLEHandler::getSize() const
+{
+ if (!m_xShape)
+ return css::awt::Size();
+ return m_xShape->getSize();
+}
+
+css::uno::Reference<css::graphic::XGraphic> OLEHandler::getReplacement() const
+{
+ if (!m_xShape)
+ return nullptr;
+ uno::Reference<beans::XPropertySet> xShapeProps(m_xShape, uno::UNO_QUERY);
+ css::uno::Reference<css::graphic::XGraphic> xReplacement;
+ xShapeProps->getPropertyValue(getPropertyName(PROP_BITMAP)) >>= xReplacement;
+ return xReplacement;
+}
void OLEHandler::lcl_sprm(Sprm & rSprm)
{
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx
index cbb92aa9a53b..eb04d4782c90 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -57,10 +57,6 @@ class OLEHandler : public LoggedProperties
css::uno::Reference<css::drawing::XShape> m_xShape;
- css::awt::Size m_aShapeSize;
-
- css::uno::Reference<css::graphic::XGraphic> m_xReplacement;
-
css::uno::Reference<css::io::XInputStream> m_xInputStream;
DomainMapper& m_rDomainMapper;
@@ -90,8 +86,8 @@ public:
OUString copyOLEOStream(css::uno::Reference<css::text::XTextDocument> const& xTextDocument);
- const css::awt::Size& getSize() const { return m_aShapeSize; }
- const css::uno::Reference<css::graphic::XGraphic>& getReplacement() const { return m_xReplacement; }
+ css::awt::Size getSize() const;
+ css::uno::Reference<css::graphic::XGraphic> getReplacement() const;
};
}