[Libreoffice-commits] core.git: 2 commits - sw/source writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Sat Mar 14 03:46:23 PDT 2015


 sw/source/filter/rtf/swparrtf.cxx                    |    5 -----
 sw/source/filter/ww8/docxattributeoutput.cxx         |    8 +++-----
 sw/source/filter/ww8/docxsdrexport.cxx               |   18 ++++--------------
 sw/source/filter/ww8/docxsdrexport.hxx               |    3 +--
 writerfilter/source/dmapper/SdtHelper.cxx            |    1 -
 writerfilter/source/filter/WriterFilter.cxx          |    5 -----
 writerfilter/source/filter/WriterFilterDetection.cxx |    3 ---
 7 files changed, 8 insertions(+), 35 deletions(-)

New commits:
commit f21e8575326430d29bfe3a5c17b923f8f38cc20c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Mar 14 10:41:49 2015 +0100

    DocxSdrExport::Impl::m_pFlyAttrList: use unique_ptr
    
    Change-Id: I3424af5e3c10eef454cb6a17ec6e84113fbe10f4

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 99b4fbc..6b125c0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -845,8 +845,7 @@ void DocxAttributeOutput::WriteCollectedParagraphProperties()
 {
     if ( m_rExport.SdrExporter().getFlyAttrList() )
     {
-        XFastAttributeListRef xAttrList( m_rExport.SdrExporter().getFlyAttrList() );
-        m_rExport.SdrExporter().setFlyAttrList(NULL);
+        XFastAttributeListRef xAttrList( m_rExport.SdrExporter().getFlyAttrList().release() );
 
         m_pSerializer->singleElementNS( XML_w, XML_framePr, xAttrList );
     }
@@ -2385,9 +2384,8 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData)
                     // to the DOCX when the function 'WriteCollectedParagraphProperties' gets called.
                     // So we need to store the current status of these lists, so that we can revert back to them when
                     // we are done exporting the redline attributes.
-                    ::sax_fastparser::FastAttributeList *pFlyAttrList_Original              = m_rExport.SdrExporter().getFlyAttrList();
+                    std::unique_ptr<sax_fastparser::FastAttributeList> pFlyAttrList_Original(m_rExport.SdrExporter().getFlyAttrList().release());
                     std::unique_ptr<sax_fastparser::FastAttributeList> pParagraphSpacingAttrList_Original(m_pParagraphSpacingAttrList.release());
-                    m_rExport.SdrExporter().setFlyAttrList(NULL);
 
                     // Output the redline item set
                     m_rExport.OutputItemSet( *pChangesSet, true, false, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF );
@@ -2396,7 +2394,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData)
                     WriteCollectedParagraphProperties();
 
                     // Revert back the original values that were stored in 'm_rExport.SdrExporter().getFlyAttrList()', 'm_pParagraphSpacingAttrList'
-                    m_rExport.SdrExporter().setFlyAttrList(pFlyAttrList_Original);
+                    m_rExport.SdrExporter().getFlyAttrList().reset(pFlyAttrList_Original.release());
                     m_pParagraphSpacingAttrList.reset(pParagraphSpacingAttrList_Original.release());
 
                     m_pSerializer->endElementNS( XML_w, XML_pPr );
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 142e79c..a642b17 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -132,7 +132,7 @@ struct DocxSdrExport::Impl
     const Size* m_pFlyFrameSize;
     bool m_bTextFrameSyntax;
     bool m_bDMLTextFrameSyntax;
-    sax_fastparser::FastAttributeList* m_pFlyAttrList;
+    std::unique_ptr<sax_fastparser::FastAttributeList> m_pFlyAttrList;
     sax_fastparser::FastAttributeList* m_pTextboxAttrList;
     OStringBuffer m_aTextFrameStyle;
     bool m_bFrameBtLr;
@@ -160,7 +160,6 @@ struct DocxSdrExport::Impl
           m_pFlyFrameSize(0),
           m_bTextFrameSyntax(false),
           m_bDMLTextFrameSyntax(false),
-          m_pFlyAttrList(0),
           m_pTextboxAttrList(0),
           m_bFrameBtLr(false),
           m_bDrawingOpen(false),
@@ -181,7 +180,6 @@ struct DocxSdrExport::Impl
 
     ~Impl()
     {
-        delete m_pFlyAttrList, m_pFlyAttrList = NULL;
         delete m_pTextboxAttrList, m_pTextboxAttrList = NULL;
     }
 
@@ -220,16 +218,11 @@ bool DocxSdrExport::getDMLTextFrameSyntax()
     return m_pImpl->m_bDMLTextFrameSyntax;
 }
 
-sax_fastparser::FastAttributeList*& DocxSdrExport::getFlyAttrList()
+std::unique_ptr<sax_fastparser::FastAttributeList>& DocxSdrExport::getFlyAttrList()
 {
     return m_pImpl->m_pFlyAttrList;
 }
 
-void DocxSdrExport::setFlyAttrList(sax_fastparser::FastAttributeList* pAttrList)
-{
-    m_pImpl->m_pFlyAttrList = pAttrList;
-}
-
 sax_fastparser::FastAttributeList* DocxSdrExport::getTextboxAttrList()
 {
     return m_pImpl->m_pTextboxAttrList;
@@ -1592,7 +1585,7 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly
     m_pImpl->m_pFlyFrameSize = &aSize;
 
     m_pImpl->m_bTextFrameSyntax = true;
-    m_pImpl->m_pFlyAttrList = pFS->createAttrList();
+    m_pImpl->m_pFlyAttrList.reset(pFS->createAttrList());
     m_pImpl->m_pTextboxAttrList = pFS->createAttrList();
     m_pImpl->m_aTextFrameStyle = "position:absolute";
     if (!bTextBoxOnly)
@@ -1610,8 +1603,7 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly
         if (!sAnchorId.isEmpty())
             m_pImpl->m_pFlyAttrList->addNS(XML_w14, XML_anchorId, OUStringToOString(sAnchorId, RTL_TEXTENCODING_UTF8));
     }
