summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2021-10-13 14:56:44 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-14 08:45:39 +0200
commit036d45b602c2f554f9bcc21fecbc3e3ac5b834da (patch)
treed057e84508cac74ecacf2f25494feafacd02936f /sw/source/uibase/wrtsh
parent22a79927eec282b65fe71fbdcb9fa2810137b17c (diff)
...save/restore character format on selection overwrite" which might also fix tdf#144638 as well. This reverts LO 6.3 commit 6abed0ea006f3616e40faf2ae782cf64f8ac2914. This 6.3 fix for bug 79717 has caused too many other problems that are not being looked at, so it should just be reverted. It is spamming document with direct formatting which is a terrible thing to have happen by accident. It completely wrecks the proper use of styles. Also revert asscoiated follow-up commits: Revert "tdf#79717 save/restore character style on selection overwrite" This reverts commit 04bd1925706360414438b814046b543c5e317d0a. Revert "tdf#79717: sw_uiwriter: Add unittest" This reverts commit b05955b480fe4d32852e7be8a118d46ca7e6dbfa. These effectively revert 12eac5bcbc9b71bf00cb88b918988826229cca35 but its unit test is left intact. Change-Id: Ideced4d38bfdf4c82f1744534afbaad29689fded Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123566 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/wrtsh')
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx21
1 files changed, 0 insertions, 21 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index c8a3cae408fe..215cdf2980a5 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -219,11 +219,6 @@ void SwWrtShell::Insert( const OUString &rStr )
bCallIns = m_bIns /*|| bHasSel*/;
bool bDeleted = false;
- const auto CharItems = svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_RSID - 1,
- RES_CHRATR_RSID + 1, RES_CHRATR_END - 1,
- RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT>;
- SfxItemSet aCharAttrSet(GetAttrPool(), CharItems);
-
if( bHasSel || ( !m_bIns && SelectHiddenRange() ) )
{
// Only here parenthesizing, because the normal
@@ -241,12 +236,6 @@ void SwWrtShell::Insert( const OUString &rStr )
aRewriter.AddRule(UndoArg3, aTmpStr);
}
- // tdf#79717 Save character formatting of the start of the selection
- const SwPosition *pStart = GetCursor()->Start();
- SwPaM aPaM(pStart->nNode.GetNode(), pStart->nContent.GetIndex(),
- pStart->nNode.GetNode(), pStart->nContent.GetIndex() + 1);
- GetPaMAttr(&aPaM, aCharAttrSet);
-
StartUndo(SwUndoId::REPLACE, &aRewriter);
bStarted = true;
Push();
@@ -259,16 +248,6 @@ void SwWrtShell::Insert( const OUString &rStr )
bCallIns ?
SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
- if( bDeleted )
- {
- // tdf#79717 Restore formatting of the deleted selection
- SwPosition* pEnd = GetCursor()->Start();
- SwPaM aPaM(pEnd->nNode.GetNode(), pEnd->nContent.GetIndex() - rStr.getLength(),
- pEnd->nNode.GetNode(), pEnd->nContent.GetIndex());
-
- SetAttrSet(aCharAttrSet, SetAttrMode::DEFAULT, &aPaM);
- }
-
if( bStarted )
{
EndUndo();