[Libreoffice-commits] core.git: starmath/inc starmath/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 31 11:29:47 UTC 2020


 starmath/inc/view.hxx    |   17 +++++++++--------
 starmath/source/view.cxx |   25 ++++++++-----------------
 2 files changed, 17 insertions(+), 25 deletions(-)

New commits:
commit 787d4d6dcac18da6205fe4762a99f44966fd49a5
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 31 09:29:49 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 31 12:29:15 2020 +0100

    remove pimpl from SmViewShell
    
    Change-Id: Iaa42a593cc76b03e507f34305fce0833f7eac40a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105096
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index d48f1b2dcd62..eab940b2ed86 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -24,11 +24,13 @@
 #include <memory>
 
 #include <rtl/ref.hxx>
+#include <sfx2/docinsert.hxx>
 #include <sfx2/dockwin.hxx>
 #include <sfx2/viewsh.hxx>
 #include <sfx2/ctrlitem.hxx>
 #include <sfx2/shell.hxx>
 #include <sfx2/viewfrm.hxx>
+#include <svtools/miscopt.hxx>
 #include <vcl/timer.hxx>
 #include "document.hxx"
 #include "edit.hxx"
@@ -206,26 +208,25 @@ public:
 };
 
 namespace sfx2 { class FileDialogHelper; }
-struct SmViewShell_Impl;
 
 class SmViewShell: public SfxViewShell
 {
-    std::unique_ptr<SmViewShell_Impl> mpImpl;
-
+    std::unique_ptr<sfx2::DocumentInserter> mpDocInserter;
+    std::unique_ptr<SfxRequest> mpRequest;
+    SvtMiscOptions          maOpts;
     VclPtr<SmGraphicWindow> mpGraphic;
     SmGraphicController maGraphicController;
     OUString maStatusText;
-
     bool mbPasteState;
-
-    DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper*, void );
-    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
-
     /** Used to determine whether insertions using SID_INSERTSPECIAL and SID_INSERTCOMMANDTEXT
      * should be inserted into SmEditWindow or directly into the SmDocShell as done if the
      * visual editor was last to have focus.
      */
     bool mbInsertIntoEditWindow;
+
+    DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper*, void );
+    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
+
 protected:
 
     static Size GetTextLineSize(OutputDevice const & rDevice,
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 82bd312062c6..b76012a6b084 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -45,7 +45,6 @@
 #include <svl/stritem.hxx>
 #include <vcl/transfer.hxx>
 #include <svtools/colorcfg.hxx>
-#include <svtools/miscopt.hxx>
 #include <svl/whiter.hxx>
 #include <svx/zoomslideritem.hxx>
 #include <editeng/editeng.hxx>
@@ -855,13 +854,6 @@ SmCmdBoxWrapper::SmCmdBoxWrapper(vcl::Window *pParentWindow, sal_uInt16 nId,
     static_cast<SfxDockingWindow *>(GetWindow())->Initialize(pInfo);
 }
 
-struct SmViewShell_Impl
-{
-    std::unique_ptr<sfx2::DocumentInserter> pDocInserter;
-    std::unique_ptr<SfxRequest> pRequest;
-    SvtMiscOptions          aOpts;
-};
-
 SFX_IMPL_SUPERCLASS_INTERFACE(SmViewShell, SfxViewShell)
 
 void SmViewShell::InitInterface_Impl()
@@ -1568,10 +1560,10 @@ void SmViewShell::Execute(SfxRequest& rReq)
 
         case SID_IMPORT_FORMULA:
         {
-            mpImpl->pRequest.reset(new SfxRequest( rReq ));
-            mpImpl->pDocInserter.reset(new ::sfx2::DocumentInserter(pWin ? pWin->GetFrameWeld() : nullptr,
+            mpRequest.reset(new SfxRequest( rReq ));
+            mpDocInserter.reset(new ::sfx2::DocumentInserter(pWin ? pWin->GetFrameWeld() : nullptr,
                               GetDoc()->GetFactory().GetFactoryName()));
-            mpImpl->pDocInserter->StartExecuteModal( LINK( this, SmViewShell, DialogClosedHdl ) );
+            mpDocInserter->StartExecuteModal( LINK( this, SmViewShell, DialogClosedHdl ) );
             break;
         }
 
@@ -1897,7 +1889,6 @@ void SmViewShell::GetState(SfxItemSet &rSet)
 
 SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *)
     : SfxViewShell(pFrame_, SfxViewShellFlags::HAS_PRINTOPTIONS)
-    , mpImpl(new SmViewShell_Impl)
     , mpGraphic(VclPtr<SmGraphicWindow>::Create(this))
     , maGraphicController(*mpGraphic, SID_GAPHIC_SM, pFrame_->GetBindings())
     , mbPasteState(false)
@@ -1952,11 +1943,11 @@ void SmViewShell::Activate( bool bIsMDIActivate )
 IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void )
 {
     assert(_pFileDlg && "SmViewShell::DialogClosedHdl(): no file dialog");
-    assert(mpImpl->pDocInserter && "ScDocShell::DialogClosedHdl(): no document inserter");
+    assert(mpDocInserter && "ScDocShell::DialogClosedHdl(): no document inserter");
 
     if ( ERRCODE_NONE == _pFileDlg->GetError() )
     {
-        std::unique_ptr<SfxMedium> pMedium = mpImpl->pDocInserter->CreateMedium();
+        std::unique_ptr<SfxMedium> pMedium = mpDocInserter->CreateMedium();
 
         if ( pMedium )
         {
@@ -1975,8 +1966,8 @@ IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, voi
         }
     }
 
-    mpImpl->pRequest->SetReturnValue( SfxBoolItem( mpImpl->pRequest->GetSlot(), true ) );
-    mpImpl->pRequest->Done();
+    mpRequest->SetReturnValue( SfxBoolItem( mpRequest->GetSlot(), true ) );
+    mpRequest->Done();
 }
 
 void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint )
@@ -1994,7 +1985,7 @@ void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint )
 
 bool SmViewShell::IsInlineEditEnabled() const
 {
-    return mpImpl->aOpts.IsExperimentalMode();
+    return maOpts.IsExperimentalMode();
 }
 
 void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet)


More information about the Libreoffice-commits mailing list