summaryrefslogtreecommitdiff
path: root/include/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-15 13:55:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-18 13:16:23 +0200
commit7d14555ef7e867c5b1a0e195e3ef056885697c59 (patch)
treeaf39963caf1328d41756e4463a2a39019448026d /include/editeng
parent0083b33650c2f584ceff6eeaf9ef6993bfe0ae9b (diff)
convert SvxDateFormat to scoped enum
And simplify the code in sd/headerfooterdlg, no need for the complex encoding of date and time when we can just index into a static array. Change-Id: I677400bf1f956c81eba665b71dbda9183b63f55c Reviewed-on: https://gerrit.libreoffice.org/42346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/editeng')
-rw-r--r--include/editeng/flditem.hxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx
index addb6974493e..06424ee34418 100644
--- a/include/editeng/flditem.hxx
+++ b/include/editeng/flditem.hxx
@@ -83,17 +83,18 @@ public:
enum class SvxDateType { Fix, Var };
-enum SvxDateFormat { SVXDATEFORMAT_APPDEFAULT = 0, // Set as in App
- SVXDATEFORMAT_SYSTEM, // Set as in System
- SVXDATEFORMAT_STDSMALL,
- SVXDATEFORMAT_STDBIG,
- SVXDATEFORMAT_A, // 13.02.96
- SVXDATEFORMAT_B, // 13.02.1996
- SVXDATEFORMAT_C, // 13.Feb 1996
- SVXDATEFORMAT_D, // 13.February 1996
- SVXDATEFORMAT_E, // Tue, 13.February 1996
- SVXDATEFORMAT_F // Tuesday, 13.February 1996
- };
+enum class SvxDateFormat {
+ AppDefault = 0, // Set as in App
+ System, // Set as in System
+ StdSmall,
+ StdBig,
+ A, // 13.02.96
+ B, // 13.02.1996
+ C, // 13.Feb 1996
+ D, // 13.February 1996
+ E, // Tue, 13.February 1996
+ F // Tuesday, 13.February 1996
+};
class EDITENG_DLLPUBLIC SvxDateField : public SvxFieldData
{
@@ -107,7 +108,7 @@ public:
SvxDateField();
explicit SvxDateField( const Date& rDate,
SvxDateType eType,
- SvxDateFormat eFormat = SVXDATEFORMAT_STDSMALL );
+ SvxDateFormat eFormat = SvxDateFormat::StdSmall );
sal_Int32 GetFixDate() const { return nFixDate; }
void SetFixDate( const Date& rDate ) { nFixDate = rDate.GetDate(); }
@@ -407,7 +408,9 @@ public:
SV_DECL_PERSIST1( SvxDateTimeField, css::text::textfield::Type::PRESENTATION_DATE_TIME )
SvxDateTimeField();
- static OUString GetFormatted( Date const & rDate, tools::Time const & rTime, int eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage );
+ static OUString GetFormatted( Date const & rDate, tools::Time const & rTime,
+ SvxDateFormat eDateFormat, SvxTimeFormat eTimeFormat,
+ SvNumberFormatter& rFormatter, LanguageType eLanguage );
virtual SvxFieldData* Clone() const override;
virtual bool operator==( const SvxFieldData& ) const override;