[Libreoffice-commits] core.git: compilerplugins/clang filter/source include/filter

Noel Grandin noel.grandin at collabora.co.uk
Thu Oct 13 11:34:33 UTC 2016


 compilerplugins/clang/mergeclasses.results |    1 
 filter/source/msfilter/escherex.cxx        |    4 +-
 filter/source/msfilter/eschesdo.cxx        |   49 ++++++++++++--------------
 filter/source/msfilter/eschesdo.hxx        |   53 +++++++----------------------
 include/filter/msfilter/escherex.hxx       |    8 ++--
 5 files changed, 42 insertions(+), 73 deletions(-)

New commits:
commit a7e395f3975a326a278eb99dbabb0030e4335009
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Oct 13 13:30:27 2016 +0200

    loplugin:mergeclasses ImplEESdrWriter with ImplEscherExSdr
    
    Change-Id: Iea2241d9fc44b92e18101b3f367a643f03729183

diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index d0c51a5..428bd40 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -71,7 +71,6 @@ merge IXFAttrList with XFSaxAttrList
 merge IXFStream with XFSaxStream
 merge IXFStyle with XFStyle
 merge IconChoicePage with SvxHyperlinkTabPageBase
-merge ImplEESdrWriter with ImplEscherExSdr
 merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstitution
 merge ImplPreMatchFontSubstitution with FcPreMatchSubstitution
 merge LwpDLList with LwpParaProperty
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index da6a5cf..ff78d89 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4975,7 +4975,7 @@ EscherEx::EscherEx(const std::shared_ptr<EscherExGlobal>& rxGlobal, SvStream* pO
         mbOwnsStrm = true;
     }
     mnStrmStartOfs = mpOutStrm->Tell();
-    mpImplEscherExSdr.reset( new ImplEscherExSdr( *this ) );
+    mpImplEESdrWriter.reset( new ImplEESdrWriter( *this ) );
 }
 
 EscherEx::~EscherEx()
