include/svx/tbcontrl.hxx | 1 + svx/source/tbxctrls/tbcontrl.cxx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
New commits: commit bdd7abf56676732f8ce4fd04bea5c72758f1ec3b Author: Daniel <danielfaleirosi...@gmail.com> Date: Sat Mar 24 00:13:26 2018 -0300 tdf#63438 Toggle highlight color to no fill if the same value is active Change-Id: I7553bc7bffeb0a8d1275aadc44bf2813564087b5 Reviewed-on: https://gerrit.libreoffice.org/51794 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 57d1dcba5f22..1f5079f69a22 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -212,6 +212,7 @@ class SVX_DLLPUBLIC SvxColorToolBoxControl : public cppu::ImplInheritanceHelper< std::shared_ptr<PaletteManager> m_xPaletteManager; BorderColorStatus m_aBorderColorStatus; bool m_bSplitButton; + bool m_bIsNoFill; sal_uInt16 m_nSlotId; ColorSelectFunction m_aColorSelectFunction; DECL_LINK(SelectedHdl, const NamedColor&, void); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 6ec04a941513..c817027dedad 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2753,6 +2753,7 @@ com_sun_star_comp_svx_FontNameToolBoxControl_get_implementation( SvxColorToolBoxControl::SvxColorToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext ) : ImplInheritanceHelper( rContext, nullptr, OUString() ), m_bSplitButton(true), + m_bIsNoFill(false), m_nSlotId(0), m_aColorSelectFunction(PaletteManager::DispatchColorCommand) { @@ -2876,6 +2877,9 @@ VclPtr<vcl::Window> SvxColorToolBoxControl::createPopupWindow( vcl::Window* pPar IMPL_LINK(SvxColorToolBoxControl, SelectedHdl, const NamedColor&, rColor, void) { + if (m_xBtnUpdater->GetCurrentColor() != rColor.first) + m_bIsNoFill = false; + m_xBtnUpdater->Update(rColor.first); if (m_xPaletteManager) m_xPaletteManager->SetLastColor(rColor.first); @@ -2938,8 +2942,11 @@ void SvxColorToolBoxControl::execute(sal_Int16 /*nSelectModifier*/) Color aColor = m_xPaletteManager->GetLastColor(); auto aArgs( comphelper::InitPropertySequence( { - { m_aCommandURL.copy(5), css::uno::makeAny( m_xPaletteManager->GetLastColor() ) } + { m_aCommandURL.copy(5), css::uno::makeAny( COL_TRANSPARENT ) } } ) ); + if (!m_bIsNoFill) + aArgs[0].Value <<= sal_Int32( m_xPaletteManager->GetLastColor() ); + m_bIsNoFill = !m_bIsNoFill; dispatchCommand( aCommand, aArgs ); OUString sColorName = ("#" + aColor.AsRGBHexString().toAsciiUpperCase()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits