Reviewed by Dave Hyatt.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 May 2005 02:10:10 +0000 (02:10 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 May 2005 02:10:10 +0000 (02:10 +0000)
        No new layout tests needed.

        - remove all remaining uses of QMIN/QMAX and KMIN/KMAX.

        * kwq/KWQDef.h: Remove the macros.

        Remove all use of the macros (and fix a few compile errors by changing the types of
        some integer and floating point constants).

        * khtml/css/cssparser.cpp:
        (CSSParser::parseColorFromValue):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::addHTMLColor):
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::parseComment):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::nearestFloatBottom):
        (khtml::RenderBlock::calcMinMaxWidth):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintOutlineForLine):
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::calcMinMaxWidth):
        (RenderFieldset::layoutLegend):
        (RenderFileButton::calcMinMaxWidth):
        (RenderSelect::layout):
        (RenderTextArea::calcMinMaxWidth):
        * khtml/rendering/render_object.cpp:
        (RenderObject::drawBorder):
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::resizeWidget):
        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):
        * khtml/rendering/table_layout.cpp:
        (AutoTableLayout::recalcColumn):
        (AutoTableLayout::calcEffectiveWidth):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9157 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/cssparser.cpp
WebCore/khtml/css/cssstyleselector.cpp
WebCore/khtml/html/html_elementimpl.cpp
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/html/htmltokenizer.cpp
WebCore/khtml/rendering/render_block.cpp
WebCore/khtml/rendering/render_flow.cpp
WebCore/khtml/rendering/render_form.cpp
WebCore/khtml/rendering/render_object.cpp
WebCore/khtml/rendering/render_replaced.cpp
WebCore/khtml/rendering/render_table.cpp
WebCore/khtml/rendering/table_layout.cpp
WebCore/kwq/KWQDef.h

index ada3c45ba8036d2e2795d6d1d229fad9fb0867a5..c5183a9970bed94732a03e7eb535d6b6a221af1e 100644 (file)
@@ -1,3 +1,46 @@
+2005-05-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dave Hyatt.
+        No new layout tests needed.
+
+        - remove all remaining uses of QMIN/QMAX and KMIN/KMAX.
+
+        * kwq/KWQDef.h: Remove the macros.
+
+        Remove all use of the macros (and fix a few compile errors by changing the types of
+        some integer and floating point constants).
+
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseColorFromValue):
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
+        * khtml/html/html_elementimpl.cpp:
+        (HTMLElementImpl::addHTMLColor):
+        * khtml/html/html_formimpl.cpp:
+        (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
+        * khtml/html/htmltokenizer.cpp:
+        (khtml::HTMLTokenizer::parseComment):
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::nearestFloatBottom):
+        (khtml::RenderBlock::calcMinMaxWidth):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::paintOutlineForLine):
+        * khtml/rendering/render_form.cpp:
+        (RenderLineEdit::calcMinMaxWidth):
+        (RenderFieldset::layoutLegend):
+        (RenderFileButton::calcMinMaxWidth):
+        (RenderSelect::layout):
+        (RenderTextArea::calcMinMaxWidth):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::drawBorder):
+        * khtml/rendering/render_replaced.cpp:
+        (RenderWidget::resizeWidget):
+        * khtml/rendering/render_table.cpp:
+        (RenderTableSection::layoutRows):
+        * khtml/rendering/table_layout.cpp:
+        (AutoTableLayout::recalcColumn):
+        (AutoTableLayout::calcEffectiveWidth):
+
 2005-05-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Chris Blumenberg.
index 1034ad401c86cf18b3f64fd89dbd9539d8cd0922..14f23f5103d4a3f456000b9337e9c9978f65662d 100644 (file)
@@ -2219,9 +2219,9 @@ CSSPrimitiveValueImpl *CSSParser::parseColorFromValue(Value* value)
        if ( !validUnit( v, FInteger|FPercent, true ) )
            return 0;
        int b = (int) ( v->fValue * (v->unit == CSSPrimitiveValue::CSS_PERCENTAGE ? 256./100. : 1.) );
