On 06/28/2010 01:31 PM, Rob Oakes wrote:
TocBackend.h

...

std::vector<TocItem>* summary_notes;

...

TocBackend.cpp

...

TocItem::TocItem(DocIterator const&  dit, int d, docstring const&  s,
docstring const&  t) : dit_(dit), depth_(d), str_(s), summary_notes(new
std::vector<TocItem>), tooltip_(t)
{
}

This:

Index: /cvs/lyx-devel/trunk/src/TocBackend.cpp

 TocItem::TocItem(DocIterator const & dit, int d, docstring const & s,
-    docstring const & t) : dit_(dit), depth_(d), str_(s), tooltip_(t)
+    docstring const & t) : dit_(dit), depth_(d), str_(s), tooltip_(t),
+    test(new vector<TocItem>)
 {
 }

Index: /cvs/lyx-devel/trunk/src/TocBackend.h

     /// The tooltip string
     docstring tooltip_;
+
+    std::vector<TocItem> * test;
 };


works fine for me.


Still, I guess I'm a bit puzzled why you would need a pointer, new, etc, here. If you just do:

std::vector<TocItem>  summary_notes;

it's automatically initialized and cleaned up. Is there a worry about copying?

FYI, you don't need "std" in the cpp file, due to:
    using namespace std;

Richard

Reply via email to