Kaydet (Commit) 17dab5bf authored tarafından Michael Stahl's avatar Michael Stahl

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 9830fd36)

Change-Id: I5d0388cbc364e1f9dfb60ff9e83c7d2f101c69d8
üst 34140139
...@@ -1986,7 +1986,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) ...@@ -1986,7 +1986,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
{ {
sal_Bool bIsModified = IsModified(); sal_Bool bIsModified = IsModified();
sal_uLong nDate, nTime; sal_Int32 nDate;
sal_Int64 nTime;
if( pNewDateTime ) if( pNewDateTime )
{ {
nDate = pNewDateTime->GetDate(); nDate = pNewDateTime->GetDate();
......
...@@ -327,7 +327,8 @@ void SwHTMLParser::NewField() ...@@ -327,7 +327,8 @@ void SwHTMLParser::NewField()
case RES_TIMEFLD: case RES_TIMEFLD:
{ {
sal_uLong nNumFmt = 0; 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_uInt16 nSub = 0;
sal_Bool bValidFmt = sal_False; sal_Bool bValidFmt = sal_False;
HTMLNumFmtTblEntry * pFmtTbl; HTMLNumFmtTblEntry * pFmtTbl;
...@@ -337,7 +338,7 @@ void SwHTMLParser::NewField() ...@@ -337,7 +338,7 @@ void SwHTMLParser::NewField()
nSub = DATEFLD; nSub = DATEFLD;
pFmtTbl = aHTMLDateFldFmtTable; pFmtTbl = aHTMLDateFldFmtTable;
if( !aValue.isEmpty() ) if( !aValue.isEmpty() )
nDate = (sal_uLong)aValue.toInt32(); nDate = aValue.toInt32();
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment