code cosmetics whitespace, unneeded lyx:: qualification, indentation, unneeded destructors and the like

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17994 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-25 16:39:21 +00:00
parent 5924500e24
commit c6b932f467
47 changed files with 265 additions and 308 deletions

View File

@ -24,13 +24,10 @@
#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);

View File

@ -19,10 +19,6 @@
#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();

View File

@ -32,18 +32,16 @@
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);

View 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"

View 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_;

View 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);
}

View 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

View File

@ -22,36 +22,29 @@
#include <QHBoxLayout>
using lyx::support::split;
using lyx::docstring;
using std::string;
namespace {
/// return the Qt form of the label
docstring const getLabel(docstring const & ucs4str) {
// FIXME UNICODE
string str = lyx::to_utf8(ucs4str);
string label;
string sc(split(str, label, '|'));
if (sc.length() < 2)
return lyx::from_utf8(label);
string::size_type pos = label.find(sc[1]);
if (pos == string::npos)
return lyx::from_utf8(label);
label.insert(pos, 1, '&');
return lyx::from_utf8(label);
}
} // namespace anon
namespace lyx {
/// return the Qt form of the label
static docstring const getLabel(docstring const & ucs4str) {
// FIXME UNICODE
string str = to_utf8(ucs4str);
string label;
string sc(split(str, label, '|'));
if (sc.length() < 2)
return from_utf8(label);
string::size_type pos = label.find(sc[1]);
if (pos == string::npos)
return from_utf8(label);
label.insert(pos, 1, '&');
return from_utf8(label);
}
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()

View 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

View 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()) {

View 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(

View 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 {

View File

@ -45,9 +45,6 @@ using std::string;
namespace lyx {
namespace frontend {
GuiFontLoader::~GuiFontLoader() {
}
namespace {
struct symbol_font {

View 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);

View 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);

View File

@ -22,7 +22,7 @@ namespace frontend {
/**
* The Qt4 version of the Selection.
*/
class GuiSelection: public Selection
class GuiSelection : public Selection
{
public:
virtual ~GuiSelection() {}

View 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);

View 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;

View 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);
}

View 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;
}

View 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()));

View 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 {

View File

@ -16,7 +16,6 @@
#include "controllers/ButtonController.h"
using lyx::docstring;
namespace lyx {
namespace frontend {

View 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;

View 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());

View 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(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(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);

View 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));
}

View 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:

View 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()));

View 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_;

View 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

View 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);

View 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_;

View 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_,

View 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())
{}

View 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();

View File

@ -109,7 +109,7 @@ private:
int restored_buffer_;
/// the references
std::vector<lyx::docstring> refs_;
std::vector<docstring> refs_;
};
} // namespace frontend

View 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()));

View 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);
}

View 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));

View 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);
}

View 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

View 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);

View 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;

View 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_;

View 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;
}

View 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
{