@@ -5295,7 +5295,7 @@ sal_uInt32 EscherEx::EnterGroup( const OUString& rShapeName, const Rectangle* pB
         if ( mnGroupLevel > 1 )
             AddChildAnchor( aRect );
 
-        EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
+        EscherExHostAppData* pAppData = mpImplEESdrWriter->ImplGetHostData();
         if( pAppData )
         {
             if ( mnGroupLevel <= 1 )
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 010fadf..5b9028d 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -69,9 +69,13 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
     , mpPicStrm(nullptr)
     , mpHostAppData(nullptr)
     , mbIsTitlePossible(false)
+    , mpSdrPage( nullptr )
+    , mpSolverContainer( nullptr )
 {
 }
 
+
+
 Point ImplEESdrWriter::ImplMapPoint( const Point& rPoint )
 {
     return OutputDevice::LogicToLogic( rPoint, maMapModeSrc, maMapModeDest );
@@ -833,18 +837,9 @@ void ImplEESdrWriter::ImplWritePage(
     }
 }
 
-ImplEscherExSdr::ImplEscherExSdr( EscherEx& rEx )
-        :
-        ImplEESdrWriter( rEx ),
-        mpSdrPage( nullptr ),
-        mpSolverContainer( nullptr )
+ImplEESdrWriter::~ImplEESdrWriter()
 {
-}
-
-
-ImplEscherExSdr::~ImplEscherExSdr()
-{
-    DBG_ASSERT( !mpSolverContainer, "ImplEscherExSdr::~ImplEscherExSdr: unwritten SolverContainer" );
+    DBG_ASSERT( !mpSolverContainer, "ImplEESdrWriter::~ImplEESdrWriter: unwritten SolverContainer" );
     Reference<css::lang::XComponent> xComp(mXDrawPage, UNO_QUERY);
     if (xComp.is())
         xComp->dispose();
@@ -852,7 +847,7 @@ ImplEscherExSdr::~ImplEscherExSdr()
 }
 
 
-bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
+bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
 {
     SvxDrawPage* pSvxDrawPage;
     if ( mpSdrPage != &rPage || !mXDrawPage.is() )
@@ -880,7 +875,7 @@ bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
     return pSvxDrawPage != nullptr;
 }
 
-bool ImplEscherExSdr::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
+bool ImplEESdrWriter::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
 {
     // eventually write SolverContainer of current page, deletes the Solver
     ImplFlushSolverContainer();
@@ -899,7 +894,7 @@ bool ImplEscherExSdr::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
     return true;
 }
 
-void ImplEscherExSdr::ImplExitPage()
+void ImplEESdrWriter::ImplExitPage()
 {
     // close all groups before the solver container is written
     while( mpEscherEx->GetGroupLevel() )
@@ -910,7 +905,7 @@ void ImplEscherExSdr::ImplExitPage()
 }
 
 
-void ImplEscherExSdr::ImplFlushSolverContainer()
+void ImplEESdrWriter::ImplFlushSolverContainer()
 {
     if ( mpSolverContainer )
     {
@@ -920,43 +915,43 @@ void ImplEscherExSdr::ImplFlushSolverContainer()
     }
 }
 
-void ImplEscherExSdr::ImplWriteCurrentPage()
+void ImplEESdrWriter::ImplWriteCurrentPage()
 {
-    assert(mpSolverContainer && "ImplEscherExSdr::ImplWriteCurrentPage: no SolverContainer");
+    assert(mpSolverContainer && "ImplEESdrWriter::ImplWriteCurrentPage: no SolverContainer");
     ImplWritePage( *mpSolverContainer );
     ImplExitPage();
 }
 
-sal_uInt32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj , bool ooxmlExport )
+sal_uInt32 ImplEESdrWriter::ImplWriteTheShape( ImplEESdrObject& rObj , bool ooxmlExport )
 {
-    assert(mpSolverContainer && "ImplEscherExSdr::ImplWriteShape: no SolverContainer");
+    assert(mpSolverContainer && "ImplEESdrWriter::ImplWriteShape: no SolverContainer");
     return ImplWriteShape( rObj, *mpSolverContainer, ooxmlExport );
 }
 
 void EscherEx::AddSdrPage( const SdrPage& rPage )
 {
-    if ( mpImplEscherExSdr->ImplInitPage( rPage ) )
-        mpImplEscherExSdr->ImplWriteCurrentPage();
+    if ( mpImplEESdrWriter->ImplInitPage( rPage ) )
+        mpImplEESdrWriter->ImplWriteCurrentPage();
 }
 
 void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
 {
-    if ( mpImplEscherExSdr->ImplInitUnoShapes( rxShapes ) )
-        mpImplEscherExSdr->ImplWriteCurrentPage();
+    if ( mpImplEESdrWriter->ImplInitUnoShapes( rxShapes ) )
+        mpImplEESdrWriter->ImplWriteCurrentPage();
 }
 
 sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport )
 {
-    ImplEESdrObject aObj( *mpImplEscherExSdr, rObj, mbOOXML );
+    ImplEESdrObject aObj( *mpImplEESdrWriter, rObj, mbOOXML );
     if( aObj.IsValid() )
-        return mpImplEscherExSdr->ImplWriteTheShape( aObj, ooxmlExport );
+        return mpImplEESdrWriter->ImplWriteTheShape( aObj, ooxmlExport );
     return 0;
 }
 
 
 void EscherEx::EndSdrObjectPage()
 {
-    mpImplEscherExSdr->ImplExitPage();
+    mpImplEESdrWriter->ImplExitPage();
 }
 
 EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const Rectangle* /*pChildAnchor*/ )
@@ -999,7 +994,7 @@ const SdrObject* EscherEx::GetSdrObject( const Reference< XShape >& rShape )
 }
 
 
-ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
+ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx,
                                     const SdrObject& rObj, bool bOOXML ) :
     mnShapeId( 0 ),
     mnTextSize( 0 ),
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index da24e94..18bfece 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -29,7 +29,9 @@
 enum ImplEESdrPageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
 
 class ImplEESdrWriter;
