diff options
-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(); }; |