]> git.lyx.org Git - lyx.git/commitdiff
rename Paragraph::getLabel()
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 29 Jul 2024 07:08:13 +0000 (09:08 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 29 Jul 2024 07:08:13 +0000 (09:08 +0200)
getLabel() usually refers to a paragraph label (e.g. \item) in this
context, not \label as in the case here.

src/BufferView.cpp
src/Paragraph.cpp
src/Paragraph.h
src/frontends/qt/TocWidget.cpp

index 145839ba1438dbdadf9c18d11b1ce6529ebe2706..f3267d75d3265e07322387e1e6348a3ef6e2486a 100644 (file)
@@ -1666,7 +1666,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                for (Buffer * b = &buffer_; i == 0 || b != &buffer_;
                        b = theBufferList().next(b)) {
                        DocIterator const dit = b->getParFromID(id);
-                       string const label = dit.innerParagraph().getLabel();
+                       string const label = dit.innerParagraph().getLabelForXRef();
                        if (!label.empty()) {
                                // if the paragraph has a label, we refer to this
                                string const arg = (type.empty()) ? label : label + " " + type;
index 1d239ef5a0a1dd2fc28c2944992045b274b6b64d..9d8acf84e066a95eb92d3f2209a0e18a99649c72 100644 (file)
@@ -3350,7 +3350,7 @@ string Paragraph::getID(Buffer const &, OutputParams const &)
 }
 
 
-string Paragraph::getLabel() const
+string Paragraph::getLabelForXRef() const
 {
        for (pos_type i = 0; i < size(); ++i) {
                if (Inset const * inset = getInset(i)) {
index ee27e170ece87196f77e76899495a19744101e65..a7904dee3c58983138fc25008e0497407aedc11e 100644 (file)
@@ -201,8 +201,9 @@ public:
        /// Get the id of the paragraph, useful for DocBook
        std::string getID(Buffer const & buf, OutputParams const & runparams) const;
 
-       /// Get the (first) string of a \label in this paragraph, or empty string
-       std::string getLabel() const;
+       /// Return the string of a´the (first) \label (cross-referencing target)
+       /// in this paragraph, or an empty string
+       std::string getLabelForXRef() const;
 
        /// Output the first word of a paragraph, return the position where it left.
        pos_type firstWordDocBook(XMLStream & xs, OutputParams const & runparams) const;
index 9779a5c903de6436cae704dcc4b9ade2302446e1..16a9e0a883f2e98a7a2fcd7c475fe74b248f86fa 100644 (file)
@@ -269,7 +269,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd,
                // go to the item
                sendDispatch(item.action());
                // check if it has a label
-               docstring label = from_utf8(cur.innerParagraph().getLabel());
+               docstring label = from_utf8(cur.innerParagraph().getLabelForXRef());
                if (label.empty()) {
                        // if not:
                        // insert a new label