[Libreoffice-commits] core.git: include/svx svx/source

Stephan Bergmann sbergman at redhat.com
Wed Jun 29 12:03:15 UTC 2016


 include/svx/numfmtsh.hxx      |    2 -
 svx/source/items/numfmtsh.cxx |   57 ++++++++++++++++++++++--------------------
 2 files changed, 30 insertions(+), 29 deletions(-)

New commits:
commit bc578df9aed185b79bd42c9ffe95186d800fff59
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 29 14:02:47 2016 +0200

    loplugin:staticmethods
    
    Change-Id: I0f1be4e783dfa039cf8cec085df9827adbd56b35

diff --git a/include/svx/numfmtsh.hxx b/include/svx/numfmtsh.hxx
index 6c4f6eb..7e0d8cc 100644
--- a/include/svx/numfmtsh.hxx
+++ b/include/svx/numfmtsh.hxx
@@ -130,8 +130,6 @@ public:
 
     sal_uInt16          GetFormatIntegerDigits( const OUString&  rFormat ) const;
 
-    double              GetDefaultValNum( const short nType ) const;
-
     void                MakePreviewString( const OUString& rFormatStr,
                                            OUString&       rPreviewStr,
                                            Color*&         rpFontColor );
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 878d388..67ad366 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -32,6 +32,36 @@
 
 #include <limits>
 
+namespace {
+
+double GetDefaultValNum( const short nType )
+{
+    switch( nType )
+    {
+        case css::util::NumberFormat::NUMBER:
+            return fSvxNumValConst[SVX_NUMVAL_STANDARD];
+        case css::util::NumberFormat::CURRENCY:
+            return fSvxNumValConst[SVX_NUMVAL_CURRENCY];
+        case css::util::NumberFormat::PERCENT:
+            return fSvxNumValConst[SVX_NUMVAL_PERCENT];
+        case css::util::NumberFormat::DATE:
+        case css::util::NumberFormat::DATETIME:
+            return fSvxNumValConst[SVX_NUMVAL_DATE];
+        case css::util::NumberFormat::TIME:
+            return fSvxNumValConst[SVX_NUMVAL_TIME];
+        case css::util::NumberFormat::SCIENTIFIC:
+            return fSvxNumValConst[SVX_NUMVAL_SCIENTIFIC];
+        case css::util::NumberFormat::FRACTION:
+            return fSvxNumValConst[SVX_NUMVAL_FRACTION];
+        case css::util::NumberFormat::LOGICAL:
+            return fSvxNumValConst[SVX_NUMVAL_BOOLEAN];
+        default: break;
+    }
+    return fSvxNumValConst[SVX_NUMVAL_NOVALUE];
+}
+
+}
+
 SvxNumberFormatShell* SvxNumberFormatShell::Create( SvNumberFormatter* pNumFormatter,
                                               sal_uInt32           nFormatKey,
                                               SvxNumberValueType   eNumValType,
@@ -406,33 +436,6 @@ void SvxNumberFormatShell::GetOptions( const OUString&  rFormat,
 }
 
 
-double SvxNumberFormatShell::GetDefaultValNum( const short nType ) const
-{
-    switch( nType )
-    {
-        case css::util::NumberFormat::NUMBER:
-            return fSvxNumValConst[SVX_NUMVAL_STANDARD];
-        case css::util::NumberFormat::CURRENCY:
-            return fSvxNumValConst[SVX_NUMVAL_CURRENCY];
-        case css::util::NumberFormat::PERCENT:
-            return fSvxNumValConst[SVX_NUMVAL_PERCENT];
-        case css::util::NumberFormat::DATE:
-        case css::util::NumberFormat::DATETIME:
-            return fSvxNumValConst[SVX_NUMVAL_DATE];
-        case css::util::NumberFormat::TIME:
-            return fSvxNumValConst[SVX_NUMVAL_TIME];
-        case css::util::NumberFormat::SCIENTIFIC:
-            return fSvxNumValConst[SVX_NUMVAL_SCIENTIFIC];
-        case css::util::NumberFormat::FRACTION:
-            return fSvxNumValConst[SVX_NUMVAL_FRACTION];
-        case css::util::NumberFormat::LOGICAL:
-            return fSvxNumValConst[SVX_NUMVAL_BOOLEAN];
-        default: break;
-    }
-    return fSvxNumValConst[SVX_NUMVAL_NOVALUE];
-}
-
-
 void SvxNumberFormatShell::MakePreviewString( const OUString& rFormatStr,
                                               OUString&       rPreviewStr,
                                               Color*&         rpFontColor )


More information about the Libreoffice-commits mailing list