sw/source/uibase/uiview/formatclipboard.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit 576ba26d09448f8bc332acdf6d17061e8ad552a3 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Aug 25 11:56:16 2022 -0400 Commit: Gökay ŞATIR <gokaysa...@collabora.com> CommitDate: Tue Sep 13 11:25:19 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> diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index b8c5023eac0d..bcafb0bd3ce6 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -543,7 +543,17 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) ) rWrtShell.SetFlyFrameAttr(*pTemplateItemSet); else if ( !bNoCharacterFormats ) + { + const SfxPoolItem* pItem; + SfxItemSetFixed<RES_CHRATR_CROSSEDOUT, RES_CHRATR_CROSSEDOUT> aSet(rWrtShell.GetAttrPool()); + rWrtShell.GetCurAttr(aSet); + if (!pTemplateItemSet->HasItem(RES_CHRATR_CROSSEDOUT, &pItem)) + { + rWrtShell.ResetAttr({ RES_CHRATR_CROSSEDOUT }); + } + rWrtShell.SetAttrSet(*pTemplateItemSet); + } } } }