... but I do not like it...
? build
? qt
? string
? test
Index: po/POTFILES.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v
retrieving revision 1.299
diff -u -p -r1.299 POTFILES.in
--- po/POTFILES.in 9 Oct 2002 14:38:17 -0000 1.299
+++ po/POTFILES.in 21 Oct 2002 22:06:01 -0000
@@ -1,20 +1,16 @@
-src/BufferView.C
-src/BufferView_pimpl.C
-src/Chktex.C
-src/CutAndPaste.C
-src/LColor.C
-src/LaTeX.C
-src/LyXAction.C
-src/MenuBackend.C
src/buffer.C
src/bufferlist.C
+src/BufferView.C
src/bufferview_funcs.C
+src/BufferView_pimpl.C
+src/Chktex.C
src/converter.C
+src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
-src/frontends/LyXView.C
+src/frontends/controllers/biblio.C
src/frontends/controllers/ButtonController.h
+src/frontends/controllers/character.C
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlCharacter.C
@@ -29,13 +25,13 @@ src/frontends/controllers/ControlSearch.
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlThesaurus.C
src/frontends/controllers/ControlVCLog.C
-src/frontends/controllers/biblio.C
-src/frontends/controllers/character.C
src/frontends/controllers/frnt_lang.C
src/frontends/controllers/helper_funcs.C
src/frontends/gnome/GLog.C
+src/frontends/LyXView.C
src/frontends/qt2/Alert_pimpl.C
src/frontends/qt2/FileDialog.C
+src/frontends/qt2/lengthcombo.C
src/frontends/qt2/QAbout.C
src/frontends/qt2/QBibitem.C
src/frontends/qt2/QBibtex.C
@@ -47,8 +43,8 @@ src/frontends/qt2/QCommandBuffer.C
src/frontends/qt2/QDelimiterDialog.C
src/frontends/qt2/QDocument.C
src/frontends/qt2/QDocumentDialog.C
-src/frontends/qt2/QERT.C
src/frontends/qt2/QError.C
+src/frontends/qt2/QERT.C
src/frontends/qt2/QExternal.C
src/frontends/qt2/QExternalDialog.C
src/frontends/qt2/QFloat.C
@@ -65,6 +61,7 @@ src/frontends/qt2/QPrint.C
src/frontends/qt2/QPrintDialog.C
src/frontends/qt2/QRef.C
src/frontends/qt2/QSearch.C
+src/frontends/qt2/QSendto.C
src/frontends/qt2/QShowFile.C
src/frontends/qt2/QSpellchecker.C
src/frontends/qt2/QTabularCreate.C
@@ -74,9 +71,9 @@ src/frontends/qt2/QToc.C
src/frontends/qt2/QURL.C
src/frontends/qt2/QVCLog.C
src/frontends/qt2/QWrap.C
-src/frontends/qt2/lengthcombo.C
src/frontends/xforms/Alert_pimpl.C
src/frontends/xforms/ColorHandler.C
+src/frontends/xforms/combox.C
src/frontends/xforms/FeedbackController.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormAboutlyx.C
@@ -85,8 +82,8 @@ src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormDocument.C
-src/frontends/xforms/FormERT.C
src/frontends/xforms/FormError.C
+src/frontends/xforms/FormERT.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormFloat.C
@@ -119,15 +116,14 @@ src/frontends/xforms/FormToc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/FormWrap.C
-src/frontends/xforms/Menubar_pimpl.C
-src/frontends/xforms/XMiniBuffer.C
-src/frontends/xforms/combox.C
src/frontends/xforms/input_validators.C
+src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/xforms_helpers.C
+src/frontends/xforms/XMiniBuffer.C
src/gettext.h
src/importer.C
-src/insets/inset.C
src/insets/insetbib.C
+src/insets/inset.C
src/insets/insetcaption.C
src/insets/inseterror.C
src/insets/insetert.C
@@ -154,11 +150,14 @@ src/insets/inseturl.C
src/insets/insetwrap.C
src/kbsequence.C
src/language.C
+src/LaTeX.C
+src/LColor.C
+src/LyXAction.C
src/lyx_cb.C
-src/lyx_main.C
src/lyxfind.C
src/lyxfont.C
src/lyxfunc.C
+src/lyx_main.C
src/lyxrc.C
src/lyxtextclasslist.C
src/lyxvc.C
@@ -168,10 +167,11 @@ src/mathed/math_cursor.C
src/mathed/math_hullinset.C
src/mathed/math_parboxinset.C
src/mathed/ref_inset.C
+src/MenuBackend.C
src/paragraph.C
src/support/filetools.C
src/tabular.C
-src/text.C
src/text2.C
src/text3.C
+src/text.C
src/ext_l10n.h
Index: src/LaTeX.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeX.C,v
retrieving revision 1.68
diff -u -p -r1.68 LaTeX.C
--- src/LaTeX.C 7 Aug 2002 08:11:36 -0000 1.68
+++ src/LaTeX.C 21 Oct 2002 22:06:02 -0000
@@ -47,7 +47,12 @@ using std::vector;
using std::set;
using boost::regex;
using boost::regex_match;
+
+#ifndef USE_INCLUDED_STRING
using boost::smatch;
+#else
+using boost::cmatch;
+#endif
// TODO: in no particular order
// - get rid of the extern BufferList and the call to
@@ -432,9 +437,23 @@ void LaTeX::scanAuxFile(string const & f
while (getline(ifs, token)) {
token = rtrim(token, "\r");
+#ifndef USE_INCLUDED_STRING
smatch sub;
- if (regex_match(token, sub, reg1)) {
- string data = sub[1];
+#else
+ cmatch sub;
+#endif
+ if (
+#ifndef USE_INCLUDED_STRING
+ regex_match(token, sub, reg1)
+#else
+ regex_match(token.c_str(), sub, reg1)
+#endif
+ ) {
+#ifndef USE_INCLUDED_STRING
+ string data = sub.str(1);
+#else
+ string data = sub.str(1).c_str();
+#endif
while (!data.empty()) {
string citation;
data = split(data, citation, ',');
@@ -442,8 +461,18 @@ void LaTeX::scanAuxFile(string const & f
<< citation << endl;
aux_info.citations.insert(citation);
}
- } else if (regex_match(token, sub, reg2)) {
- string data = sub[1];
+ } else if (
+#ifndef USE_INCLUDED_STRING
+ regex_match(token, sub, reg2)
+#else
+ regex_match(token.c_str(), sub, reg2)
+#endif
+ ) {
+#ifndef USE_INCLUDED_STRING
+ string data = sub.str(1);
+#else
+ string data = sub.str(1).c_str();
+#endif
// data is now all the bib files separated by ','
// get them one by one and pass them to the helper
while (!data.empty()) {
@@ -454,16 +483,36 @@ void LaTeX::scanAuxFile(string const & f
<< database << "'" << endl;
aux_info.databases.insert(database);
}
- } else if (regex_match(token, sub, reg3)) {
- string style = sub[1];
+ } else if (
+#ifndef USE_INCLUDED_STRING
+ regex_match(token, sub, reg3)
+#else
+ regex_match(token.c_str(), sub, reg3)
+#endif
+ ) {
+#ifndef USE_INCLUDED_STRING
+ string style = sub.str(1);
+#else
+ string style = sub.str(1).c_str();
+#endif
// token is now the style file
// pass it to the helper
style = ChangeExtension(style, "bst");
lyxerr[Debug::LATEX] << "Bibtex style: `"
<< style << "'" << endl;
aux_info.styles.insert(style);
- } else if (regex_match(token, sub, reg4)) {
- string file2 = sub[1];
+ } else if (
+#ifndef USE_INCLUDED_STRING
+ regex_match(token, sub, reg4)
+#else
+ regex_match(token.c_str(), sub, reg4)
+#endif
+ ) {
+#ifndef USE_INCLUDED_STRING
+ string const file2 = sub.str(1);
+#else
+ string const file2 = sub.str(1).c_str();
+#endif
scanAuxFile(file2, aux_info);
}
}
@@ -683,21 +732,37 @@ void LaTeX::deplog(DepTable & head)
token = rtrim(token, "\r");
if (token.empty()) continue;
+#ifndef USE_INCLUDED_STRING
smatch sub;
if (regex_match(token, sub, reg1)) {
- foundfile = sub[1];
+ foundfile = sub.str(1);
} else if (regex_match(token, sub, reg2)) {
- foundfile = sub[1];
+ foundfile = sub.str(1);
} else if (regex_match(token, sub, reg3)) {
- foundfile = sub[1];
+ foundfile = sub.str(1);
} else if (regex_match(token, sub, reg4)) {
- foundfile = sub[1];
+ foundfile = sub.str(1);
} else if (regex_match(token, sub, reg5)) {
- foundfile = sub[1];
+ foundfile = sub.str(1);
} else {
continue;
}
-
+#else
+ cmatch sub;
+ if (regex_match(token.c_str(), sub, reg1)) {
+ foundfile = sub.str(1).c_str();
+ } else if (regex_match(token.c_str(), sub, reg2)) {
+ foundfile = sub.str(1).c_str();
+ } else if (regex_match(token.c_str(), sub, reg3)) {
+ foundfile = sub.str(1).c_str();
+ } else if (regex_match(token.c_str(), sub, reg4)) {
+ foundfile = sub.str(1).c_str();
+ } else if (regex_match(token.c_str(), sub, reg5)) {
+ foundfile = sub.str(1).c_str();
+ } else {
+ continue;
+ }
+#endif
// convert from native os path to unix path
foundfile = os::internal_path(foundfile);
@@ -726,7 +791,13 @@ void LaTeX::deplog(DepTable & head)
// (2) foundfile is in the tmpdir
// insert it into head
else if (FileInfo(OnlyFilename(foundfile)).exist()) {
- if (regex_match(foundfile, unwanted)) {
+ if (
+#ifndef USE_INCLUDED_STRING
+ regex_match(foundfile, unwanted)
+#else
+ regex_match(foundfile.c_str(), unwanted)
+#endif
+ ) {
lyxerr[Debug::DEPEND]
<< "We don't want "
<< OnlyFilename(foundfile)
Index: src/box.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/box.C,v
retrieving revision 1.4
diff -u -p -r1.4 box.C
--- src/box.C 21 Mar 2002 17:25:09 -0000 1.4
+++ src/box.C 21 Oct 2002 22:06:02 -0000
@@ -8,6 +8,8 @@
// Code moved out of line and out of box.h by Angus (7 Jan 2002)
+#include <config.h>
+
#include "box.h"
#include "support/LOstream.h"
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.389
diff -u -p -r1.389 buffer.C
--- src/buffer.C 21 Oct 2002 16:21:52 -0000 1.389
+++ src/buffer.C 21 Oct 2002 22:06:04 -0000
@@ -1180,7 +1180,11 @@ bool Buffer::readFile(LyXLex & lex, stri
"running the conversion script."));
return false;
}
+#ifndef USE_INCLUDED_STRING
istringstream is(ret.second);
+#else
+ istringstream is(ret.second.c_str());
+#endif
LyXLex tmplex(0, 0);
tmplex.setStream(is);
return readFile(tmplex, string());
Index: src/chset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/chset.C,v
retrieving revision 1.23
diff -u -p -r1.23 chset.C
--- src/chset.C 25 May 2002 00:19:56 -0000 1.23
+++ src/chset.C 21 Oct 2002 22:06:04 -0000
@@ -20,7 +20,13 @@ using std::make_pair;
using std::endl;
using boost::regex;
using boost::regex_match;
+
+#ifndef USE_INCLUDED_STRING
using boost::smatch;
+#else
+using boost::cmatch;
+#endif
+
bool CharacterSet::loadFile(string const & fname)
{
@@ -49,10 +55,25 @@ bool CharacterSet::loadFile(string const
// without the use of a keyword table.
regex reg("^([12][0-9][0-9])[ \t]+\"([^ ]+)\".*");
while (getline(ifs, line)) {
+#ifndef USE_INCLUDED_STRING
smatch sub;
- if (regex_match(line, sub, reg)) {
- int const n = lyx::atoi(sub[1]);
- string const str = sub[2];
+#else
+ cmatch sub;
+#endif
+ if (
+#ifndef USE_INCLUDED_STRING
+ regex_match(line, sub, reg)
+#else
+ regex_match(line.c_str(), sub, reg)
+#endif
+ ) {
+#ifndef USE_INCLUDED_STRING
+ int const n = lyx::atoi(sub.str(1));
+ string const str = sub.str(2);
+#else
+ int const n = lyx::atoi(sub.str(1).c_str());
+ string const str = sub.str(2).c_str();
+#endif
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "Chardef: " << n
<< " to [" << str << "]" << endl;
Index: src/counters.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/counters.C,v
retrieving revision 1.15
diff -u -p -r1.15 counters.C
--- src/counters.C 6 Sep 2002 14:47:59 -0000 1.15
+++ src/counters.C 21 Oct 2002 22:06:04 -0000
@@ -278,7 +278,12 @@ string Counters::labelItem(string const
}
s << o.str();
}
+
+#ifndef USE_INCLUDED_STRING
return s.str();
+#else
+ return s.str().c_str();
+#endif
}
@@ -340,5 +345,10 @@ string Counters::numberLabel(string cons
s << eiv.str();
}
}
+
+#ifndef USE_INCLUDED_STRING
return s.str();
+#else
+ return s.str().c_str();
+#endif
}
Index: src/factory.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/factory.C,v
retrieving revision 1.8
diff -u -p -r1.8 factory.C
--- src/factory.C 12 Sep 2002 14:58:05 -0000 1.8
+++ src/factory.C 21 Oct 2002 22:06:04 -0000
@@ -8,6 +8,8 @@
* Full author contact details are available in file CREDITS
*/
+#include <config.h>
+
#include "funcrequest.h"
#include "bufferparams.h"
#include "buffer.h"
@@ -123,7 +125,7 @@ Inset * createInset(FuncRequest const &
}
return 0;
- case LFUN_INDEX_PRINT:
+ case LFUN_INDEX_PRINT:
return new InsetPrintIndex(InsetCommandParams("printindex"));
case LFUN_TOC_INSERT:
@@ -153,5 +155,3 @@ Inset * createInset(FuncRequest const &
}
return 0;
}
-
-
Index: src/funcrequest.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/funcrequest.C,v
retrieving revision 1.4
diff -u -p -r1.4 funcrequest.C
--- src/funcrequest.C 28 Aug 2002 08:30:26 -0000 1.4
+++ src/funcrequest.C 21 Oct 2002 22:06:04 -0000
@@ -6,6 +6,8 @@
* \author Andr� P�nitz
*/
+#include <config.h>
+
#include "funcrequest.h"
#include "BufferView.h"
#include "lyxfunc.h" // only for setMessage()
@@ -54,13 +56,13 @@ FuncRequest::FuncRequest(FuncRequest con
: view_(cmd.view_), action(cmd.action), argument(arg),
x(cmd.x), y(cmd.y), button_(cmd.button_)
{}
-
+
FuncRequest::FuncRequest(FuncRequest const & cmd, BufferView * view)
: view_(view), action(cmd.action), argument(cmd.argument),
x(cmd.x), y(cmd.y), button_(cmd.button_)
{}
-
+
BufferView * FuncRequest::view() const
{
Index: src/lyx_main.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.125
diff -u -p -r1.125 lyx_main.C
--- src/lyx_main.C 20 Oct 2002 15:03:53 -0000 1.125
+++ src/lyx_main.C 21 Oct 2002 22:06:04 -0000
@@ -91,7 +91,7 @@ LyX::LyX(int & argc, char * argv[])
// if this should not be in this file, please also remove
// #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye.
grfx::setDisplayTranslator();
-
+
if (want_gui) {
lyx_gui::parse_init(argc, argv);
}
Index: src/sgml.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/sgml.C,v
retrieving revision 1.2
diff -u -p -r1.2 sgml.C
--- src/sgml.C 21 Oct 2002 16:21:53 -0000 1.2
+++ src/sgml.C 21 Oct 2002 22:06:04 -0000
@@ -8,23 +8,22 @@
*/
#include <config.h>
-
+
#include "support/LOstream.h"
-
+
#include "paragraph.h"
#include "sgml.h"
-
+
using std::pair;
using std::make_pair;
using std::ostream;
using std::endl;
-
+
namespace sgml {
-pair<bool, string> escapeChar(char c)
-{
+pair<bool, string> escapeChar(char c) {
string str;
-
+
switch (c) {
case Paragraph::META_HFILL:
break;
@@ -83,7 +82,7 @@ pair<bool, string> escapeChar(char c)
return make_pair(false, str);
}
-
+
int openTag(ostream & os, Paragraph::depth_type depth,
bool mixcont, string const & latexname)
{
Index: src/text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.263
diff -u -p -r1.263 text2.C
--- src/text2.C 10 Sep 2002 10:18:55 -0000 1.263
+++ src/text2.C 21 Oct 2002 22:06:06 -0000
@@ -1335,7 +1335,11 @@ void LyXText::setCounter(Buffer const *
ostringstream o;
//o << fl.name() << " " << buf->counters().value(fl.name()) << ":";
o << fl.name() << " #:";
+#ifndef USE_INCLUDED_STRING
s = o.str();
+#else
+ s = o.str().c_str();
+#endif
} else {
// par->SetLayout(0);
// s = layout->labelstring;
Index: src/vc-backend.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/vc-backend.C,v
retrieving revision 1.33
diff -u -p -r1.33 vc-backend.C
--- src/vc-backend.C 13 Aug 2002 17:43:37 -0000 1.33
+++ src/vc-backend.C 21 Oct 2002 22:06:06 -0000
@@ -31,7 +31,13 @@ using std::ifstream;
using std::getline;
using boost::regex;
using boost::regex_match;
+
+#ifndef USE_INCLUDED_STRING
using boost::smatch;
+#else
+using boost::cmatch;
+#endif
+
int VCS::doVCCommand(string const & cmd, string const & path)
{
@@ -252,13 +258,23 @@ void CVS::scanMaster()
lyxerr[Debug::LYXVC] << "\t line: " << line << endl;
if (contains(line, tmpf)) {
// Ok extract the fields.
+#ifndef USE_INCLUDED_STRING
smatch sm;
regex_match(line, sm, reg);
//sm[0]; // whole matched string
//sm[1]; // filename
- version_ = sm[2];
- string file_date = sm[3];
+ version_ = sm.str(2);
+ string file_date = sm.str(3);
+#else
+ cmatch sm;
+ regex_match(line.c_str(), sm, reg);
+
+ //sm[0]; // whole matched string
+ //sm[1]; // filename
+ version_ = sm.str(2).c_str();
+ string file_date = sm.str(3).c_str();
+#endif
//sm[4]; // options
//sm[5]; // tag or tagdate
FileInfo fi(file_);
Index: src/frontends/lyx_gui.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/lyx_gui.h,v
retrieving revision 1.12
diff -u -p -r1.12 lyx_gui.h
--- src/frontends/lyx_gui.h 5 Sep 2002 15:14:20 -0000 1.12
+++ src/frontends/lyx_gui.h 21 Oct 2002 22:06:06 -0000
@@ -4,16 +4,17 @@
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author John Levon
+ * \author John Levon
*
* Full author contact details are available in file CREDITS
*/
#ifndef LYX_GUI_H
#define LYX_GUI_H
-
+
#include "LColor.h"
-#include "LString.h"
+#include "LString.h"
+
#include <vector>
class Dialogs;
@@ -23,55 +24,56 @@ class LyXComm;
/// GUI interaction
namespace lyx_gui {
- /// parse command line and do basic initialisation
- void parse_init(int & argc, char * argv[]);
+/// parse command line and do basic initialisation
+void parse_init(int & argc, char * argv[]);
+
+/**
+ * set up GUI parameters. At this point lyxrc may
+ * be used.
+ */
+void parse_lyxrc();
+
+/**
+ * Start the main event loop, after executing the given
+ * batch commands, and loading the given documents
+ */
+void start(string const & batch, std::vector<string> const & files);
+
+/**
+ * quit running LyX
+ */
+void exit();
+
+/** Eg, passing LColor::black returns "000000",
+ * passing LColor::white returns "ffffff".
+ */
+string const hexname(LColor::color col);
+
+/**
+ * update an altered GUI color
+ */
+void update_color(LColor::color col);
+
+/**
+ * update the font cache
+ */
+void update_fonts();
+
+/**
+ * is the given font available ?
+ */
+bool font_available(LyXFont const & font);
+
+/**
+ * add a callback for I/O read notification
+ */
+void set_read_callback(int fd, LyXComm * comm);
+
+/**
+ * remove a I/O read callback
+ */
+void remove_read_callback(int fd);
- /**
- * set up GUI parameters. At this point lyxrc may
- * be used.
- */
- void parse_lyxrc();
-
- /**
- * Start the main event loop, after executing the given
- * batch commands, and loading the given documents
- */
- void start(string const & batch, std::vector<std::string> files);
-
- /**
- * quit running LyX
- */
- void exit();
-
- /** Eg, passing LColor::black returns "000000",
- * passing LColor::white returns "ffffff".
- */
- string const hexname(LColor::color col);
-
- /**
- * update an altered GUI color
- */
- void update_color(LColor::color col);
-
- /**
- * update the font cache
- */
- void update_fonts();
-
- /**
- * is the given font available ?
- */
- bool font_available(LyXFont const & font);
-
- /**
- * add a callback for I/O read notification
- */
- void set_read_callback(int fd, LyXComm * comm);
-
- /**
- * remove a I/O read callback
- */
- void remove_read_callback(int fd);
-}
+} // namespace lyx_gui
#endif // LYX_GUI_H
Index: src/frontends/controllers/ControlMath.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlMath.C,v
retrieving revision 1.5
diff -u -p -r1.5 ControlMath.C
--- src/frontends/controllers/ControlMath.C 9 Sep 2002 15:53:20 -0000 1.5
+++ src/frontends/controllers/ControlMath.C 21 Oct 2002 22:06:06 -0000
@@ -9,6 +9,8 @@
* Full author contact details are available in file CREDITS
*/
+#include <config.h>
+
#include "ControlMath.h"
char const * function_names[] = {
Index: src/frontends/controllers/biblio.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/biblio.C,v
retrieving revision 1.35
diff -u -p -r1.35 biblio.C
--- src/frontends/controllers/biblio.C 21 Oct 2002 17:38:08 -0000 1.35
+++ src/frontends/controllers/biblio.C 21 Oct 2002 22:06:07 -0000
@@ -118,7 +118,11 @@ regexSearch(InfoMap const & theMap,
vector<string>::const_iterator start,
Direction dir)
{
+#ifndef USE_INCLUDED_STRING
boost::regex reg(expr);
+#else
+ boost::regex reg(expr.c_str());
+#endif
for (vector<string>::const_iterator it = start;
// End condition is direction-dependent.
@@ -131,9 +135,15 @@ regexSearch(InfoMap const & theMap,
if (info != theMap.end())
data += " " + info->second;
+#ifndef USE_INCLUDED_STRING
if (boost::regex_match(data, reg)) {
return it;
}
+#else
+ if (boost::regex_match(data.c_str(), reg)) {
+ return it;
+ }
+#endif
}
return keys.end();
Index: src/frontends/qt2/QLPainter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLPainter.C,v
retrieving revision 1.14
diff -u -p -r1.14 QLPainter.C
--- src/frontends/qt2/QLPainter.C 20 Oct 2002 14:27:28 -0000 1.14
+++ src/frontends/qt2/QLPainter.C 21 Oct 2002 22:06:07 -0000
@@ -261,7 +261,8 @@ Painter & QLPainter::text(int x, int y,
for (size_t i = 0; i < ls; ++i)
str[i] = QChar(encoding->ucs(s[i]));
// HACK: QT3 refuses to show single compose characters
- if (ls = 1 && str[0].unicode() >= 0x05b0 && str[0].unicode() <= 0x05c2)
+ ls = 1;
+ if (str[0].unicode() >= 0x05b0 && str[0].unicode() <= 0x05c2)
str = ' ' + str;
#else
for (size_t i = 0; i < ls; ++i)
Index: src/frontends/qt2/lyx_gui.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v
retrieving revision 1.22
diff -u -p -r1.22 lyx_gui.C
--- src/frontends/qt2/lyx_gui.C 20 Oct 2002 01:48:28 -0000 1.22
+++ src/frontends/qt2/lyx_gui.C 21 Oct 2002 22:06:07 -0000
@@ -22,9 +22,6 @@
#include "debug.h"
#include "gettext.h"
-#include <fcntl.h>
-#include <boost/bind.hpp>
-
#include "lyx_gui.h"
#include "lyx_main.h"
#include "lyxrc.h"
@@ -41,6 +38,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/function/function0.hpp>
#include <boost/signals/signal1.hpp>
+#include <boost/bind.hpp>
#include "QtView.h"
#include "QLImage.h"
@@ -51,6 +49,8 @@
#include <qwidget.h>
#include <qpaintdevicemetrics.h>
+#include <fcntl.h>
+
#ifndef CXX_GLOBAL_CSTD
using std::exit;
#endif
@@ -98,7 +98,7 @@ void lyx_gui::parse_lyxrc()
}
-void lyx_gui::start(string const & batch, vector<string> files)
+void lyx_gui::start(string const & batch, vector<string> const & files)
{
// initial geometry
int xpos = -1;
Index: src/frontends/qt2/qttableview.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qttableview.C,v
retrieving revision 1.3
diff -u -p -r1.3 qttableview.C
--- src/frontends/qt2/qttableview.C 21 Mar 2002 21:19:37 -0000 1.3
+++ src/frontends/qt2/qttableview.C 21 Oct 2002 22:06:08 -0000
@@ -12,6 +12,8 @@
**
**********************************************************************/
+#include <config.h>
+
#include "qttableview.h"
#ifndef QT_NO_QTTABLEVIEW
#include "qscrollbar.h"
Index: src/frontends/xforms/lyx_gui.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/lyx_gui.C,v
retrieving revision 1.25
diff -u -p -r1.25 lyx_gui.C
--- src/frontends/xforms/lyx_gui.C 3 Oct 2002 11:25:01 -0000 1.25
+++ src/frontends/xforms/lyx_gui.C 21 Oct 2002 22:06:09 -0000
@@ -4,7 +4,7 @@
* Licence details can be found in the file COPYING.
*
* \author unknown
- * \author John Levon
+ * \author John Levon
*
* Full author contact details are available in file CREDITS
*/
@@ -73,10 +73,10 @@ float getDPI()
{
Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen);
return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
- (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2;
+ (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2;
}
-
+
/// set default GUI configuration
void setDefaults()
{
@@ -179,7 +179,7 @@ void lyx_gui::parse_init(int & argc, cha
Image::loadableFormats = boost::bind(&ImageXPM::loadableFormats);
#endif
- // must do this /before/ lyxrc gets read
+ // must do this /before/ lyxrc gets read
lyxrc.dpi = getDPI();
}
@@ -239,7 +239,7 @@ void lyx_gui::parse_lyxrc()
}
-void lyx_gui::start(string const & batch, vector<string> files)
+void lyx_gui::start(string const & batch, vector<string> const & files)
{
// initial geometry
int xpos = -1;
@@ -247,19 +247,19 @@ void lyx_gui::start(string const & batch
unsigned int width = 690;
unsigned int height = 510;
- static const int geometryBitmask =
+ int const geometryBitmask =
XParseGeometry(geometry,
- &xpos, &ypos, &width, &height);
+ &xpos, &ypos, &width, &height);
// if width is not set by geometry, check it against monitor width
- if (!(geometryBitmask & 4)) {
+ if (!(geometryBitmask & WidthValue)) {
Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen);
if (WidthOfScreen(scr) - 8 < int(width))
width = WidthOfScreen(scr) - 8;
}
// if height is not set by geometry, check it against monitor height
- if (!(geometryBitmask & 8)) {
+ if (!(geometryBitmask & HeightValue)) {
Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen);
if (HeightOfScreen(scr) - 24 < int(height))
height = HeightOfScreen(scr) - 24;
Index: src/graphics/GraphicsTypes.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/GraphicsTypes.C,v
retrieving revision 1.4
diff -u -p -r1.4 GraphicsTypes.C
--- src/graphics/GraphicsTypes.C 5 Sep 2002 15:14:20 -0000 1.4
+++ src/graphics/GraphicsTypes.C 21 Oct 2002 22:06:09 -0000
@@ -9,6 +9,8 @@
* Full author contact details available in file CREDITS
*/
+#include <config.h>
+
#include "graphics/GraphicsTypes.h"
namespace grfx {
@@ -30,7 +32,7 @@ void setDisplayTranslator()
displayTranslator.addPair(GrayscaleDisplay, "grayscale");
displayTranslator.addPair(ColorDisplay, "color");
displayTranslator.addPair(NoDisplay, "none");
-
+
// backward compatibility for old lyxrc.display_graphics
displayTranslator.addPair(MonochromeDisplay, "mono");
displayTranslator.addPair(GrayscaleDisplay, "gray");
Index: src/insets/insetcommandparams.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommandparams.C,v
retrieving revision 1.4
diff -u -p -r1.4 insetcommandparams.C
--- src/insets/insetcommandparams.C 25 Sep 2002 14:26:10 -0000 1.4
+++ src/insets/insetcommandparams.C 21 Oct 2002 22:06:09 -0000
@@ -8,6 +8,8 @@
* Full author contact details are available in file CREDITS
*/
+#include <config.h>
+
#ifdef __GNUG__
#pragma implementation
#endif
Index: src/mathed/formulamacro.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.C,v
retrieving revision 1.106
diff -u -p -r1.106 formulamacro.C
--- src/mathed/formulamacro.C 19 Aug 2002 14:39:35 -0000 1.106
+++ src/mathed/formulamacro.C 21 Oct 2002 22:06:09 -0000
@@ -61,7 +61,11 @@ InsetFormulaMacro::InsetFormulaMacro(str
InsetFormulaMacro::InsetFormulaMacro(string const & s)
{
+#ifndef USE_INCLUDED_STRING
std::istringstream is(s);
+#else
+ std::istringstream is(s.c_str());
+#endif
read(is);
}
Index: src/mathed/math_autocorrect.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_autocorrect.C,v
retrieving revision 1.5
diff -u -p -r1.5 math_autocorrect.C
--- src/mathed/math_autocorrect.C 11 Sep 2002 09:14:56 -0000 1.5
+++ src/mathed/math_autocorrect.C 21 Oct 2002 22:06:09 -0000
@@ -1,5 +1,5 @@
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include <config.h>
@@ -146,7 +146,12 @@ void initAutoCorrect()
//lyxerr[Debug::MATHED] << "ignoring line '" << line << "'" << endl;
continue;
}
+#ifndef USE_INCLUDED_STRING
istringstream il(line);
+#else
+ istringstream il(line.c_str());
+#endif
+
//lyxerr[Debug::MATHED] << "line '" << line << "'" << endl;
Correction corr;
if (corr.read(il)) {
Index: src/mathed/math_cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v
retrieving revision 1.321
diff -u -p -r1.321 math_cursor.C
--- src/mathed/math_cursor.C 15 Oct 2002 16:17:40 -0000 1.321
+++ src/mathed/math_cursor.C 21 Oct 2002 22:06:10 -0000
@@ -404,9 +404,13 @@ void MathCursor::insert(MathArray const
void MathCursor::paste(MathGridInset const & data)
{
ostringstream os;
- WriteStream wi(os, false, false);
- data.write(wi);
+ WriteStream wi(os, false, false);
+ data.write(wi);
+#ifndef USE_INCLUDED_STRING
dispatch(FuncRequest(LFUN_PASTE, os.str()));
+#else
+ dispatch(FuncRequest(LFUN_PASTE, os.str().c_str()));
+#endif
}
@@ -1295,7 +1299,7 @@ bool MathCursor::interpret(char c)
}
if (c == '\n') {
- if (currentMode() == MathInset::TEXT_MODE)
+ if (currentMode() == MathInset::TEXT_MODE)
insert(c);
return true;
}
Index: src/mathed/math_factory.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_factory.C,v
retrieving revision 1.65
diff -u -p -r1.65 math_factory.C
--- src/mathed/math_factory.C 21 Oct 2002 13:38:02 -0000 1.65
+++ src/mathed/math_factory.C 21 Oct 2002 22:06:10 -0000
@@ -1,6 +1,5 @@
-
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include <config.h>
@@ -55,6 +54,9 @@
#include <fstream>
+using std::endl;
+
+
namespace {
// file scope
@@ -78,7 +80,8 @@ bool math_font_available(string & name)
}
lyxerr[Debug::MATHED]
- << "font " << name << " not available and I can't fake it\n";
+ << "font " << name
+ << " not available and I can't fake it" << endl;
return false;
}
@@ -86,24 +89,28 @@ bool math_font_available(string & name)
void initSymbols()
{
string const filename = LibFileSearch(string(), "symbols");
- lyxerr[Debug::MATHED] << "read symbols from " << filename << "\n";
+ lyxerr[Debug::MATHED] << "read symbols from " << filename << endl;
if (filename.empty()) {
- lyxerr << "Could not find symbols file\n";
+ lyxerr << "Could not find symbols file" << endl;
return;
}
std::ifstream fs(filename.c_str());
string line;
bool skip = false;
- while (std::getline(fs, line)) {
+ while (getline(fs, line)) {
int charid = 0;
int fallbackid = 0;
- if (line.size() > 0 && line[0] == '#')
+ if (!line.empty() && line[0] == '#')
continue;
// special case of \iffont / \fi
if (line.size() >= 7 && line.substr(0, 6) == "iffont") {
+#ifndef USE_INCLUDED_STRING
istringstream is(line);
+#else
+ istringstream is(line.c_str());
+#endif
string tmp;
is >> tmp;
is >> tmp;
@@ -119,63 +126,71 @@ void initSymbols()
// special case of pre-defined macros
if (line.size() > 8 && line.substr(0, 5) == "\\def\\") {
- //lyxerr << "defining: '" << line << "'\n";
+ //lyxerr << "defining: '" << line << "'" << endl;
+#ifndef USE_INCLUDED_STRING
istringstream is(line);
+#else
+ istringstream is(line.c_str());
+#endif
MathMacroTable::create(MathAtom(new MathMacroTemplate(is)));
continue;
}
- istringstream is(line);
+ istringstream is(line.c_str());
latexkeys tmp;
is >> tmp.name >> tmp.inset;
- if (isFontName(tmp.inset))
+ if (isFontName(tmp.inset))
is >> charid >> fallbackid >> tmp.extra >> tmp.xmlname;
else
is >> tmp.extra;
if (!is) {
- lyxerr[Debug::MATHED] << "skipping line '" << line << "'\n";
+ lyxerr[Debug::MATHED] << "skipping line '" << line << "'" << endl;
lyxerr[Debug::MATHED]
- << tmp.name << ' ' << tmp.inset << ' ' << tmp.extra << "\n";
+ << tmp.name << ' ' << tmp.inset << ' ' << tmp.extra << endl;
continue;
}
if (isFontName(tmp.inset)) {
// tmp.inset _is_ the fontname here.
// create fallbacks if necessary
- if (tmp.extra=="func" || tmp.extra=="funclim" || tmp.extra=="special") {
- lyxerr[Debug::MATHED] << "symbol abuse for " << tmp.name << "\n";
+ if (tmp.extra == "func" || tmp.extra == "funclim" || tmp.extra == "special") {
+ lyxerr[Debug::MATHED] << "symbol abuse for " << tmp.name << endl;
tmp.draw = tmp.name;
} else if (math_font_available(tmp.inset)) {
- lyxerr[Debug::MATHED] << "symbol available for " << tmp.name << "\n";
+ lyxerr[Debug::MATHED] << "symbol available for " << tmp.name << endl;
tmp.draw += char(charid);
} else if (fallbackid) {
if (tmp.inset == "cmex")
tmp.inset = "lyxsymbol";
else
tmp.inset = "lyxboldsymbol";
- lyxerr[Debug::MATHED] << "symbol fallback for " << tmp.name << "\n";
- tmp.draw += char(fallbackid);
+ lyxerr[Debug::MATHED] << "symbol fallback for " << tmp.name << endl;
+ tmp.draw += char(fallbackid);
} else {
- lyxerr[Debug::MATHED] << "faking " << tmp.name << "\n";
+ lyxerr[Debug::MATHED] << "faking " << tmp.name << endl;
tmp.draw = tmp.name;
tmp.inset = "lyxtex";
}
} else {
// it's a proper inset
- lyxerr[Debug::MATHED] << "inset " << tmp.inset << " used for "
- << tmp.name << "\n";
+ lyxerr[Debug::MATHED] << "inset " << tmp.inset
+ << " used for " << tmp.name
+ << endl;
}
if (theWordList.find(tmp.name) != theWordList.end())
- lyxerr[Debug::MATHED] << "readSymbols: inset " << tmp.name
- << " already exists.\n";
+ lyxerr[Debug::MATHED]
+ << "readSymbols: inset " << tmp.name
+ << " already exists." << endl;
else
theWordList[tmp.name] = tmp;
- lyxerr[Debug::MATHED] << "read symbol '" << tmp.name
- << " inset: " << tmp.inset
- << " draw: " << int(tmp.draw[0])
- << " extra: " << tmp.extra
- << "'\n";
+
+ lyxerr[Debug::MATHED]
+ << "read symbol '" << tmp.name
+ << " inset: " << tmp.inset
+ << " draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
+ << " extra: " << tmp.extra
+ << "'" << endl;
}
}
@@ -197,18 +212,20 @@ latexkeys const * in_word_set(string con
{
WordList::iterator it = theWordList.find(str);
//lyxerr << "looking up '" << str << "' found: "
- // << (it != theWordList.end()) << "\n";
+ // << (it != theWordList.end()) << endl;
return (it != theWordList.end()) ? &(it->second) : 0;
}
MathAtom createMathInset(string const & s)
{
- lyxerr[Debug::MATHED] << "creating inset with name: '" << s << "'\n";
+ lyxerr[Debug::MATHED] << "creating inset with name: '"
+ << s << "'" << endl;;
latexkeys const * l = in_word_set(s);
if (l) {
string const & inset = l->inset;
- lyxerr[Debug::MATHED] << " found inset: '" << inset << "'\n";
+ lyxerr[Debug::MATHED] << " found inset: '" <<
+ inset << "'" << endl;
if (inset == "ref")
return MathAtom(new RefInset(l->name));
if (inset == "underset")
@@ -279,6 +296,6 @@ MathAtom createMathInset(string const &
if (MathMacroTable::has(s))
return MathAtom(new MathMacro(s));
- //lyxerr[Debug::MATHED] << "creating inset 2 with name: '" << s << "'\n";
+ //lyxerr[Debug::MATHED] << "creating inset 2 with name: '" << s << "'" << endl;
return MathAtom(new MathUnknownInset(s));
}
Index: src/support/lstrings.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/lstrings.C,v
retrieving revision 1.58
diff -u -p -r1.58 lstrings.C
--- src/support/lstrings.C 25 Sep 2002 10:03:41 -0000 1.58
+++ src/support/lstrings.C 21 Oct 2002 22:06:10 -0000
@@ -21,6 +21,7 @@
#include "debug.h"
#include <boost/regex.hpp>
+#include <boost/tokenizer.hpp>
#include <algorithm>
@@ -446,8 +447,13 @@ bool regexMatch(string const & a, string
string regex(pattern);
regex = subst(regex, ".", "\\.");
regex = subst(regex, "*", ".*");
+#ifndef USE_INCLUDED_STRING
boost::regex reg(regex);
return boost::regex_match(a, reg);
+#else
+ boost::regex reg(regex.c_str());
+ return boost::regex_match(a.c_str(), reg);
+#endif
}
@@ -615,6 +621,7 @@ string const escape(string const & lab)
vector<string> const getVectorFromString(string const & str,
string const & delim)
{
+#ifdef USE_INCLUDED_STRING
vector<string> vec;
if (str.empty())
return vec;
@@ -632,7 +639,13 @@ vector<string> const getVectorFromString
keys = keys.substr(start);
}
return vec;
+#else
+ boost::char_separator<char> sep(delim.c_str());
+ boost::tokenizer<boost::char_separator<char> > tokens(str, sep);
+ return vector<string>(tokens.begin(), tokens.end());
+#endif
}
+
// the same vice versa
string const getStringFromVector(vector<string> const & vec,
Index: src/support/lyxstring.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/lyxstring.C,v
retrieving revision 1.58
diff -u -p -r1.58 lyxstring.C
--- src/support/lyxstring.C 25 Sep 2002 10:03:41 -0000 1.58
+++ src/support/lyxstring.C 21 Oct 2002 22:06:11 -0000
@@ -665,7 +665,7 @@ lyxstring::const_reference lyxstring::op
#if 0
// This is actually what the standard requires,
lyx::Assert(pos <= rep->sz); // OURS!
- static char helper = '\0';
+ static char const helper = '\0';
return pos == rep->sz ? helper : rep->s[pos];
#else
// but we use this one since it is stricter
Index: src/support/os.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/os.C,v
retrieving revision 1.2
diff -u -p -r1.2 os.C
--- src/support/os.C 16 Feb 2002 15:59:55 -0000 1.2
+++ src/support/os.C 21 Oct 2002 22:06:11 -0000
@@ -1,3 +1,5 @@
+#include <config.h>
+
#ifdef __GNUG__
#pragma implementation
#endif
--
Lgb