summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-09 21:45:16 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-10 15:28:52 +0100
commit17dab5bf8efb3fd676e6854474b199b681d0dc28 (patch)
tree8ce0566de8f9befde91cff3b1f0301814ceecebc
parent34140139840a181157690038fe845f5b33866b10 (diff)
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
-rw-r--r--sw/source/core/doc/docfld.cxx3
-rw-r--r--sw/source/filter/html/htmlfld.cxx5
2 files changed, 5 insertions, 3 deletions
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
{