diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-20 12:27:41 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-20 19:44:24 +0900 |
commit | 56366b913289d1e3752b780db6820e1784937c2e (patch) | |
tree | 9749ca63a80e70f2b41d14510a458e1724c5df9d /sfx2 | |
parent | e497141d9a31a05b67c2416ae5f40838fb748def (diff) |
boost::function to std for sidebar Deck, cleanup a bit
Change-Id: Ia0ce7349efcdf0ee8f46bbfeca8b2496b738b9ad
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/sidebar/Deck.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/sidebar/DeckTitleBar.cxx | 31 | ||||
-rw-r--r-- | sfx2/source/sidebar/DeckTitleBar.hxx | 6 |
4 files changed, 30 insertions, 40 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index 256cee64b004..2e2771731b01 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -32,27 +32,23 @@ #include <vcl/scrbar.hxx> #include <tools/svborder.hxx> -#include <boost/bind.hpp> - using namespace css; using namespace css::uno; namespace sfx2 { namespace sidebar { -Deck::Deck ( - const DeckDescriptor& rDeckDescriptor, - vcl::Window* pParentWindow, - const ::boost::function<void()>& rCloserAction) - : Window(pParentWindow, 0), - msId(rDeckDescriptor.msId), - maIcon(), - mnMinimalWidth(0), - maPanels(), - mpTitleBar(VclPtr<DeckTitleBar>::Create(rDeckDescriptor.msTitle, this, rCloserAction)), - mpScrollClipWindow(VclPtr<vcl::Window>::Create(this)), - mpScrollContainer(VclPtr<ScrollContainerWindow>::Create(mpScrollClipWindow.get())), - mpFiller(VclPtr<vcl::Window>::Create(this)), - mpVerticalScrollBar(VclPtr<ScrollBar>::Create(this)) +Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, + const std::function<void()>& rCloserAction) + : Window(pParentWindow, 0) + , msId(rDeckDescriptor.msId) + , maIcon() + , mnMinimalWidth(0) + , maPanels() + , mpTitleBar(VclPtr<DeckTitleBar>::Create(rDeckDescriptor.msTitle, this, rCloserAction)) + , mpScrollClipWindow(VclPtr<vcl::Window>::Create(this)) + , mpScrollContainer(VclPtr<ScrollContainerWindow>::Create(mpScrollClipWindow.get())) + , mpFiller(VclPtr<vcl::Window>::Create(this)) + , mpVerticalScrollBar(VclPtr<ScrollBar>::Create(this)) { SetBackground(Wallpaper()); diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx index 22584f8572ea..4e6f4bc2dd49 100644 --- a/sfx2/source/sidebar/Deck.hxx +++ b/sfx2/source/sidebar/Deck.hxx @@ -25,9 +25,6 @@ #include <vcl/image.hxx> #include <com/sun/star/ui/LayoutSize.hpp> -#include <boost/function.hpp> -#include <boost/scoped_ptr.hpp> - class ScrollBar; namespace sfx2 { namespace sidebar { @@ -43,7 +40,7 @@ class Deck : public vcl::Window public: Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, - const boost::function<void()>& rCloserAction); + const std::function<void()>& rCloserAction); virtual ~Deck(); virtual void dispose() SAL_OVERRIDE; diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx index 01bbf961b540..41c8fcf78569 100644 --- a/sfx2/source/sidebar/DeckTitleBar.cxx +++ b/sfx2/source/sidebar/DeckTitleBar.cxx @@ -30,16 +30,19 @@ namespace sfx2 { namespace sidebar { +namespace +{ static const sal_Int32 gaLeftGripPadding (3); static const sal_Int32 gaRightGripPadding (3); +} DeckTitleBar::DeckTitleBar (const OUString& rsTitle, vcl::Window* pParentWindow, - const boost::function<void()>& rCloserAction) - : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()), - mnCloserItemIndex(1), - maCloserAction(rCloserAction), - mbIsCloserVisible(false) + const std::function<void()>& rCloserAction) + : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()) + , mnCloserItemIndex(1) + , maCloserAction(rCloserAction) + , mbIsCloserVisible(false) { OSL_ASSERT(pParentWindow != NULL); @@ -59,16 +62,13 @@ void DeckTitleBar::SetCloserVisible (const bool bIsCloserVisible) if (mbIsCloserVisible) { - maToolBox->InsertItem( - mnCloserItemIndex, - Theme::GetImage(Theme::Image_Closer)); - maToolBox->SetQuickHelpText( - mnCloserItemIndex, - SFX2_RESSTR(SFX_STR_SIDEBAR_CLOSE_DECK)); + maToolBox->InsertItem(mnCloserItemIndex, + Theme::GetImage(Theme::Image_Closer)); + maToolBox->SetQuickHelpText(mnCloserItemIndex, + SFX2_RESSTR(SFX_STR_SIDEBAR_CLOSE_DECK)); } else - maToolBox->RemoveItem( - maToolBox->GetItemPos(mnCloserItemIndex)); + maToolBox->RemoveItem(maToolBox->GetItemPos(mnCloserItemIndex)); } } @@ -98,9 +98,8 @@ Color DeckTitleBar::GetTextColor() void DeckTitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex) { - if (nItemIndex == mnCloserItemIndex) - if (maCloserAction) - maCloserAction(); + if (nItemIndex == mnCloserItemIndex && maCloserAction) + maCloserAction(); } css::uno::Reference<css::accessibility::XAccessible> DeckTitleBar::CreateAccessible() diff --git a/sfx2/source/sidebar/DeckTitleBar.hxx b/sfx2/source/sidebar/DeckTitleBar.hxx index 2db491ed47e7..bd47883dccc9 100644 --- a/sfx2/source/sidebar/DeckTitleBar.hxx +++ b/sfx2/source/sidebar/DeckTitleBar.hxx @@ -21,8 +21,6 @@ #include "TitleBar.hxx" -#include <boost/function.hpp> - namespace sfx2 { namespace sidebar { class DeckTitleBar : public TitleBar @@ -30,7 +28,7 @@ class DeckTitleBar : public TitleBar public: DeckTitleBar(const OUString& rsTitle, vcl::Window* pParentWindow, - const boost::function<void()>& rCloserAction); + const std::function<void()>& rCloserAction); void SetCloserVisible(const bool bIsCloserVisible); @@ -46,7 +44,7 @@ protected: private: const sal_uInt16 mnCloserItemIndex; - const boost::function<void()> maCloserAction; + const std::function<void()> maCloserAction; bool mbIsCloserVisible; }; |