diff options
author | Noel Power <noel.power@novell.com> | 2011-11-09 14:36:28 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2011-11-09 14:37:40 +0000 |
commit | 02c6f5c74b346f1e3a095d99a36ece6b603bc26b (patch) | |
tree | 1876081fca51d1907dea4b0d8a312e4a4f3dbcf1 | |
parent | de56b0f22d774bb44419560376ba8029bb4cc661 (diff) |
fix rtf image import ( causing wrong image sometimes displayed ) fdo#42640
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 50664df49917..96c0adddaf75 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -44,6 +44,8 @@ #include <svl/lngmisc.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> +#include <com/sun/star/drawing/XDrawPageSupplier.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <doctok/sprmids.hxx> // NS_sprm namespace #include <doctok/resourceids.hxx> // NS_rtf namespace @@ -590,6 +592,13 @@ int RTFDocumentImpl::resolvePict(bool bInline) if (m_xModelFactory.is()) xShape.set(m_xModelFactory->createInstance(aService), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPageSupplier> xDrawSupplier( m_xDstDoc, uno::UNO_QUERY); + if ( xDrawSupplier.is() ) + { + uno::Reference< drawing::XShapes > xShapes( xDrawSupplier->getDrawPage(), uno::UNO_QUERY ); + if ( xShapes.is() ) + xShapes->add( xShape ); + } if (m_bObject) { // Set bitmap |