diff options
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | svtools/source/table/cellvalueconversion.cxx | 49 |
2 files changed, 20 insertions, 30 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index d8b042589678..a5461e1d47fd 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -260,7 +260,6 @@ merge svt::IEditImplementation with svt::GenericEditImplementation merge svt::IEnumerationResultHandler with SvtFileView_Impl merge svt::IFilePickerController with SvtFileDialog_Base merge svt::IFilePickerListener with SvtFilePicker -merge svt::IValueNormalization with svt::StandardFormatNormalizer merge svt::table::IAccessibleTable with svt::table::TableControl merge svt::table::IAccessibleTableControl with accessibility::AccessibleGridControlAccess merge svt::table::IColumnModel with svt::table::UnoGridColumnFacade diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx index 32315c221c6c..0fa47bda9fbe 100644 --- a/svtools/source/table/cellvalueconversion.cxx +++ b/svtools/source/table/cellvalueconversion.cxx @@ -80,30 +80,12 @@ namespace svt } - //= IValueNormalization - - class SAL_NO_VTABLE IValueNormalization - { - public: - virtual ~IValueNormalization() { } - - /** converts the given <code>Any</code> into a <code>double</code> value to be fed into a number formatter - */ - virtual double convertToDouble( Any const & i_value ) const = 0; - - /** returns the format key to be used for formatting values - */ - virtual ::sal_Int32 getFormatKey() const = 0; - }; - - typedef std::shared_ptr< IValueNormalization > PValueNormalization; - typedef std::unordered_map< OUString, PValueNormalization, OUStringHash > NormalizerCache; - - //= CellValueConversion_Data - + class StandardFormatNormalizer; struct CellValueConversion_Data { + typedef std::unordered_map< OUString, std::shared_ptr< StandardFormatNormalizer >, OUStringHash > NormalizerCache; + Reference< XNumberFormatter > xNumberFormatter; bool bAttemptedFormatterCreation; NormalizerCache aNormalizers; @@ -119,8 +101,20 @@ namespace svt //= StandardFormatNormalizer - class StandardFormatNormalizer : public IValueNormalization + class StandardFormatNormalizer { + public: + /** converts the given <code>Any</code> into a <code>double</code> value to be fed into a number formatter + */ + virtual double convertToDouble( Any const & i_value ) const = 0; + + /** returns the format key to be used for formatting values + */ + sal_Int32 getFormatKey() const + { + return m_nFormatKey; + } + protected: StandardFormatNormalizer( Reference< XNumberFormatter > const & i_formatter, ::sal_Int32 const i_numberFormatType ) :m_nFormatKey( 0 ) @@ -138,10 +132,7 @@ namespace svt } } - virtual ::sal_Int32 getFormatKey() const SAL_OVERRIDE - { - return m_nFormatKey; - } + virtual ~StandardFormatNormalizer() {} private: ::sal_Int32 m_nFormatKey; @@ -351,9 +342,9 @@ namespace svt bool lcl_getValueNormalizer( CellValueConversion_Data & io_data, Type const & i_valueType, - PValueNormalization & o_formatter ) + std::shared_ptr< StandardFormatNormalizer > & o_formatter ) { - NormalizerCache::const_iterator pos = io_data.aNormalizers.find( i_valueType.getTypeName() ); + CellValueConversion_Data::NormalizerCache::const_iterator pos = io_data.aNormalizers.find( i_valueType.getTypeName() ); if ( pos == io_data.aNormalizers.end() ) { // never encountered this type before @@ -432,7 +423,7 @@ namespace svt { if ( lcl_ensureNumberFormatter( *m_pData ) ) { - PValueNormalization pNormalizer; + std::shared_ptr< StandardFormatNormalizer > pNormalizer; if ( lcl_getValueNormalizer( *m_pData, i_value.getValueType(), pNormalizer ) ) { try |