mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Allow DocIterator::paragraphGotoArgument() to return id() without pos()
We need this for the forthcoming reference-to-paragraph function
(cherry picked from commit e3b36208ed
)
This commit is contained in:
parent
dcc91b4a85
commit
ce64021ce9
@ -225,11 +225,12 @@ CursorSlice const & DocIterator::innerTextSlice() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring DocIterator::paragraphGotoArgument() const
|
docstring DocIterator::paragraphGotoArgument(bool const nopos) const
|
||||||
{
|
{
|
||||||
CursorSlice const & s = innerTextSlice();
|
CursorSlice const & s = innerTextSlice();
|
||||||
return convert<docstring>(s.paragraph().id()) + ' ' +
|
return nopos ? convert<docstring>(s.paragraph().id())
|
||||||
convert<docstring>(s.pos());
|
: convert<docstring>(s.paragraph().id())
|
||||||
|
+ ' ' + convert<docstring>(s.pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,8 +167,9 @@ public:
|
|||||||
Paragraph & innerParagraph() const;
|
Paragraph & innerParagraph() const;
|
||||||
/// return the inner text slice.
|
/// return the inner text slice.
|
||||||
CursorSlice const & innerTextSlice() const;
|
CursorSlice const & innerTextSlice() const;
|
||||||
// convert a DocIterator into an argument to LFUN_PARAGRAPH_GOTO
|
/// convert a DocIterator into an argument to LFUN_PARAGRAPH_GOTO
|
||||||
docstring paragraphGotoArgument() const;
|
/// \p nopos determines whether the cursor position is returned
|
||||||
|
docstring paragraphGotoArgument(bool const nopos = false) const;
|
||||||
/// returns a DocIterator for the containing text inset
|
/// returns a DocIterator for the containing text inset
|
||||||
DocIterator getInnerText() const;
|
DocIterator getInnerText() const;
|
||||||
/// the first and last positions of a word at top cursor slice
|
/// the first and last positions of a word at top cursor slice
|
||||||
|
Loading…
Reference in New Issue
Block a user