[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/basegfx sd/Library_sd.mk sd/source solenv/clang-format

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 16 11:35:51 UTC 2018


 drawinglayer/source/primitive2d/sceneprimitive2d.cxx   |    2 
 drawinglayer/source/processor3d/zbufferprocessor3d.cxx |    2 
 include/basegfx/raster/bpixelraster.hxx                |   78 -----
 include/basegfx/raster/bzpixelraster.hxx               |   60 ++--
 sd/Library_sd.mk                                       |    1 
 sd/source/ui/framework/module/ResourceManager.cxx      |  235 -----------------
 sd/source/ui/framework/module/ResourceManager.hxx      |   99 -------
 sd/source/ui/framework/module/SlideSorterModule.cxx    |  169 +++++++++++-
 sd/source/ui/framework/module/SlideSorterModule.hxx    |   51 +++
 solenv/clang-format/blacklist                          |    3 
 10 files changed, 254 insertions(+), 446 deletions(-)

New commits:
commit c2b0e016e246c6a70a7c41c1088cda6cf122e1b7
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 16 09:17:21 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 16 13:35:37 2018 +0200

    loplugin:mergeclasses merge ResourceManager into SlideSorterModule
    
    Change-Id: If78dc81e41180e7449b389e36223ee78d6ac91ec
    Reviewed-on: https://gerrit.libreoffice.org/57486
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 7e165c3ec7a6..563f0d833ee8 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -247,7 +247,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
 	sd/source/ui/framework/module/ImpressModule \
 	sd/source/ui/framework/module/ModuleController \
 	sd/source/ui/framework/module/PresentationModule \
-	sd/source/ui/framework/module/ResourceManager \
 	sd/source/ui/framework/module/ShellStackGuard \
 	sd/source/ui/framework/module/SlideSorterModule \
 	sd/source/ui/framework/module/ToolBarModule \
diff --git a/sd/source/ui/framework/module/ResourceManager.cxx b/sd/source/ui/framework/module/ResourceManager.cxx
deleted file mode 100644
index fc8d0961f030..000000000000
--- a/sd/source/ui/framework/module/ResourceManager.cxx
+++ /dev/null
@@ -1,235 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "ResourceManager.hxx"
-
-#include <framework/FrameworkHelper.hxx>
-#include <framework/ConfigurationController.hxx>
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
-
-#include <set>
-
-using namespace css;
-using namespace css::uno;
-using namespace css::drawing::framework;
-
-using ::sd::framework::FrameworkHelper;
-
-namespace {
-    static const sal_Int32 ResourceActivationRequestEvent = 0;
-    static const sal_Int32 ResourceDeactivationRequestEvent = 1;
-}
-
-namespace sd { namespace framework {
-
-class ResourceManager::MainViewContainer
-    : public ::std::set<OUString>
-{
-public:
-    MainViewContainer() {}
-};
-
-//===== ResourceManager =======================================================
-
-ResourceManager::ResourceManager (
-    const Reference<frame::XController>& rxController,
-    const Reference<XResourceId>& rxResourceId)
-    : ResourceManagerInterfaceBase(MutexOwner::maMutex),
-      mxConfigurationController(),
-      mpActiveMainViewContainer(new MainViewContainer()),
-      mxResourceId(rxResourceId),
-      mxMainViewAnchorId(FrameworkHelper::CreateResourceId(
-          FrameworkHelper::msCenterPaneURL)),
-      msCurrentMainViewURL()
-{
-    Reference<XControllerManager> xControllerManager (rxController, UNO_QUERY);
-    if (xControllerManager.is())
-    {
-        mxConfigurationController = xControllerManager->getConfigurationController();
-
-        if (mxConfigurationController.is())
-        {
-            uno::Reference<lang::XComponent> const xComppnent(
-                    mxConfigurationController, UNO_QUERY_THROW);
-            xComppnent->addEventListener(this);
-            mxConfigurationController->addConfigurationChangeListener(
-                this,
-                FrameworkHelper::msResourceActivationRequestEvent,
-                makeAny(ResourceActivationRequestEvent));
-            mxConfigurationController->addConfigurationChangeListener(
-                this,
-                FrameworkHelper::msResourceDeactivationRequestEvent,
-                makeAny(ResourceDeactivationRequestEvent));
-        }
-    }
-}
-
-ResourceManager::~ResourceManager()
-{
-}
-
-void ResourceManager::AddActiveMainView (
-    const OUString& rsMainViewURL)
-{
-    mpActiveMainViewContainer->insert(rsMainViewURL);
-}
-
-bool ResourceManager::IsResourceActive (
-    const OUString& rsMainViewURL)
-{
-    return (mpActiveMainViewContainer->find(rsMainViewURL) != mpActiveMainViewContainer->end());
-}
-
-void ResourceManager::SaveResourceState()
-{
-}
-
-void SAL_CALL ResourceManager::disposing()
-{
-    if (mxConfigurationController.is())
-    {
-        mxConfigurationController->removeConfigurationChangeListener(this);
-        mxConfigurationController = nullptr;
-    }
-}
-
-void SAL_CALL ResourceManager::notifyConfigurationChange (
-    const ConfigurationChangeEvent& rEvent)
-{
-    OSL_ASSERT(rEvent.ResourceId.is());
-
-    sal_Int32 nEventType = 0;
-    rEvent.UserData >>= nEventType;
-    switch (nEventType)
-    {
-        case ResourceActivationRequestEvent:
-            if (rEvent.ResourceId->isBoundToURL(
-                FrameworkHelper::msCenterPaneURL,
-                AnchorBindingMode_DIRECT))
-            {
-                // A resource directly bound to the center pane has been
-                // requested.
-                if (rEvent.ResourceId->getResourceTypePrefix() ==
-                    FrameworkHelper::msViewURLPrefix)
-                {
-                    // The requested resource is a view.  Show or hide the
-                    // resource managed by this ResourceManager accordingly.
-                    HandleMainViewSwitch(
-                        rEvent.ResourceId->getResourceURL(),
-                        true);
-                }
-            }
-            else if (rEvent.ResourceId->compareTo(mxResourceId) == 0)
-            {
-                // The resource managed by this ResourceManager has been
-                // explicitly been requested (maybe by us).  Remember this
-                // setting.
-                HandleResourceRequest(true, rEvent.Configuration);
-            }
-            break;
-
-        case ResourceDeactivationRequestEvent:
-            if (rEvent.ResourceId->compareTo(mxMainViewAnchorId) == 0)
-            {
-                HandleMainViewSwitch(
-                    OUString(),
-                    false);
-            }
-            else if (rEvent.ResourceId->compareTo(mxResourceId) == 0)
-            {
-                // The resource managed by this ResourceManager has been
-                // explicitly been requested to be hidden (maybe by us).
-                // Remember this setting.
-                HandleResourceRequest(false, rEvent.Configuration);
-            }
-            break;
-    }
-}
-
-void ResourceManager::HandleMainViewSwitch (
-    const OUString& rsViewURL,
-    const bool bIsActivated)
-{
-    if (bIsActivated)
-        msCurrentMainViewURL = rsViewURL;
-    else
-        msCurrentMainViewURL.clear();
-
-    if (mxConfigurationController.is())
-    {
-        ConfigurationController::Lock aLock (mxConfigurationController);
-
-        if (mpActiveMainViewContainer->find(msCurrentMainViewURL)
-               != mpActiveMainViewContainer->end())
-        {
-            // Activate resource.
-            mxConfigurationController->requestResourceActivation(
-                mxResourceId->getAnchor(),
-                ResourceActivationMode_ADD);
-            mxConfigurationController->requestResourceActivation(
-                mxResourceId,
-                ResourceActivationMode_REPLACE);
-        }
-        else
-        {
-            mxConfigurationController->requestResourceDeactivation(mxResourceId);
-        }
-    }
-}
-
-void ResourceManager::HandleResourceRequest(
-    bool bActivation,
-    const Reference<XConfiguration>& rxConfiguration)
-{
-    Sequence<Reference<XResourceId> > aCenterViews = rxConfiguration->getResources(
-        FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL),
-        FrameworkHelper::msViewURLPrefix,
-        AnchorBindingMode_DIRECT);
-    if (aCenterViews.getLength() == 1)
-    {
-        if (bActivation)
-        {
-            mpActiveMainViewContainer->insert(aCenterViews[0]->getResourceURL());
-        }
-        else
-        {
-            MainViewContainer::iterator iElement (
-                mpActiveMainViewContainer->find(aCenterViews[0]->getResourceURL()));
-            if (iElement != mpActiveMainViewContainer->end())
-                mpActiveMainViewContainer->erase(iElement);
-        }
-    }
-}
-
-void SAL_CALL ResourceManager::disposing (
-    const lang::EventObject& rEvent)
-{
-    if (mxConfigurationController.is()
-        && rEvent.Source == mxConfigurationController)
-    {
-        SaveResourceState();
-        // Without the configuration controller this class can do nothing.
-        mxConfigurationController = nullptr;
-        dispose();
-    }
-}
-
-} } // end of namespace sd::framework
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/framework/module/ResourceManager.hxx b/sd/source/ui/framework/module/ResourceManager.hxx
deleted file mode 100644
index 8c0c14773a21..000000000000
--- a/sd/source/ui/framework/module/ResourceManager.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SD_SOURCE_UI_FRAMEWORK_MODULE_RESOURCEMANAGER_HXX
-#define INCLUDED_SD_SOURCE_UI_FRAMEWORK_MODULE_RESOURCEMANAGER_HXX
-
-#include <MutexOwner.hxx>
-#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp>
-#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <cppuhelper/compbase.hxx>
-#include <memory>
-
-namespace sd { namespace framework {
-
-typedef ::cppu::WeakComponentImplHelper <
-    css::drawing::framework::XConfigurationChangeListener
-    > ResourceManagerInterfaceBase;
-
-/** Manage the activation state of one resource depending on the view in the
-    center pane.  The ResourceManager remembers in which configuration to
-    activate and in which to deactivate the resource.  When the resource is
-    deactivated or activated manually by the user then the ResourceManager
-    detects this and remembers it for the future.
-*/
-class ResourceManager
-    : private sd::MutexOwner,
-      public ResourceManagerInterfaceBase
-{
-public:
-    ResourceManager (
-        const css::uno::Reference<css::frame::XController>& rxController,
-        const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId);
-    virtual ~ResourceManager() override;
-
-    /** Remember the given URL as one of a center pane view for which to
-        activate the resource managed by the called object.
-    */
-    void AddActiveMainView (const OUString& rsMainViewURL);
-    bool IsResourceActive (const OUString& rsMainViewURL);
-    virtual void SaveResourceState();
-
-    virtual void SAL_CALL disposing() override;
-
-    // XConfigurationChangeListener
-
-    virtual void SAL_CALL notifyConfigurationChange (
-        const css::drawing::framework::ConfigurationChangeEvent& rEvent) override;
-
-    // XEventListener
-
-    virtual void SAL_CALL disposing (
-        const css::lang::EventObject& rEvent) override;
-
-protected:
-    css::uno::Reference<css::drawing::framework::XConfigurationController>
-        mxConfigurationController;
-
-private:
-    class MainViewContainer;
-    std::unique_ptr<MainViewContainer> mpActiveMainViewContainer;
-
-    /// The resource managed by this class.
-    css::uno::Reference<css::drawing::framework::XResourceId> mxResourceId;
-
-    /// The anchor of the main view.
-    css::uno::Reference<css::drawing::framework::XResourceId> mxMainViewAnchorId;
-
-    OUString msCurrentMainViewURL;
-
-    void HandleMainViewSwitch (
-        const OUString& rsViewURL,
-        const bool bIsActivated);
-    void HandleResourceRequest(
-        bool bActivation,
-        const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration);
-};
-
-} } // end of namespace sd::framework
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/framework/module/SlideSorterModule.cxx b/sd/source/ui/framework/module/SlideSorterModule.cxx
index 68020f5ee39e..5eca32192f00 100644
--- a/sd/source/ui/framework/module/SlideSorterModule.cxx
+++ b/sd/source/ui/framework/module/SlideSorterModule.cxx
@@ -20,8 +20,10 @@
 #include "SlideSorterModule.hxx"
 
 #include <framework/FrameworkHelper.hxx>
