From 1d0eda5d0258fdc0658529c72cd84b482948bae8 Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 19 Jul 2002 17:15:56 +0000 Subject: [PATCH] fix some dispatch calls git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4712 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 4 ++-- src/ChangeLog | 5 +++++ src/LaTeX.C | 15 +++++++++------ src/frontends/controllers/ChangeLog | 4 ++++ src/frontends/controllers/ControlRef.C | 4 ++-- src/frontends/xforms/ChangeLog | 5 +++++ src/frontends/xforms/FormMathsDelim.C | 3 ++- src/frontends/xforms/FormMathsMatrix.C | 3 ++- 8 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index da02d8a2fb..6362e88c79 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -601,7 +601,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos, owner_->getLyXFunc()->dispatch(LFUN_PASTE); else owner_->getLyXFunc()->dispatch(LFUN_PASTESELECTION, - "paragraph"); + string("paragraph")); selection_possible = false; return; } @@ -3240,7 +3240,7 @@ void BufferView::Pimpl::smartQuote() if (style->pass_thru || (!insertInset(new InsetQuotes(c, bv_->buffer()->params)))) - bv_->owner()->getLyXFunc()->dispatch(LFUN_SELFINSERT, "\""); + bv_->owner()->getLyXFunc()->dispatch(LFUN_SELFINSERT, string("\"")); } diff --git a/src/ChangeLog b/src/ChangeLog index bc8207dc14..bf8c6b26aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-07-19 John Levon + + * BufferView_pimpl.C: + * LaTeX.C: fix dispatch calls + 2002-07-19 Dekel Tsur * text.C (drawChars): Fix Arabic text rendering. diff --git a/src/LaTeX.C b/src/LaTeX.C index 830834ebd6..664486e801 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -197,7 +197,8 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) if (lfun) { ostringstream str; str << _("LaTeX run number") << ' ' << count; - lfun->dispatch(LFUN_MESSAGE, str.str().c_str()); + // check lyxstring string stream and gcc 3.1 before fixing + lfun->dispatch(LFUN_MESSAGE, string(str.str().c_str())); } this->operator()(); @@ -233,7 +234,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; if (lfun) { - lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex.")); + lfun->dispatch(LFUN_MESSAGE, string(_("Running MakeIndex."))); } rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx"))); @@ -248,7 +249,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) // no checks for now lyxerr[Debug::LATEX] << "Running BibTeX." << endl; if (lfun) { - lfun->dispatch(LFUN_MESSAGE, _("Running BibTeX.")); + lfun->dispatch(LFUN_MESSAGE, string(_("Running BibTeX."))); } updateBibtexDependencies(head, bibtex_info); @@ -282,7 +283,8 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) if (lfun) { ostringstream str; str << _("LaTeX run number") << ' ' << count; - lfun->dispatch(LFUN_MESSAGE, str.str().c_str()); + // check lyxstring string stream and gcc 3.1 before fixing + lfun->dispatch(LFUN_MESSAGE, string(str.str().c_str())); } this->operator()(); @@ -312,7 +314,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; if (lfun) { - lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex.")); + lfun->dispatch(LFUN_MESSAGE, string(_("Running MakeIndex."))); } rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx"))); @@ -338,7 +340,8 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) if (lfun) { ostringstream str; str << _("LaTeX run number") << ' ' << count; - lfun->dispatch(LFUN_MESSAGE, str.str().c_str()); + // check lyxstring string stream and gcc 3.1 before fixing + lfun->dispatch(LFUN_MESSAGE, string(str.str().c_str())); } this->operator()(); diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 985c6246e3..cb9d00401b 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2002-07-19 John Levon + + * ControlRef.C: fix dispatch call + 2002-07-17 John Levon * ControlCharacter.C: use view_state_changed not setState diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C index 98e6cbc795..6c0f6a604b 100644 --- a/src/frontends/controllers/ControlRef.C +++ b/src/frontends/controllers/ControlRef.C @@ -44,14 +44,14 @@ vector const ControlRef::getLabelList(string const & name) const void ControlRef::gotoRef(string const & ref) const { - lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_SAVE, "0"); + lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_SAVE, string("0")); lv_.getLyXFunc()->dispatch(LFUN_REF_GOTO, ref); } void ControlRef::gotoBookmark() const { - lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_GOTO, "0"); + lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_GOTO, string("0")); } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 425b91cc78..10645e7831 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-07-19 John Levon + + * FormMathsDelim.C: + * FormMathsMatrix.C: fix dispatch calls + 2002-07-18 John Levon * Menubar_pimpl.C: diff --git a/src/frontends/xforms/FormMathsDelim.C b/src/frontends/xforms/FormMathsDelim.C index 81e86ed084..6908337cd3 100644 --- a/src/frontends/xforms/FormMathsDelim.C +++ b/src/frontends/xforms/FormMathsDelim.C @@ -91,7 +91,8 @@ void FormMathsDelim::apply() ostringstream ost; ost << delim_values[left] << ' ' << delim_values[right]; - lv_->getLyXFunc()->dispatch(LFUN_MATH_DELIM, ost.str().c_str()); + // the unusual formulation here is necessary for lyxstring stringstream + lv_->getLyXFunc()->dispatch(LFUN_MATH_DELIM, string(ost.str().c_str())); } bool FormMathsDelim::input(FL_OBJECT *, long) diff --git a/src/frontends/xforms/FormMathsMatrix.C b/src/frontends/xforms/FormMathsMatrix.C index c6d0fd4674..05c9b92466 100644 --- a/src/frontends/xforms/FormMathsMatrix.C +++ b/src/frontends/xforms/FormMathsMatrix.C @@ -99,7 +99,8 @@ void FormMathsMatrix::apply() ostringstream ost; ost << nx << ' ' << ny << ' ' << c << ' ' << sh; - lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATRIX, ost.str().c_str()); + // remeber gcc 3.1 and lyxstring stringstream before "fixing" + lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATRIX, string(ost.str().c_str())); } bool FormMathsMatrix::input(FL_OBJECT * ob, long) -- 2.39.2