diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-22 17:22:08 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-22 17:28:16 -0500 |
commit | d69bda6300f2a2035d1754d8a33e4bba56a47607 (patch) | |
tree | 2bef86b377a1fe89fbdc2c36b31a85dc1178649c | |
parent | b5339f0d299b0fd080fa278b0223afdf4fd65eeb (diff) |
Make NfCurrencyTable a separate header & forward-declare it in zforlist.hxx.
Change-Id: I17b52c277ab6ec8b15e88729feee0a269b75087d
-rw-r--r-- | cui/source/options/optgdlg.cxx | 1 | ||||
-rw-r--r-- | include/svl/currencytable.hxx | 40 | ||||
-rw-r--r-- | include/svl/zforlist.hxx | 4 | ||||
-rw-r--r-- | svl/Library_svl.mk | 1 | ||||
-rw-r--r-- | svl/source/numbers/currencytable.cxx | 52 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/numfmtsh.cxx | 1 |
7 files changed, 99 insertions, 4 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 29e1387354c6..e68743da2310 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -18,6 +18,7 @@ */ #include <svl/zforlist.hxx> +#include <svl/currencytable.hxx> #include <svtools/grfmgr.hxx> #include <svl/flagitem.hxx> #include <sfx2/dispatch.hxx> diff --git a/include/svl/currencytable.hxx b/include/svl/currencytable.hxx new file mode 100644 index 000000000000..940a584fb1d6 --- /dev/null +++ b/include/svl/currencytable.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_SVL_CURRENCYTABLE_HXX +#define INCLUDED_SVL_CURRENCYTABLE_HXX + +#include <svl/svldllapi.h> +#include <svl/zforlist.hxx> +#include <boost/ptr_container/ptr_vector.hpp> + +class SVL_DLLPUBLIC NfCurrencyTable +{ + typedef boost::ptr_vector<NfCurrencyEntry> DataType; + DataType maData; +public: + typedef DataType::iterator iterator; + typedef DataType::const_iterator const_iterator; + + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + + NfCurrencyEntry& operator[] ( size_t i ); + const NfCurrencyEntry& operator[] ( size_t i ) const; + + size_t size() const; + + void insert( iterator it, NfCurrencyEntry* p ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index babaeda80011..7607af724b7d 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -34,7 +34,6 @@ #include <map> #include <set> -#include <boost/ptr_container/ptr_vector.hpp> class Date; class Color; @@ -300,11 +299,10 @@ public: static inline sal_Unicode GetEuroSymbol() { return sal_Unicode(0x20AC); } }; -typedef boost::ptr_vector<NfCurrencyEntry> NfCurrencyTable; - typedef std::vector< OUString > NfWSStringsDtor; class SvNumberFormatterRegistry_Impl; +class NfCurrencyTable; class SVL_DLLPUBLIC SvNumberFormatter { diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index b75b32a49849..36413857965b 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -127,6 +127,7 @@ $(eval $(call gb_Library_add_exception_objects,svl,\ svl/source/notify/isethint \ svl/source/notify/listener \ svl/source/notify/lstner \ + svl/source/numbers/currencytable \ svl/source/numbers/numfmuno \ svl/source/numbers/numuno \ svl/source/numbers/supservs \ diff --git a/svl/source/numbers/currencytable.cxx b/svl/source/numbers/currencytable.cxx new file mode 100644 index 000000000000..ee65e8ff5c6a --- /dev/null +++ b/svl/source/numbers/currencytable.cxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#include <svl/currencytable.hxx> + +NfCurrencyTable::iterator NfCurrencyTable::begin() +{ + return maData.begin(); +} + +NfCurrencyTable::iterator NfCurrencyTable::end() +{ + return maData.end(); +} + +NfCurrencyTable::const_iterator NfCurrencyTable::begin() const +{ + return maData.begin(); +} + +NfCurrencyTable::const_iterator NfCurrencyTable::end() const +{ + return maData.end(); +} + +NfCurrencyEntry& NfCurrencyTable::operator[] ( size_t i ) +{ + return maData[i]; +} + +const NfCurrencyEntry& NfCurrencyTable::operator[] ( size_t i ) const +{ + return maData[i]; +} + +size_t NfCurrencyTable::size() const +{ + return maData.size(); +} + +void NfCurrencyTable::insert( iterator it, NfCurrencyEntry* p ) +{ + maData.insert(it, p); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 51fe328258bb..9b8e562db476 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <svl/zforlist.hxx> +#include <svl/currencytable.hxx> + #include <comphelper/string.hxx> #include <tools/debug.hxx> #include <unotools/charclass.hxx> @@ -31,7 +34,6 @@ #include <osl/mutex.hxx> -#include <svl/zforlist.hxx> #include "zforscan.hxx" #include "zforfind.hxx" diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 4634fac8204d..76b00efff2b1 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -24,6 +24,7 @@ #include <svl/zforlist.hxx> #include <svl/zformat.hxx> +#include <svl/currencytable.hxx> #include <svtools/langtab.hxx> #include <vcl/svapp.hxx> |