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:32:27 +0100
commit9b498bb45b34a474b666107265896d69707472d1 (patch)
tree2658ecb001128fddcc8c71d55904ff5b0e9e26fb
parentd7a6b5b24a339b7e4c5f30cde28b887b0dd8712b (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 (cherry picked from commit 17dab5bf8efb3fd676e6854474b199b681d0dc28)
-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
{