]> git.lyx.org Git - features.git/commitdiff
Move the anonymous functions that are left closer to where they are now
authorRichard Heck <rgheck@comcast.net>
Sat, 9 Jan 2010 22:30:56 +0000 (22:30 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 9 Jan 2010 22:30:56 +0000 (22:30 +0000)
used.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32924 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCitation.cpp

index ebd73641c4970ddad2acc6d749a3c3e1b5edd42f..5921e7f1305b916ea2eaaf8eea77692bf81668ba 100644 (file)
@@ -37,6 +37,29 @@ using namespace lyx::support;
 
 namespace lyx {
 
+ParamInfo InsetCitation::param_info_;
+
+
+InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
+       : InsetCommand(buf, p, "citation")
+{}
+
+
+ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
+{
+       // standard cite does only take one argument if jurabib is
+       // not used, but jurabib extends this to two arguments, so
+       // we have to allow both here. InsetCitation takes care that
+       // LaTeX output is nevertheless correct.
+       if (param_info_.empty()) {
+               param_info_.add("after", ParamInfo::LATEX_OPTIONAL);
+               param_info_.add("before", ParamInfo::LATEX_OPTIONAL);
+               param_info_.add("key", ParamInfo::LATEX_REQUIRED);
+       }
+       return param_info_;
+}
+
+
 namespace {
 
 vector<string> const init_possible_cite_commands()
@@ -65,6 +88,50 @@ vector<string> const & possibleCiteCommands()
 }
 
 
+} // anon namespace
+
+
+bool InsetCitation::isCompatibleCommand(string const & cmd)
+{
+       vector<string> const & possibles = possibleCiteCommands();
+       vector<string>::const_iterator const end = possibles.end();
+       return find(possibles.begin(), end, cmd) != end;
+}
+
+
+docstring InsetCitation::toolTip(BufferView const & bv, int, int) const
+{
+       Buffer const & buf = bv.buffer();
+       // Only after the buffer is loaded from file...
+       if (!buf.isFullyLoaded())
+               return docstring();
+
+       BiblioInfo const & bi = buf.masterBibInfo();
+       if (bi.empty())
+               return _("No bibliography defined!");
+
+       docstring const & key = getParam("key");
+       if (key.empty())
+               return _("No citations selected!");
+
+       vector<docstring> keys = getVectorFromString(key);
+       vector<docstring>::const_iterator it = keys.begin();
+       vector<docstring>::const_iterator en = keys.end();
+       docstring tip;
+       for (; it != en; ++it) {
+               docstring const key_info = bi.getInfo(*it);
+               if (key_info.empty())
+                       continue;
+               if (!tip.empty())
+                       tip += "\n";
+               tip += wrap(key_info, -4);
+       }
+       return tip;
+}
+
+
+namespace {
+       
 // FIXME See the header for the issue.
 string defaultCiteCommand(CiteEngine engine)
 {
@@ -132,72 +199,7 @@ string asValidLatexCommand(string const & input, CiteEngine const engine)
        return output;
 }
 
-
-} // anon namespace
-
-
-ParamInfo InsetCitation::param_info_;
-
-
-InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
-       : InsetCommand(buf, p, "citation")
-{}
-
-
-ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
-{
-       // standard cite does only take one argument if jurabib is
-       // not used, but jurabib extends this to two arguments, so
-       // we have to allow both here. InsetCitation takes care that
-       // LaTeX output is nevertheless correct.
-       if (param_info_.empty()) {
-               param_info_.add("after", ParamInfo::LATEX_OPTIONAL);
-               param_info_.add("before", ParamInfo::LATEX_OPTIONAL);
-               param_info_.add("key", ParamInfo::LATEX_REQUIRED);
-       }
-       return param_info_;
-}
-
-
-bool InsetCitation::isCompatibleCommand(string const & cmd)
-{
-       vector<string> const & possibles = possibleCiteCommands();
-       vector<string>::const_iterator const end = possibles.end();
-       return find(possibles.begin(), end, cmd) != end;
-}
-
-
-docstring InsetCitation::toolTip(BufferView const & bv, int, int) const
-{
-       Buffer const & buf = bv.buffer();
-       // Only after the buffer is loaded from file...
-       if (!buf.isFullyLoaded())
-               return docstring();
-
-       BiblioInfo const & bi = buf.masterBibInfo();
-       if (bi.empty())
-               return _("No bibliography defined!");
-
-       docstring const & key = getParam("key");
-       if (key.empty())
-               return _("No citations selected!");
-
-       vector<docstring> keys = getVectorFromString(key);
-       vector<docstring>::const_iterator it = keys.begin();
-       vector<docstring>::const_iterator en = keys.end();
-       docstring tip;
-       for (; it != en; ++it) {
-               docstring const key_info = bi.getInfo(*it);
-               if (key_info.empty())
-                       continue;
-               if (!tip.empty())
-                       tip += "\n";
-               tip += wrap(key_info, -4);
-       }
-       return tip;
-}
-
-
+} // anonymous namespace
 
 docstring InsetCitation::generateLabel() const
 {