mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
rename Paragraph::getLabel()
getLabel() usually refers to a paragraph label (e.g. \item) in this
context, not \label as in the case here.
(cherry picked from commit 7d46ddaa95
)
This commit is contained in:
parent
2f6838cab3
commit
454800a096
@ -1656,7 +1656,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
for (Buffer * b = &buffer_; i == 0 || b != &buffer_;
|
for (Buffer * b = &buffer_; i == 0 || b != &buffer_;
|
||||||
b = theBufferList().next(b)) {
|
b = theBufferList().next(b)) {
|
||||||
DocIterator const dit = b->getParFromID(id);
|
DocIterator const dit = b->getParFromID(id);
|
||||||
string const label = dit.innerParagraph().getLabel();
|
string const label = dit.innerParagraph().getLabelForXRef();
|
||||||
if (!label.empty()) {
|
if (!label.empty()) {
|
||||||
// if the paragraph has a label, we refer to this
|
// if the paragraph has a label, we refer to this
|
||||||
string const arg = (type.empty()) ? label : label + " " + type;
|
string const arg = (type.empty()) ? label : label + " " + type;
|
||||||
|
@ -3337,7 +3337,7 @@ string Paragraph::getID(Buffer const &, OutputParams const &)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string Paragraph::getLabel() const
|
string Paragraph::getLabelForXRef() const
|
||||||
{
|
{
|
||||||
for (pos_type i = 0; i < size(); ++i) {
|
for (pos_type i = 0; i < size(); ++i) {
|
||||||
if (Inset const * inset = getInset(i)) {
|
if (Inset const * inset = getInset(i)) {
|
||||||
|
@ -201,8 +201,9 @@ public:
|
|||||||
/// Get the id of the paragraph, useful for DocBook
|
/// Get the id of the paragraph, useful for DocBook
|
||||||
std::string getID(Buffer const & buf, OutputParams const & runparams) const;
|
std::string getID(Buffer const & buf, OutputParams const & runparams) const;
|
||||||
|
|
||||||
/// Get the (first) string of a \label in this paragraph, or empty string
|
/// Return the string of a´the (first) \label (cross-referencing target)
|
||||||
std::string getLabel() const;
|
/// in this paragraph, or an empty string
|
||||||
|
std::string getLabelForXRef() const;
|
||||||
|
|
||||||
/// Output the first word of a paragraph, return the position where it left.
|
/// Output the first word of a paragraph, return the position where it left.
|
||||||
pos_type firstWordDocBook(XMLStream & xs, OutputParams const & runparams) const;
|
pos_type firstWordDocBook(XMLStream & xs, OutputParams const & runparams) const;
|
||||||
|
@ -269,7 +269,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd,
|
|||||||
// go to the item
|
// go to the item
|
||||||
sendDispatch(item.action());
|
sendDispatch(item.action());
|
||||||
// check if it has a label
|
// check if it has a label
|
||||||
docstring label = from_utf8(cur.innerParagraph().getLabel());
|
docstring label = from_utf8(cur.innerParagraph().getLabelForXRef());
|
||||||
if (label.empty()) {
|
if (label.empty()) {
|
||||||
// if not:
|
// if not:
|
||||||
// insert a new label
|
// insert a new label
|
||||||
|
Loading…
Reference in New Issue
Block a user