for (Buffer::inset_iterator it = buffer()->inset_iterator_begin();
it != buffer()->inset_iterator_end(); ++it) {
vector<string> labels;
- it->getLabelList(labels);
+ it->getLabelList(*buffer(), labels);
if (find(labels.begin(),labels.end(),label) != labels.end()) {
beforeChange(text);
text->setCursor(it.getPar(), it.getPos());
+2003-09-18 Angus Leeming <leeming@lyx.org>
+
+ * buffer.C:
+ * BufferView.C: pass the buffer when calling Inset::getLabelList,
+ Inset::fillWithBibKeys.
+ * tabular.[Ch] (getLabelList): receive, pass on a Buffer const & arg.
+
2003-09-18 Angus Leeming <leeming@lyx.org>
* LaTeXFeatures.[Ch]: append a '_' to the names of all private member
for (inset_iterator it = inset_const_iterator_begin();
it != inset_const_iterator_end(); ++it) {
- it->getLabelList(list);
+ it->getLabelList(*this, list);
}
}
for (inset_iterator it = inset_const_iterator_begin();
it != inset_const_iterator_end(); ++it) {
- if (it->lyxCode() == InsetOld::BIBTEX_CODE)
- static_cast<InsetBibtex &>(*it).fillWithBibKeys(*this, keys);
- else if (it->lyxCode() == InsetOld::INCLUDE_CODE)
- static_cast<InsetInclude &>(*it).fillWithBibKeys(keys);
- else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {
- InsetBibitem & bib = static_cast<InsetBibitem &>(*it);
- string const key = bib.getContents();
- string const opt = bib.getOptions();
+ if (it->lyxCode() == InsetOld::BIBTEX_CODE) {
+ InsetBibtex const & inset =
+ dynamic_cast<InsetBibtex const &>(*it);
+ inset.fillWithBibKeys(*this, keys);
+ } else if (it->lyxCode() == InsetOld::INCLUDE_CODE) {
+ InsetInclude const & inset =
+ dynamic_cast<InsetInclude const &>(*it);
+ inset.fillWithBibKeys(*this, keys);
+ } else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {
+ InsetBibitem const & inset =
+ dynamic_cast<InsetBibitem const &>(*it);
+ string const key = inset.getContents();
+ string const opt = inset.getOptions();
string const ref; // = pit->asString(this, false);
string const info = opt + "TheBibliographyRef" + ref;
keys.push_back(pair<string, string>(key, info));
+2003-09-18 Angus Leeming <leeming@lyx.org>
+
+ * insetinsetbase.h (getLabelList):
+ * insetinsetcollapsable.[Ch] (getLabelList):
+ * insetinsetinclude.[Ch] (getLabelList):
+ * insetinsetlabel.[Ch] (getLabelList):
+ * insetinsettabular.[Ch] (getLabelList):
+ * insetinsettext.[Ch] (getLabelList): receive a Buffer const & arg.
+ * insetinsetinclude.[Ch] (fillWithBibKeys): ditto.
+
2003-09-18 Angus Leeming <leeming@lyx.org>
* insetinclude.[Ch]: remove Params::operator==, operator!= as they're
#include <vector>
#include <memory>
+class Buffer;
class BufferView;
class FuncRequest;
class MetricsInfo;
virtual BufferView * view() const { return 0; }
/// request "external features"
virtual void validate(LaTeXFeatures &) const {}
- /// fill in all labels in the inset
- virtual void getLabelList(std::vector<string> &) const {}
+ /// Appends \c list with all labels found within this inset.
+ virtual void getLabelList(Buffer const &,
+ std::vector<string> & /* list */) const {}
};
#endif
}
-void InsetCollapsable::getLabelList(std::vector<string> & list) const
+void InsetCollapsable::getLabelList(Buffer const & buffer,
+ std::vector<string> & list) const
{
- inset.getLabelList(list);
+ inset.getLabelList(buffer, list);
}
LyXText * getLyXText(BufferView const *, bool const recursive) const;
///
void deleteLyXText(BufferView *, bool recursive=true) const;
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with all labels found within this inset.
+ void getLabelList(Buffer const &, std::vector<string> & list) const;
///
int scroll(bool recursive=true) const;
///
}
-void InsetInclude::getLabelList(std::vector<string> & list) const
+void InsetInclude::getLabelList(Buffer const &, std::vector<string> & list) const
{
if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName());
}
-void InsetInclude::fillWithBibKeys(std::vector<std::pair<string,string> > & keys) const
+void InsetInclude::fillWithBibKeys(Buffer const &,
+ std::vector<std::pair<string,string> > & keys) const
{
if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName());
virtual std::auto_ptr<InsetBase> clone() const;
///
InsetOld::Code lyxCode() const { return InsetOld::INCLUDE_CODE; }
- /// This returns the list of labels on the child buffer
- void getLabelList(std::vector<string> &) const;
- /// This returns the list of bibkeys on the child buffer
- void fillWithBibKeys(std::vector<std::pair<string,string> > & keys) const;
+ /** Fills \c list
+ * \param buffer the Buffer containing this inset.
+ * \param list the list of labels in the child buffer.
+ */
+ void getLabelList(Buffer const & buffer,
+ std::vector<string> & list) const;
+ /** Fills \c keys
+ * \param buffer the Buffer containing this inset.
+ * \param keys the list of bibkeys in the child buffer.
+ */
+ ///
+ void fillWithBibKeys(Buffer const & buffer,
+ std::vector<std::pair<string,string> > & keys) const;
///
EDITABLE editable() const
{
///
void validate(LaTeXFeatures &) const;
- /// return true if the file is or got loaded.
- bool loadIfNeeded() const;
-
///
void addPreview(lyx::graphics::PreviewLoader &) const;
private:
friend class InsetIncludeMailer;
+ /// return true if the file is or got loaded.
+ bool loadIfNeeded() const;
+
///
void write(std::ostream &) const;
///
}
-void InsetLabel::getLabelList(std::vector<string> & list) const
+void InsetLabel::getLabelList(Buffer const &, std::vector<string> & list) const
{
list.push_back(getContents());
}
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const { return InsetOld::LABEL_CODE; }
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with this label
+ void getLabelList(Buffer const &, std::vector<string> & list) const;
///
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
}
-void InsetTabular::getLabelList(std::vector<string> & list) const
+void InsetTabular::getLabelList(Buffer const & buffer,
+ std::vector<string> & list) const
{
- tabular.getLabelList(list);
+ tabular.getLabelList(buffer, list);
}
bool showInsetDialog(BufferView *) const;
///
FuncStatus getStatus(string const & argument) const;
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with all labels found within this inset.
+ void getLabelList(Buffer const &, std::vector<string> & list) const;
///
int scroll(bool recursive=true) const;
///
}
-void InsetText::getLabelList(std::vector<string> & list) const
+void InsetText::getLabelList(Buffer const & buffer,
+ std::vector<string> & list) const
{
ParagraphList::const_iterator pit = paragraphs.begin();
ParagraphList::const_iterator pend = paragraphs.end();
InsetList::const_iterator beg = pit->insetlist.begin();
InsetList::const_iterator end = pit->insetlist.end();
for (; beg != end; ++beg)
- beg->inset->getLabelList(list);
+ beg->inset->getLabelList(buffer, list);
}
}
void deleteLyXText(BufferView *, bool recursive = true) const;
///
bool showInsetDialog(BufferView *) const;
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with all labels found within this inset.
+ void getLabelList(Buffer const &, std::vector<string> & list) const;
///
int scroll(bool recursive = true) const;
///
+2003-09-18 Angus Leeming <leeming@lyx.org>
+
+ * matheformula.[Ch] (getLabelList):
+ * mathemath_hullinset.[Ch] (getLabelList):
+ receive a Buffer const & arg.
+
2003-09-18 Angus Leeming <leeming@lyx.org>
* formula.C (latexString): add a Buffer const & arg.
}
-void InsetFormula::getLabelList(vector<string> & res) const
+void InsetFormula::getLabelList(Buffer const & buffer,
+ vector<string> & res) const
{
- par()->getLabelList(res);
+ par()->getLabelList(buffer, res);
}
InsetOld::Code lyxCode() const;
///
bool insetAllowed(InsetOld::Code code) const;
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with all labels found within this inset.
+ void getLabelList(Buffer const &,
+ std::vector<string> & list) const;
///
MathAtom const & par() const { return par_; }
///
}
-void MathHullInset::getLabelList(std::vector<string> & labels) const
+void MathHullInset::getLabelList(Buffer const &,
+ std::vector<string> & labels) const
{
for (row_type row = 0; row < nrows(); ++row)
if (!label_[row].empty() && nonum_[row] != 1)
bool ams() const;
/// local dispatcher
dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with all labels found within this inset.
+ void getLabelList(Buffer const &,
+ std::vector<string> & list) const;
///
void validate(LaTeXFeatures & features) const;
/// identifies MatrixInsets
}
-void LyXTabular::getLabelList(std::vector<string> & list) const
+void LyXTabular::getLabelList(Buffer const & buffer,
+ std::vector<string> & list) const
{
for (int i = 0; i < rows_; ++i)
for (int j = 0; j < columns_; ++j)
- getCellInset(i, j).getLabelList(list);
+ getCellInset(i, j).getLabelList(buffer, list);
}
int columns() const { return columns_;}
///
void validate(LaTeXFeatures &) const;
- ///
- void getLabelList(std::vector<string> &) const;
+ /// Appends \c list with all labels found within this inset.
+ void getLabelList(Buffer const &, std::vector<string> & list) const;
///
/// recalculate the widths/heights only!
void reinit();