+#include <framework/ConfigurationController.hxx>
 #include <com/sun/star/drawing/framework/XTabBar.hpp>
 #include <com/sun/star/drawing/framework/TabBarButton.hpp>
+#include <com/sun/star/drawing/framework/XControllerManager.hpp>
 
 #include <strings.hrc>
 #include <sdresid.hxx>
@@ -33,6 +35,11 @@ using namespace ::com::sun::star::drawing::framework;
 
 using ::sd::framework::FrameworkHelper;
 
+namespace {
+    static const sal_Int32 ResourceActivationRequestEvent = 0;
+    static const sal_Int32 ResourceDeactivationRequestEvent = 1;
+}
+
 namespace sd { namespace framework {
 
 //===== SlideSorterModule ==================================================
@@ -40,13 +47,36 @@ namespace sd { namespace framework {
 SlideSorterModule::SlideSorterModule (
     const Reference<frame::XController>& rxController,
     const OUString& rsLeftPaneURL)
-    : ResourceManager(rxController,
-        FrameworkHelper::CreateResourceId(FrameworkHelper::msSlideSorterURL, rsLeftPaneURL)),
+    : SlideSorterModuleBase(MutexOwner::maMutex),
+      mxConfigurationController(),
+      mxResourceId(FrameworkHelper::CreateResourceId(FrameworkHelper::msSlideSorterURL, rsLeftPaneURL)),
+      mxMainViewAnchorId(FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL)),
+      msCurrentMainViewURL(),
       mxViewTabBarId(FrameworkHelper::CreateResourceId(
           FrameworkHelper::msViewTabBarURL,
           FrameworkHelper::msCenterPaneURL)),
       mxControllerManager(rxController,UNO_QUERY)
 {
+    Reference<XControllerManager> xControllerManager (rxController, UNO_QUERY);
+    if (xControllerManager.is())
+    {
+        mxConfigurationController = xControllerManager->getConfigurationController();
+
+        if (mxConfigurationController.is())
+        {
+            uno::Reference<lang::XComponent> const xComppnent(
+                    mxConfigurationController, UNO_QUERY_THROW);
+            xComppnent->addEventListener(this);
+            mxConfigurationController->addConfigurationChangeListener(
+                this,
+                FrameworkHelper::msResourceActivationRequestEvent,
+                makeAny(ResourceActivationRequestEvent));
+            mxConfigurationController->addConfigurationChangeListener(
+                this,
+                FrameworkHelper::msResourceDeactivationRequestEvent,
+                makeAny(ResourceDeactivationRequestEvent));
+        }
+    }
     if (mxConfigurationController.is())
     {
         UpdateViewTabBar(nullptr);
@@ -106,10 +136,55 @@ void SAL_CALL SlideSorterModule::notifyConfigurationChange (
             // has changed.
             UpdateViewTabBar(nullptr);
         }
+        return;
     }
-    else
+
+    OSL_ASSERT(rEvent.ResourceId.is());
+    sal_Int32 nEventType = 0;
+    rEvent.UserData >>= nEventType;
+    switch (nEventType)
     {
-        ResourceManager::notifyConfigurationChange(rEvent);
+        case ResourceActivationRequestEvent:
+            if (rEvent.ResourceId->isBoundToURL(
+                FrameworkHelper::msCenterPaneURL,
+                AnchorBindingMode_DIRECT))
+            {
+                // A resource directly bound to the center pane has been
+                // requested.
+                if (rEvent.ResourceId->getResourceTypePrefix() ==
+                    FrameworkHelper::msViewURLPrefix)
+                {
+                    // The requested resource is a view.  Show or hide the
+                    // resource managed by this ResourceManager accordingly.
+                    HandleMainViewSwitch(
+                        rEvent.ResourceId->getResourceURL(),
+                        true);
+                }
+            }
+            else if (rEvent.ResourceId->compareTo(mxResourceId) == 0)
+            {
+                // The resource managed by this ResourceManager has been
+                // explicitly been requested (maybe by us).  Remember this
+                // setting.
+                HandleResourceRequest(true, rEvent.Configuration);
+            }
+            break;
+
+        case ResourceDeactivationRequestEvent:
+            if (rEvent.ResourceId->compareTo(mxMainViewAnchorId) == 0)
+            {
+                HandleMainViewSwitch(
+                    OUString(),
+                    false);
+            }
+            else if (rEvent.ResourceId->compareTo(mxResourceId) == 0)
+            {
+                // The resource managed by this ResourceManager has been
+                // explicitly been requested to be hidden (maybe by us).
+                // Remember this setting.
+                HandleResourceRequest(false, rEvent.Configuration);
+            }
+            break;
     }
 }
 
@@ -145,6 +220,92 @@ void SlideSorterModule::UpdateViewTabBar (const Reference<XTabBar>& rxTabBar)
     }
 }
 
+void SlideSorterModule::AddActiveMainView (
+    const OUString& rsMainViewURL)
+{
+    maActiveMainViewContainer.insert(rsMainViewURL);
+}
+
+bool SlideSorterModule::IsResourceActive (
+    const OUString& rsMainViewURL)
+{
+    return (maActiveMainViewContainer.find(rsMainViewURL) != maActiveMainViewContainer.end());
+}
+
+void SAL_CALL SlideSorterModule::disposing()
+{
+    if (mxConfigurationController.is())
+    {
+        mxConfigurationController->removeConfigurationChangeListener(this);
+        mxConfigurationController = nullptr;
+    }
+}
+
+void SlideSorterModule::HandleMainViewSwitch (
+    const OUString& rsViewURL,
+    const bool bIsActivated)
+{
+    if (bIsActivated)
+        msCurrentMainViewURL = rsViewURL;
+    else
+        msCurrentMainViewURL.clear();
+
+    if (mxConfigurationController.is())
+    {
+        ConfigurationController::Lock aLock (mxConfigurationController);
+
+        if (maActiveMainViewContainer.find(msCurrentMainViewURL)
+               != maActiveMainViewContainer.end())
+        {
+            // Activate resource.
+            mxConfigurationController->requestResourceActivation(
+                mxResourceId->getAnchor(),
+                ResourceActivationMode_ADD);
+            mxConfigurationController->requestResourceActivation(
+                mxResourceId,
+                ResourceActivationMode_REPLACE);
+        }
+        else
+        {
+            mxConfigurationController->requestResourceDeactivation(mxResourceId);
+        }
+    }
+}
+
+void SlideSorterModule::HandleResourceRequest(
+    bool bActivation,
+    const Reference<XConfiguration>& rxConfiguration)
+{
+    Sequence<Reference<XResourceId> > aCenterViews = rxConfiguration->getResources(
+        FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL),
+        FrameworkHelper::msViewURLPrefix,
+        AnchorBindingMode_DIRECT);
+    if (aCenterViews.getLength() == 1)
+    {
+        if (bActivation)
+        {
+            maActiveMainViewContainer.insert(aCenterViews[0]->getResourceURL());
+        }
+        else
+        {
+            maActiveMainViewContainer.erase(aCenterViews[0]->getResourceURL());
+        }
+    }
+}
+
+void SAL_CALL SlideSorterModule::disposing (
+    const lang::EventObject& rEvent)
+{
+    if (mxConfigurationController.is()
+        && rEvent.Source == mxConfigurationController)
+    {
+        SaveResourceState();
+        // Without the configuration controller this class can do nothing.
+        mxConfigurationController = nullptr;
+        dispose();
+    }
+}
+
 } } // end of namespace sd::framework
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/framework/module/SlideSorterModule.hxx b/sd/source/ui/framework/module/SlideSorterModule.hxx
index 3b0eb9f709a9..c5431ad17ad7 100644
--- a/sd/source/ui/framework/module/SlideSorterModule.hxx
+++ b/sd/source/ui/framework/module/SlideSorterModule.hxx
@@ -20,18 +20,34 @@
 #ifndef INCLUDED_SD_SOURCE_UI_FRAMEWORK_MODULE_SLIDESORTERMODULE_HXX
 #define INCLUDED_SD_SOURCE_UI_FRAMEWORK_MODULE_SLIDESORTERMODULE_HXX
 
