[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sd/qa sfx2/source
Jan Holesovsky
kendy at collabora.com
Fri Jun 6 12:56:20 PDT 2014
sd/qa/unit/HtmlExportTest.cxx | 2 +-
sfx2/source/bastyp/frmhtmlw.cxx | 23 ++++++++---------------
2 files changed, 9 insertions(+), 16 deletions(-)
New commits:
commit c45565b4f46ff9c5ebb4bbf5dfe09d0d77ceeec6
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Jun 6 21:52:48 2014 +0200
html export: More standard time specification in <meta/>.
Change-Id: I1a62d12531029cc36fb8aeabecb9d92a8af837f7
diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx
index 388dfef..6064b28 100644
--- a/sd/qa/unit/HtmlExportTest.cxx
+++ b/sd/qa/unit/HtmlExportTest.cxx
@@ -46,7 +46,7 @@ public:
assertXPath(htmlDoc, "/html/head/meta[1]", "content", "text/html; charset=utf-8");
assertXPath(htmlDoc, "/html/head/meta[2]", "name", "generator");
assertXPath(htmlDoc, "/html/head/meta[3]", "name", "created");
- assertXPath(htmlDoc, "/html/head/meta[3]", "content", "20140409;170541987922038");
+ assertXPath(htmlDoc, "/html/head/meta[3]", "content", "2014-04-09T17:05:41.987922038");
}
CPPUNIT_TEST_SUITE(SdHTMLFilterTest);
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 93567e2..5d4f1ad 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -44,9 +44,7 @@
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
-
-
-
+#include <sax/tools/converter.hxx>
using namespace ::com::sun::star;
@@ -164,12 +162,10 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
// created
::util::DateTime uDT = i_xDocProps->getCreationDate();
- Date aD(uDT.Day, uDT.Month, uDT.Year);
- Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- OUString sOut = OUString::number(aD.GetDate());
- sOut += ";";
- sOut += OUString::number(aT.GetTime());
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_created, sOut, false,
+ OUStringBuffer aBuffer;
+ ::sax::Converter::convertTimeOrDateTime(aBuffer, uDT, 0);
+
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_created, aBuffer.makeStringAndClear(), false,
eDestEnc, pNonConvertableChars );
// changedby
@@ -180,12 +176,9 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
// changed
uDT = i_xDocProps->getModificationDate();
- Date aD2(uDT.Day, uDT.Month, uDT.Year);
- Time aT2(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- sOut = OUString::number(aD2.GetDate());
- sOut += ";";
- sOut += OUString::number(aT2.GetTime());
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changed, sOut, false,
+ ::sax::Converter::convertTimeOrDateTime(aBuffer, uDT, 0);
+
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changed, aBuffer.makeStringAndClear(), false,
eDestEnc, pNonConvertableChars );
// Subject
More information about the Libreoffice-commits
mailing list