-    sax_fastparser::XFastAttributeListRef xFlyAttrList(m_pImpl->m_pFlyAttrList);
-    m_pImpl->m_pFlyAttrList = NULL;
+    sax_fastparser::XFastAttributeListRef xFlyAttrList(m_pImpl->m_pFlyAttrList.release());
     m_pImpl->m_bFrameBtLr = checkFrameBtlr(m_pImpl->m_rExport.pDoc->GetNodes()[nStt], m_pImpl->m_pTextboxAttrList);
     sax_fastparser::XFastAttributeListRef xTextboxAttrList(m_pImpl->m_pTextboxAttrList);
     m_pImpl->m_pTextboxAttrList = NULL;
diff --git a/sw/source/filter/ww8/docxsdrexport.hxx b/sw/source/filter/ww8/docxsdrexport.hxx
index 0910128..da2d975 100644
--- a/sw/source/filter/ww8/docxsdrexport.hxx
+++ b/sw/source/filter/ww8/docxsdrexport.hxx
@@ -62,8 +62,7 @@ public:
     const Size* getFlyFrameSize();
     bool getTextFrameSyntax();
     bool getDMLTextFrameSyntax();
-    sax_fastparser::FastAttributeList*& getFlyAttrList();
-    void setFlyAttrList(sax_fastparser::FastAttributeList* pAttrList);
+    std::unique_ptr<sax_fastparser::FastAttributeList>& getFlyAttrList();
     /// Attributes of the next v:textbox element.
     sax_fastparser::FastAttributeList* getTextboxAttrList();
     OStringBuffer& getTextFrameStyle();
commit 05aa02a85d3f9ab6cd9d217ad2d1bef9ca28fd71
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Mar 14 10:35:20 2015 +0100

    Unused includes
    
    Change-Id: Ie273e88bd12321726f1717e4e09b1928fcadb6f9

diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 4b042f4..2730561b 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -17,14 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <tools/stream.hxx>
 #include <poolfmt.hxx>
 #include <shellio.hxx>
 #include <ndtxt.hxx>
 #include <doc.hxx>
 #include <docsh.hxx>
 #include <IDocumentStylePoolAccess.hxx>
-#include <pam.hxx>
 #include <swerror.h>
 
 #include <unotextrange.hxx>
@@ -32,11 +30,8 @@
 #include <unotools/streamwrap.hxx>
 #include <comphelper/processfactory.hxx>
 
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
 #include <com/sun/star/document/XFilter.hpp>
 #include <com/sun/star/document/XImporter.hpp>
-#include <com/sun/star/document/XExporter.hpp>
-#include <com/sun/star/text/XTextRange.hpp>
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index d12acd3..142e79c 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -17,7 +17,6 @@
 #include <svx/svdogrp.hxx>
 #include <oox/token/tokens.hxx>
 #include <oox/export/utils.hxx>
-#include <oox/export/vmlexport.hxx>
 #include <oox/token/properties.hxx>
 #include <textboxhelper.hxx>
 #include <fmtanchr.hxx>
@@ -32,7 +31,6 @@
 #include <comphelper/seqstream.hxx>
 #include <comphelper/sequence.hxx>
 
-
 #include <IDocumentDrawModelAccess.hxx>
 
 using namespace com::sun::star;
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index 673293d..ff6bae8 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -15,7 +15,6 @@
 #include <editeng/unoprnms.hxx>
 #include <vcl/svapp.hxx>
 #include <unotools/datetime.hxx>
-#include <DomainMapper_Impl.hxx>
 #include <comphelper/sequence.hxx>
 
 namespace writerfilter
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 7a5fc1d..1a968d9 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -19,7 +19,6 @@
 
 #ifdef DEBUG_WRITERFILTER
 #include <iostream>
-#include <osl/process.h>
 #endif
 
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -28,12 +27,9 @@
 #include <com/sun/star/document/XImporter.hpp>
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <com/sun/star/io/WrongFormatException.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/xml/sax/SAXParseException.hpp>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/implbase.hxx>
@@ -44,7 +40,6 @@
 #include <oox/ole/olestorage.hxx>
 #include <oox/ole/vbaproject.hxx>
 #include <ooxml/OOXMLDocument.hxx>
-#include <osl/diagnose.h>
 #include <unotools/mediadescriptor.hxx>
 
 using namespace ::com::sun::star;
diff --git a/writerfilter/source/filter/WriterFilterDetection.cxx b/writerfilter/source/filter/WriterFilterDetection.cxx
index f879997..5b202b3 100644
--- a/writerfilter/source/filter/WriterFilterDetection.cxx
+++ b/writerfilter/source/filter/WriterFilterDetection.cxx
@@ -18,14 +18,11 @@
  */
 
 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <comphelper/storagehelper.hxx>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <sot/storage.hxx>
-#include <unotools/ucbstreamhelper.hxx>
 
 using namespace ::com::sun::star;
 


More information about the Libreoffice-commits mailing list