-#include "ResourceManager.hxx"
-
+#include <MutexOwner.hxx>
+#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp>
+#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
+#include <com/sun/star/frame/XController.hpp>
 #include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/drawing/framework/XTabBar.hpp>
+#include <cppuhelper/compbase.hxx>
+#include <memory>
+#include <set>
 
 namespace sd { namespace framework {
 
+typedef ::cppu::WeakComponentImplHelper <
+    css::drawing::framework::XConfigurationChangeListener
+    > SlideSorterModuleBase;
+
 /** This module is responsible for showing the slide sorter bar and the
     slide sorter view in the center pane.
+
+    Manage the activation state of one resource depending on the view in the
+    center pane.  The ResourceManager remembers in which configuration to
+    activate and in which to deactivate the resource.  When the resource is
+    deactivated or activated manually by the user then the ResourceManager
+    detects this and remembers it for the future.
 */
 class SlideSorterModule
-    : public ResourceManager
+    : private sd::MutexOwner,
+      public SlideSorterModuleBase
 {
 public:
     SlideSorterModule (
@@ -39,16 +55,41 @@ public:
         const OUString& rsLeftPaneURL);
     virtual ~SlideSorterModule() override;
 
-    virtual void SaveResourceState() override;
-    // XConfigurationChangeListener
+    /** Remember the given URL as one of a center pane view for which to
+        activate the resource managed by the called object.
+    */
+    void AddActiveMainView (const OUString& rsMainViewURL);
+    bool IsResourceActive (const OUString& rsMainViewURL);
+    virtual void SaveResourceState();
 
+    virtual void SAL_CALL disposing() override;
+
+    // XConfigurationChangeListener
     virtual void SAL_CALL notifyConfigurationChange (
         const css::drawing::framework::ConfigurationChangeEvent& rEvent) override;
 
+    // XEventListener
+    virtual void SAL_CALL disposing (
+        const css::lang::EventObject& rEvent) override;
+
 private:
+    css::uno::Reference<css::drawing::framework::XConfigurationController>
+        mxConfigurationController;
+    ::std::set<OUString> maActiveMainViewContainer;
+    /// The resource managed by this class.
+    css::uno::Reference<css::drawing::framework::XResourceId> mxResourceId;
+    /// The anchor of the main view.
+    css::uno::Reference<css::drawing::framework::XResourceId> mxMainViewAnchorId;
+    OUString msCurrentMainViewURL;
     css::uno::Reference<css::drawing::framework::XResourceId> mxViewTabBarId;
     css::uno::Reference<css::drawing::framework::XControllerManager> mxControllerManager;
 
+    void HandleMainViewSwitch (
+        const OUString& rsViewURL,
+        const bool bIsActivated);
+    void HandleResourceRequest(
+        bool bActivation,
+        const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration);
     void UpdateViewTabBar (
         const css::uno::Reference<css::drawing::framework::XTabBar>& rxViewTabBar);
 };
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 923d36f4e7d6..c54a125bcf4f 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -12056,8 +12056,6 @@ sd/source/ui/framework/module/DrawModule.cxx
 sd/source/ui/framework/module/ImpressModule.cxx
 sd/source/ui/framework/module/ModuleController.cxx
 sd/source/ui/framework/module/PresentationModule.cxx
-sd/source/ui/framework/module/ResourceManager.cxx
-sd/source/ui/framework/module/ResourceManager.hxx
 sd/source/ui/framework/module/ShellStackGuard.cxx
 sd/source/ui/framework/module/ShellStackGuard.hxx
 sd/source/ui/framework/module/SlideSorterModule.cxx
commit 72fecbbc81bf375e2a5617db5c6e88a8a3bacb26
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 16 10:20:06 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 16 13:35:30 2018 +0200

    loplugin:mergeclasses merge BPixelRaster into BZPixelRaster
    
    Change-Id: Ib6f7bfd2392daa5512d5fa68b69428ae9c8876f9
    Reviewed-on: https://gerrit.libreoffice.org/57488
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 0249bd7a48ac..52f5137824dc 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -40,7 +40,7 @@ using namespace com::sun::star;
 
 namespace
 {
-    BitmapEx BPixelRasterToBitmapEx(const basegfx::BPixelRaster& rRaster, sal_uInt16 mnAntiAlialize)
+    BitmapEx BPixelRasterToBitmapEx(const basegfx::BZPixelRaster& rRaster, sal_uInt16 mnAntiAlialize)
     {
         BitmapEx aRetval;
         const sal_uInt32 nWidth(mnAntiAlialize ? rRaster.getWidth()/mnAntiAlialize : rRaster.getWidth());
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 4413dd30a907..55b45682a3ec 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <drawinglayer/processor3d/zbufferprocessor3d.hxx>
-#include <basegfx/raster/bpixelraster.hxx>
+#include <basegfx/raster/bzpixelraster.hxx>
 #include <basegfx/raster/rasterconvert3d.hxx>
 #include <basegfx/raster/bzpixelraster.hxx>
 #include <drawinglayer/attribute/materialattribute3d.hxx>
diff --git a/include/basegfx/raster/bpixelraster.hxx b/include/basegfx/raster/bpixelraster.hxx
deleted file mode 100644
index b3f168754a8f..000000000000
--- a/include/basegfx/raster/bpixelraster.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_BASEGFX_RASTER_BPIXELRASTER_HXX
-#define INCLUDED_BASEGFX_RASTER_BPIXELRASTER_HXX
-
-#include <memory>
-#include <algorithm>
-#include <string.h>
-#include <sal/types.h>
-#include <basegfx/pixel/bpixel.hxx>
-#include <basegfx/basegfxdllapi.h>
-
-namespace basegfx
-{
-    class BPixelRaster
-    {
-    private:
-        BPixelRaster(const BPixelRaster&) = delete;
-        BPixelRaster& operator=(const BPixelRaster&) = delete;
-
-    protected:
-        sal_uInt32                  mnWidth;
-        sal_uInt32                  mnHeight;
-        sal_uInt32                  mnCount;
-        std::unique_ptr<BPixel[]>   mpContent;
-
-    public:
-        // constructor/destructor
-        BPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight)
-        :   mnWidth(nWidth),
-            mnHeight(nHeight),
-            mnCount(nWidth * nHeight),
-            mpContent(new BPixel[mnCount])
-        {}
-
-        // coordinate calcs between X/Y and span
-        sal_uInt32 getIndexFromXY(sal_uInt32 nX, sal_uInt32 nY) const { return (nX + (nY * mnWidth)); }
-
-        // data access read
-        sal_uInt32 getWidth() const { return mnWidth; }
-        sal_uInt32 getHeight() const { return mnHeight; }
-
-        // data access read only
-        const BPixel& getBPixel(sal_uInt32 nIndex) const
-        {
-            assert(nIndex < mnCount && "Access out of range");
-            return mpContent[nIndex];
-        }
-
-        // data access read/write
-        BPixel& getBPixel(sal_uInt32 nIndex)
-        {
-            assert(nIndex < mnCount && "Access out of range");
-            return mpContent[nIndex];
-        }
-    };
-} // end of namespace basegfx
-
-#endif // INCLUDED_BASEGFX_RASTER_BPIXELRASTER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/raster/bzpixelraster.hxx b/include/basegfx/raster/bzpixelraster.hxx
index 9f6900d3b125..a9fc6a123d1e 100644
--- a/include/basegfx/raster/bzpixelraster.hxx
+++ b/include/basegfx/raster/bzpixelraster.hxx
@@ -20,51 +20,73 @@
 #ifndef INCLUDED_BASEGFX_RASTER_BZPIXELRASTER_HXX
 #define INCLUDED_BASEGFX_RASTER_BZPIXELRASTER_HXX
 
-#include <memory>
-#include <basegfx/raster/bpixelraster.hxx>
 #include <basegfx/basegfxdllapi.h>
+#include <basegfx/pixel/bpixel.hxx>
+#include <basegfx/raster/bzpixelraster.hxx>
 #include <osl/diagnose.h>
+#include <sal/types.h>
+#include <memory>
+#include <algorithm>
+#include <string.h>
 
 namespace basegfx
 {
-    class BZPixelRaster : public BPixelRaster
+    class BZPixelRaster
     {
+    private:
+        BZPixelRaster(const BZPixelRaster&) = delete;
+        BZPixelRaster& operator=(const BZPixelRaster&) = delete;
     protected:
-        // additionally, host a ZBuffer
+        sal_uInt32                  mnWidth;
+        sal_uInt32                  mnHeight;
+        sal_uInt32                  mnCount;
+        std::unique_ptr<BPixel[]>   mpContent;
         std::unique_ptr<sal_uInt16[]>  mpZBuffer;
 
     public:
         // constructor/destructor
         BZPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight)
-        :   BPixelRaster(nWidth, nHeight),
+        :   mnWidth(nWidth),
+            mnHeight(nHeight),
+            mnCount(nWidth * nHeight),
+            mpContent(new BPixel[mnCount]),
             mpZBuffer(new sal_uInt16[mnCount])
         {
             memset(mpZBuffer.get(), 0, sizeof(sal_uInt16) * mnCount);
         }
 
+         // coordinate calcs between X/Y and span
+        sal_uInt32 getIndexFromXY(sal_uInt32 nX, sal_uInt32 nY) const { return (nX + (nY * mnWidth)); }
+
+        // data access read
+        sal_uInt32 getWidth() const { return mnWidth; }
+        sal_uInt32 getHeight() const { return mnHeight; }
+
+         // data access read only
+        const BPixel& getBPixel(sal_uInt32 nIndex) const
+        {
+            assert(nIndex < mnCount && "Access out of range");
+            return mpContent[nIndex];
+        }
+
+        // data access read/write
+        BPixel& getBPixel(sal_uInt32 nIndex)
+        {
+            assert(nIndex < mnCount && "Access out of range");
+            return mpContent[nIndex];
+        }
+
         // data access read only
         const sal_uInt16& getZ(sal_uInt32 nIndex) const
         {
-#ifdef DBG_UTIL
-            if(nIndex >= mnCount)
-            {
-                OSL_FAIL("getZ: Access out of range (!)");
-                return mpZBuffer[0L];
-            }
-#endif
+            assert(nIndex < mnCount && "Access out of range");
             return mpZBuffer[nIndex];
         }
 
         // data access read/write
         sal_uInt16& getZ(sal_uInt32 nIndex)
         {
-#ifdef DBG_UTIL
-            if(nIndex >= mnCount)
-            {
-                OSL_FAIL("getZ: Access out of range (!)");
-                return mpZBuffer[0L];
-            }
-#endif
+            assert(nIndex < mnCount && "Access out of range");
             return mpZBuffer[nIndex];
         }
     };
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 6f7e23976278..923d36f4e7d6 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -5852,7 +5852,6 @@ include/basegfx/range/b2irectangle.hxx
 include/basegfx/range/b3drange.hxx
 include/basegfx/range/basicbox.hxx
 include/basegfx/range/basicrange.hxx
-include/basegfx/raster/bpixelraster.hxx
 include/basegfx/raster/bzpixelraster.hxx
 include/basegfx/raster/rasterconvert3d.hxx
 include/basegfx/tuple/b2dtuple.hxx


More information about the Libreoffice-commits mailing list