From fc83b49fd476886bf6c9472e289f611162e00bfc Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 11 Sep 2006 10:07:39 +0000 Subject: [PATCH] make it compile again git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14973 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt3/Alert_pimpl.C | 1 + src/frontends/qt3/QPrefsDialog.C | 6 +++--- src/frontends/qt3/qt_helpers.C | 20 ++++++++++---------- src/frontends/qt3/qt_helpers.h | 2 +- src/frontends/qt3/validators.C | 6 +++--- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/frontends/qt3/Alert_pimpl.C b/src/frontends/qt3/Alert_pimpl.C index 9025b6abf3..4cf4c1565e 100644 --- a/src/frontends/qt3/Alert_pimpl.C +++ b/src/frontends/qt3/Alert_pimpl.C @@ -25,6 +25,7 @@ #include +using lyx::docstring; using lyx::support::bformat; using std::pair; diff --git a/src/frontends/qt3/QPrefsDialog.C b/src/frontends/qt3/QPrefsDialog.C index 7da5eeeef1..695d69f693 100644 --- a/src/frontends/qt3/QPrefsDialog.C +++ b/src/frontends/qt3/QPrefsDialog.C @@ -863,9 +863,9 @@ void QPrefsDialog::remove_format() return; string const current_text = form_->formats().get(nr).name(); if (form_->converters().formatIsUsed(current_text)) { - Alert::error(lyx::to_utf8(_("Format in use")), - lyx::to_utf8(_("Cannot remove a Format used by a Converter. " - "Remove the converter first."))); + Alert::error(_("Format in use"), + _("Cannot remove a Format used by a Converter. " + "Remove the converter first.")); return; } form_->formats().erase(current_text); diff --git a/src/frontends/qt3/qt_helpers.C b/src/frontends/qt3/qt_helpers.C index 0458e9a174..b9b4317862 100644 --- a/src/frontends/qt3/qt_helpers.C +++ b/src/frontends/qt3/qt_helpers.C @@ -154,28 +154,28 @@ docstring const qstring_to_ucs4(QString const & str) } -string const formatted(string const & text, int w) +docstring const formatted(docstring const & text, int w) { - string sout; + docstring sout; if (text.empty()) return sout; - string::size_type curpos = 0; - string line; + docstring::size_type curpos = 0; + docstring line; for (;;) { - string::size_type const nxtpos1 = text.find(' ', curpos); - string::size_type const nxtpos2 = text.find('\n', curpos); - string::size_type const nxtpos = std::min(nxtpos1, nxtpos2); + docstring::size_type const nxtpos1 = text.find(' ', curpos); + docstring::size_type const nxtpos2 = text.find('\n', curpos); + docstring::size_type const nxtpos = std::min(nxtpos1, nxtpos2); - string const word = nxtpos == string::npos ? + docstring const word = nxtpos == docstring::npos ? text.substr(curpos) : text.substr(curpos, nxtpos-curpos); - bool const newline = (nxtpos2 != string::npos && + bool const newline = (nxtpos2 != docstring::npos && nxtpos2 < nxtpos1); - string const line_plus_word = + docstring const line_plus_word = line.empty() ? word : line + ' ' + word; // FIXME: make w be size_t diff --git a/src/frontends/qt3/qt_helpers.h b/src/frontends/qt3/qt_helpers.h index 9b64cb9830..3ddf8b11a2 100644 --- a/src/frontends/qt3/qt_helpers.h +++ b/src/frontends/qt3/qt_helpers.h @@ -36,7 +36,7 @@ void lengthToWidgets(QLineEdit * input, LengthCombo * combo, std::string const & len, LyXLength::UNIT default_unit); /// format a string to the given width -std::string const formatted(std::string const & text, int w = 80); +lyx::docstring const formatted(lyx::docstring const & text, int w = 80); /** * toqstr - convert char * into unicode diff --git a/src/frontends/qt3/validators.C b/src/frontends/qt3/validators.C index 42dba72efc..5f536bf3ac 100644 --- a/src/frontends/qt3/validators.C +++ b/src/frontends/qt3/validators.C @@ -138,9 +138,9 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const static int counter = 0; if (counter == 0) { - Alert::error(lyx::to_utf8(_("Invalid filename")), - lyx::to_utf8(_("LyX does not provide LateX support for file names containing any of these characters:\n")) + - printable_list(invalid_chars)); + Alert::error(_("Invalid filename"), + _("LyX does not provide LateX support for file names containing any of these characters:\n") + + lyx::from_utf8(printable_list(invalid_chars))); } ++counter; return QValidator::Intermediate; -- 2.39.2