[Libreoffice-commits] .: writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Sun Nov 6 05:00:35 PST 2011


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    8 +++-----
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit dc060230a15c82c482811ea3eecf1e50e9a20bc4
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Sun Nov 6 14:01:22 2011 +0100

    RTFDocumentImpl: use boost::shared_ptr for m_pInStream and m_pGraphicHelper

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f0bda24..39bbde2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -301,7 +301,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
     m_bIsInShape(false)
 {
     OSL_ASSERT(xInputStream.is());
-    m_pInStream = utl::UcbStreamHelper::CreateStream(xInputStream, sal_True);
+    m_pInStream.reset(utl::UcbStreamHelper::CreateStream(xInputStream, sal_True));
 
     m_xModelFactory.set(m_xDstDoc, uno::UNO_QUERY);
 
@@ -309,16 +309,14 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
     if (xDocumentPropertiesSupplier.is())
         m_xDocumentProperties.set(xDocumentPropertiesSupplier->getDocumentProperties(), uno::UNO_QUERY);
 
-    m_pGraphicHelper = new oox::GraphicHelper(m_xContext, xFrame, m_xStorage);
+    m_pGraphicHelper.reset(new oox::GraphicHelper(m_xContext, xFrame, m_xStorage));
 
-    m_pTokenizer.reset(new RTFTokenizer(*this, m_pInStream));
+    m_pTokenizer.reset(new RTFTokenizer(*this, m_pInStream.get()));
     m_pSdrImport.reset(new RTFSdrImport(*this, m_xDstDoc));
 }
 
 RTFDocumentImpl::~RTFDocumentImpl()
 {
-    delete m_pGraphicHelper;
-    delete m_pInStream;
 }
 
 SvStream& RTFDocumentImpl::Strm()
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 66a2839..7b8a7e0 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -351,7 +351,7 @@ namespace writerfilter {
                 uno::Reference<frame::XFrame> const& m_xFrame;
                 uno::Reference<lang::XMultiServiceFactory> m_xModelFactory;
                 uno::Reference<document::XDocumentProperties> m_xDocumentProperties;
-                SvStream* m_pInStream;
+                boost::shared_ptr<SvStream> m_pInStream;
                 Stream* m_pMapperStream;
                 boost::shared_ptr<RTFSdrImport> m_pSdrImport;
                 boost::shared_ptr<RTFTokenizer> m_pTokenizer;
@@ -382,7 +382,7 @@ namespace writerfilter {
                 RTFSprms m_aSettingsTableSprms;
 
                 oox::StorageRef m_xStorage;
-                oox::GraphicHelper* m_pGraphicHelper;
+                boost::shared_ptr<oox::GraphicHelper> m_pGraphicHelper;
 
                 /// Buffered table cells, till cell definitions are not reached.
                 RTFBuffer_t m_aTableBuffer;


More information about the Libreoffice-commits mailing list