summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-04 17:13:11 +0000
committerSzymon Kłos <szymon.klos@collabora.com>2021-05-20 13:22:18 +0200
commit555b539f7f5c114016019c4a7f906d4a125c84fb (patch)
tree8ec38adce87a9c3d192b48201058e53d44a6db0f
parentc929b2de2a4f360098e4d316448b89fb9261d748 (diff)
inherit NavigatorWrapper directly from SdNavigatorWin
Change-Id: Ifdb2aae5d9af32577adedd3512ab1f8a1e8047e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111975 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/sidebar/NavigatorWrapper.cxx41
-rw-r--r--sd/source/ui/sidebar/NavigatorWrapper.hxx13
2 files changed, 9 insertions, 45 deletions
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.cxx b/sd/source/ui/sidebar/NavigatorWrapper.cxx
index cd9bd002204a..1414f238f3a4 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.cxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.cxx
@@ -30,34 +30,13 @@ NavigatorWrapper::NavigatorWrapper (
vcl::Window* pParent,
sd::ViewShellBase& rViewShellBase,
SfxBindings* pBindings)
- : Control(pParent, 0),
- mrViewShellBase(rViewShellBase),
- maNavigator(VclPtr<SdNavigatorWin>::Create(
- this, pBindings))
+ : SdNavigatorWin(pParent, pBindings)
+ , mrViewShellBase(rViewShellBase)
{
- maNavigator->SetUpdateRequestFunctor(
+ SetUpdateRequestFunctor(
[this] () { return this->UpdateNavigator(); });
- maNavigator->SetPosSizePixel(
- Point(0,0),
- GetSizePixel());
- maNavigator->SetBackground(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Color_PanelBackground));
- maNavigator->Show();
-}
-
-NavigatorWrapper::~NavigatorWrapper()
-{
- disposeOnce();
-}
-
-void NavigatorWrapper::dispose()
-{
- maNavigator.disposeAndClear();
- Control::dispose();
-}
-
-void NavigatorWrapper::Resize()
-{
- maNavigator->SetSizePixel(GetSizePixel());
+ SetBackground(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Color_PanelBackground));
+ Show();
}
css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32)
@@ -67,15 +46,7 @@ css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32)
void NavigatorWrapper::UpdateNavigator()
{
- maNavigator->InitTreeLB(mrViewShellBase.GetDocument());
-}
-
-void NavigatorWrapper::GetFocus()
-{
- if (maNavigator)
- maNavigator->GrabFocus();
- else
- Control::GetFocus();
+ InitTreeLB(mrViewShellBase.GetDocument());
}
} // end of namespace sd::sidebar
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.hxx b/sd/source/ui/sidebar/NavigatorWrapper.hxx
index 059ab43cf1a7..7483f4b3ad94 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.hxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.hxx
@@ -20,9 +20,9 @@
#define INCLUDED_SD_SOURCE_UI_SIDEBAR_NAVIGATORWRAPPER_HXX
#include <sfx2/sidebar/ILayoutableWindow.hxx>
-#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/PanelLayout.hxx>
+#include <navigatr.hxx>
-class SdNavigatorWin;
class SfxBindings;
namespace sd { class ViewShellBase; }
@@ -36,7 +36,7 @@ namespace sd::sidebar {
- Forward size changes from sidebar to navigator.
*/
class NavigatorWrapper
- : public Control,
+ : public SdNavigatorWin,
public sfx2::sidebar::ILayoutableWindow
{
public:
@@ -44,19 +44,12 @@ public:
vcl::Window* pParent,
sd::ViewShellBase& rViewShellBase,
SfxBindings* pBindings);
- virtual ~NavigatorWrapper() override;
- virtual void dispose() override;
-
- // Control
- virtual void Resize() override;
- virtual void GetFocus() override;
// From ILayoutableWindow
virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override;
private:
ViewShellBase& mrViewShellBase;
- VclPtr<SdNavigatorWin> maNavigator;
void UpdateNavigator();
};