summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-05-24 10:51:16 +0200
committerLászló Németh <nemeth@numbertext.org>2022-05-25 09:56:53 +0200
commit2682828f73a6c759735613ec924357424baeae24 (patch)
tree69059d7b215943cc194f6d4a278ebeb9ad686a43 /xmloff
parentba2c5e05319181aa00357d66ba2fbaba20231bd3 (diff)
tdf#56266 sw xmloff: fix tracked deletions in insertions
RedlineSuccessorData export, i.e. tracked deletions within tracked insertions were loaded as plain tracked deletions during an ODF roundtrip. After that, e.g. rejecting all changes couldn't reject the lost tracked insertion, keeping the text of the tracked deletion as part of the original text by mistake. Regression from commit a9019e76812a947eb54cfa8d728c19361c929458 "INTEGRATION: CWS oasis (1.3.276); FILE MERGED 2004/05/12 11:00:37 mib 1.3.276.1: - #i20153#: changed <office:annotation> and <office:change-info>" Note: RedlineSuccessorData is still stored in an extra text:insertion within text:changed-region, only the not ODF-compatible office:chg-author and office:chg-date-time attributes were changed to dc:creator and dc:date elements in RedlineSuccessorData export: <text:changed-region> <text:deletion/> <text:insertion/> </text:changed-region> Because this structure still causes a bootstrap ODF validation error in the odfexport and layout tests, check the export with uitest. See also SetChangeInfo()/RedlineAdd(). Change-Id: Ic15c468172bd4d7ea1fd49d9b6610204f23d0036 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134860 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 6e5d4d79550a..eb8f8d68ad65 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -475,6 +475,7 @@ void XMLRedlineExport::ExportChangeInfo(
WriteComment( sTmp );
}
+// write RedlineSuccessorData
void XMLRedlineExport::ExportChangeInfo(
const Sequence<PropertyValue> & rPropertyValues)
{
@@ -482,6 +483,9 @@ void XMLRedlineExport::ExportChangeInfo(
bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(
SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo );
+ SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE,
+ XML_CHANGE_INFO, true, true);
+
for(const PropertyValue& rVal : rPropertyValues)
{
if( rVal.Name == "RedlineAuthor" )
@@ -490,9 +494,12 @@ void XMLRedlineExport::ExportChangeInfo(
rVal.Value >>= sTmp;
if (!sTmp.isEmpty())
{
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, bRemovePersonalInfo
- ? "Author" + OUString::number(rExport.GetInfoID(sTmp))
- : sTmp);
+ SvXMLElementExport aCreatorElem( rExport, XML_NAMESPACE_DC,
+ XML_CREATOR, true,
+ false );
+ rExport.Characters(bRemovePersonalInfo
+ ? "Author" + OUString::number(rExport.GetInfoID(sTmp))
+ : sTmp );
}
}
else if( rVal.Name == "RedlineComment" )
@@ -505,9 +512,12 @@ void XMLRedlineExport::ExportChangeInfo(
rVal.Value >>= aDateTime;
OUStringBuffer sBuf;
::sax::Converter::convertDateTime(sBuf, bRemovePersonalInfo
- ? util::DateTime(0, 0, 0, 0, 1, 1, 1970, true) // Epoch time
- : aDateTime, nullptr);
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME, sBuf.makeStringAndClear());
+ ? util::DateTime(0, 0, 0, 0, 1, 1, 1970, true) // Epoch time
+ : aDateTime, nullptr);
+ SvXMLElementExport aDateElem( rExport, XML_NAMESPACE_DC,
+ XML_DATE, true,
+ false );
+ rExport.Characters(sBuf.makeStringAndClear());
}
else if( rVal.Name == "RedlineType" )
{
@@ -520,10 +530,7 @@ void XMLRedlineExport::ExportChangeInfo(
// else: unknown value -> ignore
}
- // finally write element
- SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE,
- XML_CHANGE_INFO, true, true);
-
+ // finally write comment paragraphs
WriteComment( sComment );
}