Bugzilla – Attachment 173051 Details for
Bug 104945
Problems copying two different list styles - both added to same existing list on paste (comment 9)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
104945_patch.diff: the patch which I don't dare to submit
104945_patch.diff (text/plain), 3.23 KB, created by
Justin L
on 2021-06-21 09:14:43 UTC
(
hide
)
Description:
104945_patch.diff: the patch which I don't dare to submit
Filename:
MIME Type:
Creator:
Justin L
Created:
2021-06-21 09:14:43 UTC
Size:
3.23 KB
patch
obsolete
>From f9a5230afbc5ded388d052b73b58487b1e93cba6 Mon Sep 17 00:00:00 2001 >From: Justin Luth <justin_luth@sil.org> >Date: Sat, 08 May 2021 13:44:32 +0200 >Subject: [PATCH] tdf#104945 sw: don't propogate num rule if multiple rules pasted > >It makes sense to convert a paste into the most recent list >in some circumstances. >However, if the copy contains several different lists, >then don't convert any of them during the paste. > >There is one problem I found - when copying a WHOLE >rule, the endNd will be a textnode. So in that case >it never integrates, but it used to b/c Dest->IsInList(). > >Change-Id: Ifdd86095f8d30ad765a0a4a73f384a7ff91c3833 >--- > >diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx >index 88fd787..6499d03 100644 >--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx >+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx >@@ -447,28 +447,34 @@ > } > > // #i86492# >- bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam ) >+ bool lcl_ContainsOnlyParagraphsInSameList(const SwPaM& rPam, bool bPastingIntoList) > { > bool bRet = false; > > const SwTextNode* pTextNd = rPam.Start()->nNode.GetNode().GetTextNode(); > const SwTextNode* pEndTextNd = rPam.End()->nNode.GetNode().GetTextNode(); >- if ( pTextNd && pTextNd->IsInList() && >- pEndTextNd && pEndTextNd->IsInList() ) >+ const bool bEndIsInList = pEndTextNd && pEndTextNd->IsInList(); >+ // If bPastingIntoList, then treat regular paragraphs as (potential) list items. >+ if (pTextNd && pEndTextNd && (bPastingIntoList || bEndIsInList)) > { >+ if (pTextNd == pEndTextNd) >+ return true; >+ > bRet = true; > SwNodeIndex aIdx(rPam.Start()->nNode); >- >+ const SwNumRule* pEndNumRule = pEndTextNd->GetNumRule(); >+ const OUString& sEndListId = pEndTextNd->GetListId(); > do > { >- ++aIdx; >- pTextNd = aIdx.GetNode().GetTextNode(); >- >- if ( !pTextNd || !pTextNd->IsInList() ) >+ if (!pTextNd || pTextNd->IsInList() != bEndIsInList >+ || pTextNd->GetNumRule() != pEndNumRule >+ || pTextNd->GetListId() != sEndListId) > { > bRet = false; > break; > } >+ ++aIdx; >+ pTextNd = aIdx.GetNode().GetTextNode(); > } while (pTextNd != pEndTextNd); > } > >@@ -4802,14 +4808,8 @@ > pNumRuleToPropagate = > rDoc.SearchNumRule( rPos, false, false, false, 0, aListIdToPropagate, nullptr, true ); > } >- // #i86492# >- // Do not propagate previous found list, if >- // - destination is an empty paragraph which is not in a list and >- // - source contains at least one paragraph which is not in a list >- if ( pNumRuleToPropagate && >- pDestTextNd && !pDestTextNd->GetText().getLength() && >- !pDestTextNd->IsInList() && >- !lcl_ContainsOnlyParagraphsInList( rPam ) ) >+ if (pNumRuleToPropagate >+ && !lcl_ContainsOnlyParagraphsInSameList(rPam, pDestTextNd && pDestTextNd->IsInList())) > { > pNumRuleToPropagate = nullptr; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 104945
:
129967
|
129969
|
129970
|
133039
|
133040
|
133041
|
171765
|
171766
|
171769
|
171770
|
171789
| 173051