]> git.lyx.org Git - features.git/commitdiff
some de-boostification
authorAndré Pönitz <poenitz@gmx.net>
Tue, 27 Nov 2007 20:30:22 +0000 (20:30 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 27 Nov 2007 20:30:22 +0000 (20:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21830 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/tex2lyx.cpp
src/tex2lyx/text.cpp

index d216d0a49fff750017b47589c45dc50016195dcb..fa0dc3ecf077a2e08ebf4a7dcf2bcdb48c3cd893 100644 (file)
@@ -28,8 +28,6 @@
 #include "support/Package.h"
 #include "support/unicode.h"
 
-#include <boost/function.hpp>
-
 #include <fstream>
 #include <iostream>
 #include <string>
@@ -76,8 +74,8 @@ string const trim(string const & a, char const * p)
        if (a.empty() || !*p)
                return a;
 
-       string::size_type r = a.find_last_not_of(p);
-       string::size_type l = a.find_first_not_of(p);
+       size_t r = a.find_last_not_of(p);
+       size_t l = a.find_first_not_of(p);
 
        // Is this the minimal test? (lgb)
        if (r == string::npos && l == string::npos)
@@ -268,7 +266,7 @@ bool overwrite_files = false;
 
 
 /// return the number of arguments consumed
-typedef boost::function<int(string const &, string const &)> cmd_helper;
+typedef int (*cmd_helper)(string const &, string const &);
 
 
 int parse_help(string const &, string const &)
index 423992dc897fc636df59565ee0eaa9a02e6f93d5..06aaa1c1db2df157c4804367ec42694ab399516d 100644 (file)
@@ -25,8 +25,6 @@
 #include "support/convert.h"
 #include "support/filetools.h"
 
-#include <boost/tuple/tuple.hpp>
-
 #include <iostream>
 #include <map>
 #include <sstream>
@@ -999,25 +997,26 @@ void parse_text_attributes(Parser & p, ostream & os, unsigned flags, bool outer,
 
 
 /// get the arguments of a natbib or jurabib citation command
-std::pair<string, string> getCiteArguments(Parser & p, bool natbibOrder)
+void get_cite_arguments(Parser & p, bool natbibOrder,
+       string & before, string & after)
 {
        // We need to distinguish "" and "[]", so we can't use p.getOpt().
 
        // text before the citation
-       string before;
+       before.clear();
        // text after the citation
-       string after = p.getFullOpt();
+       after = p.getFullOpt();
 
        if (!after.empty()) {
                before = p.getFullOpt();
                if (natbibOrder && !before.empty())
                        std::swap(before, after);
        }
-       return std::make_pair(before, after);
 }
 
 
-/// Convert filenames with TeX macros and/or quotes to something LyX can understand
+/// Convert filenames with TeX macros and/or quotes to something LyX
+/// can understand
 string const normalize_filename(string const & name)
 {
        Parser p(trim(name, "\""));
@@ -1884,8 +1883,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        string before;
                        // text after the citation
                        string after;
+                       get_cite_arguments(p, true, before, after);
 
-                       boost::tie(before, after) = getCiteArguments(p, true);
                        if (command == "\\cite") {
                                // \cite without optional argument means
                                // \citet, \cite with at least one optional
@@ -1926,9 +1925,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        string before;
                        // text after the citation
                        string after;
+                       get_cite_arguments(p, argumentOrder != 'j', before, after);
 
-                       boost::tie(before, after) =
-                               getCiteArguments(p, argumentOrder != 'j');
                        string const citation = p.verbatim_item();
                        if (!before.empty() && argumentOrder == '\0') {
                                cerr << "Warning: Assuming argument order "