diff options
author | Noel Power <noel.power@suse.com> | 2012-09-28 15:43:05 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-09-28 17:27:23 +0100 |
commit | ee6a1c0797ca839e50d7b5ab522088d8d2f6501e (patch) | |
tree | 65ca15aa25f87917d659c49ff48e20321a4a3daa /vcl | |
parent | 886ff48256948fa6117548b1fc319646beb6fb8a (diff) |
Revert "fdo#51336 - change vcl checkbox no-label behaviour"
This reverts commit 99cad9fd7f413adecffc527d334eff616799cc4b.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/button.hxx | 15 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 18 |
2 files changed, 12 insertions, 21 deletions
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index 90dbcd9b1e4a..89d4d8e3fff0 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -401,6 +401,7 @@ public: class VCL_DLLPUBLIC CheckBox : public Button { +private: Rectangle maStateRect; Rectangle maMouseRect; TriState meState; @@ -419,7 +420,7 @@ class VCL_DLLPUBLIC CheckBox : public Button SAL_DLLPRIVATE void ImplDrawCheckBox( bool bLayout = false ); SAL_DLLPRIVATE long ImplGetImageToTextDistance() const; SAL_DLLPRIVATE Size ImplGetCheckImageSize() const; -private: + // Copy assignment is forbidden and not implemented. SAL_DLLPRIVATE CheckBox(const CheckBox &); SAL_DLLPRIVATE CheckBox& operator= (const CheckBox &); @@ -427,19 +428,15 @@ private: protected: using Control::ImplInitSettings; using Window::ImplInit; - // allows the behaviour of horizontal placement of the checbox image to be - // overridden. - virtual void ImplHandleHoriAlign( const Point& rPos, const Size& rSize, - const Size& rImageSize, Rectangle& rStateRect ); SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); - virtual void FillLayoutData() const; - virtual const Font& + SAL_DLLPRIVATE virtual void FillLayoutData() const; + SAL_DLLPRIVATE virtual const Font& GetCanonicalFont( const StyleSettings& _rStyle ) const; - virtual const Color& + SAL_DLLPRIVATE virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const; - virtual void ImplDrawCheckBoxState(); + SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState(); SAL_DLLPRIVATE const Rectangle& GetStateRect() const { return maStateRect; } SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; } public: diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 670c9e64d42a..3e09946ed16f 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -3252,9 +3252,12 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags, } else { - // allow specific handling of WB_CENTER, WB_LEFT & WB_RIGHT by - // by subclasses - ImplHandleHoriAlign( rPos, rSize, rImageSize, rStateRect ); + if ( nWinStyle & WB_CENTER ) + rStateRect.Left() = rPos.X()+((rSize.Width()-rImageSize.Width())/2); + else if ( nWinStyle & WB_RIGHT ) + rStateRect.Left() = rPos.X()+rSize.Width()-rImageSize.Width(); + else + rStateRect.Left() = rPos.X(); if ( nWinStyle & WB_VCENTER ) rStateRect.Top() = rPos.Y()+((rSize.Height()-rImageSize.Height())/2); else if ( nWinStyle & WB_BOTTOM ) @@ -3296,15 +3299,6 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags, // ----------------------------------------------------------------------- -void CheckBox:: ImplHandleHoriAlign( const Point& rPos, const Size& /*rSize*/, - const Size& /*rImageSize*/, Rectangle& rStateRect ) -{ - // align Checkbox image left ( always ) - rStateRect.Left() = rPos.X(); -} - -// ----------------------------------------------------------------------- - void CheckBox::ImplDrawCheckBox( bool bLayout ) { Size aImageSize = ImplGetCheckImageSize(); |