From 17dab5bf8efb3fd676e6854474b199b681d0dc28 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 9 Dec 2013 21:45:16 +0100 Subject: fdo#70198: sw: don't truncate Time values on 32bit platforms SwDoc::SetFixFields() uses sal_uLong to store Time.GetTime() which needs 64 bits. Also fix same problem on Time fields in HTML import. (regression from 9830fd36dbdb72c79703b0c61efc027fba793c5a) Change-Id: I5d0388cbc364e1f9dfb60ff9e83c7d2f101c69d8 --- sw/source/core/doc/docfld.cxx | 3 ++- sw/source/filter/html/htmlfld.cxx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 372f3dfb3b27..c630109bb991 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1986,7 +1986,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) { sal_Bool bIsModified = IsModified(); - sal_uLong nDate, nTime; + sal_Int32 nDate; + sal_Int64 nTime; if( pNewDateTime ) { nDate = pNewDateTime->GetDate(); diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 00c7a43b153c..57015eeabf66 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -327,7 +327,8 @@ void SwHTMLParser::NewField() case RES_TIMEFLD: { sal_uLong nNumFmt = 0; - sal_uLong nTime = Time( Time::SYSTEM ).GetTime(), nDate = Date( Date::SYSTEM ).GetDate(); + sal_Int64 nTime = Time( Time::SYSTEM ).GetTime(); + sal_Int32 nDate = Date( Date::SYSTEM ).GetDate(); sal_uInt16 nSub = 0; sal_Bool bValidFmt = sal_False; HTMLNumFmtTblEntry * pFmtTbl; @@ -337,7 +338,7 @@ void SwHTMLParser::NewField() nSub = DATEFLD; pFmtTbl = aHTMLDateFldFmtTable; if( !aValue.isEmpty() ) - nDate = (sal_uLong)aValue.toInt32(); + nDate = aValue.toInt32(); } else { -- cgit