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

Noel Grandin noel.grandin at collabora.co.uk
Thu Jan 25 11:16:05 UTC 2018


 compilerplugins/clang/datamembershadow.cxx     |    2 --
 sdext/source/presenter/PresenterPane.cxx       |   11 +++++------
 sdext/source/presenter/PresenterPane.hxx       |    1 -
 sdext/source/presenter/PresenterPaneBase.cxx   |    9 ++++-----
 sdext/source/presenter/PresenterPaneBase.hxx   |    2 --
 sdext/source/presenter/PresenterSpritePane.cxx |    5 -----
 sdext/source/presenter/PresenterSpritePane.hxx |    2 --
 7 files changed, 9 insertions(+), 23 deletions(-)

New commits:
commit 390fad39a8f945c848ff998d9f75720318781123
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jan 25 08:53:14 2018 +0200

    loplugin:datamembershadow in PresenterPane
    
    the subclass field is just a copy of the parent field, so drop the
    subclass, and consequently simply the CreateCanvases method, we don't
    need to pass the parameter down, can just access the parent field.
    
    Change-Id: I3be448a06b32d01cdda4fc36b78cafb4488e2913
    Reviewed-on: https://gerrit.libreoffice.org/48553
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/datamembershadow.cxx b/compilerplugins/clang/datamembershadow.cxx
index 54e671daffa1..e89a44214339 100644
--- a/compilerplugins/clang/datamembershadow.cxx
+++ b/compilerplugins/clang/datamembershadow.cxx
@@ -80,8 +80,6 @@ bool DataMemberShadow::VisitFieldDecl(FieldDecl const * fieldDecl)
         return true;
     if (loplugin::isSamePathname(aFileName, SRCDIR "/sd/source/ui/view/viewoverlaymanager.cxx"))
         return true;
-    if (loplugin::isSamePathname(aFileName, SRCDIR "/sdext/source/presenter/PresenterSpritePane.hxx"))
-        return true;
     if (loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stortree.hxx")
         || loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stordata.hxx"))
         return true;
diff --git a/sdext/source/presenter/PresenterPane.cxx b/sdext/source/presenter/PresenterPane.cxx
index e806c7e58a51..e539d98b4373 100644
--- a/sdext/source/presenter/PresenterPane.cxx
+++ b/sdext/source/presenter/PresenterPane.cxx
@@ -128,27 +128,26 @@ void SAL_CALL PresenterPane::windowPaint (const awt::PaintEvent& rEvent)
 
 
 void PresenterPane::CreateCanvases (
-    const Reference<awt::XWindow>& rxParentWindow,
     const Reference<rendering::XSpriteCanvas>& rxParentCanvas)
 {
     if ( ! mxPresenterHelper.is())
         return;
-    if ( ! rxParentWindow.is())
+    if ( ! mxParentWindow.is())
         return;
     if ( ! rxParentCanvas.is())
         return;
 
     mxBorderCanvas = mxPresenterHelper->createSharedCanvas(
         rxParentCanvas,
-        rxParentWindow,
+        mxParentWindow,
         Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY),
-        rxParentWindow,
+        mxParentWindow,
         mxBorderWindow);
     mxContentCanvas = mxPresenterHelper->createSharedCanvas(
         rxParentCanvas,
-        rxParentWindow,
+        mxParentWindow,
         Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY),
-        rxParentWindow,
+        mxParentWindow,
         mxContentWindow);
 
     PaintBorder(mxBorderWindow->getPosSize());
diff --git a/sdext/source/presenter/PresenterPane.hxx b/sdext/source/presenter/PresenterPane.hxx
index dc12aa920abc..681245389be9 100644
--- a/sdext/source/presenter/PresenterPane.hxx
+++ b/sdext/source/presenter/PresenterPane.hxx
@@ -76,7 +76,6 @@ private:
     css::awt::Rectangle maBoundingBox;
 
     virtual void CreateCanvases (
-        const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
         const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override;
 
     void Invalidate (
diff --git a/sdext/source/presenter/PresenterPaneBase.cxx b/sdext/source/presenter/PresenterPaneBase.cxx
index 4f8dc23e2573..f6174652b103 100644
--- a/sdext/source/presenter/PresenterPaneBase.cxx
+++ b/sdext/source/presenter/PresenterPaneBase.cxx
@@ -197,7 +197,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
                 5);
         }
 
