summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svhtml/parhtml.cxx34
1 files changed, 23 insertions, 11 deletions
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index c09ecc59c58c..3bddc50595de 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -29,6 +29,7 @@
#include <tools/tenccvt.hxx>
#include <tools/datetime.hxx>
+#include <unotools/datetime.hxx>
#include <svl/inettype.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -1993,18 +1994,29 @@ bool HTMLParser::ParseMetaOptionsImpl(
case HTML_META_CREATED:
case HTML_META_CHANGED:
- if ( i_xDocProps.is() && !aContent.isEmpty() &&
- comphelper::string::getTokenCount(aContent, ';') == 2 )
+ if (i_xDocProps.is() && !aContent.isEmpty())
{
- Date aDate( (sal_uLong)aContent.getToken(0, ';').toInt32() );
- tools::Time aTime( (sal_uLong)aContent.getToken(1, ';').toInt32() );
- DateTime aDateTime( aDate, aTime );
- ::util::DateTime uDT = aDateTime.GetUNODateTime();
- if ( HTML_META_CREATED==nAction )
- i_xDocProps->setCreationDate( uDT );
- else
- i_xDocProps->setModificationDate( uDT );
- bChanged = true;
+ ::util::DateTime uDT;
+ bool valid = false;
+ if (comphelper::string::getTokenCount(aContent, ';') == 2)
+ {
+ Date aDate((sal_uLong)aContent.getToken(0, ';').toInt32());
+ tools::Time aTime((sal_uLong)aContent.getToken(1, ';').toInt32());
+ DateTime aDateTime(aDate, aTime);
+ uDT = aDateTime.GetUNODateTime();
+ valid = true;
+ }
+ else if (utl::ISO8601parseDateTime(aContent, uDT))
+ valid = true;
+
+ if (valid)
+ {
+ bChanged = true;
+ if (HTML_META_CREATED == nAction)
+ i_xDocProps->setCreationDate(uDT);
+ else
+ i_xDocProps->setModificationDate(uDT);
+ }
}
break;