mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Make getBibkeyList const.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4001 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8b0bb92d40
commit
f2abe6cb34
@ -1,3 +1,7 @@
|
|||||||
|
2002-04-16 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
|
|
||||||
|
* buffer.[Ch] (getBibkeyList): make it const.
|
||||||
|
|
||||||
2002-04-12 Juergen Vigna <jug@sad.it>
|
2002-04-12 Juergen Vigna <jug@sad.it>
|
||||||
|
|
||||||
* BufferView_pimpl.C (workAreaMotionNotify): use new ix() cursor pos.
|
* BufferView_pimpl.C (workAreaMotionNotify): use new ix() cursor pos.
|
||||||
|
17
src/buffer.C
17
src/buffer.C
@ -3687,36 +3687,37 @@ Buffer::Lists const Buffer::getLists() const
|
|||||||
|
|
||||||
|
|
||||||
// This is also a buffer property (ale)
|
// This is also a buffer property (ale)
|
||||||
vector<pair<string, string> > const Buffer::getBibkeyList()
|
vector<pair<string, string> > const Buffer::getBibkeyList() const
|
||||||
{
|
{
|
||||||
|
typedef pair<string, string> StringPair;
|
||||||
/// if this is a child document and the parent is already loaded
|
/// if this is a child document and the parent is already loaded
|
||||||
/// Use the parent's list instead [ale990412]
|
/// Use the parent's list instead [ale990412]
|
||||||
if (!params.parentname.empty() && bufferlist.exists(params.parentname)) {
|
if (!params.parentname.empty() && bufferlist.exists(params.parentname)) {
|
||||||
Buffer * tmp = bufferlist.getBuffer(params.parentname);
|
Buffer const * tmp = bufferlist.getBuffer(params.parentname);
|
||||||
if (tmp)
|
if (tmp)
|
||||||
return tmp->getBibkeyList();
|
return tmp->getBibkeyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<pair<string, string> > keys;
|
vector<StringPair> keys;
|
||||||
Paragraph * par = paragraph;
|
Paragraph * par = paragraph;
|
||||||
while (par) {
|
while (par) {
|
||||||
if (par->bibkey)
|
if (par->bibkey)
|
||||||
keys.push_back(pair<string, string>(par->bibkey->getContents(),
|
keys.push_back(StringPair(par->bibkey->getContents(),
|
||||||
par->asString(this, false)));
|
par->asString(this, false)));
|
||||||
par = par->next();
|
par = par->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Might be either using bibtex or a child has bibliography
|
// Might be either using bibtex or a child has bibliography
|
||||||
if (keys.empty()) {
|
if (keys.empty()) {
|
||||||
for (inset_iterator it = inset_iterator_begin();
|
for (inset_iterator it = inset_const_iterator_begin();
|
||||||
it != inset_iterator_end(); ++it) {
|
it != inset_const_iterator_end(); ++it) {
|
||||||
// Search for Bibtex or Include inset
|
// Search for Bibtex or Include inset
|
||||||
if ((*it)->lyxCode() == Inset::BIBTEX_CODE) {
|
if ((*it)->lyxCode() == Inset::BIBTEX_CODE) {
|
||||||
vector<pair<string,string> > tmp =
|
vector<StringPair> tmp =
|
||||||
static_cast<InsetBibtex*>(*it)->getKeys(this);
|
static_cast<InsetBibtex*>(*it)->getKeys(this);
|
||||||
keys.insert(keys.end(), tmp.begin(), tmp.end());
|
keys.insert(keys.end(), tmp.begin(), tmp.end());
|
||||||
} else if ((*it)->lyxCode() == Inset::INCLUDE_CODE) {
|
} else if ((*it)->lyxCode() == Inset::INCLUDE_CODE) {
|
||||||
vector<pair<string,string> > const tmp =
|
vector<StringPair> const tmp =
|
||||||
static_cast<InsetInclude*>(*it)->getKeys();
|
static_cast<InsetInclude*>(*it)->getKeys();
|
||||||
keys.insert(keys.end(), tmp.begin(), tmp.end());
|
keys.insert(keys.end(), tmp.begin(), tmp.end());
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ public:
|
|||||||
///
|
///
|
||||||
string const getIncludeonlyList(char delim = ',');
|
string const getIncludeonlyList(char delim = ',');
|
||||||
///
|
///
|
||||||
std::vector<std::pair<string, string> > const getBibkeyList();
|
std::vector<std::pair<string, string> > const getBibkeyList() const;
|
||||||
///
|
///
|
||||||
struct TocItem {
|
struct TocItem {
|
||||||
TocItem(Paragraph * p, int d, string const & s)
|
TocItem(Paragraph * p, int d, string const & s)
|
||||||
|
Loading…
Reference in New Issue
Block a user