-class ImplEscherExSdr;
+class ImplEESdrWriter;
+class SdrObject;
+class SdrPage;
 
 class ImplEESdrObject
 {
@@ -50,7 +52,7 @@ class ImplEESdrObject
 public:
     css::uno::Reference< css::beans::XPropertySet >   mXPropSet;
 
-    ImplEESdrObject( ImplEscherExSdr& rEx, const SdrObject& rObj, bool bOOXML = false );
+    ImplEESdrObject( ImplEESdrWriter& rEx, const SdrObject& rObj, bool bOOXML = false );
     ImplEESdrObject( ImplEESdrWriter& rEx, const css::uno::Reference< css::drawing::XShape >& rShape );
     ~ImplEESdrObject();
 
@@ -106,70 +108,43 @@ class EscherExHostAppData;
 
 class ImplEESdrWriter
 {
-protected:
     EscherEx*           mpEscherEx;
     MapMode             maMapModeSrc;
     MapMode             maMapModeDest;
-
     css::uno::Reference< css::drawing::XDrawPage >        mXDrawPage;
     css::uno::Reference< css::drawing::XShapes >          mXShapes;
-
     SvStream*           mpPicStrm;
-
     // own extensions
-
     EscherExHostAppData*    mpHostAppData;
-
     bool                    mbIsTitlePossible;
-
-
-    explicit ImplEESdrWriter( EscherEx& rEx );
+    const SdrPage*          mpSdrPage;
+    EscherSolverContainer*  mpSolverContainer;
 
     bool                ImplInitPageValues();
-
-    void                ImplWritePage(
-                            EscherSolverContainer& rSolver );
-
+    void                ImplWritePage( EscherSolverContainer& rSolver );
     sal_uInt32          ImplWriteShape( ImplEESdrObject& rObj,
                             EscherSolverContainer& rSolver,
                             const bool bOOxmlExport = false );  // returns ShapeID
-
     static void         ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
     void                ImplWriteAdditionalText(
-                                        ImplEESdrObject& rObj,
-                                        const Point& rTextRefPoint );
+                            ImplEESdrObject& rObj,
+                            const Point& rTextRefPoint );
     sal_uInt32          ImplEnterAdditionalTextGroup(
-                                const css::uno::Reference< css::drawing::XShape >& rShape,
-                                const Rectangle* pBoundRect );
-
+                            const css::uno::Reference< css::drawing::XShape >& rShape,
+                            const Rectangle* pBoundRect );
+    void                ImplFlushSolverContainer();
 
 public:
+    explicit            ImplEESdrWriter( EscherEx& rEx );
+                        ~ImplEESdrWriter();
     Point               ImplMapPoint( const Point& rPoint );
     Size                ImplMapSize( const Size& rSize );
     EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
-};
-
-class SdrObject;
-class SdrPage;
-
-class ImplEscherExSdr : public ImplEESdrWriter
-{
-private:
-    const SdrPage*          mpSdrPage;
-    EscherSolverContainer*  mpSolverContainer;
-
-public:
-    explicit            ImplEscherExSdr( EscherEx& rEx );
-    virtual             ~ImplEscherExSdr();
-
     bool                ImplInitPage( const SdrPage& rPage );
     bool                ImplInitUnoShapes( const css::uno::Reference< css::drawing::XShapes >& rxShapes );
     void                ImplWriteCurrentPage();
-
     sal_uInt32          ImplWriteTheShape( ImplEESdrObject& rObj, bool ooxmlExport );
-
     void                ImplExitPage();
-    void                ImplFlushSolverContainer();
 };
 
 
diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx
index 1aa7de3..746bb2a 100644
--- a/include/filter/msfilter/escherex.hxx
+++ b/include/filter/msfilter/escherex.hxx
@@ -966,7 +966,7 @@ public:
     void                WriteDggAtom( SvStream& rStrm ) const;
 
     /** Called if a picture shall be written and no picture stream is set at
-        class ImplEscherExSdr.
+        class ImplEESdrWriter.
 
         On first invokation, this function calls the virtual member function
         ImplQueryPictureStream(). The return value will be cached internally
@@ -1015,13 +1015,13 @@ private:
 
 class SdrObject;
 class SdrPage;
-class ImplEscherExSdr;
+class ImplEESdrWriter;
 
 class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
 {
     protected:
         std::shared_ptr<EscherExGlobal>           mxGlobal;
-        ::std::unique_ptr< ImplEscherExSdr > mpImplEscherExSdr;
+        ::std::unique_ptr< ImplEESdrWriter > mpImplEESdrWriter;
         SvStream*                   mpOutStrm;
         bool                        mbOwnsStrm;
         sal_uInt32                  mnStrmStartOfs;
@@ -1056,7 +1056,7 @@ public:
     EscherGraphicProvider& GetGraphicProvider() { return *mxGlobal; }
 
     /** Called if a picture shall be written and no picture stream is set at
-        class ImplEscherExSdr.
+        class ImplEESdrWriter.
      */
     inline SvStream*    QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
 


More information about the Libreoffice-commits mailing list