diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-01 21:30:57 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-01 21:30:57 -0500 |
commit | 051fb0d37a1f1c05ac5876fcfcc9a589938780e4 (patch) | |
tree | 0b573e200bfc4298c2bf277d5cd238f61c5417f1 /sc/inc/unitconv.hxx | |
parent | 67748256612046759bf4141c6c08f023585d11d5 (diff) |
Unit converter data no longer relies on StrCollection.
Diffstat (limited to 'sc/inc/unitconv.hxx')
-rw-r--r-- | sc/inc/unitconv.hxx | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/sc/inc/unitconv.hxx b/sc/inc/unitconv.hxx index be51d3cf3de6..2b000fb1e63a 100644 --- a/sc/inc/unitconv.hxx +++ b/sc/inc/unitconv.hxx @@ -31,42 +31,41 @@ #include "collect.hxx" +#include <boost/noncopyable.hpp> +#include <boost/ptr_container/ptr_map.hpp> -class ScUnitConverterData : public StrData +class ScUnitConverterData { - double fValue; - + rtl::OUString maIndexString; + double mfValue; // not implemented - ScUnitConverterData& operator=( const ScUnitConverterData& ); + ScUnitConverterData& operator=( const ScUnitConverterData& ); public: - ScUnitConverterData( const String& rFromUnit, - const String& rToUnit, double fValue = 1.0 ); - ScUnitConverterData( const ScUnitConverterData& ); - virtual ~ScUnitConverterData() {}; - - virtual ScDataObject* Clone() const; + ScUnitConverterData( const rtl::OUString& rFromUnit, + const rtl::OUString& rToUnit, double fValue = 1.0 ); + ScUnitConverterData( const ScUnitConverterData& ); + ~ScUnitConverterData(); - double GetValue() const { return fValue; } - - static void BuildIndexString( String& rStr, - const String& rFromUnit, const String& rToUnit ); + double GetValue() const; + const rtl::OUString& GetIndexString() const; + static rtl::OUString BuildIndexString( + const rtl::OUString& rFromUnit, const rtl::OUString& rToUnit ); }; -class ScUnitConverter : public ScStrCollection +class ScUnitConverter : public boost::noncopyable { - // not implemented - ScUnitConverter( const ScUnitConverter& ); - ScUnitConverter& operator=( const ScUnitConverter& ); + typedef boost::ptr_map<rtl::OUString, ScUnitConverterData> MapType; + MapType maData; public: - ScUnitConverter( sal_uInt16 nInit = 16, sal_uInt16 nDelta = 4 ); - virtual ~ScUnitConverter() {}; + ScUnitConverter(); + ~ScUnitConverter(); - sal_Bool GetValue( double& fValue, const String& rFromUnit, - const String& rToUnit ) const; + bool GetValue( + double& fValue, const rtl::OUString& rFromUnit, const rtl::OUString& rToUnit ) const; }; |