diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-10-14 16:51:25 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2018-10-27 22:43:14 +0200 |
commit | 68c73b2cc26313de315e828cb9f8db53d9aeb6bf (patch) | |
tree | daa39ae56cf63a3eb1498d054d6f501f335832c0 /reportdesign | |
parent | d666b6b19d3e400561edc585d967ecab266c6b8f (diff) |
tdf#108751 Show currently selected color name in color button tooltip
Based on Heiko Tietze's work in
I26f0500527d2b86049948ca64e636e1ff566f262
Change-Id: I20541dd6ad155a39c0f87361088b44923406064f
Reviewed-on: https://gerrit.libreoffice.org/61815
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.cxx | 19 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.hxx | 2 |
2 files changed, 12 insertions, 9 deletions
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index d3382478b766..5e8194fd7214 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -96,7 +96,7 @@ void ConditionColorWrapper::dispose() void ConditionColorWrapper::operator()(const OUString& /*rCommand*/, const NamedColor& rNamedColor) { - mxControl->ApplyCommand(mnSlotId, rNamedColor.first); + mxControl->ApplyCommand(mnSlotId, rNamedColor); } // = Condition @@ -161,9 +161,11 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction, m_nFontDialogId = m_pActions->GetItemId(".uno:FontDialog"); m_pBtnUpdaterBackgroundColor.reset( new svx::ToolboxButtonColorUpdater( - SID_BACKGROUND_COLOR, m_nBackgroundColorId, m_pActions ) ); + SID_BACKGROUND_COLOR, m_nBackgroundColorId, m_pActions, false, + m_pActions->GetItemText( m_nBackgroundColorId ) ) ); m_pBtnUpdaterFontColor.reset( new svx::ToolboxButtonColorUpdater( - SID_ATTR_CHAR_COLOR2, m_nFontColorId, m_pActions ) ); + SID_ATTR_CHAR_COLOR2, m_nFontColorId, m_pActions, false, + m_pActions->GetItemText( m_nFontColorId ) ) ); Show(); @@ -238,7 +240,8 @@ IMPL_LINK(Condition, DropdownClick, ToolBox*, pToolBox, void) IMPL_LINK_NOARG( Condition, OnFormatAction, ToolBox*, void ) { - ApplyCommand(mapToolbarItemToSlotId(m_pActions->GetCurItemId()),COL_AUTO); + ApplyCommand(mapToolbarItemToSlotId(m_pActions->GetCurItemId()), + NamedColor(COL_AUTO, "#" + COL_AUTO.AsRGBHexString())); } IMPL_LINK( Condition, OnConditionAction, Button*, _pClickedButton, void ) @@ -253,14 +256,14 @@ IMPL_LINK( Condition, OnConditionAction, Button*, _pClickedButton, void ) m_rAction.deleteCondition( getConditionIndex() ); } -void Condition::ApplyCommand( sal_uInt16 _nCommandId, const ::Color& _rColor) +void Condition::ApplyCommand( sal_uInt16 _nCommandId, const NamedColor& rNamedColor ) { if ( _nCommandId == SID_ATTR_CHAR_COLOR2 ) - m_pBtnUpdaterFontColor->Update( _rColor ); + m_pBtnUpdaterFontColor->Update( rNamedColor ); else if ( _nCommandId == SID_BACKGROUND_COLOR ) - m_pBtnUpdaterBackgroundColor->Update( _rColor ); + m_pBtnUpdaterBackgroundColor->Update( rNamedColor ); - m_rAction.applyCommand( m_nCondIndex, _nCommandId, _rColor ); + m_rAction.applyCommand( m_nCondIndex, _nCommandId, rNamedColor.first ); } void Condition::setImageList(sal_Int16 /*_eBitmapSet*/) diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx index 04e228707b22..ceca03281ecc 100644 --- a/reportdesign/source/ui/dlg/Condition.hxx +++ b/reportdesign/source/ui/dlg/Condition.hxx @@ -162,7 +162,7 @@ namespace rptui /** forward to the parent class */ - void ApplyCommand(sal_uInt16 _nCommandId, const ::Color& _aColor ); + void ApplyCommand( sal_uInt16 _nCommandId, const NamedColor& rNamedColor ); ::rptui::OReportController& getController() const { return m_rController; } |