Bugzilla – Attachment 54840 Details for
Bug 34425
[EasyHack] formatting background color toolbar button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
modified code so far, still not complete
34425-20111227.diff (text/plain), 7.95 KB, created by
Winfried Donkers
on 2011-12-27 02:58:19 UTC
(
hide
)
Description:
modified code so far, still not complete
Filename:
MIME Type:
Creator:
Winfried Donkers
Created:
2011-12-27 02:58:19 UTC
Size:
7.95 KB
patch
obsolete
>diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx >index 9cf9555..0ce46eb 100644 >--- a/sc/source/ui/app/scdll.cxx >+++ b/sc/source/ui/app/scdll.cxx >@@ -203,8 +203,10 @@ void ScDLL::Init() > SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod); > SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod); > // SvxFontHeightToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod); >- SvxFontColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod); >- SvxColorToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod); >+//34425 Dnk start mod >+ SvxFontColorExtToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod); >+ SvxFontColorExtToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod); >+//34425 Dnk end mod > SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod); > SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod); > SvxFrameLineColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod); >diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx >index dd619fe..08fb88e 100644 >--- a/sc/source/ui/view/formatsh.cxx >+++ b/sc/source/ui/view/formatsh.cxx >@@ -1453,14 +1453,18 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) > > case SID_BACKGROUND_COLOR: > { >- // SID_BACKGROUND_COLOR without arguments -> set transparent background >+//34425 Dnk, start mod >+ // SID_BACKGROUND_COLOR without arguments -> set background to last used color > > SvxBrushItem aBrushItem( (const SvxBrushItem&) > pTabViewShell->GetSelectionPattern()-> > GetItem( ATTR_BACKGROUND ) ); > >- aBrushItem.SetColor( COL_TRANSPARENT ); >- >+ //here is where we need mLastColor from SvxFontColorExtToolBoxControl, but HOW??? >+ //for testing purposes, used a fixed color in the mean time >+ Color aColor = 0x5050FF; >+ aBrushItem.SetColor( aColor ); >+//34425 Dnk, end mod > pTabViewShell->ApplyAttr( aBrushItem ); > } > break; >diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc >index f66af83..a9f5fe4 100755 >--- a/svx/inc/svx/svxids.hrc >+++ b/svx/inc/svx/svxids.hrc >@@ -1134,7 +1134,7 @@ > #define SID_EXTRUSION_SURFACE ( SID_SVX_START + 975 ) > #define SID_EXTRUSION_DEPTH_DIALOG ( SID_SVX_START + 976 ) > #define SID_FONTWORK_GALLERY_FLOATER ( SID_SVX_START + 977 ) >-// free ( SID_SVX_START + 978 ) >+#define SID_BACKGROUND_COLOR_EXT ( SID_SVX_START + 978 ) //34425 Dnk, was free > #define SID_FONTWORK_SHAPE_TYPE ( SID_SVX_START + 979 ) > #define SID_FONTWORK_SAME_LETTER_HEIGHTS ( SID_SVX_START + 980 ) > #define SID_FONTWORK_ALIGNMENT_FLOATER ( SID_SVX_START + 981 ) >diff --git a/svx/inc/svx/tbcontrl.hxx b/svx/inc/svx/tbcontrl.hxx >index ad465ef..8d3d032 100644 >--- a/svx/inc/svx/tbcontrl.hxx >+++ b/svx/inc/svx/tbcontrl.hxx >@@ -312,6 +312,9 @@ class SVX_DLLPUBLIC SvxFontColorExtToolBoxControl : public SfxToolBoxControl > { > using SfxToolBoxControl::StateChanged; > using SfxToolBoxControl::Select; >+//34425 Dnk, start mod >+ sal_Bool bChoiceFromPalette; >+//34425 Dnk, end mod > > // SfxStatusForwarder aForward; > ::svx::ToolboxButtonColorUpdater* pBtnUpdater; >diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx >index b5c50a5..64ee722 100644 >--- a/svx/source/tbxctrls/tbcontrl.cxx >+++ b/svx/source/tbxctrls/tbcontrl.cxx >@@ -2245,13 +2245,18 @@ SvxFontColorExtToolBoxControl::SvxFontColorExtToolBoxControl( > { > rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) ); > // The following commands are available at the writer module. >- if ( SID_ATTR_CHAR_COLOR2 == nSlotId ) >+//34425 Dnk start mod >+ bChoiceFromPalette = sal_False; >+ >+ if ( SID_ATTR_CHAR_COLOR2 == nSlotId || SID_ATTR_CHAR_COLOR == nSlotId ) > addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharColorExt" ))); >- else >+ else > addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharBackgroundExt" ))); >+//34425 Dnk end mod >+ >+//34425 Dnk removed useless code in next line >+ sal_uInt16 nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW; > >- sal_uInt16 nMode = SID_ATTR_CHAR_COLOR2 == nSlotId >- ? TBX_UPDATER_MODE_CHAR_COLOR_NEW : TBX_UPDATER_MODE_CHAR_COLOR_NEW; > pBtnUpdater = new ::svx::ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox(), nMode ); > } > >@@ -2289,6 +2294,9 @@ SfxPopupWindow* SvxFontColorExtToolBoxControl::CreatePopupWindow() > FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF ); > pColorWin->StartSelection(); > SetPopupWindow( pColorWin ); >+//34425 Dnk start mod >+ bChoiceFromPalette = sal_True; >+//34425 Dnk, end mod > return pColorWin; > } > >@@ -2303,27 +2311,34 @@ void SvxFontColorExtToolBoxControl::StateChanged( > ToolBox& rTbx = GetToolBox(); > const SvxColorItem* pItem = 0; > >- if ( nSID == SID_ATTR_CHAR_COLOR_EXT || >- nSID == SID_ATTR_CHAR_COLOR_BACKGROUND_EXT ) >- { >- if ( SFX_ITEM_DONTCARE != eState ) >- { >- const SfxBoolItem* pBool = PTR_CAST( SfxBoolItem, pState ); >- rTbx.CheckItem( nId, pBool && pBool->GetValue()); >- } >- rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); >- } >- else >- { >- if ( SFX_ITEM_DONTCARE != eState ) >- pItem = PTR_CAST( SvxColorItem, pState ); >+//34425 Dnk start mod >+ if ( bChoiceFromPalette ) >+ { >+ bChoiceFromPalette = sal_False; >+ if ( nSID == SID_ATTR_CHAR_COLOR_EXT || >+ nSID == SID_ATTR_CHAR_COLOR_BACKGROUND_EXT || >+ nSID == SID_BACKGROUND_COLOR_EXT ) >+ { >+ if ( SFX_ITEM_DONTCARE != eState ) >+ { >+ const SfxBoolItem* pBool = PTR_CAST( SfxBoolItem, pState ); >+ rTbx.CheckItem( nId, pBool && pBool->GetValue()); >+ } >+ rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); >+ } >+ else >+ { >+ if ( SFX_ITEM_DONTCARE != eState ) >+ pItem = PTR_CAST( SvxColorItem, pState ); > >- if ( pItem ) >- { >- pBtnUpdater->Update( pItem->GetValue() ); >- mLastColor = pItem->GetValue(); >- } >- } >+ if ( pItem ) >+ { >+ pBtnUpdater->Update( pItem->GetValue() ); >+ mLastColor = pItem->GetValue(); >+ } >+ } >+ } >+//34425 Dnk, end mod > } > > // ----------------------------------------------------------------------- >@@ -2332,17 +2347,27 @@ void SvxFontColorExtToolBoxControl::Select( sal_Bool ) > { > OUString aCommand; > OUString aParamName; >- if ( SID_ATTR_CHAR_COLOR2 == GetSlotId() ) >+//34425 Dnk, mod >+ if ( SID_ATTR_CHAR_COLOR2 == GetSlotId() || SID_ATTR_CHAR_COLOR == GetSlotId() ) > { > aCommand = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharColorExt" )); > aParamName = OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColorExt" )); > } > else > { >- aCommand = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharBackgroundExt" )); >- aParamName = OUString( RTL_CONSTASCII_USTRINGPARAM( "CharBackgroundExt" )); >- } >- >+ if ( SID_BACKGROUND_COLOR == GetSlotId() ) >+ { >+ aCommand = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:BackgroundColor" )); >+ aParamName = OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" )); >+ } >+ else >+ { >+ aCommand = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharBackgroundExt" )); >+ aParamName = OUString( RTL_CONSTASCII_USTRINGPARAM( "CharBackgroundExt" )); >+ } >+ } >+//34425 Dnk, end mod >+ > Sequence< PropertyValue > aArgs( 1 ); > aArgs[0].Name = aParamName; > aArgs[0].Value = makeAny( GetToolBox().IsItemChecked( GetId() ));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 34425
:
43505
|
54485
|
54626
| 54840