mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
* following Andre's advice to rename the method into
createCompletionList. This makes the ownership of the returned object clear. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23143 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
426c4bf356
commit
8c2149d3aa
@ -364,7 +364,9 @@ void GuiCompleter::updateModel(Cursor & cur, bool popupUpdate, bool inlineUpdate
|
||||
old = last_selection_;
|
||||
|
||||
// set new model
|
||||
setModel(new GuiCompletionModel(this, cur.inset().completionList(cur)));
|
||||
Inset::CompletionList const * list
|
||||
= cur.inset().createCompletionList(cur);
|
||||
setModel(new GuiCompletionModel(this, list));
|
||||
|
||||
// show popup
|
||||
if (popupUpdate)
|
||||
|
@ -317,7 +317,7 @@ public:
|
||||
/// Returns completion suggestions at cursor position. Return an
|
||||
/// null pointer if no completion is a available or possible.
|
||||
/// The caller is responsible to free the returned object!
|
||||
virtual CompletionList const * completionList(Cursor const &) const
|
||||
virtual CompletionList const * createCompletionList(Cursor const &) const
|
||||
{ return 0; }
|
||||
/// Returns the completion prefix to filter the suggestions for completion.
|
||||
/// This is only called if completionList returned a non-null list.
|
||||
|
@ -504,7 +504,8 @@ bool InsetText::automaticPopupCompletion() const
|
||||
}
|
||||
|
||||
|
||||
Inset::CompletionList const * InsetText::completionList(Cursor const & cur) const
|
||||
Inset::CompletionList const
|
||||
* InsetText::createCompletionList(Cursor const & cur) const
|
||||
{
|
||||
if (!completionSupported(cur))
|
||||
return 0;
|
||||
|
@ -150,7 +150,7 @@ public:
|
||||
///
|
||||
bool automaticPopupCompletion() const;
|
||||
///
|
||||
CompletionList const * completionList(Cursor const & cur) const;
|
||||
CompletionList const * createCompletionList(Cursor const & cur) const;
|
||||
///
|
||||
docstring completionPrefix(Cursor const & cur) const;
|
||||
///
|
||||
|
@ -1607,7 +1607,8 @@ bool InsetMathNest::automaticPopupCompletion() const
|
||||
}
|
||||
|
||||
|
||||
Inset::CompletionList const * InsetMathNest::completionList(Cursor const & cur) const
|
||||
Inset::CompletionList const *
|
||||
InsetMathNest::createCompletionList(Cursor const & cur) const
|
||||
{
|
||||
if (!cur.inMacroMode())
|
||||
return 0;
|
||||
|
@ -142,7 +142,7 @@ public:
|
||||
///
|
||||
bool automaticPopupCompletion() const;
|
||||
///
|
||||
CompletionList const * completionList(Cursor const & cur) const;
|
||||
CompletionList const * createCompletionList(Cursor const & cur) const;
|
||||
///
|
||||
docstring completionPrefix(Cursor const & cur) const;
|
||||
///
|
||||
|
@ -763,10 +763,11 @@ bool MathMacro::automaticPopupCompletion() const
|
||||
}
|
||||
|
||||
|
||||
Inset::CompletionList const * MathMacro::completionList(Cursor const & cur) const
|
||||
Inset::CompletionList const *
|
||||
MathMacro::createCompletionList(Cursor const & cur) const
|
||||
{
|
||||
if (displayMode() != DISPLAY_UNFOLDED)
|
||||
return InsetMathNest::completionList(cur);
|
||||
return InsetMathNest::createCompletionList(cur);
|
||||
|
||||
return new MathCompletionList(cur.bv().cursor());
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public:
|
||||
///
|
||||
bool automaticPopupCompletion() const;
|
||||
///
|
||||
CompletionList const * completionList(Cursor const & cur) const;
|
||||
CompletionList const * createCompletionList(Cursor const & cur) const;
|
||||
///
|
||||
docstring completionPrefix(Cursor const & cur) const;
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user