diff options
-rw-r--r-- | sc/inc/conditio.hxx | 24 | ||||
-rw-r--r-- | sc/source/core/data/conditio.cxx | 28 |
2 files changed, 25 insertions, 27 deletions
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index bcf72c93b959..9e7e14d224c2 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -31,6 +31,7 @@ #include <map> +#include <boost/noncopyable.hpp> #include <boost/ptr_container/ptr_set.hpp> #include <boost/ptr_container/ptr_vector.hpp> #include <boost/scoped_ptr.hpp> @@ -367,7 +368,7 @@ private: // complete conditional formatting // -class SC_DLLPUBLIC ScConditionalFormat +class SC_DLLPUBLIC ScConditionalFormat: private boost::noncopyable { ScDocument* pDoc; sal_uInt32 nKey; // Index in attributes @@ -378,7 +379,6 @@ class SC_DLLPUBLIC ScConditionalFormat public: ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument); - ScConditionalFormat(const ScConditionalFormat& r); ~ScConditionalFormat(); // true copy of formulas (for Ref-Undo / between documents) @@ -390,8 +390,8 @@ public: // don't use the same name as for the const version ScRangeList& GetRangeList() { return maRanges; } - bool IsEmpty() const { return maEntries.empty(); } - size_t size() const { return maEntries.size(); } + bool IsEmpty() const; + size_t size() const; void CompileAll(); void CompileXML(); @@ -434,16 +434,19 @@ public: class SC_DLLPUBLIC ScConditionalFormatList { private: - boost::ptr_set<ScConditionalFormat> maConditionalFormats; typedef boost::ptr_set<ScConditionalFormat> ConditionalFormatContainer; + ConditionalFormatContainer maConditionalFormats; + + void operator =(ScConditionalFormatList const &) SAL_DELETED_FUNCTION; + public: ScConditionalFormatList() {} ScConditionalFormatList(const ScConditionalFormatList& rList); ScConditionalFormatList(ScDocument* pDoc, const ScConditionalFormatList& rList); ~ScConditionalFormatList() {} - void InsertNew( ScConditionalFormat* pNew ) - { maConditionalFormats.insert(pNew); } + void InsertNew( ScConditionalFormat* pNew ); + /** * Checks that all cond formats have a non empty range. * Deletes empty cond formats. @@ -481,13 +484,6 @@ public: void endRendering(); }; -// see http://www.boost.org/doc/libs/1_49_0/libs/ptr_container/doc/tutorial.html#cloneability -//for MSVC we need: -inline ScFormatEntry* new_clone( const ScFormatEntry& rFormat ) -{ - return rFormat.Clone(); -} - #endif diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index f898cfef0906..c091cd592643 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1829,19 +1829,6 @@ ScConditionalFormat::ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocume { } -ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) : - pDoc( r.pDoc ), - nKey( r.nKey ), - maRanges( r.maRanges ) -{ - for (CondFormatContainer::const_iterator itr = r.maEntries.begin(); itr != r.maEntries.end(); ++itr) - { - ScFormatEntry* pNewEntry = itr->Clone(r.pDoc); - maEntries.push_back( pNewEntry ); - pNewEntry->SetParent(this); - } -} - ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const { // echte Kopie der Formeln (fuer Ref-Undo / zwischen Dokumenten) @@ -1890,6 +1877,16 @@ void ScConditionalFormat::AddEntry( ScFormatEntry* pNew ) pNew->SetParent(this); } +bool ScConditionalFormat::IsEmpty() const +{ + return maEntries.empty(); +} + +size_t ScConditionalFormat::size() const +{ + return maEntries.size(); +} + ScConditionalFormat::~ScConditionalFormat() { } @@ -2106,6 +2103,11 @@ ScConditionalFormatList::ScConditionalFormatList(ScDocument* pDoc, const ScCondi InsertNew( itr->Clone(pDoc) ); } +void ScConditionalFormatList::InsertNew( ScConditionalFormat* pNew ) +{ + maConditionalFormats.insert(pNew); +} + bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const { // fuer Ref-Undo - interne Variablen werden nicht verglichen |