]> git.lyx.org Git - lyx.git/blobdiff - src/InsetList.cpp
* Paragraph: reserve memory by chunks of 100 chars. This improve the loading of big...
[lyx.git] / src / InsetList.cpp
index 27e59280f31b6673846fdbfbf3fb455441029368..c3d2805511a269bf4b4291e8cebad68d4d9bdf16 100644 (file)
 
 #include "insets/InsetBranch.h"
 
-
-namespace lyx {
-
 using std::endl;
 using std::lower_bound;
 
 
+namespace lyx {
+
+
 namespace {
 
 typedef InsetList::InsetTable Table;
@@ -71,7 +71,7 @@ InsetList::const_iterator InsetList::insetIterator(pos_type pos) const
 }
 
 
-void InsetList::insert(InsetBase * inset, pos_type pos)
+void InsetList::insert(Inset * inset, pos_type pos)
 {
        List::iterator end = list_.end();
        List::iterator it = insetIterator(pos);
@@ -95,12 +95,12 @@ void InsetList::erase(pos_type pos)
 }
 
 
-InsetBase * InsetList::release(pos_type pos)
+Inset * InsetList::release(pos_type pos)
 {
        List::iterator end = list_.end();
        List::iterator it = insetIterator(pos);
        if (it != end && it->pos == pos) {
-               InsetBase * tmp = it->inset;
+               Inset * tmp = it->inset;
                it->inset = 0;
                return tmp;
        }
@@ -108,7 +108,7 @@ InsetBase * InsetList::release(pos_type pos)
 }
 
 
-InsetBase * InsetList::get(pos_type pos) const
+Inset * InsetList::get(pos_type pos) const
 {
        List::const_iterator end = list_.end();
        List::const_iterator it = insetIterator(pos);
@@ -138,4 +138,13 @@ void InsetList::decreasePosAfterPos(pos_type pos)
 }
 
 
+InsetList::InsetList(InsetList const & il)
+{
+       list_ = il.list_;
+       List::iterator it = list_.begin();
+       List::iterator end = list_.end();
+       for (; it != end; ++it)
+               it->inset = it->inset->clone();
+}
+
 } // namespace lyx