The branch, master, has been updated. - Log -----------------------------------------------------------------
commit ad42e885e684cc440493b510e4ee786ab6b01fd2 Author: Pavel Sanda <sa...@lyx.org> Date: Sat Nov 24 17:48:47 2012 +0100 Rescue monolithic build after 32fde61c8f17d524. diff --git a/src/frontends/qt4/CategorizedCombo.cpp b/src/frontends/qt4/CategorizedCombo.cpp index 878d277..327059f 100644 --- a/src/frontends/qt4/CategorizedCombo.cpp +++ b/src/frontends/qt4/CategorizedCombo.cpp @@ -34,10 +34,11 @@ #include <QStandardItemModel> #include <QTextFrame> -using namespace std; -using namespace lyx; using namespace lyx::support; +namespace lyx { +namespace frontend { + class CCItemDelegate : public QItemDelegate { public: @@ -128,13 +129,13 @@ struct CategorizedCombo::Private }; -static QString category(QAbstractItemModel const & model, int row) +static QString categoryCC(QAbstractItemModel const & model, int row) { return model.data(model.index(row, 2), Qt::DisplayRole).toString(); } -static int headerHeight(QStyleOptionViewItem const & opt) +static int headerHeightCC(QStyleOptionViewItem const & opt) { return opt.fontMetrics.height(); } @@ -148,10 +149,10 @@ void CCItemDelegate::paint(QPainter * painter, QStyleOptionViewItem const & opti // default background painter->fillRect(opt.rect, opt.palette.color(QPalette::Base)); - QString cat = category(*index.model(), index.row()); + QString cat = categoryCC(*index.model(), index.row()); // not the same as in the previous line? - if (index.row() == 0 || cat != category(*index.model(), index.row() - 1)) { + if (index.row() == 0 || cat != categoryCC(*index.model(), index.row() - 1)) { painter->save(); // draw unselected background @@ -162,10 +163,10 @@ void CCItemDelegate::paint(QPainter * painter, QStyleOptionViewItem const & opti // draw category header drawCategoryHeader(painter, opt, - category(*index.model(), index.row())); + categoryCC(*index.model(), index.row())); // move rect down below header - opt.rect.setTop(opt.rect.top() + headerHeight(opt)); + opt.rect.setTop(opt.rect.top() + headerHeightCC(opt)); painter->restore(); } @@ -216,9 +217,9 @@ QSize CCItemDelegate::sizeHint(QStyleOptionViewItem const & opt, /// So we tweak this value accordingly. It's not nice, but the /// only possible way it seems. // Add space for the category headers here - QString cat = category(*index.model(), index.row()); - if (index.row() == 0 || cat != category(*index.model(), index.row() - 1)) { - size.setHeight(size.height() + headerHeight(opt)); + QString cat = categoryCC(*index.model(), index.row()); + if (index.row() == 0 || cat != categoryCC(*index.model(), index.row() - 1)) { + size.setHeight(size.height() + headerHeightCC(opt)); } return size; @@ -289,7 +290,7 @@ QString CCItemDelegate::underlineFilter(QString const & s) const } -static QString charFilterRegExp(QString const & filter) +static QString charFilterRegExpCC(QString const & filter) { QString re; for (int i = 0; i < filter.length(); ++i) { @@ -314,7 +315,7 @@ void CategorizedCombo::Private::setFilter(QString const & s) lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row(); filter_ = s; - filterModel_->setFilterRegExp(charFilterRegExp(filter_)); + filterModel_->setFilterRegExp(charFilterRegExpCC(filter_)); countCategories(); // restore old selection @@ -583,5 +584,8 @@ QString const & CategorizedCombo::filter() const return d->filter_; } +} // namespace frontend +} // namespace lyx + #include "moc_CategorizedCombo.cpp" diff --git a/src/frontends/qt4/CategorizedCombo.h b/src/frontends/qt4/CategorizedCombo.h index bb28db9..b2e5c7f 100644 --- a/src/frontends/qt4/CategorizedCombo.h +++ b/src/frontends/qt4/CategorizedCombo.h @@ -22,6 +22,9 @@ #include <QComboBox> +namespace lyx { +namespace frontend { + class CCItemDelegate; /** @@ -72,4 +75,7 @@ private: }; +} // namespace frontend +} // namespace lyx + #endif // LYX_CATEGORIZEDCOMBO_H diff --git a/src/frontends/qt4/ui/LaTeXUi.ui b/src/frontends/qt4/ui/LaTeXUi.ui index 3420810..8c1c5ab 100644 --- a/src/frontends/qt4/ui/LaTeXUi.ui +++ b/src/frontends/qt4/ui/LaTeXUi.ui @@ -26,7 +26,7 @@ <number>6</number> </property> <item row="0" column="0"> - <widget class="CategorizedCombo" name="classCO"> + <widget class="lyx::frontend::CategorizedCombo" name="classCO"> <property name="maxVisibleItems"> <number>20</number> </property> ----------------------------------------------------------------------- Summary of changes: src/frontends/qt4/CategorizedCombo.cpp | 30 +++++++++++++++++------------- src/frontends/qt4/CategorizedCombo.h | 6 ++++++ src/frontends/qt4/ui/LaTeXUi.ui | 2 +- 3 files changed, 24 insertions(+), 14 deletions(-) hooks/post-receive -- The LyX Source Repository