-       r = QMAX( 0, QMIN( 255, r ) );
-       g = QMAX( 0, QMIN( 255, g ) );
-       b = QMAX( 0, QMIN( 255, b ) );
+       r = kMax( 0, kMin( 255, r ) );
+       g = kMax( 0, kMin( 255, g ) );
+       b = kMax( 0, kMin( 255, b ) );
        c = qRgb( r, g, b );
     }
     else if ( value->unit == Value::Function &&
@@ -2253,10 +2253,10 @@ CSSPrimitiveValueImpl *CSSParser::parseColorFromValue(Value* value)
         v = args->next();
         if ( !validUnit( v, FNumber, true ) )
             return 0;
-        r = QMAX( 0, QMIN( 255, r ) );
-        g = QMAX( 0, QMIN( 255, g ) );
-        b = QMAX( 0, QMIN( 255, b ) );
-        int a = (int)(QMAX( 0, QMIN( 1.0f, v->fValue ) ) * 255);
+        r = kMax( 0, kMin( 255, r ) );
+        g = kMax( 0, kMin( 255, g ) );
+        b = kMax( 0, kMin( 255, b ) );
+        int a = (int)(kMax( 0.0, kMin( 1.0, v->fValue ) ) * 255);
         c = qRgba( r, g, b, a );
     }
     else
index f5f3b4a5af45d6c310cf32da0217ad67ad4bf200..6861063eb9600f208a8b72a792c537d88f37033a 100644 (file)
@@ -4000,7 +4000,7 @@ float CSSStyleSelector::getComputedSizeFromSpecifiedSize(bool isAbsoluteSize, fl
     if (zoomedSize < minLogicalSize && (specifiedSize >= minLogicalSize || !isAbsoluteSize))
         zoomedSize = minLogicalSize;
     
-    return KMAX(zoomedSize, 1.0f);
+    return kMax(zoomedSize, 1.0f);
 }
 
 const int fontSizeTableMax = 16;
