24 #include <tools/datetime.hxx>
26 #include <com/sun/star/util/DateTime.hpp>
40 return std::make_unique<SwDateTimeFieldType>(
GetDoc());
83 std::unique_ptr<SwDateTimeField> pTmp(
91 return std::unique_ptr<SwField>(pTmp.release());
126 double fResult = rDT -
DateTime(rNullDate);
146 Date aDate = rNullDate + nVal;
170 rVal <<= static_cast<sal_Int32>(
GetFormat());
173 rVal <<= static_cast<sal_Int32>(
m_nOffset);
193 if(*o3tl::doAccess<bool>(rVal))
212 util::DateTime aDateTimeValue;
213 if(!(rVal >>= aDateTimeValue))
216 aDateTime.
SetNanoSec(aDateTimeValue.NanoSeconds);
217 aDateTime.
SetSec(aDateTimeValue.Seconds);
218 aDateTime.
SetMin(aDateTimeValue.Minutes);
219 aDateTime.
SetHour(aDateTimeValue.Hours);
220 aDateTime.
SetDay(aDateTimeValue.Day);
221 aDateTime.
SetMonth(aDateTimeValue.Month);
222 aDateTime.
SetYear(aDateTimeValue.Year);
virtual double GetValue() const override
virtual void SetSubType(sal_uInt16 nSub) override
#define FIELD_PROP_DATE_TIME
LanguageType GetLanguage() const
Language at field position.
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
virtual OUString GetPar2() const override
virtual sal_uInt16 GetSubType() const override
static double GetDateTime(SwDoc &rDoc, const DateTime &rDT)
The root element of a Writer document layout.
#define FIELD_PROP_SUBTYPE
void SetDateTime(const DateTime &rDT)
virtual std::unique_ptr< SwField > Copy() const override
#define FIELD_PROP_FORMAT
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId)
virtual std::unique_ptr< SwFieldType > Copy() const override
virtual void SetPar2(const OUString &rStr) override
void SetYear(sal_Int16 nNewYear)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
css::util::DateTime GetUNODateTime() const
void SetDay(sal_uInt16 nNewDay)
bool IsAutomaticLanguage() const
tools::Time GetTime() const
SwFieldType * GetTyp() const
constexpr T & temporary(T &&x)
SwDateTimeField(SwDateTimeFieldType *pType, sal_uInt16 nSubType=DATEFLD, sal_uLong nFormat=0, LanguageType nLng=LANGUAGE_SYSTEM)
Fields containing values that have to be formatted via number formatter.
void AddTime(double fTimeInDays)
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
SwDateTimeFieldType(SwDoc *pDoc)
void ChangeFormat(sal_uInt32 n)
virtual void SetValue(const double &rVal)
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nMId) override
virtual double GetValue() const
void SetMonth(sal_uInt16 nNewMonth)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nMId) const override