]> git.lyx.org Git - lyx.git/commitdiff
code cosmetics whitespace, unneeded lyx:: qualification, indentation, unneeded destru...
authorAndré Pönitz <poenitz@gmx.net>
Wed, 25 Apr 2007 16:39:21 +0000 (16:39 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 25 Apr 2007 16:39:21 +0000 (16:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17994 a592a061-630c-0410-9148-cb99ea01b6c8

47 files changed:
src/frontends/qt4/Action.C
src/frontends/qt4/Action.h
src/frontends/qt4/Alert_pimpl.C
src/frontends/qt4/BulletsModule.C
src/frontends/qt4/BulletsModule.h
src/frontends/qt4/ColorCache.C
src/frontends/qt4/ColorCache.h
src/frontends/qt4/FileDialog_private.C
src/frontends/qt4/FileDialog_private.h
src/frontends/qt4/GuiApplication.C
src/frontends/qt4/GuiApplication.h
src/frontends/qt4/GuiClipboard.C
src/frontends/qt4/GuiFontLoader.C
src/frontends/qt4/GuiFontLoader.h
src/frontends/qt4/GuiSelection.C
src/frontends/qt4/GuiSelection.h
src/frontends/qt4/GuiView.h
src/frontends/qt4/GuiWorkArea.C
src/frontends/qt4/InsertTableWidget.C
src/frontends/qt4/QBibtex.C
src/frontends/qt4/QBox.C
src/frontends/qt4/QCitation.C
src/frontends/qt4/QDialogView.C
src/frontends/qt4/QDocument.C
src/frontends/qt4/QErrorList.C
src/frontends/qt4/QExternal.C
src/frontends/qt4/QGraphicsDialog.C
src/frontends/qt4/QIndex.h
src/frontends/qt4/QLMenubar.C
src/frontends/qt4/QLMenubar.h
src/frontends/qt4/QLPainter.h
src/frontends/qt4/QLPopupMenu.C
src/frontends/qt4/QLPopupMenu.h
src/frontends/qt4/QLToolbar.C
src/frontends/qt4/QLog.C
src/frontends/qt4/QPrefs.C
src/frontends/qt4/QRef.h
src/frontends/qt4/QTabular.C
src/frontends/qt4/QToc.C
src/frontends/qt4/QVSpace.C
src/frontends/qt4/Qt2BC.C
src/frontends/qt4/Qt2BC.h
src/frontends/qt4/TocModel.C
src/frontends/qt4/panelstack.C
src/frontends/qt4/panelstack.h
src/frontends/qt4/qt_helpers.C
src/frontends/qt4/validators.C

index b0f244742a3bcb9df0247ce30e95c3a685dad2d1..b34d9543fb2cdfe24fd9ff5b0f7fadefbc030e77 100644 (file)
 
 #include <boost/bind.hpp>
 
-using lyx::docstring;
-
 using std::string;
 using std::endl;
 
 namespace lyx {
-
 namespace frontend {
 
 
@@ -70,7 +67,7 @@ void Action::setAction(FuncRequest const & func)
 
 void Action::update()
 {
-       FuncStatus const status = lyx::getStatus(func_);
+       FuncStatus const status = getStatus(func_);
 
        if (status.onoff(true)) {
                setCheckable(true);
index 03a3e0da8d9c471f02b3cf71f2075e3955f5620f..f40d7a3ee7b81017bbd05afcbe8a69cdb71db072 100644 (file)
 
 #include <QAction>
 
-//class FuncRequest;
-
-//class string;
-
 namespace lyx {
 namespace frontend {
 
@@ -33,15 +29,15 @@ class GuiView;
  *
  * Action can be used in LyX menubar and/or toolbars.
  */
-class Action: public QAction {
+class Action : public QAction {
        Q_OBJECT
 public:
 
-       Action(GuiView & lyxView, lyx::docstring const & text,
-               FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring());
+       Action(GuiView & lyxView, docstring const & text,
+               FuncRequest const & func, docstring const & tooltip = docstring());
 
-       Action(GuiView & lyxView, std::string const & icon, lyx::docstring const & text,
-               FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring());
+       Action(GuiView & lyxView, std::string const & icon, docstring const & text,
+               FuncRequest const & func, docstring const & tooltip = docstring());
 
        void update();
 
index 95c690340859be299c6a74810a59cc737fd35406..0218c7c7e925340269f2d6b2a8afd81254e08b50 100644 (file)
 
 using std::pair;
 using std::make_pair;
+using lyx::support::bformat;
 
 namespace lyx {
 
-using lyx::support::bformat;
-using lyx::docstring;
-
 namespace {
 
 class MessageBox: public QMessageBox
 {
 public:
-       MessageBox(QWidget * parent = 0): QMessageBox(parent)
+       MessageBox(QWidget * parent = 0) : QMessageBox(parent)
        {
                setAttribute(Qt::WA_DeleteOnClose, true);
                setAttribute(Qt::WA_QuitOnClose, false);
@@ -139,7 +137,7 @@ askForText_pimpl(docstring const & msg, docstring const & dflt)
        bool ok;
        QString text = QInputDialog::getText(qApp->focusWidget(),
                toqstr(title),
-               toqstr(lyx::char_type('&') + msg),
+               toqstr(char_type('&') + msg),
                QLineEdit::Normal,
                toqstr(dflt), &ok);
 
index 5fdab63e59e47ecf0dc0fe829b91666aec93d027..7704b80261c2a231affd23c6dc4a3202e5b4f7dd 100644 (file)
@@ -22,7 +22,7 @@
 
 namespace lyx {
 
-using lyx::support::libFileSearch;
+using support::libFileSearch;
 
 using std::string;
 
@@ -30,9 +30,9 @@ BulletsModule::BulletsModule(QWidget * , char const * , Qt::WFlags)
 {
        setupUi(this);
 
-       for (int iter = 0; iter < 4; ++iter) {
+       for (int iter = 0; iter < 4; ++iter)
                bullets_[iter] = ITEMIZE_DEFAULTS[iter];
-       }
+
        current_font_ = -1;
        current_char_ = 0;
 
@@ -50,17 +50,15 @@ BulletsModule::BulletsModule(QWidget * , char const * , Qt::WFlags)
        setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 3"), "psnfss3");
        setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 4"), "psnfss4");
 
-       connect(levelLW, SIGNAL(currentRowChanged(int)), this, SLOT(showLevel(int)));
-       connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW, SLOT(setCurrentIndex(int)));
+       connect(levelLW, SIGNAL(currentRowChanged(int)),
+               this, SLOT(showLevel(int)));
+       connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW,
+               SLOT(setCurrentIndex(int)));
 }
 
 
-BulletsModule::~BulletsModule()
-{
-}
-
-
-void BulletsModule::setupPanel(QListWidget * lw, QString panelname, std::string fname)
+void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
+       std::string const & fname)
 {
        connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
                this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
@@ -199,10 +197,7 @@ Bullet const & BulletsModule::getBullet(int level) const
        return bullets_[level];
 }
 
-
 } // namespace lyx
 
 
 #include "BulletsModule_moc.cpp"
-
-
index 55b60881b6a921e5557f16f9c55862c8da1ae629..d7e667ec099defde7d57712dc6053805a527dd35 100644 (file)
@@ -25,11 +25,9 @@ namespace lyx {
 class BulletsModule : public QWidget, public Ui::BulletsUi {
        Q_OBJECT
 public:
-
+       ///
        BulletsModule(QWidget * parent = 0, const char * name = 0, Qt::WFlags fl = 0);
 
-       ~BulletsModule();
-
        /// set a bullet
        void setBullet(int level, Bullet const & bullet);
        /// get bullet setting
@@ -45,12 +43,13 @@ protected Q_SLOTS:
        void on_bulletsizeCO_activated(int level);
        void on_customCB_clicked(bool);
        void on_customLE_textEdited(const QString &);
-       void bulletSelected(QListWidgetItem *, QListWidgetItem*);
+       void bulletSelected(QListWidgetItem *, QListWidgetItem *);
        void showLevel(int);
 
 private:
        void selectItem(int font, int character, bool select);
-       void setupPanel(QListWidget * lw, QString panelname, std::string fname);
+       void setupPanel(QListWidget * lw, QString const & panelname,
+               std::string const & fname);
 
        /// store results
        boost::array<Bullet, 4> bullets_;
index 796f63e726aa917477cb7275f397c2791db146a8..5dcac2b96b2721ac2491344359d52fcfa1851cf3 100644 (file)
@@ -24,11 +24,6 @@ const QColor grey80(0xcc, 0xcc, 0xcc);
 const QColor grey90(0xe5, 0xe5, 0xe5);
 const QColor none = Qt::black;
 
-
-ColorCache::ColorCache()
-{
-}
-
 QColor const & ColorCache::get(LColor_color col) const
 {
        lcolor_map::const_iterator cit = colormap.find(col);
@@ -58,7 +53,7 @@ void ColorCache::clear()
 }
 
 
-QColor const rgb2qcolor(lyx::RGBColor const & rgb)
+QColor const rgb2qcolor(RGBColor const & rgb)
 {
        return QColor(rgb.r, rgb.g, rgb.b);
 }
index 2a9b188fbb6aaa5ab85719294d30c4c3e16db66c..0604061537a6ca36f2b4a0ead482456b7370b8ab 100644 (file)
@@ -30,7 +30,7 @@ struct RGBColor;
  */
 class ColorCache {
 public:
-       ColorCache();
+       ColorCache() {}
 
        /// get the given color
        QColor const & get(LColor_color color) const;
@@ -45,7 +45,7 @@ private:
 };
 
 ///
-QColor const rgb2qcolor(lyx::RGBColor const &);
+QColor const rgb2qcolor(RGBColor const &);
 
 } // namespace lyx
 
index 2dcb1bf46c3009ba52a043c7044727797cba0967..fefa83ad4c6f37665ece1f460403bc026b07b2b0 100644 (file)
 #include <QHBoxLayout>
 
 using lyx::support::split;
-using lyx::docstring;
-
 using std::string;
 
-
-namespace {
+namespace lyx {
 
 /// return the Qt form of the label
-docstring const getLabel(docstring const & ucs4str) {
+static docstring const getLabel(docstring const & ucs4str) {
        // FIXME UNICODE
-       string str = lyx::to_utf8(ucs4str);
+       string str = to_utf8(ucs4str);
        string label;
        string sc(split(str, label, '|'));
        if (sc.length() < 2)
-               return lyx::from_utf8(label);
+               return from_utf8(label);
        string::size_type pos = label.find(sc[1]);
        if (pos == string::npos)
-               return lyx::from_utf8(label);
+               return from_utf8(label);
        label.insert(pos, 1, '&');
-       return lyx::from_utf8(label);
+       return from_utf8(label);
 }
 
-} // namespace anon
-
-
-namespace lyx {
 
 LyXFileDialog::LyXFileDialog(docstring const & t,
                             docstring const & p,
-                            lyx::support::FileFilterList const & filters,
+                            support::FileFilterList const & filters,
                             FileDialog::Button const & b1,
                             FileDialog::Button const & b2)
                                 // FIXME replace that with theApp->gui()->currentView()
index ff438dac942bc0fe9b05d4b6de996cdeb264c66c..e697b361f0bb57a0837b727aa53339d3929a3343 100644 (file)
@@ -26,19 +26,19 @@ class LyXFileDialog : public QFileDialog
 {
        Q_OBJECT
 public:
-       LyXFileDialog(lyx::docstring const & title,
-                     lyx::docstring const & path,
-                     lyx::support::FileFilterList const & filters,
+       LyXFileDialog(docstring const & title,
+                     docstring const & path,
+                     support::FileFilterList const & filters,
                      FileDialog::Button const & b1,
                      FileDialog::Button const & b2);
 public Q_SLOTS:
        void buttonClicked();
 private:
        QToolButton * b1_;
-       lyx::docstring b1_dir_;
+       docstring b1_dir_;
 
        QToolButton * b2_;
-       lyx::docstring b2_dir_;
+       docstring b2_dir_;
 };
 
 } // namespace lyx
index b0f149774e10477e32b18941a9de6374b2fcc35a..88f412771e662eb70c9a5a4eab8ab5940313bc6b 100644 (file)
@@ -136,6 +136,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
        guiApp = this;
 }
 
+
 Clipboard& GuiApplication::clipboard()
 {
        return clipboard_;
@@ -248,7 +249,7 @@ void GuiApplication::syncEvents()
 
 
 bool GuiApplication::getRgbColor(LColor_color col,
-       lyx::RGBColor & rgbcol)
+       RGBColor & rgbcol)
 {
        QColor const & qcol = color_cache_.get(col);
        if (!qcol.isValid()) {
index 6ddc40eaffa153f7a3f96a9a95aa97b0bb59934c..ab2f1583ef0ec14042a732f15345528e7365a436 100644 (file)
@@ -63,7 +63,7 @@ public:
        virtual std::string const romanFontName();
        virtual std::string const sansFontName();
        virtual std::string const typewriterFontName();
-       virtual bool getRgbColor(LColor_color col, lyx::RGBColor & rgbcol);
+       virtual bool getRgbColor(LColor_color col, RGBColor & rgbcol);
        virtual std::string const hexName(LColor_color col);
        virtual void updateColor(LColor_color col);
        virtual void registerSocketCallback(
index e84c0162d78393112f19d3e6a5da21d45dc682e5..03c1c2b40f4de0a0b2c77e56a940f07e93f612d2 100644 (file)
@@ -29,12 +29,7 @@ using lyx::support::externalLineEnding;
 using std::endl;
 using std::string;
 
-
-namespace {
-
-char const * const mime_type = "application/x-lyx";
-
-}
+static char const * const mime_type = "application/x-lyx";
 
 
 namespace lyx {
index 7f71631e76580e7d3d08dcfeda988ccb50af71ed..2c473882fc421a0f68263508a36a687c8fa72872 100644 (file)
@@ -45,9 +45,6 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
-GuiFontLoader::~GuiFontLoader() {
-}
-
 namespace {
 
 struct symbol_font {
index 71d10b26d2d272406068539a04cc3a6607521eaf..e9b28d58135990fb864404a57c83d20e328eff0c 100644 (file)
@@ -40,14 +40,14 @@ public:
 
 
 /// Hold info about a particular font
-class GuiFontLoader: public FontLoader 
+class GuiFontLoader : public FontLoader 
 {
 public:
        ///
        GuiFontLoader();
        
        /// Destructor
-       virtual ~GuiFontLoader();
+       virtual ~GuiFontLoader() {}
 
        virtual void update();
        virtual bool available(LyXFont const & f);
index 2b7b941a89a220f7f3add177d4f9aac495f323e6..16506d4718e70d8fc96661f9bcb6c5f80177940c 100644 (file)
@@ -71,7 +71,7 @@ docstring const GuiSelection::get() const
 
 void GuiSelection::put(docstring const & str)
 {
-       LYXERR(Debug::ACTION) << "GuiSelection::put: " << lyx::to_utf8(str) << endl;
+       LYXERR(Debug::ACTION) << "GuiSelection::put: " << to_utf8(str) << endl;
 
        qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
                                   QClipboard::Selection);
index 8ffed6d32628eeb7ac52604f42ddbc20a0db0b0a..d1fa749a8d9d529b40a0b3c4814a19d2f2920a9a 100644 (file)
@@ -22,7 +22,7 @@ namespace frontend {
 /**
  * The Qt4 version of the Selection.
  */
-class GuiSelection: public Selection
+class GuiSelection : public Selection
 {
 public:
        virtual ~GuiSelection() {}
index 7e87cc1d898eb031b088c507ced1dae6a4f7727c..dd1c2ca76d49a4b03a45a13c2ba313dcc5bfc023 100644 (file)
@@ -69,7 +69,7 @@ public:
        /// add toolbar, if newline==true, add a toolbar break before the toolbar
        Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline);
        virtual void updateStatusBar();
-       virtual void message(lyx::docstring const & str);
+       virtual void message(docstring const & str);
        virtual void clearMessage();
        virtual bool hasFocus() const;
 
@@ -124,7 +124,7 @@ private:
         * @param t main window title
         * @param it iconified (short) title
         */
-       virtual void setWindowTitle(lyx::docstring const & t, lyx::docstring const & it);
+       virtual void setWindowTitle(docstring const & t, docstring const & it);
 
        /// in order to catch Tab key press.
        bool event(QEvent * e);
index 9db4e44aaae97f153a67d7d0ee7a12a3cf450c42..a06303ab73e14d6c722dd4534e1b8fd8aaa64400 100644 (file)
@@ -678,7 +678,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
                rLength = 0;
        }
 
-       int const right_margin = lyx::rightMargin();
+       int const right_margin = rightMargin();
        Painter::preedit_style ps;
        // Most often there would be only one line:
        preedit_lines_ = 1;
index ac34dac72ebcf439ea8eb6a7270b5dd9b9afeedb..0868c6353aa36b17a8e7ad3496015d73a66f1915 100644 (file)
@@ -146,7 +146,7 @@ void InsertTableWidget::drawGrid(int const rows, int const cols, Qt::GlobalColor
 
 void InsertTableWidget::updateParent()
 {
-       bool status = lyx::getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled();
+       bool status = getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled();
        parentWidget()->setEnabled(status);
 }
 
index 81fd9ab98cae60ad85553aa1fb0d8786a9e2fd42..61b428d5925db0f2e0451ebaf92a5d56a7f66b76 100644 (file)
@@ -369,7 +369,7 @@ void QBibtex::apply()
                controller().params()["options"] = "bibtotoc," + bibstyle;
        } else if (bibtotoc) {
                // bibtotoc and no style
-               controller().params()["options"] = lyx::from_ascii("bibtotoc");
+               controller().params()["options"] = from_ascii("bibtotoc");
        } else {
                // only style. An empty one is valid, because some
                // documentclasses have an own \bibliographystyle{}
@@ -385,13 +385,13 @@ void QBibtex::apply()
 
        switch (btp) {
        case 0:
-               controller().params()["btprint"] = lyx::from_ascii("btPrintCited");
+               controller().params()["btprint"] = from_ascii("btPrintCited");
                break;
        case 1:
-               controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited");
+               controller().params()["btprint"] = from_ascii("btPrintNotCited");
                break;
        case 2:
-               controller().params()["btprint"] = lyx::from_ascii("btPrintAll");
+               controller().params()["btprint"] = from_ascii("btPrintAll");
                break;
        }
 
index b4916170adabdd2d3e44054b2f8c04afe7183255..675554c637f11cfc92c831905612db8ddd21495e 100644 (file)
@@ -60,13 +60,13 @@ QBoxDialog::QBoxDialog(QBox * form)
 
        connect(widthED, SIGNAL(textChanged(const QString &)),
                this, SLOT(change_adaptor()));
-       connect(widthUnitsLC, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+       connect(widthUnitsLC, SIGNAL(selectionChanged(LyXLength::UNIT)),
                this, SLOT(change_adaptor()));
        connect(valignCO, SIGNAL(highlighted(const QString &)),
                this, SLOT(change_adaptor()));
        connect(heightED, SIGNAL(textChanged(const QString &)),
                this, SLOT(change_adaptor()));
-       connect(heightUnitsLC, SIGNAL(selectionChanged(lyx::LyXLength::UNIT) ),
+       connect(heightUnitsLC, SIGNAL(selectionChanged(LyXLength::UNIT) ),
                this, SLOT(change_adaptor()));
        connect(restorePB, SIGNAL(clicked()), this, SLOT(restoreClicked()));
        connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
index 512d00b296d74f124d008a086176cdf0eaa148eb..9200704115f8d4aff8a6a7a696c2334b1691c5b8 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * \file QCitation.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
@@ -27,13 +27,11 @@ using std::vector;
 using std::string;
 
 
-namespace {
-
 template<typename String> static QStringList to_qstring_list(vector<String> const & v)
 {
        QStringList qlist;
 
-       for (size_t i=0; i != v.size(); ++i) {
+       for (size_t i = 0; i != v.size(); ++i) {
                if (v[i].empty())
                        continue;
                qlist.append(lyx::toqstr(v[i]));
@@ -42,7 +40,7 @@ template<typename String> static QStringList to_qstring_list(vector<String> cons
 }
 
 
-vector<string> const to_string_vector(QStringList const & qlist)
+static vector<string> const to_string_vector(QStringList const & qlist)
 {
        vector<string> v;
        for (int i = 0; i != qlist.size(); ++i) {
@@ -53,8 +51,6 @@ vector<string> const to_string_vector(QStringList const & qlist)
        return v;
 }
 
-}
-
 
 namespace lyx {
 namespace frontend {
index 7e7a86191ef3e36423a6aaa21f6bda90d0f7ffc8..28fbd6a2ef94589c2104b2cb65626846a620aecb 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "controllers/ButtonController.h"
 
-using lyx::docstring;
 
 namespace lyx {
 namespace frontend {
index 1693adbf7b7e5e8d06a06bd997a97ed017336126..39a17026651280de3ff976b6f106e91021bcbba1 100644 (file)
@@ -433,7 +433,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
                        latexModule->classCO->addItem(toqstr(cit->description()));
                } else {
                        docstring item =
-                               bformat(_("Unavailable: %1$s"), lyx::from_utf8(cit->description()));
+                               bformat(_("Unavailable: %1$s"), from_utf8(cit->description()));
                        latexModule->classCO->addItem(toqstr(item));
                }
        }
@@ -667,7 +667,7 @@ void QDocumentDialog::classChanged()
        ControlDocument & cntrl = form_->controller();
        BufferParams & params = cntrl.params();
 
-       lyx::textclass_type const tc = latexModule->classCO->currentIndex();
+       textclass_type const tc = latexModule->classCO->currentIndex();
 
        if (form_->controller().loadTextclass(tc)) {
                params.textclass = tc;
index 5bcbed209aaf0f38a9072cbbf483a353cda45492..f5fe58d7d1d3cfbbe0bfc15e5ca223860c963967 100644 (file)
@@ -75,7 +75,7 @@ typedef QController<ControlErrorList, QView<QErrorListDialog> >
        ErrorListBase;
 
 QErrorList::QErrorList(Dialog & parent)
-       : ErrorListBase(parent, lyx::docstring())
+       : ErrorListBase(parent, docstring())
 {}
 
 
@@ -96,7 +96,7 @@ void QErrorList::select(QListWidgetItem * wi)
 
 void QErrorList::update_contents()
 {
-       setTitle(lyx::from_utf8(controller().name()));
+       setTitle(from_utf8(controller().name()));
        dialog_->errorsLW->clear();
        dialog_->descriptionTB->setPlainText(QString());
 
index 6ff368b3e9a3ffda9764b8e9bc3e6175f1f44752..460d8802e36f492ef60c9023adadd365f52bff33 100644 (file)
@@ -69,38 +69,54 @@ QExternalDialog::QExternalDialog(QExternal * form)
        : form_(form)
 {
        setupUi(this);
-       connect(okPB, SIGNAL(clicked()),
-               form, SLOT(slotOK()));
-       connect(applyPB, SIGNAL(clicked()),
-               form, SLOT(slotApply()));
-       connect(closePB, SIGNAL(clicked()),
-               form, SLOT(slotClose()));
-
-       connect( displayCB, SIGNAL( toggled(bool) ), showCO, SLOT( setEnabled(bool) ) );
-       connect( displayCB, SIGNAL( toggled(bool) ), displayscaleED, SLOT( setEnabled(bool) ) );
-       connect( showCO, SIGNAL( activated(const QString&) ), this, SLOT( change_adaptor() ) );
-       connect( originCO, SIGNAL( activated(int) ), this, SLOT( change_adaptor() ) );
-       connect( aspectratioCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
-       connect( browsePB, SIGNAL( clicked() ), this, SLOT( browseClicked() ) );
-       connect( editPB, SIGNAL( clicked() ), this, SLOT( editClicked() ) );
-       connect( externalCO, SIGNAL( activated(const QString&) ), this, SLOT( templateChanged() ) );
-       connect( extraED, SIGNAL( textChanged(const QString&) ), this, SLOT( extraChanged(const QString&) ) );
-       connect( extraFormatCO, SIGNAL( activated(const QString&) ), this, SLOT( formatChanged(const QString&) ) );
-       connect( widthUnitCO, SIGNAL( activated(int) ), this, SLOT( widthUnitChanged() ) );
-       connect( heightUnitCO, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
-       connect( displayCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
-       connect( displayscaleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-       connect( angleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-       connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
-       connect( heightED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
-       connect( fileED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-       connect( clipCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
-       connect( getbbPB, SIGNAL( clicked() ), this, SLOT( getbbClicked() ) );
-       connect( xrED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-       connect( ytED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-       connect( xlED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-       connect( ybED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-       connect( draftCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
+       connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
+       connect(applyPB, SIGNAL(clicked()), form, SLOT(slotApply()));
+       connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
+
+       connect(displayCB, SIGNAL(toggled(bool)),
+               showCO, SLOT(setEnabled(bool)));
+       connect(displayCB, SIGNAL(toggled(bool)),
+               displayscaleED, SLOT(setEnabled(bool)));
+       connect(showCO, SIGNAL(activated(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(originCO, SIGNAL(activated(int)),
+               this, SLOT(change_adaptor()));
+       connect(aspectratioCB, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(browsePB, SIGNAL(clicked()),
+               this, SLOT(browseClicked()));
+       connect(editPB, SIGNAL(clicked()),
+               this, SLOT(editClicked()));
+       connect(externalCO, SIGNAL(activated(const QString&)),
+               this, SLOT(templateChanged()));
+       connect(extraED, SIGNAL(textChanged(const QString&)),
+               this, SLOT(extraChanged(const QString&)));
+       connect(extraFormatCO, SIGNAL(activated(const QString&)),
+               this, SLOT(formatChanged(const QString&)));
+       connect(widthUnitCO, SIGNAL(activated(int)),
+               this, SLOT(widthUnitChanged()));
+       connect(heightUnitCO, SIGNAL(selectionChanged(LyXLength::UNIT)),
+               this, SLOT(change_adaptor()));
+       connect(displayCB, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(displayscaleED, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(angleED, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(widthED, SIGNAL(textChanged(const QString&)),
+               this, SLOT(sizeChanged()));
+       connect(heightED, SIGNAL(textChanged(const QString&)),
+               this, SLOT(sizeChanged()));
+       connect(fileED, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(clipCB, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(getbbPB, SIGNAL(clicked()), this, SLOT(getbbClicked()));
+       connect(xrED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+       connect(ytED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+       connect(xlED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+       connect(ybED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+       connect(draftCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 
        QIntValidator * validator = new QIntValidator(displayscaleED);
        validator->setBottom(1);
@@ -167,7 +183,7 @@ void QExternalDialog::browseClicked()
 {
        int const choice =  externalCO->currentIndex();
        docstring const template_name = 
-               lyx::from_utf8(form_->controller().getTemplate(choice).lyxName);
+               from_utf8(form_->controller().getTemplate(choice).lyxName);
        docstring const str =
                form_->controller().browse(qstring_to_ucs4(fileED->text()),
                                           template_name);
index b0939ec093c604347f27bb82620828997c1c0dec..ba98ed817c3b57706dd4d78b5e26b08875b707a4 100644 (file)
@@ -43,40 +43,40 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form)
 {
        setupUi(this);
        //main buttons
-       connect(okPB, SIGNAL( clicked() ),
-               form, SLOT( slotOK() ) );
-       connect(applyPB, SIGNAL( clicked() ),
-               form, SLOT( slotApply() ) );
-       connect(closePB, SIGNAL( clicked() ),
-               form, SLOT( slotClose() ) );
-       connect(restorePB, SIGNAL( clicked() ),
-               form, SLOT( slotRestore() ) );
+       connect(okPB, SIGNAL(clicked()),
+               form, SLOT(slotOK()));
+       connect(applyPB, SIGNAL(clicked()),
+               form, SLOT(slotApply()));
+       connect(closePB, SIGNAL(clicked()),
+               form, SLOT(slotClose()));
+       connect(restorePB, SIGNAL(clicked()),
+               form, SLOT(slotRestore()));
        
        //graphics pane
-       connect(filename, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
-       connect(WidthCB, SIGNAL(  clicked() ),
-               this, SLOT( change_adaptor() ) );
-       connect(HeightCB, SIGNAL(  clicked() ),
-               this, SLOT( change_adaptor() ) );
-       connect(Width, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
-       connect(Height, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
-       connect(heightUnit, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ),
-               this, SLOT( change_adaptor() ) );
-       connect(widthUnit, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ),
-               this, SLOT( change_adaptor() ) );
-       connect(aspectratio, SIGNAL( stateChanged(int) ),
-               this, SLOT( change_adaptor() ) );
-       connect(angle, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
-       connect(origin, SIGNAL( activated(int) ),
-               this, SLOT( change_adaptor() ) );
-       connect(scaleCB, SIGNAL( clicked() ),
-               this, SLOT(change_adaptor()) );
-       connect(Scale, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
+       connect(filename, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(WidthCB, SIGNAL( clicked()),
+               this, SLOT(change_adaptor()));
+       connect(HeightCB, SIGNAL( clicked()),
+               this, SLOT(change_adaptor()));
+       connect(Width, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(Height, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(heightUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
+               this, SLOT(change_adaptor()));
+       connect(widthUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+               this, SLOT(change_adaptor()));
+       connect(aspectratio, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(angle, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(origin, SIGNAL(activated(int)),
+               this, SLOT(change_adaptor()));
+       connect(scaleCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
+       connect(Scale, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
        
        filename->setValidator(new PathValidator(true, filename));
        setFocusProxy(filename);
@@ -90,26 +90,26 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form)
        angle->setValidator(new QDoubleValidator(-360, 360, 2, angle));
 
        //clipping pane
-       connect(clip, SIGNAL( stateChanged(int) ),
-               this, SLOT( change_adaptor() ) );
-       connect(lbY, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_bb() ) );
-       connect(lbYunit, SIGNAL( activated(int) ),
-               this, SLOT( change_bb() ) );
-       connect(rtY, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_bb() ) );
-       connect(rtYunit, SIGNAL( activated(int) ),
-               this, SLOT( change_bb() ) );
-       connect(lbX, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_bb() ) );
-       connect(lbXunit, SIGNAL( activated(int) ),
-               this, SLOT( change_bb() ) );
-       connect(rtX, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_bb() ) );
-       connect(rtXunit, SIGNAL( activated(int) ),
-               this, SLOT( change_bb() ) );
-       connect(getPB, SIGNAL( clicked() ),
-               this, SLOT( change_adaptor() ) );
+       connect(clip, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(lbY, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_bb()));
+       connect(lbYunit, SIGNAL(activated(int)),
+               this, SLOT(change_bb()));
+       connect(rtY, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_bb()));
+       connect(rtYunit, SIGNAL(activated(int)),
+               this, SLOT(change_bb()));
+       connect(lbX, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_bb()));
+       connect(lbXunit, SIGNAL(activated(int)),
+               this, SLOT(change_bb()));
+       connect(rtX, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_bb()));
+       connect(rtXunit, SIGNAL(activated(int)),
+               this, SLOT(change_bb()));
+       connect(getPB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
        
        lbX->setValidator(new QDoubleValidator(lbX));
        lbY->setValidator(new QDoubleValidator(lbY));
@@ -117,12 +117,12 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form)
        rtY->setValidator(new QDoubleValidator(rtY));
 
        //extra options pane
-       connect(latexoptions, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
-       connect(draftCB, SIGNAL( stateChanged(int) ),
-               this, SLOT( change_adaptor() ) );
-       connect(unzipCB, SIGNAL( stateChanged(int) ),
-               this, SLOT( change_adaptor() ) );
+       connect(latexoptions, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(draftCB, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(unzipCB, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
        // FIXME: we should connect to clicked() when we move to Qt 4.2 because
        // the toggled(bool) signal is also trigged when we update the widgets
        // (rgh-4/07) this isn't as much or a problem as it was, because we're now
@@ -130,16 +130,16 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form)
        // setChecked(). Note, too, that clicked() would get called whenever it
        // is clicked, even right clicked (I think), not just whenever it is
        // toggled.
-       connect(subfigure, SIGNAL( toggled(bool) ),
-               this, SLOT( change_adaptor() ) );
-       connect(subcaption, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
-       connect(displayGB, SIGNAL( toggled(bool) ),
-               this, SLOT( change_adaptor() ) );
-       connect(showCB, SIGNAL( currentIndexChanged(int) ),
-               this, SLOT( change_adaptor() ) );
-       connect(displayscale, SIGNAL( textChanged(const QString&) ),
-               this, SLOT( change_adaptor() ) );
+       connect(subfigure, SIGNAL(toggled(bool)),
+               this, SLOT(change_adaptor()));
+       connect(subcaption, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
+       connect(displayGB, SIGNAL(toggled(bool)),
+               this, SLOT(change_adaptor()));
+       connect(showCB, SIGNAL(currentIndexChanged(int)),
+               this, SLOT(change_adaptor()));
+       connect(displayscale, SIGNAL(textChanged(const QString&)),
+               this, SLOT(change_adaptor()));
        displayscale->setValidator(new QIntValidator(displayscale));
 }
 
index a49bdc5a3fe7d74505826cc6b32f796f4110a557..ea5e64f10e1e00f7f7f59049c7a0cad3c7b08f1e 100644 (file)
@@ -38,6 +38,7 @@ private:
        QIndex * form_;
 };
 
+
 class ControlCommand;
 
 class QIndex :
@@ -46,7 +47,7 @@ class QIndex :
 public:
        friend class QIndexDialog;
 
-       QIndex(Dialog &, lyx::docstring const & title, QString const & label);
+       QIndex(Dialog &, docstring const & title, QString const & label);
 protected:
        virtual bool isValid();
 private:
index 6cbaf522fc758c76447bb9a0322d197338456799..95789bfd9b8a30e0b369c65b5b8d253ab7680987 100644 (file)
@@ -32,13 +32,7 @@ using std::pair;
 using std::string;
 using std::endl;
 
-namespace {
-
-} // namespace anon
-
 namespace lyx {
-
-
 namespace frontend {
 
 // MacOSX specific stuff is at the end.
@@ -48,17 +42,18 @@ QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe)
 {
        macxMenuBarInit();
 
-       LYXERR(Debug::GUI) << "populating menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
+       LYXERR(Debug::GUI) << "populating menu bar" << to_utf8(menubackend_.getMenubar().name()) << endl;
 
        if (menubackend_.getMenubar().size() == 0) {
-               LYXERR(Debug::GUI) << "\tERROR: empty menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
+               LYXERR(Debug::GUI) << "\tERROR: empty menu bar"
+                       << to_utf8(menubackend_.getMenubar().name()) << endl;
                return;
                //                      continue;
        }
        else {
-               LYXERR(Debug::GUI) << "menu bar entries " << menubackend_.getMenubar().size();
+               LYXERR(Debug::GUI) << "menu bar entries "
+                       << menubackend_.getMenubar().size();
        }
-       //      for (; m != end; ++m) {
 
        Menu menu;
        menubackend_.expand(menubackend_.getMenubar(), menu, owner_->buffer());
@@ -69,15 +64,18 @@ QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe)
        for (; m != end; ++m) {
 
                if (m->kind() != MenuItem::Submenu) {
-                       LYXERR(Debug::GUI) << "\tERROR: not a submenu " << lyx::to_utf8(m->label()) << endl;
+                       LYXERR(Debug::GUI) << "\tERROR: not a submenu "
+                               << to_utf8(m->label()) << endl;
                        continue;
                }
 
-               LYXERR(Debug::GUI) << "menu bar item " << lyx::to_utf8(m->label()) << " is a submenu named " << lyx::to_utf8(m->submenuname()) << endl;
+               LYXERR(Debug::GUI) << "menu bar item " << to_utf8(m->label())
+                       << " is a submenu named " << to_utf8(m->submenuname()) << endl;
 
                docstring name = m->submenuname();
                if (!menubackend_.hasMenu(name)) {
-                       LYXERR(Debug::GUI) << "\tERROR: " << lyx::to_utf8(name) << " submenu has no menu!" << endl;
+                       LYXERR(Debug::GUI) << "\tERROR: " << to_utf8(name)
+                               << " submenu has no menu!" << endl;
                        continue;
                }
 
@@ -89,7 +87,8 @@ QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe)
 
                pair<NameMap::iterator, bool> I = name_map_.insert(make_pair(name, qMenu));
                if (!I.second) {
-                       LYXERR(Debug::GUI) << "\tERROR: " << lyx::to_utf8(name) << " submenu is already there!" << endl;
+                       LYXERR(Debug::GUI) << "\tERROR: " << to_utf8(name)
+                               << " submenu is already there!" << endl;
                }
 /*
                QObject::connect(qMenu, SIGNAL(aboutToShow()), this, SLOT(update()));
index 28382c780a235bf1e4cbe0eef669aaf8223a6b77..cbcdab6b5493732d909a8ce493d439ef197a542c 100644 (file)
@@ -29,8 +29,6 @@ class Menu;
 class MenuItem;
 
 namespace lyx {
-
-
 namespace frontend {
 
 class GuiView;
@@ -41,7 +39,7 @@ public:
        QLMenubar(LyXView *, MenuBackend &);
 
        /// opens a top-level submenu given its name
-       void openByName(lyx::docstring const &);
+       void openByName(docstring const &);
 
        /// return the owning view
        GuiView * view();
@@ -69,7 +67,7 @@ private:
        /// menu controller
        MenuBackend & menubackend_;
 
-       typedef std::map<lyx::docstring, QLPopupMenu *> NameMap;
+       typedef std::map<docstring, QLPopupMenu *> NameMap;
 
        /// name to menu for openByName
        NameMap name_map_;
index 3050ea4946fd187e2ab8d2b83e549bfc89509c6f..5a5c72d814d950305adf5e8a09432d5e4cfc19cc 100644 (file)
@@ -90,11 +90,10 @@ public:
 
        /// draw a string at position x, y (y is the baseline)
        virtual int text(int x, int y,
-               lyx::docstring const & str, LyXFont const & f);
+               docstring const & str, LyXFont const & f);
 
        /// draw a char at position x, y (y is the baseline)
-       virtual int text(int x, int y,
-                lyx::char_type c, LyXFont const & f);
+       virtual int text(int x, int y, char_type c, LyXFont const & f);
 
 private:
        /// draw small caps text
index c1b0782e4877b02ad79b5acf7b20b626e866fd0b..f3b6d1f00730264ecfa94819d0778a5ef4b198a7 100644 (file)
@@ -32,15 +32,10 @@ using std::string;
 using std::pair;
 using std::endl;
 
-namespace {
-
-} // namespace anon
 
 namespace lyx {
-
 namespace frontend {
 
-
 QLPopupMenu::QLPopupMenu(QLMenubar * owner,
                                                 MenuItem const & mi, bool topLevelMenu)
        : owner_(owner)
@@ -54,11 +49,10 @@ QLPopupMenu::QLPopupMenu(QLMenubar * owner,
 }
 
 
-
 void QLPopupMenu::update()
 {
        LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION << endl;
-       LYXERR(Debug::GUI) << "\tTriggered menu: " << lyx::to_utf8(name_) << endl;
+       LYXERR(Debug::GUI) << "\tTriggered menu: " << to_utf8(name_) << endl;
 
        clear();
 
@@ -72,16 +66,18 @@ void QLPopupMenu::update()
        owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer());
 
        if (!owner_->backend().hasMenu(topLevelMenu_.name())) {
-               LYXERR(Debug::GUI) << "\tWARNING: menu seems empty" << lyx::to_utf8(topLevelMenu_.name()) << endl;
+               LYXERR(Debug::GUI) << "\tWARNING: menu seems empty"     
+                       << to_utf8(topLevelMenu_.name()) << endl;
        }
        populate(this, &topLevelMenu_);
 }
 
 void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
 {
-       LYXERR(Debug::GUI) << "populating menu " << lyx::to_utf8(menu->name()) ;
+       LYXERR(Debug::GUI) << "populating menu " << to_utf8(menu->name()) ;
        if (menu->size() == 0) {
-               LYXERR(Debug::GUI) << "\tERROR: empty menu " << lyx::to_utf8(menu->name()) << endl;
+               LYXERR(Debug::GUI) << "\tERROR: empty menu "
+                       << to_utf8(menu->name()) << endl;
                return;
        }
        else {
@@ -100,13 +96,15 @@ void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
 
                } else if (m->kind() == MenuItem::Submenu) {
 
-                       LYXERR(Debug::GUI) << "** creating New Sub-Menu " << lyx::to_utf8(getLabel(*m)) << endl;
+                       LYXERR(Debug::GUI) << "** creating New Sub-Menu "
+                               << to_utf8(getLabel(*m)) << endl;
                        QMenu * subMenu = qMenu->addMenu(toqstr(getLabel(*m)));
                        populate(subMenu, m->submenu());
 
                } else { // we have a MenuItem::Command
 
-                       LYXERR(Debug::GUI) << "creating Menu Item " << lyx::to_utf8(m->label()) << endl;
+                       LYXERR(Debug::GUI) << "creating Menu Item "
+                               << to_utf8(m->label()) << endl;
 
                        docstring label = getLabel(*m);
                        addBinding(label, *m);
@@ -118,12 +116,12 @@ void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
        }
 }
 
+
 docstring const QLPopupMenu::getLabel(MenuItem const & mi)
 {
        docstring const shortcut = mi.shortcut();
        docstring label = support::subst(mi.label(),
-                                     lyx::from_ascii("&"),
-                                     lyx::from_ascii("&&"));
+       from_ascii("&"), from_ascii("&&"));
 
        if (!shortcut.empty()) {
                docstring::size_type pos = label.find(shortcut);
index c565990e16185240f7a377a7b3ac950a763a9f7b..f397e4cd114ded74975c890aa5e9d48b761514c1 100644 (file)
@@ -43,14 +43,14 @@ private:
        QLMenubar * owner_;
 
        /// the name of this menu
-       lyx::docstring name_;
+       docstring name_;
 
 private:
        /// Get a Menu item label from the menu backend
-       lyx::docstring const getLabel(MenuItem const & mi);
+       docstring const getLabel(MenuItem const & mi);
 
        /// add binding keys a the menu item label.
-       void addBinding(lyx::docstring & label, MenuItem const & mi);
+       void addBinding(docstring & label, MenuItem const & mi);
 
        /// Top Level Menu
        Menu topLevelMenu_;
index dc539912f56e0126e2b28a7e637d6a6b22ad3496..756d6d05607f30c4d4b60b6485dc41f937567528 100644 (file)
@@ -219,7 +219,7 @@ void QLToolbar::add(ToolbarItem const & item)
                ToolbarInfo::item_iterator it = tbinfo.items.begin();
                ToolbarInfo::item_iterator const end = tbinfo.items.end();
                for (; it != end; ++it) 
-                       if (!lyx::getStatus(it->func_).unknown()) {
+                       if (!getStatus(it->func_).unknown()) {
                                Action * action = new Action(owner_,
                                        getIcon(it->func_),
                                        it->label_,
@@ -253,7 +253,7 @@ void QLToolbar::add(ToolbarItem const & item)
                ToolbarInfo::item_iterator it = tbinfo.items.begin();
                ToolbarInfo::item_iterator const end = tbinfo.items.end();
                for (; it != end; ++it)
-                       if (!lyx::getStatus(it->func_).unknown()) {
+                       if (!getStatus(it->func_).unknown()) {
                                Action * action = new Action(owner_,
                                        getIcon(it->func_, false),
                                        it->label_,
@@ -267,7 +267,7 @@ void QLToolbar::add(ToolbarItem const & item)
                break;
                }
        case ToolbarItem::COMMAND: {
-               if (lyx::getStatus(item.func_).unknown())
+               if (getStatus(item.func_).unknown())
                        break;
 
                Action * action = new Action(owner_,
index 11b51ba7ebf3f7d3e532487384cb9c6b6b4b21eb..dcd519a53c58c71145e06f9d4bf6c9ed920ddda1 100644 (file)
@@ -110,7 +110,7 @@ void LogHighlighter::highlightBlock(QString const & text)
 typedef QController<ControlLog, QView<QLogDialog> > LogBase;
 
 QLog::QLog(Dialog & parent)
-       : LogBase(parent, lyx::docstring())
+       : LogBase(parent, docstring())
 {}
 
 
index 23ff4e837cd90b99fb07475910273b22a806244d..a822f75ce4570ecfa0ee3ac87d49279f2bccdb32 100644 (file)
@@ -1181,7 +1181,7 @@ class SamePrettyName {
 public:
        SamePrettyName(string const & n) : pretty_name_(n) {}
 
-       bool operator()(lyx::Format const & fmt) const {
+       bool operator()(Format const & fmt) const {
                return fmt.prettyname() == pretty_name_;
        }
 
@@ -1192,8 +1192,8 @@ private:
 
 Format const * getFormat(std::string const & prettyname)
 {
-       Formats::const_iterator it = lyx::formats.begin();
-       Formats::const_iterator const end = lyx::formats.end();
+       Formats::const_iterator it = formats.begin();
+       Formats::const_iterator const end = formats.end();
        it = std::find_if(it, end, SamePrettyName(prettyname));
        return it == end ? 0 : &*it;
 }
@@ -1595,8 +1595,7 @@ PrefLanguage::PrefLanguage(QWidget * parent)
        defaultLanguageCO->clear();
 
        // store the lang identifiers for later
-       std::vector<LanguagePair> const langs =
-               lyx::frontend::getLanguageData(false);
+       std::vector<LanguagePair> const langs = frontend::getLanguageData(false);
        lang_ = getSecond(langs);
 
        std::vector<LanguagePair>::const_iterator lit  = langs.begin();
index 19c006db079065cfa42569f91242f1bb43bc5bbc..c175655afdfef13a27c5fbd54fde53e31432617d 100644 (file)
@@ -109,7 +109,7 @@ private:
        int restored_buffer_;
 
        /// the references
-       std::vector<lyx::docstring> refs_;
+       std::vector<docstring> refs_;
 };
 
 } // namespace frontend
index 21aa2c4e3dd04e27fbd98a143ba466d5c51a4c95..8969ed98c30e2b61da9a21ad6ecd9369d287213e 100644 (file)
@@ -56,17 +56,17 @@ QTabularDialog::QTabularDialog(QTabular * form)
 
        connect(topspaceED, SIGNAL(returnPressed()),
                this, SLOT(topspace_changed()));
-       connect(topspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+       connect(topspaceUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
                this, SLOT(topspace_changed()));
        connect(topspaceCO, SIGNAL(activated(int)), this, SLOT(topspace_changed()));
        connect(bottomspaceED, SIGNAL(returnPressed()),
                this, SLOT(bottomspace_changed()));
-       connect(bottomspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+       connect(bottomspaceUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
                this, SLOT(bottomspace_changed()));
        connect(bottomspaceCO, SIGNAL(activated(int)), this, SLOT(bottomspace_changed()));
        connect(interlinespaceED, SIGNAL(returnPressed()),
                this, SLOT(interlinespace_changed()));
-       connect(interlinespaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+       connect(interlinespaceUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
                this, SLOT(interlinespace_changed()));
        connect(interlinespaceCO, SIGNAL(activated(int)), this, SLOT(interlinespace_changed()));
        connect(booktabsRB, SIGNAL(clicked(bool)), this, SLOT(booktabsChanged(bool)));
@@ -95,7 +95,7 @@ QTabularDialog::QTabularDialog(QTabular * form)
        connect(lastfooterNoContentsCB, SIGNAL(clicked()), this, SLOT(ltLastFooterEmpty_clicked()));
        connect(specialAlignmentED, SIGNAL(returnPressed()), this, SLOT(specialAlignment_changed()));
        connect(widthED, SIGNAL(returnPressed()), this, SLOT(width_changed()));
-       connect(widthUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), this, SLOT(width_changed()));
+       connect(widthUnit, SIGNAL(selectionChanged(LyXLength::UNIT)), this, SLOT(width_changed()));
        connect(closePB, SIGNAL(clicked()), this, SLOT(close_clicked()));
        connect(borders, SIGNAL(topSet(bool)), this, SLOT(topBorder_changed()));
        connect(borders, SIGNAL(bottomSet(bool)), this, SLOT(bottomBorder_changed()));
index 7fa122c83965c031a915126afec018cc591d18a2..ea308c0fb04cdcedaf1197854d3e217371b8ab28 100644 (file)
@@ -99,9 +99,7 @@ void QToc::goTo(int type, QModelIndex const & index)
 
        TocIterator const it = toc_models_[type]->tocIterator(index);
        
-       LYXERR(Debug::GUI)
-               << "QToc::goTo " << lyx::to_utf8(it->str())
-               << endl;
+       LYXERR(Debug::GUI) << "QToc::goTo " << to_utf8(it->str()) << endl;
 
        ControlToc::goTo(*it);
 }
index e991aefe5830363e8bec4007e4ce60c563561d0a..4d9ca14d14e661ad90a9bf0e8b5f0dfb4b81b90c 100644 (file)
@@ -69,7 +69,7 @@ QVSpaceDialog::QVSpaceDialog(QVSpace * form)
                this, SLOT(enableCustom(int)));
        connect(keepCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
-       connect(unitCO, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+       connect(unitCO, SIGNAL(selectionChanged(LyXLength::UNIT)),
                this, SLOT(change_adaptor()));
 
        valueLE->setValidator(unsignedLengthValidator(valueLE));
index be3c9b722e37a217cf592e2c8798058cf5d0a127..811ceecdb744219e4f937a42d2b3c38d8958a4ba 100644 (file)
@@ -17,8 +17,6 @@
 #include <QPushButton>
 #include <QLineEdit>
 
-using lyx::docstring;
-
 namespace lyx {
 namespace frontend {
 
@@ -37,16 +35,12 @@ void Qt2BC::setButtonEnabled(QPushButton * obj, bool enabled) const
 void Qt2BC::setWidgetEnabled(QWidget * obj, bool enabled) const
 {
        // yuck, rtti, but the user comes first
-       if (obj->inherits("QLineEdit")) {
-               QLineEdit * le(static_cast<QLineEdit*>(obj));
+       if (QLineEdit * le = qobject_cast<QLineEdit*>(obj))
                le->setReadOnly(!enabled);
-       } else {
+       else
                obj->setEnabled(enabled);
-       }
 
-       Qt::FocusPolicy const p =
-               (enabled) ? Qt::StrongFocus : Qt::NoFocus;
-       obj->setFocusPolicy(p);
+       obj->setFocusPolicy(enabled ? Qt::StrongFocus : Qt::NoFocus);
 }
 
 
index e71a16a1cfaf0d1ae670a973c1738ed2bba930fb..9ba55e2685a73b48cf096d8e526ba01037e3b7f2 100644 (file)
@@ -33,8 +33,8 @@ class Qt2BC : public GuiBC<QPushButton, QWidget> {
 public:
        ///
        Qt2BC(ButtonController const &,
-             lyx::docstring const & = _("Cancel"),
-             lyx::docstring const & = _("Close"));
+             docstring const & = _("Cancel"),
+             docstring const & = _("Close"));
 private:
        /// Updates the button sensitivity (enabled/disabled)
        void setButtonEnabled(QPushButton *, bool enabled) const;
@@ -43,7 +43,7 @@ private:
        void setWidgetEnabled(QWidget *, bool enabled) const;
 
        /// Set the label on the button
-       void setButtonLabel(QPushButton *, lyx::docstring const & label) const;
+       void setButtonLabel(QPushButton *, docstring const & label) const;
 };
 
 } // namespace frontend
index 7dc4e56e530c4cda3951abef522a0211523a4279..8f923d89f49e107b460fa611fb82832bfafacd0c 100644 (file)
@@ -110,7 +110,7 @@ void TocModel::populate(Toc const & toc)
 
                        LYXERR(Debug::GUI)
                                << "Toc: at depth " << iter->depth()
-                               << ", added item " << lyx::to_utf8(iter->str())
+                               << ", added item " << to_utf8(iter->str())
                                << endl;
 
                        populate(iter, end, top_level_item);
index 9e0c77fe692571b5b1ff5b8f0b52bf57682187c3..b0e5f46b18a404b9388bfc8ecaa6982cea2199d9 100644 (file)
@@ -58,11 +58,10 @@ PanelStack::PanelStack(QWidget * parent)
 
 void PanelStack::addCategory(docstring const & n, docstring const & parent)
 {
-       QTreeWidgetItem * item;
+       QTreeWidgetItem * item = 0;
+       QString const name = toqstr(n);
 
-       QString const name(toqstr(n));
-
-       LYXERR(Debug::GUI) << "addCategory n= " << lyx::to_utf8(n) << "   parent= " << endl;
+       LYXERR(Debug::GUI) << "addCategory n= " << to_utf8(n) << "   parent= " << endl;
 
        int depth = 1;
 
index 8ea60c4b4ee7dba9375f78ce4cccde758a73edae..ff8948683ecd3d53d694a2df493502d41bd80d3d 100644 (file)
@@ -17,8 +17,6 @@
 #include <QWidget>
 
 #include <map>
-#include <string>
-
 
 class QTreeWidget;
 class QTreeWidgetItem;
@@ -35,23 +33,24 @@ public:
        PanelStack(QWidget * parent = 0);
 
        /// add a category with no associated panel
-       void addCategory(lyx::docstring const & name,
-               lyx::docstring const & parent = lyx::docstring());
+       void addCategory(docstring const & name,
+               docstring const & parent = docstring());
 
        /// add a widget panel with a given name, under the given parent
-       void addPanel(QWidget * panel, lyx::docstring const & name,
-               lyx::docstring const & parent = lyx::docstring());
+       void addPanel(QWidget * panel, docstring const & name,
+               docstring const & parent = docstring());
 
        /// set current panel by logical name
-       void setCurrentPanel(lyx::docstring const &);
+       void setCurrentPanel(docstring const &);
 
        virtual QSize sizeHint() const;
+
 public Q_SLOTS:
        /// set current panel from an item
-       void switchPanel(QTreeWidgetItem * i, QTreeWidgetItem* previous=0);
+       void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0);
 
 private:
-       typedef std::map<lyx::docstring, QTreeWidgetItem *> PanelMap;
+       typedef std::map<docstring, QTreeWidgetItem *> PanelMap;
 
        PanelMap panel_map_;
 
index e1709a2c925023fee79c12b40859e0cd0eceb049..c1fd07035a79979914a80a439e01cd5b1805b10f 100644 (file)
@@ -134,9 +134,11 @@ void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit,
        LengthCombo * lengthCombo) 
 {
        if (!checkBox->isChecked()) 
-               lengthToWidgets(lineEdit, lengthCombo, "auto", lengthCombo->currentLengthItem());
+               lengthToWidgets(lineEdit, lengthCombo,
+                               "auto", lengthCombo->currentLengthItem());
        else if (lineEdit->text() == "auto")
-               lengthToWidgets(lineEdit, lengthCombo, string(""), lengthCombo->currentLengthItem());
+               lengthToWidgets(lineEdit, lengthCombo, string(),
+                               lengthCombo->currentLengthItem());
 }
 
 
@@ -176,25 +178,25 @@ docstring const formatted(docstring const & text, int w)
                                      nxtpos2 < nxtpos1);
 
                docstring const line_plus_word =
-                       line.empty() ? word : line + lyx::char_type(' ') + word;
+                       line.empty() ? word : line + char_type(' ') + word;
 
                // FIXME: make w be size_t
                if (int(line_plus_word.length()) >= w) {
-                       sout += line + lyx::char_type('\n');
+                       sout += line + char_type('\n');
                        if (newline) {
-                               sout += word + lyx::char_type('\n');
+                               sout += word + char_type('\n');
                                line.erase();
                        } else {
                                line = word;
                        }
 
                } else if (newline) {
-                       sout += line_plus_word + lyx::char_type('\n');
+                       sout += line_plus_word + char_type('\n');
                        line.erase();
 
                } else {
                        if (!line.empty())
-                               line += lyx::char_type(' ');
+                               line += char_type(' ');
                        line += word;
                }
 
index 3020d2420c61e168cfbd36c3abdb486c76523d57..e4cf2fe68e304968b0901662915859e7e7ee6990 100644 (file)
@@ -32,8 +32,6 @@
 #include <sstream>
 
 using lyx::support::isStrDbl;
-using lyx::docstring;
-
 using std::string;
 
 
@@ -141,9 +139,7 @@ PathValidator::PathValidator(bool acceptable_if_empty,
 {}
 
 
-namespace {
-
-docstring const printable_list(docstring const & invalid_chars)
+static docstring const printable_list(docstring const & invalid_chars)
 {
        docstring s;
        docstring::const_iterator const begin = invalid_chars.begin();
@@ -162,8 +158,6 @@ docstring const printable_list(docstring const & invalid_chars)
        return s;
 }
 
-} // namespace anon
-
 
 QValidator::State PathValidator::validate(QString & qtext, int &) const
 {