diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-02 16:50:16 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-03 10:20:06 -0400 |
commit | 32234172b038532375bf7b4f43430efc76ef7b9a (patch) | |
tree | 8be414ce66120d33d76d921e28de4e65f20582c8 /editeng | |
parent | Merged ContentList into EditDoc. (diff) | |
download | core-32234172b038532375bf7b4f43430efc76ef7b9a.tar.gz core-32234172b038532375bf7b4f43430efc76ef7b9a.zip |
Moving method definitions.
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 46 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc2.cxx | 46 |
2 files changed, 46 insertions, 46 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 8798540e0fd7..8b96a24ef7f6 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1350,6 +1350,52 @@ ContentNode* EditDoc::SafeGetObject(size_t nPos) return ( nPos < Count() ) ? GetObject( nPos ) : 0; } +const ContentNode* EditDoc::GetObject(size_t nPos) const +{ + return nPos < maContents.size() ? &maContents[nPos] : NULL; +} + +ContentNode* EditDoc::GetObject(size_t nPos) +{ + return nPos < maContents.size() ? &maContents[nPos] : NULL; +} + +const ContentNode* EditDoc::operator[](size_t nPos) const +{ + return GetObject(nPos); +} + +ContentNode* EditDoc::operator[](size_t nPos) +{ + return GetObject(nPos); +} + +void EditDoc::Insert(size_t nPos, ContentNode* p) +{ + maContents.insert(maContents.begin()+nPos, p); +} + +void EditDoc::Remove(size_t nPos) +{ + if (nPos >= maContents.size()) + return; + + maContents.erase(maContents.begin() + nPos); +} + +void EditDoc::Release(size_t nPos) +{ + if (nPos >= maContents.size()) + return; + + maContents.release(maContents.begin() + nPos).release(); +} + +size_t EditDoc::Count() const +{ + return maContents.size(); +} + XubString EditDoc::GetSepStr( LineEnd eEnd ) { XubString aSep; diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx index f40f216f9e40..9ed81a9ba401 100644 --- a/editeng/source/editeng/editdoc2.cxx +++ b/editeng/source/editeng/editdoc2.cxx @@ -384,52 +384,6 @@ size_t EditDoc::GetPos(const ContentNode* p) const return FastGetPos(maContents, p, nLastCache); } -const ContentNode* EditDoc::GetObject(size_t nPos) const -{ - return nPos < maContents.size() ? &maContents[nPos] : NULL; -} - -ContentNode* EditDoc::GetObject(size_t nPos) -{ - return nPos < maContents.size() ? &maContents[nPos] : NULL; -} - -const ContentNode* EditDoc::operator[](size_t nPos) const -{ - return GetObject(nPos); -} - -ContentNode* EditDoc::operator[](size_t nPos) -{ - return GetObject(nPos); -} - -void EditDoc::Insert(size_t nPos, ContentNode* p) -{ - maContents.insert(maContents.begin()+nPos, p); -} - -void EditDoc::Remove(size_t nPos) -{ - if (nPos >= maContents.size()) - return; - - maContents.erase(maContents.begin() + nPos); -} - -void EditDoc::Release(size_t nPos) -{ - if (nPos >= maContents.size()) - return; - - maContents.release(maContents.begin() + nPos).release(); -} - -size_t EditDoc::Count() const -{ - return maContents.size(); -} - void ParaPortionList::Reset() { maPortions.clear(); |