diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-02-23 23:36:49 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-02-29 23:37:51 +0100 |
commit | c06dbbe7594c2a0b5a5b19f8e183d9c421e6e094 (patch) | |
tree | 276dbc9a2c9589953c79bc45c70a965b99482ec0 /sc/inc/postit.hxx | |
parent | a6d65732f14e49be8ec61aac53a2a8b909d810f7 (diff) |
remove mpNote from ScBaseCell
Diffstat (limited to 'sc/inc/postit.hxx')
-rw-r--r-- | sc/inc/postit.hxx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index 5d63b373db21..fb40347a56a7 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -35,6 +35,8 @@ #include "address.hxx" #include "scdllapi.h" +#include <map> + class EditTextObject; class OutlinerParaObject; class SdrCaptionObj; @@ -259,6 +261,59 @@ public: bool bAlwaysCreateCaption ); }; +class SC_DLLPUBLIC ScNotes +{ +private: + typedef std::pair<SCCOL, SCROW> ScAddress2D; + typedef std::map<ScAddress2D, ScPostIt*> ScNoteMap; + ScNoteMap maNoteMap; + + ScDocument* mpDoc; +public: + ScNotes(ScDocument* pDoc); + ScNotes(const ScNotes& rNotes); + ~ScNotes(); + + typedef ScNoteMap::iterator iterator; + typedef ScNoteMap::const_iterator const_iterator; + + iterator begin(); + iterator end(); + + const_iterator begin() const; + const_iterator end() const; + + size_t size() const; + bool empty() const; + + ScPostIt* findByAddress(SCCOL nCol, SCROW nRow); + const ScPostIt* findByAddress(SCCOL nCol, SCROW nRow) const; + + ScPostIt* findByAddress(const ScAddress& rAddress); + const ScPostIt* findByAddress(const ScAddress& rAddress) const; + /** + * takes ownership of the + */ + bool insert( SCCOL nCol, SCROW nRow, ScPostIt* ); + bool insert( const ScAddress& rPos, ScPostIt* ); + + void erase(SCCOL, SCROW); + void erase(const ScAddress& rPos); + + /** Returns and forgets the cell note object at the passed cell address. */ + ScPostIt* ReleaseNote( const ScAddress& rPos ); + ScPostIt* ReleaseNote( SCCOL nCol, SCROW nRow ); + /** Returns the pointer to an existing or created cell note object at the passed cell address. */ + ScPostIt* GetOrCreateNote( const ScAddress& rPos ); + + void clear(); + + ScNotes* clone(ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bCloneNoteCaption, SCTAB nTab); + void CopyFromClip(const ScNotes& maNotes, ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, SCTAB nTab, bool bCloneCaption); + + +}; + // ============================================================================ #endif |