summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-06-15 22:55:59 +0200
committerEike Rathke <erack@redhat.com>2016-06-29 09:46:20 +0000
commit9724eaa94e1f1e58dbbba2ecad4287245e0f0bf0 (patch)
tree0c46b710a396e20f6fe27335bc1e8df27e520e71 /include
parentac265f6210452ee48c1766942a3a311aedc3cdcd (diff)
tdf#100413 Use same default values for preview string and format list
Add specific default values for: - scientific: to distinguish engineering notation - fraction: to have quarter format understandable Change-Id: I73b74713a4bc502e9967b8d2c9983cfc6244912e Reviewed-on: https://gerrit.libreoffice.org/26391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/flagsdef.hxx31
-rw-r--r--include/svx/numfmtsh.hxx5
2 files changed, 27 insertions, 9 deletions
diff --git a/include/svx/flagsdef.hxx b/include/svx/flagsdef.hxx
index eedea33e8323..fbf833d6902e 100644
--- a/include/svx/flagsdef.hxx
+++ b/include/svx/flagsdef.hxx
@@ -70,13 +70,30 @@ namespace o3tl
#define SVX_ENABLE_FLASH 0x04
-// copy from numfmt.hxx
-#define SVX_NUMVAL_STANDARD -1234.12345678901234
-#define SVX_NUMVAL_CURRENCY -1234
-#define SVX_NUMVAL_PERCENT -0.1295
-#define SVX_NUMVAL_TIME 36525.5678935185
-#define SVX_NUMVAL_DATE 36525.5678935185
-#define SVX_NUMVAL_BOOLEAN 1
+// Default values for Number Format Category List and Preview
+enum SvxNumValCategory
+{
+ SVX_NUMVAL_STANDARD = 0,
+ SVX_NUMVAL_PERCENT,
+ SVX_NUMVAL_CURRENCY,
+ SVX_NUMVAL_DATE,
+ SVX_NUMVAL_TIME,
+ SVX_NUMVAL_SCIENTIFIC,
+ SVX_NUMVAL_FRACTION,
+ SVX_NUMVAL_BOOLEAN,
+ SVX_NUMVAL_NOVALUE
+};
+const double fSvxNumValConst[] = {
+ -1234.56789012345678, // SVX_NUMVAL_STANDARD
+ -0.1295, // SVX_NUMVAL_PERCENT
+ -1234.0, // SVX_NUMVAL_CURRENCY
+ 36525.5678935185, // SVX_NUMVAL_DATE
+ 36525.5678935185, // SVX_NUMVAL_TIME
+ 12345.67889, // SVX_NUMVAL_SCIENTIFIC
+ 123.456, // SVX_NUMVAL_FRACTION
+ 1.0, // SVX_NUMVAL_BOOLEAN
+ 0.0 // SVX_NUMVAL_NOVALUE
+};
// copy from page.hxx
// enum ------------------------------------------------------------------
diff --git a/include/svx/numfmtsh.hxx b/include/svx/numfmtsh.hxx
index 179b597de497..6c4f6eb64db0 100644
--- a/include/svx/numfmtsh.hxx
+++ b/include/svx/numfmtsh.hxx
@@ -130,6 +130,8 @@ public:
sal_uInt16 GetFormatIntegerDigits( const OUString& rFormat ) const;
+ double GetDefaultValNum( const short nType ) const;
+
void MakePreviewString( const OUString& rFormatStr,
OUString& rPreviewStr,
Color*& rpFontColor );
@@ -177,8 +179,6 @@ public:
void SetUseStarFormat( bool bUse ) { bUseStarFormat = bUse; }
private:
- static const double DEFAULT_NUMVALUE;
-
SvNumberFormatter* pFormatter;
SvNumberFormatTable* pCurFmtTable;
SvxNumberValueType eValType;
@@ -197,6 +197,7 @@ private:
sal_uInt32 nCurCurrencyEntryPos;
std::vector<OUString> aCurrencyFormatList;
bool bUseStarFormat;
+ bool bIsDefaultValNum;
SVX_DLLPRIVATE short FillEntryList_Impl( std::vector<OUString>& rList );
SVX_DLLPRIVATE void FillEListWithStd_Impl( std::vector<OUString>& rList,sal_uInt16 aPrivCat, short &Pos);