summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-05-17 11:28:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-05-17 21:03:12 +0200
commit649313625b94e6b879848fc19b607b74375100bf (patch)
treedaa8993fe967cbfdad18aabac1635f7ded1977c2 /sw
parent3a667101987ccbc75024942d779c8c62a4d0a296 (diff)
New o3tl::temporary to simplify calls of std::modf
...that ignore the out-parameter integral part Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca Reviewed-on: https://gerrit.libreoffice.org/54474 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/bastyp/calc.cxx5
-rw-r--r--sw/source/core/fields/flddat.cxx4
2 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index c1cbfdfb841d..30a1ca83a5ab 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -38,6 +38,7 @@
#include <editeng/unolingu.hxx>
#include <expfld.hxx>
#include <hintids.hxx>
+#include <o3tl/temporary.hxx>
#include <osl/diagnose.hxx>
#include <rtl/math.hxx>
#include <shellres.hxx>
@@ -1195,8 +1196,8 @@ SwSbxValue SwCalc::Prim()
GetToken();
double right = Prim().GetDouble();
- double fraction, integer;
- fraction = modf( right, &integer );
+ double fraction;
+ fraction = modf( right, &o3tl::temporary(double()) );
if( ( dleft < 0.0 && 0.0 != fraction ) ||
( 0.0 == dleft && right < 0.0 ) )
{
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index aac0b4def6aa..6cb2f930b492 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <o3tl/any.hxx>
+#include <o3tl/temporary.hxx>
#include <tools/datetime.hxx>
#include <svl/zforlist.hxx>
#include <com/sun/star/util/DateTime.hpp>
@@ -150,8 +151,7 @@ Date SwDateTimeField::GetDate() const
tools::Time SwDateTimeField::GetTime() const
{
- double fDummy;
- double fFract = modf(GetValue(), &fDummy);
+ double fFract = modf(GetValue(), &o3tl::temporary(double()));
DateTime aDT( DateTime::EMPTY );
aDT.AddTime(fFract);
return static_cast<tools::Time>(aDT);