break;
case LFUN_LABEL_GOTO: {
- string label = lyx::to_utf8(cmd.argument());
+ docstring label = cmd.argument();
if (label.empty()) {
InsetRef * inset =
getInsetByCode<InsetRef>(cursor_,
InsetBase::REF_CODE);
if (inset) {
- label = inset->getContents();
+ label = lyx::from_utf8(inset->getContents());
savePosition(0);
}
}
}
-void BufferView::gotoLabel(string const & label)
+void BufferView::gotoLabel(docstring const & label)
{
for (InsetIterator it = inset_iterator_begin(buffer_->inset()); it; ++it) {
- vector<string> labels;
+ vector<docstring> labels;
it->getLabelList(*buffer_, labels);
if (find(labels.begin(),labels.end(),label) != labels.end()) {
setCursor(it);
LyXText const * getLyXText() const;
/// move cursor to the named label
- void gotoLabel(std::string const & label);
+ void gotoLabel(lyx::docstring const & label);
/// set the cursor based on the given TeX source row
void setCursorFromRow(int row);
}
-void Buffer::getLabelList(vector<string> & list) const
+void Buffer::getLabelList(vector<docstring> & list) const
{
/// if this is a child document and the parent is already loaded
/// Use the parent's list instead [ale990407]
//FIXME: This does not work for child documents yet.
BOOST_ASSERT(code == InsetBase::CITE_CODE || code == InsetBase::REF_CODE);
// Check if the label 'from' appears more than once
- vector<string> labels;
+ vector<docstring> labels;
if (code == InsetBase::CITE_CODE) {
vector<pair<string, string> > keys;
vector<pair<string, string> >::const_iterator bend = keys.end();
for (; bit != bend; ++bit)
- labels.push_back(bit->first);
+ // FIXME UNICODE
+ labels.push_back(lyx::from_utf8(bit->first));
} else
getLabelList(labels);
- if (lyx::count(labels.begin(), labels.end(), from) > 1)
+ // FIXME UNICODE
+ if (lyx::count(labels.begin(), labels.end(), lyx::from_utf8(from)) > 1)
return;
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
/// of loaded child documents).
std::vector<std::string> const & getBibfilesCache() const;
///
- void getLabelList(std::vector<std::string> &) const;
+ void getLabelList(std::vector<lyx::docstring> &) const;
///
void changeLanguage(Language const * from, Language const * to);
#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
+using lyx::docstring;
+
using std::vector;
using std::string;
{}
-vector<string> const ControlRef::getLabelList(string const & name) const
+vector<docstring> const ControlRef::getLabelList(string const & name) const
{
Buffer const & buf = *theBufferList().getBuffer(makeAbsPath(name));
- vector<string> list;
+ vector<docstring> list;
buf.getLabelList(list);
return list;
}
///
ControlRef(Dialog &);
///
- std::vector<std::string> const getLabelList(std::string const &) const;
+ std::vector<lyx::docstring> const getLabelList(std::string const &) const;
///
void gotoRef(std::string const &);
///
#include <libglademm.h>
+using lyx::docstring;
+
using std::string;
using std::vector;
buffernum=0;
string const name = controller().getBufferName(buffernum);
- vector<string> keys = controller().getLabelList(name);
+ vector<docstring> keys = controller().getLabelList(name);
refListStore_ = Gtk::ListStore::create(refColumns);
if (!keys.empty()) {
- vector<string>::const_iterator it = keys.begin();
- vector<string>::const_iterator end = keys.end();
+ vector<docstring>::const_iterator it = keys.begin();
+ vector<docstring>::const_iterator end = keys.end();
for (;it != keys.end(); ++it) {
Gtk::TreeModel::iterator iter =refListStore_->append();
- (*iter)[refColumns.name] = *it;
+ (*iter)[refColumns.name] = lyx::to_utf8(*it);
}
refview_->set_sensitive(true);
} else {
#include <qtooltip.h>
+using lyx::docstring;
+
using std::vector;
using std::string;
// the first item inserted
QString const tmp(dialog_->referenceED->text());
- for (std::vector<string>::const_iterator iter = refs_.begin();
+ for (std::vector<docstring>::const_iterator iter = refs_.begin();
iter != refs_.end(); ++iter) {
dialog_->refsLB->insertItem(toqstr(*iter));
}
int restored_buffer_;
/// the references
- std::vector<std::string> refs_;
+ std::vector<lyx::docstring> refs_;
};
} // namespace frontend
#include <QToolTip>
+using lyx::docstring;
+
using std::vector;
using std::string;
// the first item inserted
QString const tmp(dialog_->referenceED->text());
- for (std::vector<string>::const_iterator iter = refs_.begin();
+ for (std::vector<docstring>::const_iterator iter = refs_.begin();
iter != refs_.end(); ++iter) {
dialog_->refsLW->addItem(toqstr(*iter));
}
int restored_buffer_;
/// the references
- std::vector<std::string> refs_;
+ std::vector<lyx::docstring> refs_;
};
} // namespace frontend
virtual void validate(LaTeXFeatures &) const {}
/// Appends \c list with all labels found within this inset.
virtual void getLabelList(Buffer const &,
- std::vector<std::string> & /* list */) const {}
+ std::vector<lyx::docstring> & /* list */) const {}
/// describe content if cursor inside
virtual void infoize(std::ostream &) const {}
void InsetInclude::getLabelList(Buffer const & buffer,
- std::vector<string> & list) const
+ std::vector<docstring> & list) const
{
if (loadIfNeeded(buffer, params_)) {
string const included_file = includedFilename(buffer, params_);
* \param list the list of labels in the child buffer.
*/
void getLabelList(Buffer const & buffer,
- std::vector<std::string> & list) const;
+ std::vector<lyx::docstring> & list) const;
/** Fills \c keys
* \param buffer the Buffer containing this inset.
* \param keys the list of bibkeys in the child buffer.
}
-void InsetLabel::getLabelList(Buffer const &, std::vector<string> & list) const
+void InsetLabel::getLabelList(Buffer const &, std::vector<docstring> & list) const
{
- list.push_back(getContents());
+ // FIXME UNICODE
+ list.push_back(lyx::from_utf8(getContents()));
}
///
InsetBase::Code lyxCode() const { return InsetBase::LABEL_CODE; }
/// Appends \c list with this label
- void getLabelList(Buffer const &, std::vector<std::string> & list) const;
+ void getLabelList(Buffer const &, std::vector<lyx::docstring> & list) const;
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
}
-void InsetMathHull::getLabelList(Buffer const &, vector<string> & labels) const
+void InsetMathHull::getLabelList(Buffer const &, vector<docstring> & labels) const
{
for (row_type row = 0; row < nrows(); ++row)
if (!label_[row].empty() && nonum_[row] != 1)
- labels.push_back(label_[row]);
+ // FIXME UNICODE
+ labels.push_back(lyx::from_utf8(label_[row]));
}
bool ams() const;
/// Appends \c list with all labels found within this inset.
void getLabelList(Buffer const &,
- std::vector<std::string> & list) const;
+ std::vector<lyx::docstring> & list) const;
///
void validate(LaTeXFeatures & features) const;
/// identifies HullInset