diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-05-22 16:57:07 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-05-22 17:27:43 +0200 |
commit | 476316bfc9dd36c0613327c20822a193b5ca8d9b (patch) | |
tree | 99f33d8564a228a4fbcd0a6be5447154633ce98a /writerfilter | |
parent | Resolves: fdo#40778 wrong type used for callback arg (diff) | |
download | core-476316bfc9dd36c0613327c20822a193b5ca8d9b.tar.gz core-476316bfc9dd36c0613327c20822a193b5ca8d9b.zip |
do reuse shape context
This is pretty much a revert of 60cb70b94537e9ff1155fb80255fc04ce41363b2.
Turns out e.g. <v:shapetype> is not local only to its <w:pict>.
Added a testcase.
Change-Id: Ibbb9fe01bc2fc77dd67151bf4ca0905443eebf63
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/inc/ooxml/OOXMLDocument.hxx | 2 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLDocumentImpl.hxx | 3 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 2 |
4 files changed, 17 insertions, 0 deletions
diff --git a/writerfilter/inc/ooxml/OOXMLDocument.hxx b/writerfilter/inc/ooxml/OOXMLDocument.hxx index 1e150b41a8c9..7ce8052da2a5 100644 --- a/writerfilter/inc/ooxml/OOXMLDocument.hxx +++ b/writerfilter/inc/ooxml/OOXMLDocument.hxx @@ -246,6 +246,8 @@ public: virtual void setXNoteType(const Id & nId) = 0; virtual const Id & getXNoteType() const = 0; virtual const ::rtl::OUString & getTarget() const = 0; + virtual uno::Reference<xml::sax::XFastShapeContextHandler> getShapeContext( ) = 0; + virtual void setShapeContext( uno::Reference<xml::sax::XFastShapeContextHandler> xContext ) = 0; }; diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 18357bcb3851..acf84f9ab68f 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -401,6 +401,16 @@ uno::Reference<io::XInputStream> OOXMLDocumentImpl::getStorageStream() return mpStream->getStorageStream(); } +void OOXMLDocumentImpl::setShapeContext( uno::Reference<xml::sax::XFastShapeContextHandler> xContext ) +{ + mxShapeContext = xContext; +} + +uno::Reference<xml::sax::XFastShapeContextHandler> OOXMLDocumentImpl::getShapeContext( ) +{ + return mxShapeContext; +} + OOXMLDocument * OOXMLDocumentFactory::createDocument (OOXMLStream::Pointer_t pStream) diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx index d534b158ffc4..a20fbab52af1 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx @@ -48,6 +48,7 @@ class OOXMLDocumentImpl : public OOXMLDocument uno::Reference<frame::XModel> mxModel; uno::Reference<drawing::XDrawPage> mxDrawPage; + uno::Reference<xml::sax::XFastShapeContextHandler> mxShapeContext; bool mbIsSubstream; @@ -110,6 +111,8 @@ public: virtual void setXNoteType(const Id & rId); virtual const Id & getXNoteType() const; virtual const ::rtl::OUString & getTarget() const; + virtual uno::Reference<xml::sax::XFastShapeContextHandler> getShapeContext( ); + virtual void setShapeContext( uno::Reference<xml::sax::XFastShapeContextHandler> xContext ); }; }} #endif // OOXML_DOCUMENT_IMPL_HXX diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 4a4a076cd522..0724c659f4ec 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -1918,6 +1918,7 @@ OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape uno::Reference<XMultiComponentFactory> rServiceManager (xContext->getServiceManager()); + mrShapeContext.set( getDocument( )->getShapeContext( ) ); if ( !mrShapeContext.is( ) ) { // Define the shape context for the whole document @@ -1928,6 +1929,7 @@ OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.xml.sax.FastShapeContextHandler")), xContext), uno::UNO_QUERY); + getDocument()->setShapeContext( mrShapeContext ); } if (mrShapeContext.is()) |