diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-07 12:28:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-07 12:36:02 +0100 |
commit | 68adf20e1e89d6e19e8122b600c0fb675eaebdbd (patch) | |
tree | 19e09bef0cd43236230e79fc8acbb79fa0b13a78 /sfx2/source/sidebar | |
parent | b48874cd54deaacd858f9eaf0557d2b01bc25806 (diff) |
loplugin:deletedspecial
Change-Id: Ib9e704c3b27dad81eea44583c99ecdbc5449dd13
Diffstat (limited to 'sfx2/source/sidebar')
-rw-r--r-- | sfx2/source/sidebar/DeckLayouter.cxx | 79 | ||||
-rw-r--r-- | sfx2/source/sidebar/DeckLayouter.hxx | 72 |
2 files changed, 72 insertions, 79 deletions
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx index a7639fbd6aac..9d831a7628df 100644 --- a/sfx2/source/sidebar/DeckLayouter.cxx +++ b/sfx2/source/sidebar/DeckLayouter.cxx @@ -35,6 +35,64 @@ namespace sfx2 { namespace sidebar { namespace { static const sal_Int32 MinimalPanelHeight (25); + + enum LayoutMode + { + MinimumOrLarger, + PreferredOrLarger, + Preferred + }; + class LayoutItem + { + public: + SharedPanel mpPanel; + css::ui::LayoutSize maLayoutSize; + sal_Int32 mnDistributedHeight; + sal_Int32 mnWeight; + sal_Int32 mnPanelIndex; + bool mbShowTitleBar; + + LayoutItem (void) + : mpPanel(),maLayoutSize(0,0,0),mnDistributedHeight(0),mnWeight(0),mnPanelIndex(0),mbShowTitleBar(true) + {} + }; + Rectangle LayoutPanels ( + const Rectangle aContentArea, + sal_Int32& rMinimalWidth, + ::std::vector<LayoutItem>& rLayoutItems, + vcl::Window& rScrollClipWindow, + vcl::Window& rScrollContainer, + ScrollBar& pVerticalScrollBar, + const bool bShowVerticalScrollBar); + void GetRequestedSizes ( + ::std::vector<LayoutItem>& rLayoutItem, + sal_Int32& rAvailableHeight, + sal_Int32& rMinimalWidth, + const Rectangle& rContentBox); + void DistributeHeights ( + ::std::vector<LayoutItem>& rLayoutItems, + const sal_Int32 nHeightToDistribute, + const sal_Int32 nContainerHeight, + const bool bMinimumHeightIsBase); + sal_Int32 PlacePanels ( + ::std::vector<LayoutItem>& rLayoutItems, + const sal_Int32 nWidth, + const LayoutMode eMode, + vcl::Window& rScrollContainer); + Rectangle PlaceDeckTitle ( + vcl::Window& rTittleBar, + const Rectangle& rAvailableSpace); + Rectangle PlaceVerticalScrollBar ( + ScrollBar& rVerticalScrollBar, + const Rectangle& rAvailableSpace, + const bool bShowVerticalScrollBar); + void SetupVerticalScrollBar( + ScrollBar& rVerticalScrollBar, + const sal_Int32 nContentHeight, + const sal_Int32 nVisibleHeight); + void UpdateFiller ( + vcl::Window& rFiller, + const Rectangle& rBox); } #define IterateLayoutItems(iterator_name,container) \ @@ -82,10 +140,9 @@ void DeckLayouter::LayoutDeck ( UpdateFiller(rFiller, aBox); } +namespace { - - -Rectangle DeckLayouter::LayoutPanels ( +Rectangle LayoutPanels ( const Rectangle aContentArea, sal_Int32& rMinimalWidth, ::std::vector<LayoutItem>& rLayoutItems, @@ -193,7 +250,7 @@ Rectangle DeckLayouter::LayoutPanels ( -sal_Int32 DeckLayouter::PlacePanels ( +sal_Int32 PlacePanels ( ::std::vector<LayoutItem>& rLayoutItems, const sal_Int32 nWidth, const LayoutMode eMode, @@ -288,7 +345,7 @@ sal_Int32 DeckLayouter::PlacePanels ( -void DeckLayouter::GetRequestedSizes ( +void GetRequestedSizes ( ::std::vector<LayoutItem>& rLayoutItems, sal_Int32& rAvailableHeight, sal_Int32& rMinimalWidth, @@ -343,7 +400,7 @@ void DeckLayouter::GetRequestedSizes ( -void DeckLayouter::DistributeHeights ( +void DistributeHeights ( ::std::vector<LayoutItem>& rLayoutItems, const sal_Int32 nHeightToDistribute, const sal_Int32 nContainerHeight, @@ -428,7 +485,7 @@ void DeckLayouter::DistributeHeights ( -Rectangle DeckLayouter::PlaceDeckTitle ( +Rectangle PlaceDeckTitle ( vcl::Window& rDeckTitleBar, const Rectangle& rAvailableSpace) { @@ -458,7 +515,7 @@ Rectangle DeckLayouter::PlaceDeckTitle ( -Rectangle DeckLayouter::PlaceVerticalScrollBar ( +Rectangle PlaceVerticalScrollBar ( ScrollBar& rVerticalScrollBar, const Rectangle& rAvailableSpace, const bool bShowVerticalScrollBar) @@ -488,7 +545,7 @@ Rectangle DeckLayouter::PlaceVerticalScrollBar ( -void DeckLayouter::SetupVerticalScrollBar( +void SetupVerticalScrollBar( ScrollBar& rVerticalScrollBar, const sal_Int32 nContentHeight, const sal_Int32 nVisibleHeight) @@ -503,7 +560,7 @@ void DeckLayouter::SetupVerticalScrollBar( -void DeckLayouter::UpdateFiller ( +void UpdateFiller ( vcl::Window& rFiller, const Rectangle& rBox) { @@ -521,7 +578,7 @@ void DeckLayouter::UpdateFiller ( } } - +} } } // end of namespace sfx2::sidebar diff --git a/sfx2/source/sidebar/DeckLayouter.hxx b/sfx2/source/sidebar/DeckLayouter.hxx index fa2b5ea8bcda..9421829e33b0 100644 --- a/sfx2/source/sidebar/DeckLayouter.hxx +++ b/sfx2/source/sidebar/DeckLayouter.hxx @@ -35,13 +35,12 @@ namespace sfx2 { namespace sidebar { class Panel; -/** Helper class for layouting the direct and indirect children of a +/** Helper for layouting the direct and indirect children of a deck like title bars, panels, and scroll bars. */ -class DeckLayouter +namespace DeckLayouter { -public: - static void LayoutDeck ( + void LayoutDeck ( const Rectangle aContentArea, sal_Int32& rMinimalWidth, SharedPanelContainer& rPanels, @@ -50,70 +49,7 @@ public: vcl::Window& pScrollContainer, vcl::Window& pFiller, ScrollBar& pVerticalScrollBar); - -private: - // Do not use constructor or destructor. - DeckLayouter (void); - ~DeckLayouter (void); - - enum LayoutMode - { - MinimumOrLarger, - PreferredOrLarger, - Preferred - }; - class LayoutItem - { - public: - SharedPanel mpPanel; - css::ui::LayoutSize maLayoutSize; - sal_Int32 mnDistributedHeight; - sal_Int32 mnWeight; - sal_Int32 mnPanelIndex; - bool mbShowTitleBar; - - LayoutItem (void) - : mpPanel(),maLayoutSize(0,0,0),mnDistributedHeight(0),mnWeight(0),mnPanelIndex(0),mbShowTitleBar(true) - {} - }; - static Rectangle LayoutPanels ( - const Rectangle aContentArea, - sal_Int32& rMinimalWidth, - ::std::vector<LayoutItem>& rLayoutItems, - vcl::Window& rScrollClipWindow, - vcl::Window& rScrollContainer, - ScrollBar& pVerticalScrollBar, - const bool bShowVerticalScrollBar); - static void GetRequestedSizes ( - ::std::vector<LayoutItem>& rLayoutItem, - sal_Int32& rAvailableHeight, - sal_Int32& rMinimalWidth, - const Rectangle& rContentBox); - static void DistributeHeights ( - ::std::vector<LayoutItem>& rLayoutItems, - const sal_Int32 nHeightToDistribute, - const sal_Int32 nContainerHeight, - const bool bMinimumHeightIsBase); - static sal_Int32 PlacePanels ( - ::std::vector<LayoutItem>& rLayoutItems, - const sal_Int32 nWidth, - const LayoutMode eMode, - vcl::Window& rScrollContainer); - static Rectangle PlaceDeckTitle ( - vcl::Window& rTittleBar, - const Rectangle& rAvailableSpace); - static Rectangle PlaceVerticalScrollBar ( - ScrollBar& rVerticalScrollBar, - const Rectangle& rAvailableSpace, - const bool bShowVerticalScrollBar); - static void SetupVerticalScrollBar( - ScrollBar& rVerticalScrollBar, - const sal_Int32 nContentHeight, - const sal_Int32 nVisibleHeight); - static void UpdateFiller ( - vcl::Window& rFiller, - const Rectangle& rBox); -}; +} } } // end of namespace sfx2::sidebar |