mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Get rid of helper Text::previousWord(), used only once
This commit is contained in:
parent
a41bcb3701
commit
f9aadae290
19
src/Text.cpp
19
src/Text.cpp
@ -2278,19 +2278,6 @@ void Text::setMacrocontextPosition(DocIterator const & pos)
|
||||
}
|
||||
|
||||
|
||||
docstring Text::previousWord(CursorSlice const & sl) const
|
||||
{
|
||||
CursorSlice from = sl;
|
||||
CursorSlice to = sl;
|
||||
getWord(from, to, PREVIOUS_WORD);
|
||||
if (sl == from || to == from)
|
||||
return docstring();
|
||||
|
||||
Paragraph const & par = sl.paragraph();
|
||||
return par.asString(from.pos(), to.pos());
|
||||
}
|
||||
|
||||
|
||||
bool Text::completionSupported(Cursor const & cur) const
|
||||
{
|
||||
Paragraph const & par = cur.paragraph();
|
||||
@ -2321,7 +2308,11 @@ bool Text::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/
|
||||
|
||||
docstring Text::completionPrefix(Cursor const & cur) const
|
||||
{
|
||||
return previousWord(cur.top());
|
||||
CursorSlice from = cur.top();
|
||||
CursorSlice to = from;
|
||||
getWord(from, to, PREVIOUS_WORD);
|
||||
|
||||
return cur.paragraph().asString(from.pos(), to.pos());
|
||||
}
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -173,8 +173,6 @@ public:
|
||||
void selectWord(Cursor & cur, word_location loc);
|
||||
/// select all text
|
||||
void selectAll(Cursor & cur);
|
||||
/// convenience function get the previous word or an empty string
|
||||
docstring previousWord(CursorSlice const & sl) const;
|
||||
|
||||
/// what type of change operation to make
|
||||
enum ChangeOp {
|
||||
|
Loading…
Reference in New Issue
Block a user