diff options
author | Laurent Godard <lgodard.libre@laposte.net> | 2013-09-11 09:06:24 +0200 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-23 10:44:20 -0400 |
commit | 759bdbbc348d320994813a9de1a7927b795580a3 (patch) | |
tree | 897cb53c217866ce6b365f76943390e3e6368529 /sc/inc/postit.hxx | |
parent | ae88290f87acf693fed02140ca384ec15589616b (diff) |
Re-implement cell note storage using mdds::multi_type_vector.
Change-Id: I34ea91e360e2a6b85d65f970c6e43db687d213ca
Diffstat (limited to 'sc/inc/postit.hxx')
-rw-r--r-- | sc/inc/postit.hxx | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index c8468c44dcb9..9a7c60a2d5ea 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -57,6 +57,7 @@ struct SC_DLLPUBLIC ScNoteData class SC_DLLPUBLIC ScPostIt { public: + /** Creates an empty note and its caption object and places it according to the passed cell position. */ explicit ScPostIt( ScDocument& rDoc, const ScAddress& rPos, bool bShown ); @@ -159,8 +160,6 @@ private: class SC_DLLPUBLIC ScNoteUtil { public: - /** Tries to update the position of note caption objects in the specified range. */ - static void UpdateCaptionPositions( ScDocument& rDoc, const ScRange& rRange ); /** Creates and returns a caption object for a temporary caption. */ static SdrCaptionObj* CreateTempCaption( ScDocument& rDoc, const ScAddress& rPos, @@ -242,64 +241,8 @@ public: ScDocument& rDoc, const ScAddress& rPos, const OUString& rNoteText, bool bShown, bool bAlwaysCreateCaption ); -}; - -class SC_DLLPUBLIC ScNotes -{ -private: - typedef std::pair<SCCOL, SCROW> ScAddress2D; - typedef std::map<ScAddress2D, ScPostIt*> ScNoteMap; - ScNoteMap maNoteMap; - - ScNotes(const ScNotes& rNotes); - ScNotes operator=(const ScNotes& rNotes); - ScDocument* mpDoc; -public: - ScNotes(ScDocument* pDoc); - ~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, bool bForgetCaption = false); - 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(); - - void clone(ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bCloneNoteCaption, SCTAB nTab, ScNotes& rTarget); - void CopyFromClip(const ScNotes& maNotes, ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, SCTAB nTab, bool bCloneCaption); - - void erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bForgetCaption = false); - - void CreateAllNoteCaptions(SCTAB nTab); }; #endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |