* 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:
Stefan Schimanski 2008-02-22 21:11:19 +00:00
parent 426c4bf356
commit 8c2149d3aa
8 changed files with 14 additions and 9 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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;

View File

@ -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;
///

View File

@ -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;

View File

@ -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;
///

View File

@ -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());
}

View File

@ -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;
///