From 21f8b386e07702e375abd8000e7583f25a0804cf Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 19 Nov 2017 20:10:49 +0100 Subject: Disabled slot with Put leaks entry (StateFormatPaintbrush/sw) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same as https://cgit.freedesktop.org/libreoffice/core/commit/?id=21dde7a09e2cfe7b48d2fec1edc7a94fa94af5c3 Change-Id: I670c01eb5e5e747ceb77995ad855ee448faa054f Reviewed-on: https://gerrit.libreoffice.org/44931 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/uibase/uiview/view1.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/uiview/view1.cxx b/sw/source/uibase/uiview/view1.cxx index dd3547b64b22..4f3650a6e7dc 100644 --- a/sw/source/uibase/uiview/view1.cxx +++ b/sw/source/uibase/uiview/view1.cxx @@ -168,12 +168,14 @@ void SwView::StateFormatPaintbrush(SfxItemSet &rSet) return; bool bHasContent = m_pFormatClipboard && m_pFormatClipboard->HasContent(); - rSet.Put(SfxBoolItem(SID_FORMATPAINTBRUSH, bHasContent)); - if(!bHasContent) + if( !bHasContent && + !SwFormatClipboard::CanCopyThisType( GetWrtShell().GetSelectionType()) + ) { - if( !SwFormatClipboard::CanCopyThisType( GetWrtShell().GetSelectionType() ) ) - rSet.DisableItem( SID_FORMATPAINTBRUSH ); + rSet.DisableItem( SID_FORMATPAINTBRUSH ); } + else + rSet.Put(SfxBoolItem(SID_FORMATPAINTBRUSH, bHasContent)); } void SwView::UpdateWordCount(SfxShell* pShell, sal_uInt16 nSlot) -- cgit v1.2.3