diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-04 17:13:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-04 20:58:42 +0100 |
commit | 82cce8f46d033a887886f1abae1f608d966c5e08 (patch) | |
tree | cdbec1891568f507f90340d5cc9069bcae22fa19 /sd | |
parent | 9b0bc61f4bcba6d5716e9c3717cda5c682cf5965 (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>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/sidebar/NavigatorWrapper.cxx | 41 | ||||
-rw-r--r-- | sd/source/ui/sidebar/NavigatorWrapper.hxx | 13 |
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(); }; |