From c8fd502b5671fe85b15f07df7d7dbc177f709888 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 27 Nov 2007 20:30:22 +0000 Subject: [PATCH] some de-boostification git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21830 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/tex2lyx.cpp | 8 +++----- src/tex2lyx/text.cpp | 18 ++++++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index d216d0a49f..fa0dc3ecf0 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -28,8 +28,6 @@ #include "support/Package.h" #include "support/unicode.h" -#include - #include #include #include @@ -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 cmd_helper; +typedef int (*cmd_helper)(string const &, string const &); int parse_help(string const &, string const &) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 423992dc89..06aaa1c1db 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -25,8 +25,6 @@ #include "support/convert.h" #include "support/filetools.h" -#include - #include #include #include @@ -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 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 " -- 2.39.5