sw/source/uibase/uiview/formatclipboard.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit 7f0261e1d14df2e0a44e527134c8506750ee7b5d Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Aug 25 11:56:16 2022 -0400 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Thu Sep 29 09:41:23 2022 +0200 sw: fix format brush to reset the font strikeout attribute The format brush always inserts attributes to a set, it should be intersected. For a special use case, ugly hack to reset the font strikeout attribute. Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: I94c172e61b3d6d3339b1243a9344952b5c59d872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138839 Tested-by: Jenkins Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com> (cherry picked from commit 576ba26d09448f8bc332acdf6d17061e8ad552a3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140376 Tested-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index e9268bffa23f..c0c61252b496 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -27,6 +27,7 @@ #include <frmfmt.hxx> #include <docstyle.hxx> #include <fchrfmt.hxx> +#include <svl/itemset.hxx> #include <svx/svdview.hxx> #include <editeng/brushitem.hxx> #include <editeng/shaditem.hxx> @@ -557,7 +558,18 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) ) rWrtShell.SetFlyFrameAttr(*pTemplateItemSet); else if ( !bNoCharacterFormats ) + { + const SfxPoolItem* pItem; + SfxItemSet aSet(rWrtShell.GetAttrPool(), + { { RES_CHRATR_CROSSEDOUT, RES_CHRATR_CROSSEDOUT } }); + rWrtShell.GetCurAttr(aSet); + if (!pTemplateItemSet->HasItem(RES_CHRATR_CROSSEDOUT, &pItem)) + { + rWrtShell.ResetAttr({ RES_CHRATR_CROSSEDOUT }); + } + rWrtShell.SetAttrSet(*pTemplateItemSet); + } } } }