[Libreoffice-commits] core.git: oox/source sw/qa
Ravindra_Vidhate
ravindra.vidhate at synerzip.com
Thu Apr 30 05:20:10 PDT 2015
oox/source/docprop/docprophandler.cxx | 3 ++-
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
New commits:
commit fa38941a10832130ea8c8b86fac2468e79689585
Author: Ravindra_Vidhate <ravindra.vidhate at synerzip.com>
Date: Wed Apr 22 17:15:10 2015 +0530
tdf#38693: Document property TotalTime misinterpreted as seconds
Problem Description :
The xlsx file has the extended document property <TotalTime>#n</TotalTime> in /docProps/app.xml
LibreOffice appears to read this as a a total editing time of in second_ but according to ECMA-376 2nd edition:
22.2.2.27 TotalTime (Total Edit Time Metadata Element)
Total time that a document has been edited.
The default time unit is minutes.
(ECMA-376 1st edition has the same statement in 7.2.2.27)
XML difference: None
After RT : None
Solution :
As LO uses the TotalTime in seconds, while importing the TotalTime,
the TotalTime mentioned in the app.xml [which is in minutes] converted it to seconds.
TODO: Writing a UT seems to be tricky for this change.
Need to analyze and will raise the UT in separate CL.
Change-Id: Icbe998b9881ac241a9147628573bab6ef63582c4
Reviewed-on: https://gerrit.libreoffice.org/15479
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index 4d04f50..1a5000b 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -480,7 +480,8 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars )
case EXTPR_TOKEN( TotalTime ):
try
{
- m_xDocProp->setEditingDuration( aChars.toInt32() );
+ // The TotalTime is in mins as per ECMA specification.
+ m_xDocProp->setEditingDuration( aChars.toInt32() * 60 );
}
catch (lang::IllegalArgumentException &)
{
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index fa80679..9121588 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -580,7 +580,7 @@ DECLARE_OOXMLEXPORT_TEST(testEditTime, "fdo81341.docx")
//Ensure that EditTime is written inside w:fldChar in "HH:MM:SS" format.
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar", "fldCharType", "begin");
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:fldChar", "fldCharType", "separate");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:t", "00:00:05");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:t", "00:05");
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:fldChar", "fldCharType", "end");
}
}
More information about the Libreoffice-commits
mailing list