summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-07-21 13:32:10 +0200
committerEike Rathke <erack@redhat.com>2017-07-21 19:26:43 +0200
commit252aab1b9dc1dbeace3087929a52e1248f043839 (patch)
tree2890b163a00aaed11c53bfb68c8dbd16325812a7 /sw
parentec340697d682bd7d0a361c8c701e513329c032bd (diff)
Eliminate DateTime::operator+=() and -=() with POD types
And make some tools::Time conversion ctors explicit to catch more oddities like automatic conversion from sal_Int64 that might be unintentional. Change-Id: If275297d86d6657544c056a712b862523e310e44 Reviewed-on: https://gerrit.libreoffice.org/40275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docufld.hxx2
-rw-r--r--sw/source/core/fields/flddat.cxx4
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx2
3 files changed, 4 insertions, 4 deletions
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 5cdeb3ff9030..440f31d306fb 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -465,7 +465,7 @@ public:
const DateTime& GetDateTime() const { return aDateTime; }
const Date GetDate() const { return Date(aDateTime.GetDate()); }
- const tools::Time GetTime() const { return aDateTime.GetTime(); }
+ const tools::Time GetTime() const { return tools::Time(aDateTime.GetTime()); }
sal_uInt32 GetPostItId() const { return m_nPostItId; }
/// Author
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index 5ae5da51a9c3..a611e088eb36 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -152,8 +152,8 @@ tools::Time SwDateTimeField::GetTime() const
{
double fDummy;
double fFract = modf(GetValue(), &fDummy);
- DateTime aDT(Date(static_cast<sal_Int32>(fDummy)), 0);
- aDT += fFract;
+ DateTime aDT(Date(static_cast<sal_Int32>(fDummy)));
+ aDT.AddTime(fFract);
return static_cast<tools::Time>(aDT);
}
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index a43d402e3add..4fca14fae575 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -573,7 +573,7 @@ void SwAnnotationWin::CheckMetaText()
{
sMeta = SwResId(STR_NODATE);
}
- if (GetTime()!=0)
+ if (GetTime().GetTime()!=0)
{
sMeta += " " + rLocalData.getTime( GetTime(),false );
}