]> git.lyx.org Git - features.git/commitdiff
* following Andre's advice to rename the method into
authorStefan Schimanski <sts@lyx.org>
Fri, 22 Feb 2008 21:11:19 +0000 (21:11 +0000)
committerStefan Schimanski <sts@lyx.org>
Fri, 22 Feb 2008 21:11:19 +0000 (21:11 +0000)
  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

src/frontends/qt4/GuiCompleter.cpp
src/insets/Inset.h
src/insets/InsetText.cpp
src/insets/InsetText.h
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathNest.h
src/mathed/MathMacro.cpp
src/mathed/MathMacro.h

index 20ad50f4717495a7a172c0d8e53f4710b343fed3..b59c8ce451b08cef0ce996ef37127638b56d33a2 100644 (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)
index 17ed08beaab3e3c106022a4fd08aa58337809081..e9c6b3e9e4cb52e12901c7271e38273f13e56750 100644 (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.
index 0e8f3ad5715f8bc42f3d32a99f235e91740b4e46..5226edb6ae09eb6c60113fe3f4bb6f0edf4669cc 100644 (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;
index ccb7301474e953025e62e096d8528bcb35f96388..ed748c7680714cf544fae3fd32ef7d1e9bd95ad2 100644 (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;
        ///
index f1ab2cdc82e9e1ec350bb1ae1c02da2d5faa79fd..e0cf27a5fbd6c2c92507a7dedb6cf97ae5cdf4b2 100644 (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;
index d3fc72cc8b78e6093decb4549ecb88df05c5393f..bcdc13afad565ae627c81c3e5d19b37b994dc6e7 100644 (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;
        ///
index bdcc025128e6ce067fccce1690249341f099fa73..b86d36ca6bdc97e5af058fb4f3023825158f9075 100644 (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());
 }
index 8a10a45300f4267226effb6f807f47bc93f75f9e..dae4d8099c08edb028efcc2fd177278d8b60c210 100644 (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;
        ///