tdf#136850 DOCX: fix change tracking in floating tables
Deleted text still reappeared as normal text in floating tables in the case of combination with tracked paragraph property changes. Follow-up of commit288db6eb47
(tdf#132271 DOCX: import change tracking in floating tables) and commit464a7b0631
(tdf#136667 DOCX import: fix crash of floating tables). Change-Id: I2c8f63054520ce28306c063ef638756f7d8342e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103832 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
This commit is contained in:
BIN
sw/qa/extras/ooxmlexport/data/tdf136850.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/tdf136850.docx
Normal file
Binary file not shown.
@@ -998,6 +998,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136667, "tdf136667.docx")
|
|||||||
assertXPath(pXmlDoc, "//w:ins", 4);
|
assertXPath(pXmlDoc, "//w:ins", 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136850, "tdf136850.docx")
|
||||||
|
{
|
||||||
|
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
|
||||||
|
// import change tracking in floating tables
|
||||||
|
assertXPath(pXmlDoc, "//w:del");
|
||||||
|
}
|
||||||
|
|
||||||
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128156, "tdf128156.docx")
|
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128156, "tdf128156.docx")
|
||||||
{
|
{
|
||||||
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
|
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
|
||||||
|
@@ -6809,11 +6809,12 @@ void DomainMapper_Impl::ExecuteFrameConversion()
|
|||||||
{
|
{
|
||||||
if( m_xFrameStartRange.is() && m_xFrameEndRange.is() && !m_bDiscardHeaderFooter )
|
if( m_xFrameStartRange.is() && m_xFrameEndRange.is() && !m_bDiscardHeaderFooter )
|
||||||
{
|
{
|
||||||
|
std::vector<sal_Int32> redPos, redLen;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( GetTopTextAppend(), uno::UNO_QUERY_THROW );
|
uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( GetTopTextAppend(), uno::UNO_QUERY_THROW );
|
||||||
// convert redline ranges to cursor movement and character length
|
// convert redline ranges to cursor movement and character length
|
||||||
std::vector<sal_Int32> redPos, redLen;
|
|
||||||
for( size_t i = 0; i < aFramedRedlines.size(); i+=3)
|
for( size_t i = 0; i < aFramedRedlines.size(); i+=3)
|
||||||
{
|
{
|
||||||
uno::Reference< text::XTextRange > xRange;
|
uno::Reference< text::XTextRange > xRange;
|
||||||
@@ -6863,6 +6864,19 @@ void DomainMapper_Impl::ExecuteFrameConversion()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_bIsActualParagraphFramed = false;
|
m_bIsActualParagraphFramed = false;
|
||||||
|
|
||||||
|
if (redPos.size() == aFramedRedlines.size()/3)
|
||||||
|
{
|
||||||
|
for( sal_Int32 i = aFramedRedlines.size() - 1; i >= 0; --i)
|
||||||
|
{
|
||||||
|
// keep redlines of floating tables to process them in CloseSectionGroup()
|
||||||
|
if ( redPos[i/3] != -1 )
|
||||||
|
{
|
||||||
|
aFramedRedlines.erase(aFramedRedlines.begin() + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
aFramedRedlines.clear();
|
aFramedRedlines.clear();
|
||||||
}
|
}
|
||||||
m_xFrameStartRange = nullptr;
|
m_xFrameStartRange = nullptr;
|
||||||
|
Reference in New Issue
Block a user