From 6c1b980274015aee930aa54ed76893008f838048 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 10 Jul 2003 12:14:47 +0000 Subject: [PATCH] Fix compilation qt + included string by getting rid of the #ifdef BOOST_FORMAT stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7257 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/Alert_pimpl.C | 41 +++++---------------------------- src/frontends/qt2/ChangeLog | 6 +++++ src/frontends/qt2/QDocument.C | 24 ++++++++----------- 3 files changed, 22 insertions(+), 49 deletions(-) diff --git a/src/frontends/qt2/Alert_pimpl.C b/src/frontends/qt2/Alert_pimpl.C index 41e0fa8dc6..4a43fbdf2b 100644 --- a/src/frontends/qt2/Alert_pimpl.C +++ b/src/frontends/qt2/Alert_pimpl.C @@ -27,18 +27,13 @@ using std::pair; using std::make_pair; +using lyx::support::bformat; int prompt_pimpl(string const & tit, string const & question, int default_button, int cancel_button, string const & b1, string const & b2, string const & b3) { -#if USE_BOOST_FORMAT - boost::format fmt(_("LyX: %1$s")); - fmt % tit; - string const title = fmt.str(); -#else - string const title = _("LyX: ") + tit; -#endif + string const title = bformat(_("LyX: %1$s"), tit); int res = QMessageBox::information(0, toqstr(title), toqstr(formatted(question)), toqstr(b1), toqstr(b2), b3.empty() ? QString::null : toqstr(b3), @@ -53,39 +48,21 @@ int prompt_pimpl(string const & tit, string const & question, void warning_pimpl(string const & tit, string const & message) { -#if USE_BOOST_FORMAT - boost::format fmt(_("LyX: %1$s")); - fmt % tit; - string const title = fmt.str(); -#else - string const title = _("LyX: ") + tit; -#endif + string const title = bformat(_("LyX: %1$s"), tit); QMessageBox::warning(0, toqstr(title), toqstr(formatted(message))); } void error_pimpl(string const & tit, string const & message) { -#if USE_BOOST_FORMAT - boost::format fmt(_("LyX: %1$s")); - fmt % tit; - string const title = fmt.str(); -#else - string const title = _("LyX: ") + tit; -#endif + string const title = bformat(_("LyX: %1$s"), tit); QMessageBox::critical(0, toqstr(title), toqstr(formatted(message))); } void information_pimpl(string const & tit, string const & message) { -#if USE_BOOST_FORMAT - boost::format fmt(_("LyX: %1$s")); - fmt % tit; - string const title = fmt.str(); -#else - string const title = _("LyX: ") + tit; -#endif + string const title = bformat(_("LyX: %1$s"), tit); QMessageBox::information(0, toqstr(title), toqstr(formatted(message))); } @@ -93,13 +70,7 @@ void information_pimpl(string const & tit, string const & message) pair const askForText_pimpl(string const & msg, string const & dflt) { -#if USE_BOOST_FORMAT - boost::format fmt(_("LyX: %1$s")); - fmt % msg; - string const title = fmt.str(); -#else - string const title = _("LyX: ") + msg; -#endif + string const title = bformat(_("LyX: %1$s"), msg); QAskForTextDialog d(0, toqstr(title), true); // less than ideal ! d.askLA->setText(toqstr('&' + msg)); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 49a2aa048a..88d0673eda 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,9 @@ + +2003-07-11 André Pönitz + + * Alert_pimpl.C: + * QDocument.C: use bformat() instead of #ifdef + 2003-07-04 Lars Gullik Bjønnes * introduce namespace lyx::graphics diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index d5883b0398..4207074450 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -25,6 +25,7 @@ #include "lyxrc.h" // defaultUnit #include "tex-strings.h" // tex_graphics #include "support/tostr.h" +#include "support/lstrings.h" #include "support/filetools.h" // LibFileSearch() #include "support/BoostFormat.h" #include "lyxtextclasslist.h" @@ -47,19 +48,12 @@ #include - using std::vector; +using lyx::support::bformat; typedef Qt2CB > base_class; -QDocument::QDocument() - : base_class(_("LyX: Document Settings")) -{ - vector const langs = frnt::getLanguageData(false); - lang_ = getSecond(langs); -} - namespace { char const * encodings[] = { "LaTeX default", "latin1", "latin2", @@ -71,6 +65,12 @@ char const * encodings[] = { "LaTeX default", "latin1", "latin2", } +QDocument::QDocument() + : base_class(_("LyX: Document Settings")), + lang_(getSecond(frnt::getLanguageData(false))) +{} + + void QDocument::build_dialog() { dialog_.reset(new QDocumentDialog(this)); @@ -128,11 +128,7 @@ void QDocument::build_dialog() dialog_->latexModule->classCO->insertItem(toqstr(cit->description())); } else { string item = -#if USE_BOOST_FORMAT - boost::io::str(boost::format(_("Unavailable: %1$s")) % cit->description()); -#else - _("Unavailable: ") + cit->description(); -#endif + bformat(_("Unavailable: %1$s"), cit->description()); dialog_->latexModule->classCO->insertItem(toqstr(item)); } } @@ -602,7 +598,7 @@ void QDocument::update_contents() // margins - MarginsModuleBase * m(dialog_->marginsModule); + MarginsModuleBase * m = dialog_->marginsModule; int item = params.paperpackage; if (params.use_geometry) { -- 2.39.5