index bfd17724ccfe3da4032e7583940d0029a71cfca1..010fcbce73fe8eb81d64f877ee1a074e0c4b6eb1 100644 (file)
@@ -704,7 +704,7 @@ void HTMLElementImpl::addHTMLColor(HTMLAttributeImpl* attr, int id, const DOMStr
                     colors[component] = (colors[component] << 4);
                     if ( hex > 0 ) {
                         colors[component] += hex;
-                        maxDigit = QMIN( maxDigit, numDigits );
+                        maxDigit = kMin( maxDigit, numDigits );
                     }
                     numDigits++;
                     pos++;
index 3fafe32caadd04e7699af74704220193a3c6b12e..5052d32b1490438b28aac53c346da0d40835be68 100644 (file)
@@ -2711,10 +2711,10 @@ void HTMLSelectElementImpl::parseHTMLAttribute(HTMLAttributeImpl *attr)
     switch(attr->id())
     {
     case ATTR_SIZE:
-        m_size = QMAX( attr->value().toInt(), 1 );
+        m_size = kMax( attr->value().toInt(), 1 );
         break;
     case ATTR_WIDTH:
-        m_minwidth = QMAX( attr->value().toInt(), 0 );
+        m_minwidth = kMax( attr->value().toInt(), 0 );
         break;
     case ATTR_MULTIPLE:
         m_multiple = (!attr->isNull());
index 9df0cf003708c5290f1d6f19134b134bb95181a3..74fd79c69cc919ddd01ba397deb0f8aa640bdc71 100644 (file)
@@ -665,7 +665,7 @@ void HTMLTokenizer::parseComment(TokenizerString &src)
         scriptCode[ scriptCodeSize++ ] = *src;
 #if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
         qDebug("comment is now: *%s*",
-               QConstString((QChar*)src.current(), QMIN(16, src.length())).string().latin1());
+               QConstString((QChar*)src.current(), kMin(16, src.length())).string().latin1());
 #endif
 
         if (strict) {
index 54e207a1d0bd8ddbe258f921a53289ce9e430220..8784098b94c7b0c1653091708adb8cae57ca6626 100644 (file)
@@ -2020,7 +2020,7 @@ RenderBlock::nearestFloatBottom(int height) const
     for ( ; (r = it.current()); ++it )
         if (r->endY>height && (r->endY<bottom || bottom==0))
             bottom=r->endY;
-    return QMAX(bottom, height);
+    return kMax(bottom, height);
 }
 
 int
@@ -2670,19 +2670,19 @@ void RenderBlock::calcMinMaxWidth()
 
     if (style()->width().isFixed() && style()->width().value > 0) {
         if (isTableCell())
-            m_maxWidth = KMAX(m_minWidth, style()->width().value);
+            m_maxWidth = kMax(m_minWidth, style()->width().value);
         else
             m_minWidth = m_maxWidth = style()->width().value;
     }
     
     if (style()->minWidth().isFixed() && style()->minWidth().value > 0) {
-        m_maxWidth = KMAX(m_maxWidth, style()->minWidth().value);
-        m_minWidth = KMAX(m_minWidth, style()->minWidth().value);
+        m_maxWidth = kMax(m_maxWidth, style()->minWidth().value);
+        m_minWidth = kMax(m_minWidth, style()->minWidth().value);
     }
     
     if (style()->maxWidth().isFixed() && style()->maxWidth().value != UNDEFINED) {
-        m_maxWidth = KMIN(m_maxWidth, style()->maxWidth().value);
-        m_minWidth = KMIN(m_minWidth, style()->maxWidth().value);
+        m_maxWidth = kMin(m_maxWidth, style()->maxWidth().value);
+        m_minWidth = kMin(m_minWidth, style()->maxWidth().value);
     }
 
     int toAdd = 0;
index db93adb11a16e4013a09b71228cbb448e6913b78..1a751d85bf752115c22c31e9db18058a79c39806 100644 (file)
@@ -752,7 +752,7 @@ void RenderFlow::paintOutlineForLine(QPainter *p, int tx, int ty, const QRect &l
         drawBorder(p,
                    l - ow,
                    t - ow,
-                   QMIN(r+ow, (lastline.isValid()? tx+lastline.left() : 1000000)),
+                   kMin(r+ow, (lastline.isValid()? tx+lastline.left() : 1000000)),
                    t ,
                    BSTop, oc, style()->color(), os,
                    ow,
@@ -761,7 +761,7 @@ void RenderFlow::paintOutlineForLine(QPainter *p, int tx, int ty, const QRect &l
     
     if (lastline.right() < thisline.right())
         drawBorder(p,
-                   QMAX(lastline.isValid()?tx + lastline.right() + 1:-1000000, l - ow),
+                   kMax(lastline.isValid()?tx + lastline.right() + 1:-1000000, l - ow),
                    t - ow,
                    r + ow,
                    t ,
@@ -775,7 +775,7 @@ void RenderFlow::paintOutlineForLine(QPainter *p, int tx, int ty, const QRect &l
         drawBorder(p,
                    l - ow,
                    b,
-                   QMIN(r+ow, nextline.isValid()? tx+nextline.left()+1 : 1000000),
+                   kMin(r+ow, nextline.isValid()? tx+nextline.left()+1 : 1000000),
                    b + ow,
                    BSBottom, oc, style()->color(), os,
                    ow,
@@ -784,7 +784,7 @@ void RenderFlow::paintOutlineForLine(QPainter *p, int tx, int ty, const QRect &l
     
     if (nextline.right() < thisline.right())
         drawBorder(p,
-                   QMAX(nextline.isValid()?tx+nextline.right()+1:-1000000 , l-ow),
+                   kMax(nextline.isValid()?tx+nextline.right()+1:-1000000 , l-ow),
                    b,
                    r + ow,
                    b + ow,
index ce2584fdac140af30e3a64f12e8e52383c69a943..25e2b29b561eb3f43fc4bf0ba768fc1ef6608985 100644 (file)
@@ -616,7 +616,7 @@ void RenderLineEdit::calcMinMaxWidth()
     int h = fm.lineSpacing();
     int w = fm.width( 'x' ) * (size > 0 ? size : 17); // "some"
     s = QSize(w + 2 + 2*widget()->frameWidth(),
-              QMAX(h, 14) + 2 + 2*widget()->frameWidth())
+              kMax(h, 14) + 2 + 2*widget()->frameWidth())
         .expandedTo(QApplication::globalStrut());
 #endif
 
@@ -721,8 +721,8 @@ RenderObject* RenderFieldset::layoutLegend(bool relayoutChildren)
             xPos = m_width - paddingRight() - borderRight() - legend->width() - legend->marginRight();
         int b = borderTop();
         int h = legend->height();
-        legend->setPos(xPos, QMAX((b-h)/2, 0));
-        m_height = QMAX(b,h) + paddingTop();
+        legend->setPos(xPos, kMax((b-h)/2, 0));
+        m_height = kMax(b,h) + paddingTop();
     }
     return legend;
 }
@@ -887,7 +887,7 @@ void RenderFileButton::calcMinMaxWidth()
     int w = fm.width( 'x' ) * (size > 0 ? size : 17); // "some"
     w += 6 + fm.width( m_button->text() ) + 2*fm.width( ' ' );
     s = QSize(w + 2 + 2*m_edit->frameWidth(),
-              QMAX(h, 14) + 2 + 2*m_edit->frameWidth())
+              kMax(h, 14) + 2 + 2*m_edit->frameWidth())
         .expandedTo(QApplication::globalStrut());
 #endif
 
@@ -1241,20 +1241,20 @@ void RenderSelect::layout( )
         int width = 0;
         int height = 0;
         while(p) {
-            width = QMAX(width, p->width(p->listBox()));
-            height = QMAX(height, p->height(p->listBox()));
+            width = kMax(width, p->width(p->listBox()));
+            height = kMax(height, p->height(p->listBox()));
             p = p->next();
         }
 #endif
 
         int size = m_size;
         // check if multiple and size was not given or invalid
-        // Internet Exploder sets size to QMIN(number of elements, 4)
+        // Internet Exploder sets size to kMin(number of elements, 4)
         // Netscape seems to simply set it to "number of elements"
-        // the average of that is IMHO QMIN(number of elements, 10)
+        // the average of that is IMHO kMin(number of elements, 10)
         // so I did that ;-)
         if(size < 1)
-            size = QMIN(static_cast<KListBox*>(m_widget)->count(), 10);
+            size = kMin(static_cast<KListBox*>(m_widget)->count(), 10U);
 
 #if APPLE_CHANGES
         // Let the widget tell us how big it wants to be.
@@ -1496,13 +1496,13 @@ void RenderTextArea::calcMinMaxWidth()
 
     QTextEdit* w = static_cast<QTextEdit*>(m_widget);
 #if APPLE_CHANGES
-    QSize size(w->sizeWithColumnsAndRows(QMAX(element()->cols(), 1), QMAX(element()->rows(), 1)));
+    QSize size(w->sizeWithColumnsAndRows(kMax(element()->cols(), 1L), kMax(element()->rows(), 1L)));
 #else
     const QFontMetrics &m = style()->fontMetrics();
     w->setTabStopWidth(8 * m.width(" "));
-    QSize size( QMAX(element()->cols(), 1)*m.width('x') + w->frameWidth() +
+    QSize size( kMax(element()->cols(), 1)*m.width('x') + w->frameWidth() +
                 w->verticalScrollBar()->sizeHint().width(),
-                QMAX(element()->rows(), 1)*m.height() + w->frameWidth()*2 +
+                kMax(element()->rows(), 1)*m.height() + w->frameWidth()*2 +
                 (w->wordWrap() == QTextEdit::NoWrap ?
                  w->horizontalScrollBar()->sizeHint().height() : 0)
         );
index b4b8d9f11cf0d77bd1629f8ebb25a853927a6ea2..94d0954a1dbe2f41a350557627b163f085425e58 100644 (file)
@@ -852,20 +852,20 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2,
          switch(s)
            {
            case BSTop:
-             drawBorder(p, x1+QMAX((-adjbw1*2+1)/3,0), y1        , x2-QMAX((-adjbw2*2+1)/3,0), y1 + third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
-             drawBorder(p, x1+QMAX(( adjbw1*2+1)/3,0), y2 - third, x2-QMAX(( adjbw2*2+1)/3,0), y2        , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+             drawBorder(p, x1+kMax((-adjbw1*2+1)/3,0), y1        , x2-kMax((-adjbw2*2+1)/3,0), y1 + third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+             drawBorder(p, x1+kMax(( adjbw1*2+1)/3,0), y2 - third, x2-kMax(( adjbw2*2+1)/3,0), y2        , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
              break;
            case BSLeft:
-             drawBorder(p, x1        , y1+QMAX((-adjbw1*2+1)/3,0), x1+third, y2-QMAX((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
-             drawBorder(p, x2 - third, y1+QMAX(( adjbw1*2+1)/3,0), x2      , y2-QMAX(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+             drawBorder(p, x1        , y1+kMax((-adjbw1*2+1)/3,0), x1+third, y2-kMax((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+             drawBorder(p, x2 - third, y1+kMax(( adjbw1*2+1)/3,0), x2      , y2-kMax(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
              break;
            case BSBottom:
-             drawBorder(p, x1+QMAX(( adjbw1*2+1)/3,0), y1      , x2-QMAX(( adjbw2*2+1)/3,0), y1+third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
-             drawBorder(p, x1+QMAX((-adjbw1*2+1)/3,0), y2-third, x2-QMAX((-adjbw2*2+1)/3,0), y2      , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+             drawBorder(p, x1+kMax(( adjbw1*2+1)/3,0), y1      , x2-kMax(( adjbw2*2+1)/3,0), y1+third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+             drawBorder(p, x1+kMax((-adjbw1*2+1)/3,0), y2-third, x2-kMax((-adjbw2*2+1)/3,0), y2      , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
              break;
            case BSRight:
-            drawBorder(p, x1      , y1+QMAX(( adjbw1*2+1)/3,0), x1+third, y2-QMAX(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
-           drawBorder(p, x2-third, y1+QMAX((-adjbw1*2+1)/3,0), x2      , y2-QMAX((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+            drawBorder(p, x1      , y1+kMax(( adjbw1*2+1)/3,0), x1+third, y2-kMax(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+           drawBorder(p, x2-third, y1+kMax((-adjbw1*2+1)/3,0), x2      , y2-kMax((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
              break;
            default:
              break;
@@ -902,20 +902,20 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2,
         switch (s)
        {
        case BSTop:
-           drawBorder(p, x1+QMAX(-adjbw1  ,0)/2,  y1        , x2-QMAX(-adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
-           drawBorder(p, x1+QMAX( adjbw1+1,0)/2, (y1+y2+1)/2, x2-QMAX( adjbw2+1,0)/2,  y2        , s, c, textcolor, s2, adjbw1/2, adjbw2/2);
+           drawBorder(p, x1+kMax(-adjbw1  ,0)/2,  y1        , x2-kMax(-adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
+           drawBorder(p, x1+kMax( adjbw1+1,0)/2, (y1+y2+1)/2, x2-kMax( adjbw2+1,0)/2,  y2        , s, c, textcolor, s2, adjbw1/2, adjbw2/2);
            break;
        case BSLeft:
-            drawBorder(p,  x1        , y1+QMAX(-adjbw1  ,0)/2, (x1+x2+1)/2, y2-QMAX(-adjbw2,0)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
-           drawBorder(p, (x1+x2+1)/2, y1+QMAX( adjbw1+1,0)/2,  x2        , y2-QMAX( adjbw2+1,0)/2, s, c, textcolor, s2, adjbw1/2, adjbw2/2);
+            drawBorder(p,  x1        , y1+kMax(-adjbw1  ,0)/2, (x1+x2+1)/2, y2-kMax(-adjbw2,0)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
+           drawBorder(p, (x1+x2+1)/2, y1+kMax( adjbw1+1,0)/2,  x2        , y2-kMax( adjbw2+1,0)/2, s, c, textcolor, s2, adjbw1/2, adjbw2/2);
            break;
        case BSBottom:
-           drawBorder(p, x1+QMAX( adjbw1  ,0)/2,  y1        , x2-QMAX( adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s2,  adjbw1bighalf, adjbw2bighalf);
-           drawBorder(p, x1+QMAX(-adjbw1+1,0)/2, (y1+y2+1)/2, x2-QMAX(-adjbw2+1,0)/2,  y2        , s, c, textcolor, s1, adjbw1/2, adjbw2/2);
+           drawBorder(p, x1+kMax( adjbw1  ,0)/2,  y1        , x2-kMax( adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s2,  adjbw1bighalf, adjbw2bighalf);
+           drawBorder(p, x1+kMax(-adjbw1+1,0)/2, (y1+y2+1)/2, x2-kMax(-adjbw2+1,0)/2,  y2        , s, c, textcolor, s1, adjbw1/2, adjbw2/2);
            break;
        case BSRight:
-            drawBorder(p,  x1        , y1+QMAX( adjbw1  ,0)/2, (x1+x2+1)/2, y2-QMAX( adjbw2,0)/2, s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
-           drawBorder(p, (x1+x2+1)/2, y1+QMAX(-adjbw1+1,0)/2,  x2        , y2-QMAX(-adjbw2+1,0)/2, s, c, textcolor, s1, adjbw1/2, adjbw2/2);
+            drawBorder(p,  x1        , y1+kMax( adjbw1  ,0)/2, (x1+x2+1)/2, y2-kMax( adjbw2,0)/2, s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
+           drawBorder(p, (x1+x2+1)/2, y1+kMax(-adjbw1+1,0)/2,  x2        , y2-kMax(-adjbw2+1,0)/2, s, c, textcolor, s1, adjbw1/2, adjbw2/2);
            break;
        }
         break;
@@ -943,31 +943,31 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2,
        switch(s) {
         case BSTop:
             quad.setPoints(4,
-                          x1+QMAX(-adjbw1,0), y1,
-                           x1+QMAX( adjbw1,0), y2,
-                           x2-QMAX( adjbw2,0), y2,
-                           x2-QMAX(-adjbw2,0), y1);
+                          x1+kMax(-adjbw1,0), y1,
+                           x1+kMax( adjbw1,0), y2,
+                           x2-kMax( adjbw2,0), y2,
+                           x2-kMax(-adjbw2,0), y1);
             break;
         case BSBottom:
             quad.setPoints(4,
-                          x1+QMAX( adjbw1,0), y1,
-                           x1+QMAX(-adjbw1,0), y2,
-                           x2-QMAX(-adjbw2,0), y2,
-                           x2-QMAX( adjbw2,0), y1);
+                          x1+kMax( adjbw1,0), y1,
+                           x1+kMax(-adjbw1,0), y2,
+                           x2-kMax(-adjbw2,0), y2,
+                           x2-kMax( adjbw2,0), y1);
             break;
         case BSLeft:
          quad.setPoints(4,
-                        x1, y1+QMAX(-adjbw1,0),
-                                x1, y2-QMAX(-adjbw2,0),
-                        x2, y2-QMAX( adjbw2,0),
-                        x2, y1+QMAX( adjbw1,0));
+                        x1, y1+kMax(-adjbw1,0),
+                                x1, y2-kMax(-adjbw2,0),
+                        x2, y2-kMax( adjbw2,0),
+                        x2, y1+kMax( adjbw1,0));
             break;
         case BSRight:
          quad.setPoints(4,
-                        x1, y1+QMAX( adjbw1,0),
-                                x1, y2-QMAX( adjbw2,0),
-                        x2, y2-QMAX(-adjbw2,0),
-                        x2, y1+QMAX(-adjbw1,0));
+                        x1, y1+kMax( adjbw1,0),
+                                x1, y2-kMax( adjbw2,0),
+                        x2, y2-kMax(-adjbw2,0),
+                        x2, y1+kMax(-adjbw1,0));
             break;
         }
        p->drawConvexPolygon(quad);
index 35b73401f23b2731ac112491921d272249406e10..5143a90d1d3ec09f7daa5b58d61b4925e681df33 100644 (file)
@@ -266,8 +266,8 @@ void  RenderWidget::resizeWidget( QWidget *widget, int w, int h )
 {
 #if !APPLE_CHANGES
     // ugly hack to limit the maximum size of the widget (as X11 has problems if it's bigger)
-    h = QMIN( h, 3072 );
-    w = QMIN( w, 2000 );
+    h = kMin( h, 3072 );
+    w = kMin( w, 2000 );
 #endif
 
     if (element() && (widget->width() != w || widget->height() != h)) {
index 7ad2e222ee35a1303951e8a5ed1c333e023c6ddc..fe4c0ee6eb25c0650053d37ed65c230d29163eeb 100644 (file)
@@ -1184,7 +1184,7 @@ int RenderTableSection::layoutRows( int toAdd )
                    int toAdd = kMin(dh, (totalHeight * grid[r].height.value / 100)-rh);
                     // If toAdd is negative, then we don't want to shrink the row (this bug
                     // affected Outlook Web Access).
-                    toAdd = QMAX(0, toAdd);
+                    toAdd = kMax(0, toAdd);
                    add += toAdd;
                    dh -= toAdd;
                    totalPercent -= grid[r].height.value;
index 50898fa105755a0af1c02f4f173384972b46f9de..147312cbb7880353b7fc96dd37c14df9592ef344 100644 (file)
@@ -381,8 +381,8 @@ void AutoTableLayout::recalcColumn( int effCol )
                if ( cell && cell->colSpan() == 1 ) {
                     // A cell originates in this column.  Ensure we have
                     // a min/max width of at least 1px for this column now.
-                    l.minWidth = QMAX(l.minWidth, 1);
-                    l.maxWidth = QMAX(l.maxWidth, 1);
+                    l.minWidth = kMax(l.minWidth, 1);
+                    l.maxWidth = kMax(l.maxWidth, 1);
                    if ( !cell->minMaxKnown() )
                        cell->calcMinMaxWidth();
                    if ( cell->minWidth() > l.minWidth )
@@ -431,8 +431,8 @@ void AutoTableLayout::recalcColumn( int effCol )
                     if ( cell && (!effCol || section->cellAt( i, effCol-1 ) != cell) ) {
                         // This spanning cell originates in this column.  Ensure we have
                         // a min/max width of at least 1px for this column now.
-                        l.minWidth = QMAX(l.minWidth, 1);
-                        l.maxWidth = QMAX(l.maxWidth, 1);
+                        l.minWidth = kMax(l.minWidth, 1);
+                        l.maxWidth = kMax(l.maxWidth, 1);
                        insertSpanCell( cell );
                     }
                    last = cell;
@@ -698,11 +698,11 @@ int AutoTableLayout::calcEffectiveWidth()
                // can't satify this condition, treat as variable
                w = Length();
            } else {
-               int spanMax = QMAX( maxWidth, cMaxWidth );
+               int spanMax = kMax( maxWidth, cMaxWidth );
 #ifdef DEBUG_LAYOUT
                qDebug("    adjusting tMaxWidth (%d): spanMax=%d, value=%d, totalPercent=%d", tMaxWidth, spanMax, w.value, totalPercent );
 #endif
-               tMaxWidth = QMAX( tMaxWidth, spanMax * 100 / w.value );
+               tMaxWidth = kMax( tMaxWidth, spanMax * 100 / w.value );
 
                // all non percent columns in the span get percent vlaues to sum up correctly.
                int percentMissing = w.value - totalPercent;
@@ -737,7 +737,7 @@ int AutoTableLayout::calcEffectiveWidth()
                qDebug("extending minWidth of cols %d-%d to %dpx currentMin=%d accroding to fixed sum %d", col, lastCol-1, cMinWidth, minWidth, fixedWidth );
 #endif
                for ( unsigned int pos = col; fixedWidth > 0 && pos < lastCol; pos++ ) {
-                   int w = QMAX( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].width.value / fixedWidth );
+                   int w = kMax( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].width.value / fixedWidth );
 #ifdef DEBUG_LAYOUT
                    qDebug("   col %d: min=%d, effMin=%d, new=%d", pos, layoutStruct[pos].effMinWidth, layoutStruct[pos].effMinWidth, w );
 #endif
@@ -756,7 +756,7 @@ int AutoTableLayout::calcEffectiveWidth()
                 // Give min to variable first, to fixed second, and to others third.
                 for ( unsigned int pos = col; maxw > 0 && pos < lastCol; pos++ ) {
                    if ( layoutStruct[pos].width.type == Fixed && haveVariable && fixedWidth <= cMinWidth ) {
-                       int w = QMAX( layoutStruct[pos].effMinWidth, layoutStruct[pos].width.value );
+                       int w = kMax( layoutStruct[pos].effMinWidth, layoutStruct[pos].width.value );
                        fixedWidth -= layoutStruct[pos].width.value;
                         minw -= layoutStruct[pos].effMinWidth;
 #ifdef DEBUG_LAYOUT
@@ -770,8 +770,8 @@ int AutoTableLayout::calcEffectiveWidth()
 
                 for ( unsigned int pos = col; maxw > 0 && pos < lastCol && minw < cMinWidth; pos++ ) {
                    if ( !(layoutStruct[pos].width.type == Fixed && haveVariable && fixedWidth <= cMinWidth) ) {
-                        int w = QMAX( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].effMaxWidth / maxw );
-                        w = QMIN(layoutStruct[pos].effMinWidth+(cMinWidth-minw), w);
+                        int w = kMax( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].effMaxWidth / maxw );
+                        w = kMin(layoutStruct[pos].effMinWidth+(cMinWidth-minw), w);
                                                 
 #ifdef DEBUG_LAYOUT
                         qDebug("   col %d: min=%d, effMin=%d, new=%d", pos, layoutStruct[pos].effMinWidth, layoutStruct[pos].effMinWidth, w );
@@ -790,7 +790,7 @@ int AutoTableLayout::calcEffectiveWidth()
                qDebug("extending maxWidth of cols %d-%d to %dpx", col, lastCol-1, cMaxWidth );
 #endif
                for ( unsigned int pos = col; maxWidth > 0 && pos < lastCol; pos++ ) {
-                   int w = QMAX( layoutStruct[pos].effMaxWidth, cMaxWidth * layoutStruct[pos].effMaxWidth / maxWidth );
+                   int w = kMax( layoutStruct[pos].effMaxWidth, cMaxWidth * layoutStruct[pos].effMaxWidth / maxWidth );
 #ifdef DEBUG_LAYOUT
                    qDebug("   col %d: max=%d, effMax=%d, new=%d", pos, layoutStruct[pos].effMaxWidth, layoutStruct[pos].effMaxWidth, w );
 #endif
@@ -801,7 +801,7 @@ int AutoTableLayout::calcEffectiveWidth()
            }
        } else {
            for ( unsigned int pos = col; pos < lastCol; pos++ )
-               layoutStruct[pos].maxWidth = QMAX(layoutStruct[pos].maxWidth, layoutStruct[pos].minWidth );
+               layoutStruct[pos].maxWidth = kMax(layoutStruct[pos].maxWidth, layoutStruct[pos].minWidth );
        }
     }
     effWidthDirty = false;
index cad7f6cf8e255150ac040e4cd47e6d0b1cff2ce7..b13b91d6cfa472f93e2eab4fbaff1c6267ceee06 100644 (file)
@@ -39,12 +39,6 @@ typedef unsigned int Q_UINT32;
 typedef short Q_INT16;
 typedef unsigned short Q_UINT16;
 
-#define QMAX(a,b) ((a) > (b) ? (a) : (b))
-#define QMIN(a,b) ((a) < (b) ? (a) : (b))
-
-#define KMAX(a,b) kMax(a, b)
-#define KMIN(a,b) kMin(a, b)
-
 template<class T>
 inline const T& kMin ( const T& a, const T& b ) { return a < b ? a : b; }