]> git.lyx.org Git - features.git/commitdiff
Rescue monolithic build after 32fde61c8f17d524.
authorPavel Sanda <sanda@lyx.org>
Sat, 24 Nov 2012 16:48:47 +0000 (17:48 +0100)
committerPavel Sanda <sanda@lyx.org>
Sat, 24 Nov 2012 16:48:47 +0000 (17:48 +0100)
src/frontends/qt4/CategorizedCombo.cpp
src/frontends/qt4/CategorizedCombo.h
src/frontends/qt4/ui/LaTeXUi.ui

index 878d277aceb1e47d03ca5b2187b2064e47154817..327059f878588b32cbc46d6c4d6d7f5743abc397 100644 (file)
 #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"
index bb28db971b9ab63a8ad0127730e294c769682c18..b2e5c7fa721ae273940591596d3ac85fa09ce179 100644 (file)
@@ -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
index 34208109909d82fe892a9d64d284e78b596d955a..8c1c5ab24844d24259aabe48d3c197732ea4a570 100644 (file)
@@ -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>