This fixes compilation in frontends/qt3. Committing now.
JMarc
Index: src/frontends/qt3/qt_helpers.C
===================================================================
--- src/frontends/qt3/qt_helpers.C (revision 14972)
+++ src/frontends/qt3/qt_helpers.C (working copy)
@@ -154,51 +154,53 @@ docstring const qstring_to_ucs4(QString
}
-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);
+
+ docstring const word =
+ nxtpos == docstring::npos ?
+ text.substr(curpos) :
+ text.substr(curpos, nxtpos - curpos);
- string const word = nxtpos == string::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 =
- line.empty() ? word : line + ' ' + word;
+ docstring const line_plus_word =
+ line.empty() ? word : line + lyx::char_type(' ') + word;
// FIXME: make w be size_t
if (int(line_plus_word.length()) >= w) {
- sout += line + '\n';
+ sout += line + lyx::char_type('\n');
if (newline) {
- sout += word + '\n';
+ sout += word + lyx::char_type('\n');
line.erase();
} else {
line = word;
}
} else if (newline) {
- sout += line_plus_word + '\n';
+ sout += line_plus_word + lyx::char_type('\n');
line.erase();
} else {
if (!line.empty())
- line += ' ';
+ line += lyx::char_type(' ');
line += word;
}
- if (nxtpos == string::npos) {
+ if (nxtpos == docstring::npos) {
if (!line.empty())
sout += line;
break;
Index: src/frontends/qt3/validators.C
===================================================================
--- src/frontends/qt3/validators.C (revision 14972)
+++ src/frontends/qt3/validators.C (working copy)
@@ -138,9 +138,9 @@ QValidator::State PathValidator::validat
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;
Index: src/frontends/qt3/qt_helpers.h
===================================================================
--- src/frontends/qt3/qt_helpers.h (revision 14972)
+++ src/frontends/qt3/qt_helpers.h (working copy)
@@ -36,7 +36,7 @@ void lengthToWidgets(QLineEdit * input,
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
Index: src/frontends/qt3/Alert_pimpl.C
===================================================================
--- src/frontends/qt3/Alert_pimpl.C (revision 14972)
+++ src/frontends/qt3/Alert_pimpl.C (working copy)
@@ -26,6 +26,7 @@
#include <algorithm>
using lyx::support::bformat;
+using lyx::docstring;
using std::pair;
using std::make_pair;
Index: src/frontends/qt3/QPrefsDialog.C
===================================================================
--- src/frontends/qt3/QPrefsDialog.C (revision 14972)
+++ src/frontends/qt3/QPrefsDialog.C (working copy)
@@ -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);