-        CreateWindows(mxParentWindow, bIsWindowVisibleOnCreation);
+        CreateWindows(bIsWindowVisibleOnCreation);
 
         if (mxBorderWindow.is())
         {
@@ -205,7 +205,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
             mxBorderWindow->addPaintListener(this);
         }
 
-        CreateCanvases(mxParentWindow, xParentCanvas);
+        CreateCanvases(xParentCanvas);
 
         // Raise new windows.
         ToTop();
@@ -265,14 +265,13 @@ void SAL_CALL PresenterPaneBase::disposing (const lang::EventObject& rEvent)
 
 
 void PresenterPaneBase::CreateWindows (
-    const Reference<awt::XWindow>& rxParentWindow,
     const bool bIsWindowVisibleOnCreation)
 {
-    if (mxPresenterHelper.is() && rxParentWindow.is())
+    if (mxPresenterHelper.is() && mxParentWindow.is())
     {
 
         mxBorderWindow = mxPresenterHelper->createWindow(
-            rxParentWindow,
+            mxParentWindow,
             false,
             bIsWindowVisibleOnCreation,
             false,
diff --git a/sdext/source/presenter/PresenterPaneBase.hxx b/sdext/source/presenter/PresenterPaneBase.hxx
index f47ccbfd4c44..bfe87ed42206 100644
--- a/sdext/source/presenter/PresenterPaneBase.hxx
+++ b/sdext/source/presenter/PresenterPaneBase.hxx
@@ -114,11 +114,9 @@ protected:
     SharedBitmapDescriptor mpViewBackground;
 
     virtual void CreateCanvases (
-        const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
         const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) = 0;
 
     void CreateWindows (
-        const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
         const bool bIsWindowVisibleOnCreation);
     void PaintBorder (const css::awt::Rectangle& rUpdateRectangle);
     void ToTop();
diff --git a/sdext/source/presenter/PresenterSpritePane.cxx b/sdext/source/presenter/PresenterSpritePane.cxx
index 64c7ee327e44..a5ebf1fce252 100644
--- a/sdext/source/presenter/PresenterSpritePane.cxx
+++ b/sdext/source/presenter/PresenterSpritePane.cxx
@@ -33,7 +33,6 @@ namespace sdext { namespace presenter {
 PresenterSpritePane::PresenterSpritePane (const Reference<XComponentContext>& rxContext,
         const ::rtl::Reference<PresenterController>& rpPresenterController)
     : PresenterPaneBase(rxContext, rpPresenterController),
-      mxParentWindow(),
       mxParentCanvas(),
       mpSprite(new PresenterSprite())
 {
@@ -53,7 +52,6 @@ PresenterSpritePane::~PresenterSpritePane()
 void PresenterSpritePane::disposing()
 {
     mpSprite->SetFactory(nullptr);
-    mxParentWindow = nullptr;
     mxParentCanvas = nullptr;
     PresenterPaneBase::disposing();
 }
@@ -165,12 +163,9 @@ void PresenterSpritePane::UpdateCanvases()
 }
 
 void PresenterSpritePane::CreateCanvases (
-    const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
     const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas)
 {
-    OSL_ASSERT(!mxParentWindow.is() || mxParentWindow==rxParentWindow);
     OSL_ASSERT(!mxParentCanvas.is() || mxParentCanvas==rxParentCanvas);
-    mxParentWindow = rxParentWindow;
     mxParentCanvas = rxParentCanvas;
 
     mpSprite->SetFactory(mxParentCanvas);
diff --git a/sdext/source/presenter/PresenterSpritePane.hxx b/sdext/source/presenter/PresenterSpritePane.hxx
index e65ea98a9148..694b8794265c 100644
--- a/sdext/source/presenter/PresenterSpritePane.hxx
+++ b/sdext/source/presenter/PresenterSpritePane.hxx
@@ -80,12 +80,10 @@ public:
     virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
 
 private:
-    css::uno::Reference<css::awt::XWindow> mxParentWindow;
     css::uno::Reference<css::rendering::XSpriteCanvas> mxParentCanvas;
     std::shared_ptr<PresenterSprite> mpSprite;
 
     virtual void CreateCanvases (
-        const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
         const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override;
     void UpdateCanvases();
 };


More information about the Libreoffice-commits mailing list