sd/source/ui/sidebar/NavigatorWrapper.cxx | 41 ++++-------------------------- sd/source/ui/sidebar/NavigatorWrapper.hxx | 13 ++------- 2 files changed, 9 insertions(+), 45 deletions(-)
New commits: commit 82cce8f46d033a887886f1abae1f608d966c5e08 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Mar 4 17:13:11 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Mar 4 20:58:42 2021 +0100 inherit NavigatorWrapper directly from SdNavigatorWin Change-Id: Ifdb2aae5d9af32577adedd3512ab1f8a1e8047e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111975 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> 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(); }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits