diff options
-rw-r--r-- | include/svx/tbxcolorupdate.hxx | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 4 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanel.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanel.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 10 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbxcolorupdate.cxx | 70 |
9 files changed, 39 insertions, 63 deletions
diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx index 7dad6e7347dc..3c9c100bbc2b 100644 --- a/include/svx/tbxcolorupdate.hxx +++ b/include/svx/tbxcolorupdate.hxx @@ -33,10 +33,6 @@ namespace svx { //........................................................................ -#define TBX_UPDATER_MODE_CHAR_COLOR 0x01 -#define TBX_UPDATER_MODE_CHAR_BACKGROUND 0x02 -#define TBX_UPDATER_MODE_CHAR_COLOR_NEW 0x03 - //==================================================================== //= ToolboxButtonColorUpdater //==================================================================== @@ -49,14 +45,12 @@ namespace svx public: ToolboxButtonColorUpdater( sal_uInt16 nSlotId, sal_uInt16 nTbxBtnId, - ToolBox* ptrTbx, - sal_uInt16 nMode = 0 ); + ToolBox* ptrTbx); ~ToolboxButtonColorUpdater(); void Update( const Color& rColor ); private: - sal_uInt16 mnDrawMode; sal_uInt16 mnBtnId; sal_uInt16 mnSlotId; ToolBox* mpTbx; diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index eee8c29e0762..854ec4d6b705 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -295,7 +295,7 @@ Condition::Condition( Window* _pParent, IConditionalFormatAction& _rAction, ::rp m_pBtnUpdaterBackgroundColor = new ::svx::ToolboxButtonColorUpdater( SID_BACKGROUND_COLOR, SID_BACKGROUND_COLOR, &m_aActions ); m_pBtnUpdaterFontColor = new ::svx::ToolboxButtonColorUpdater( - SID_ATTR_CHAR_COLOR2, SID_ATTR_CHAR_COLOR2, &m_aActions, TBX_UPDATER_MODE_CHAR_COLOR_NEW ); + SID_ATTR_CHAR_COLOR2, SID_ATTR_CHAR_COLOR2, &m_aActions ); Show(); diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index fbb623678e8d..332b72d884c4 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -221,10 +221,10 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( mpFillColorUpdater.reset( new ::svx::ToolboxButtonColorUpdater(SID_ATTR_BRUSH, mpTBFillColor->GetItemId( UNO_BACKGROUNDCOLOR ), - mpTBFillColor, TBX_UPDATER_MODE_CHAR_COLOR_NEW) ); + mpTBFillColor) ); mpLineColorUpdater.reset( new ::svx::ToolboxButtonColorUpdater(SID_FRAME_LINECOLOR, mpTBLineColor->GetItemId( UNO_FRAMELINECOLOR ), - mpTBLineColor, TBX_UPDATER_MODE_CHAR_COLOR_NEW) ); + mpTBLineColor) ); mpCellBorderUpdater.reset( new CellBorderUpdater( mpTBCellBorder->GetItemId( UNO_SETBORDERSTYLE ), *mpTBCellBorder) ); diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx index df87602696c3..c08963156c8f 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx @@ -87,7 +87,7 @@ AreaPropertyPanel::AreaPropertyPanel( mpMTRTransparent(new MetricField(this, SVX_RES(MTR_TRANSPARENT))), mpBTNGradientBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)), mpBTNGradient(sfx2::sidebar::ControlFactory::CreateToolBox(mpBTNGradientBackground.get(), SVX_RES(BTN_GRADIENT))), - mpColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, TBI_COLOR, mpToolBoxColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)), + mpColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, TBI_COLOR, mpToolBoxColor.get())), mpStyleItem(), mpColorItem(), mpFillGradientItem(), diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx index 130220560c9b..1330f4636fb9 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.cxx +++ b/svx/source/sidebar/line/LinePropertyPanel.cxx @@ -185,7 +185,7 @@ LinePropertyPanel::LinePropertyPanel( maEdgeStyle(SID_ATTR_LINE_JOINT, *pBindings, *this), maCapStyle(SID_ATTR_LINE_CAP, *pBindings, *this), maColor(COL_BLACK), - mpColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_LINE_COLOR, TBI_COLOR, mpTBColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)), + mpColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_LINE_COLOR, TBI_COLOR, mpTBColor.get())), mpStyleItem(), mpDashItem(), mnTrans(0), diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index 4934f97f7629..f2d384075d63 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -439,7 +439,7 @@ void ParaPropertyPanel::InitToolBoxIndent() void ParaPropertyPanel::InitToolBoxBGColor() { - mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, TBI_BACK_COLOR, mpTBxBackColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW )); + mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, TBI_BACK_COLOR, mpTBxBackColor.get())); mpTBxBackColor->SetItemImage(TBI_BACK_COLOR, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor); mpTBxBackColor->SetItemBits( TBI_BACK_COLOR, mpTBxBackColor->GetItemBits( TBI_BACK_COLOR ) | TIB_DROPDOWNONLY ); diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index b4ce7cde262e..cef5f887031e 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -981,7 +981,7 @@ ExtrusionColorControl::ExtrusionColorControl( mLastColor( COL_AUTO ) { rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) ); - mpBtnUpdater = new ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox(), TBX_UPDATER_MODE_CHAR_COLOR_NEW ); + mpBtnUpdater = new ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox() ); } // ----------------------------------------------------------------------- diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index cfeb01e4735a..781a9b55c5d5 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2292,7 +2292,7 @@ SvxFontColorToolBoxControl::SvxFontColorToolBoxControl( : SfxToolBoxControl( nSlotId, nId, rTbx ), pBtnUpdater( new ::svx::ToolboxButtonColorUpdater( - nSlotId, nId, &GetToolBox(), TBX_UPDATER_MODE_CHAR_COLOR_NEW )), + nSlotId, nId, &GetToolBox() )), mLastColor( COL_AUTO ) { rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) ); @@ -2449,8 +2449,6 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl( pBtnUpdater(0), mLastColor( COL_AUTO ) { - sal_uInt16 nMode; - rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) ); bChoiceFromPalette = sal_False; @@ -2459,13 +2457,11 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl( { case SID_ATTR_CHAR_COLOR: addStatusListener( OUString( ".uno:Color" )); - nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW; mLastColor = COL_RED; break; case SID_ATTR_CHAR_COLOR2: addStatusListener( OUString( ".uno:CharColorExt" )); - nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW; mLastColor = COL_RED; break; @@ -2473,18 +2469,16 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl( case SID_ATTR_CHAR_COLOR_BACKGROUND: default: addStatusListener( OUString( ".uno:CharBackgroundExt" )); - nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW; mLastColor = COL_YELLOW; break; case SID_FRAME_LINECOLOR: addStatusListener( OUString( ".uno:FrameLineColor" )); - nMode = 0; mLastColor = COL_BLUE; break; } - pBtnUpdater = new ::svx::ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox(), nMode ); + pBtnUpdater = new ::svx::ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox() ); } // ----------------------------------------------------------------------- diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 85f580fe38ff..289395868748 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -45,16 +45,12 @@ namespace svx ToolboxButtonColorUpdater::ToolboxButtonColorUpdater( sal_uInt16 nId, sal_uInt16 nTbxBtnId, - ToolBox* ptrTbx, - sal_uInt16 nMode ) : - mnDrawMode ( nMode ), + ToolBox* ptrTbx) : mnBtnId ( nTbxBtnId ), mnSlotId ( nId ), mpTbx ( ptrTbx ), maCurColor ( COL_TRANSPARENT ) { - if (mnSlotId == SID_BACKGROUND_COLOR) - mnDrawMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW; DBG_ASSERT( ptrTbx, "ToolBox not found :-(" ); mbWasHiContrastMode = ptrTbx ? ( ptrTbx->GetSettings().GetStyleSettings().GetHighContrastMode() ) : sal_False; switch( mnSlotId ) @@ -126,7 +122,7 @@ namespace svx mbWasHiContrastMode = mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode(); - if( mnDrawMode == TBX_UPDATER_MODE_CHAR_COLOR_NEW && ( COL_TRANSPARENT != aColor.GetColor() ) ) + if( COL_TRANSPARENT != aColor.GetColor() ) pBmpAcc->SetLineColor( aColor ); else if( mpTbx->GetBackground().GetColor().IsDark() ) pBmpAcc->SetLineColor( Color( COL_WHITE ) ); @@ -135,46 +131,38 @@ namespace svx pBmpAcc->SetFillColor( maCurColor = aColor ); - if( TBX_UPDATER_MODE_CHAR_COLOR_NEW == mnDrawMode ) + if( maBmpSize.Width() <= 16 ) + maUpdRect = Rectangle( Point( 0,12 ), Size( maBmpSize.Width(), 4 ) ); + else if(76 == maBmpSize.Width() && 12 == maBmpSize.Height()) { - if( maBmpSize.Width() <= 16 ) - maUpdRect = Rectangle( Point( 0,12 ), Size( maBmpSize.Width(), 4 ) ); - else if(76 == maBmpSize.Width() && 12 == maBmpSize.Height()) - { - maUpdRect.Left() = 22; - maUpdRect.Top() = 2; - maUpdRect.Right() = 73; - maUpdRect.Bottom() = 9; - } - else if(maBmpSize.Width() >= (2 * maBmpSize.Height() - 2) && maBmpSize.Height() >= 16) - { - maUpdRect.Left() = maBmpSize.Height() + 2; - maUpdRect.Top() = 2; - maUpdRect.Right() = maBmpSize.Width() - 3; - maUpdRect.Bottom() = maBmpSize.Height() - 3; - } - else - maUpdRect = Rectangle( Point( 1, maBmpSize.Height() - 7 ), Size( maBmpSize.Width() - 2 ,6 ) ); + maUpdRect.Left() = 22; + maUpdRect.Top() = 2; + maUpdRect.Right() = 73; + maUpdRect.Bottom() = 9; + } + else if(maBmpSize.Width() >= (2 * maBmpSize.Height() - 2) && maBmpSize.Height() >= 16) + { + maUpdRect.Left() = maBmpSize.Height() + 2; + maUpdRect.Top() = 2; + maUpdRect.Right() = maBmpSize.Width() - 3; + maUpdRect.Bottom() = maBmpSize.Height() - 3; + } + else + maUpdRect = Rectangle( Point( 1, maBmpSize.Height() - 7 ), Size( maBmpSize.Width() - 2 ,6 ) ); - pBmpAcc->DrawRect( maUpdRect ); + pBmpAcc->DrawRect( maUpdRect ); - if( pMskAcc ) + if( pMskAcc ) + { + if( COL_TRANSPARENT == aColor.GetColor() ) { - if( COL_TRANSPARENT == aColor.GetColor() ) - { - pMskAcc->SetLineColor( COL_BLACK ); - pMskAcc->SetFillColor( COL_WHITE ); - } - else - pMskAcc->SetFillColor( COL_BLACK ); - - pMskAcc->DrawRect( maUpdRect ); + pMskAcc->SetLineColor( COL_BLACK ); + pMskAcc->SetFillColor( COL_WHITE ); } - } - else - { - OSL_FAIL( "ToolboxButtonColorUpdater::Update: TBX_UPDATER_MODE_CHAR_COLOR / TBX_UPDATER_MODE_CHAR_BACKGROUND" ); - // !!! DrawChar( aVirDev, aColor ); + else + pMskAcc->SetFillColor( COL_BLACK ); + + pMskAcc->DrawRect( maUpdRect ); } aBmp.ReleaseAccess( pBmpAcc ); |