[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/qa sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 5 08:49:29 UTC 2019
sw/qa/extras/ooxmlexport/data/tdf123054.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 6 ++
sw/source/core/doc/DocumentRedlineManager.cxx | 61 +++++++++++++-------------
3 files changed, 38 insertions(+), 29 deletions(-)
New commits:
commit bf26bf309c580f153dd6ca965d12f7193ca32754
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Fri Mar 8 22:35:46 2019 +0100
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Fri Apr 5 10:49:01 2019 +0200
tdf#123054 track changes: fix paragraph style regression
caused by the commit 173069a1f6ac060a06f04908a94a1a8420461795
"fix paragraph join with change tracking" and commit
1bbbe57dfc0b43d6b5444798d77dcdf5e4e76e49 "change tracking:
show layout changes at paragraph join".
Change-Id: I05203255b04094ae118fd4967398045d6e0ad9fa
Reviewed-on: https://gerrit.libreoffice.org/68947
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit b3265d6e11200a55a068902e2d78c2de374e973b)
Reviewed-on: https://gerrit.libreoffice.org/69034
Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123054.docx b/sw/qa/extras/ooxmlexport/data/tdf123054.docx
new file mode 100644
index 000000000000..d857479d5add
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf123054.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 906634c4da99..23958351a91b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -946,6 +946,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf1
assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del");
}
+DECLARE_OOXMLIMPORT_TEST(testTdf123054, "tdf123054.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(OUString("No Spacing"),
+ getProperty<OUString>(getParagraph(20), "ParaStyleName"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 7704057b0c77..029d48e03614 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1897,37 +1897,40 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
}
else
{
- if (pStt->nContent == 0)
+ if ( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() )
{
- // tdf#54819 to keep the style of the paragraph
- // after the fully deleted paragraphs (normal behaviour
- // of editing without change tracking), we copy its style
- // to the first removed paragraph.
- SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode();
- SwTextNode* pTextNode = pEnd->nNode.GetNode().GetTextNode();
- if (pDelNode != nullptr && pTextNode != nullptr && pDelNode != pTextNode)
- pTextNode->CopyCollFormat( *pDelNode );
- }
- else if ( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() )
- {
- // tdf#119571 update the style of the joined paragraph
- // after a partially deleted paragraph to show its correct style
- // in "Show changes" mode, too. All removed paragraphs
- // get the style of the first (partially deleted) paragraph
- // to avoid text insertion with bad style in the deleted
- // area later.
- SwContentNode* pDelNd = pStt->nNode.GetNode().GetContentNode();
- SwContentNode* pTextNd = pEnd->nNode.GetNode().GetContentNode();
- SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode();
- SwTextNode* pTextNode;
- SwNodeIndex aIdx( pEnd->nNode.GetNode() );
-
- while (pDelNode != nullptr && pTextNd != nullptr && pDelNd->GetIndex() < pTextNd->GetIndex())
+ if ( pStt->nContent == 0 )
{
- pTextNode = pTextNd->GetTextNode();
- if (pTextNode && pDelNode != pTextNode )
- pDelNode->CopyCollFormat( *pTextNode );
- pTextNd = SwNodes::GoPrevious( &aIdx );
+ // tdf#54819 to keep the style of the paragraph
+ // after the fully deleted paragraphs (normal behaviour
+ // of editing without change tracking), we copy its style
+ // to the first removed paragraph.
+ SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode();
+ SwTextNode* pTextNode = pEnd->nNode.GetNode().GetTextNode();
+ if (pDelNode != nullptr && pTextNode != nullptr && pDelNode != pTextNode)
+ pTextNode->CopyCollFormat( *pDelNode );
+ }
+ else
+ {
+ // tdf#119571 update the style of the joined paragraph
+ // after a partially deleted paragraph to show its correct style
+ // in "Show changes" mode, too. All removed paragraphs
+ // get the style of the first (partially deleted) paragraph
+ // to avoid text insertion with bad style in the deleted
+ // area later.
+ SwContentNode* pDelNd = pStt->nNode.GetNode().GetContentNode();
+ SwContentNode* pTextNd = pEnd->nNode.GetNode().GetContentNode();
+ SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode();
+ SwTextNode* pTextNode;
+ SwNodeIndex aIdx( pEnd->nNode.GetNode() );
+
+ while (pDelNode != nullptr && pTextNd != nullptr && pDelNd->GetIndex() < pTextNd->GetIndex())
+ {
+ pTextNode = pTextNd->GetTextNode();
+ if (pTextNode && pDelNode != pTextNode )
+ pDelNode->CopyCollFormat( *pTextNode );
+ pTextNd = SwNodes::GoPrevious( &aIdx );
+ }
}
}
bool const ret = mpRedlineTable->Insert( pNewRedl );
More information about the Libreoffice-commits
mailing list