diff options
author | Winfried Donkers <osc@dci-electronics.nl> | 2012-02-21 14:50:04 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-21 14:50:04 +0000 |
commit | 836d98646203e0d9d3916571ed55d6572c2cb3dc (patch) | |
tree | 2e7f4845b93bbc3f4fc05a4845f95ec03edf84df /sw | |
parent | 46cf18fdf137d68ff42d6e037a1285a37c65c07f (diff) |
fdo#44611 writer: paragraph background color picker with split button
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/app/swmodule.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/inc/basesh.hxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 12 |
3 files changed, 16 insertions, 7 deletions
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index b37b86f6e370..ab747375c747 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -349,10 +349,10 @@ void SwDLL::RegisterControls() SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT, pMod ); SvxFontColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR, pMod ); - SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2, pMod ); - SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND, pMod ); + SvxColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2, pMod ); + SvxColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND, pMod ); SvxStyleToolBoxControl::RegisterControl(SID_STYLE_APPLY, pMod ); - SvxColorToolBoxControl::RegisterControl(SID_BACKGROUND_COLOR, pMod ); + SvxColorExtToolBoxControl::RegisterControl( SID_BACKGROUND_COLOR, pMod ); SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod ); SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod ); SvxFrameLineColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod ); diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx index 648af2bab340..26e48b21de10 100644 --- a/sw/source/ui/inc/basesh.hxx +++ b/sw/source/ui/inc/basesh.hxx @@ -35,6 +35,7 @@ #include <sfx2/module.hxx> #include <sfx2/shell.hxx> #include <svl/svstdarr.hxx> +#include <viewopt.hxx> #include <mdiexp.hxx> #include <set> @@ -49,6 +50,7 @@ struct DBTextStruct_Impl; class SwBaseShell: public SfxShell { SwView &rView; + static Color mBackgroundColor; // DragMode static FlyMode eFrameMode; @@ -119,7 +121,8 @@ public: static void SetFrmMode( FlyMode eMode, SwWrtShell *pShell ); // with update! static void _SetFrmMode( FlyMode eMode ) { eFrameMode = eMode; } static FlyMode GetFrmMode() { return eFrameMode; } - + Color GetBackgroundColor() { return mBackgroundColor; } + void SetBackgroundColor( const Color& clr ) { mBackgroundColor = clr; } }; diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index d793595fc79d..c45a40d1d619 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -1927,6 +1927,10 @@ void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh ) /*-------------------------------------------------------------------- Beschreibung: Ctor --------------------------------------------------------------------*/ +// STATIC DATA ----------------------------------------------------------- +Color SwBaseShell::mBackgroundColor = COL_TRANSPARENT; +// ----------------------------------------------------------- + SwBaseShell::SwBaseShell(SwView& rVw) : SfxShell( &rVw ), rView(rVw), @@ -2260,13 +2264,15 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) pArgs->Get(SID_BACKGROUND_COLOR); const Color& rNewColor = rNewColorItem.GetValue(); aBrushItem.SetColor( rNewColor ); + SetBackgroundColor( rNewColor ); GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem); } else { - aBrushItem.SetColor( COL_TRANSPARENT ); - rReq.AppendItem( SvxColorItem( Color( COL_TRANSPARENT ), nSlot ) ); - } + // call without arguments, use last used background color + aBrushItem.SetColor( GetBackgroundColor() ); + rReq.AppendItem( SvxColorItem( GetBackgroundColor(), nSlot ) ); + } } break; |