[Libreoffice-commits] .: writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon Jun 11 08:05:46 PDT 2012


 writerfilter/source/dmapper/DomainMapper.cxx      |    3 +++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    4 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |    7 +++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 61ba6e49f5bbadaf1334ce71459647c3d0a3a37d
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Jun 11 17:04:37 2012 +0200

    fdo#49659 dmapper: handle tables in substreams
    
    Change-Id: I4c81eb1ec57bda2b5ce65b19de998bab2dfb6c3c

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 5c45373..9f3d115 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3491,6 +3491,9 @@ void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t
 void DomainMapper::lcl_substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
 {
     m_pImpl->appendTableManager( );
+    // Appending a TableManager resets its TableHandler, so we need to append
+    // that as well, or tables won't be imported properly in headers/footers.
+    m_pImpl->appendTableHandler( );
     m_pImpl->getTableManager().startLevel();
 
     //import of page header/footer
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 08e189b..546613a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -216,9 +216,9 @@ DomainMapper_Impl::DomainMapper_Impl(
 
     //todo: does it make sense to set the body text as static text interface?
     uno::Reference< text::XTextAppendAndConvert > xBodyTextAppendAndConvert( m_xBodyText, uno::UNO_QUERY );
-    TableDataHandler_t::Pointer_t pTableHandler
+    m_pTableHandler.reset
         (new DomainMapperTableHandler(xBodyTextAppendAndConvert, *this));
-    getTableManager( ).setHandler(pTableHandler);
+    getTableManager( ).setHandler(m_pTableHandler);
 
     getTableManager( ).startLevel();
     m_bUsingEnhancedFields = lcl_IsUsingEnhancedFields( uno::Reference< lang::XMultiServiceFactory >( m_xComponentContext->getServiceManager(), uno::UNO_QUERY ) );
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 1dc1ebc..07f6934 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -311,6 +311,7 @@ private:
 
     // TableManagers are stacked: one for each stream to avoid any confusion
     std::stack< boost::shared_ptr< DomainMapperTableManager > > m_aTableManagers;
+    TableDataHandler_t::Pointer_t m_pTableHandler;
 
     //each context needs a stack of currently used attributes
     FIB                     m_aFIB;
@@ -556,6 +557,12 @@ public:
         m_aTableManagers.push( pMngr );
     }
 
+    void appendTableHandler( )
+    {
+        if (m_pTableHandler.get())
+            m_aTableManagers.top()->setHandler(m_pTableHandler);
+    }
+
     void popTableManager( )
     {
         if ( m_aTableManagers.size( ) > 0 )


More information about the Libreoffice-commits mailing list