sw/source/uibase/uiview/formatclipboard.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 35502dd36bfd857c5514022e25bce8d1695eec61
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 22 12:47:54 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/+/140375
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.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 2bf4dd036fef..881a3f0109b5 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -550,7 +550,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);
+                }
             }
         }
     }

Reply via email to