diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-12-09 21:45:16 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-12-10 16:03:38 +0000 |
commit | 1a37462bb59f036b5b871e6f1361c4b2fd216481 (patch) | |
tree | dfcf7d1c27fc406611e3aee195cd24f0577b8467 | |
parent | fdo#72148 if expecting table at begin, explicitly set it so (diff) | |
download | core-1a37462bb59f036b5b871e6f1361c4b2fd216481.tar.gz core-1a37462bb59f036b5b871e6f1361c4b2fd216481.zip |
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)
(cherry picked from commit 17dab5bf8efb3fd676e6854474b199b681d0dc28)
Conflicts:
sw/source/filter/html/htmlfld.cxx
Change-Id: I5d0388cbc364e1f9dfb60ff9e83c7d2f101c69d8
Reviewed-on: https://gerrit.libreoffice.org/7020
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit f0d031c19c45d680b3d468c58a912da2a3ce4c78)
Reviewed-on: https://gerrit.libreoffice.org/7023
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index a78a59289742..941e79b03cd9 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1982,7 +1982,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 3213bfc30517..bcf06da75651 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.Len() ) - nDate = (sal_uLong)aValue.ToInt32(); + nDate = aValue.ToInt32(); } else { |