Reviewed by mjs
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Aug 2005 18:32:51 +0000 (18:32 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Aug 2005 18:32:51 +0000 (18:32 +0000)
        Temporary workaround for gcc-5216+ bug 4213314.  Don't use NSMake* convenience methods inside KWQ_BLOCK_EXCEPTIONS.

        * kwq/KWQKConfigBase.mm:
        (KConfig::readEntry):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::attributedString):
        * kwq/KWQListBox.mm:
        (QListBox::sizeForNumberOfLines):
        * kwq/KWQPainter.mm:
        (QPainter::drawTiledPixmap):
        * kwq/KWQScrollView.mm:
        (QScrollView::resizeContents):
        (QScrollView::contentsToViewport):
        (QScrollView::viewportToContents):
        (QScrollView::setContentsPosRecursive):
        (QScrollView::ensureVisible):
        (QScrollView::ensureRectVisibleCentered):

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

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQKConfigBase.mm
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQListBox.mm
WebCore/kwq/KWQPainter.mm
WebCore/kwq/KWQScrollView.mm

index 99a366c..7569356 100644 (file)
@@ -1,3 +1,25 @@
+2005-08-23  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by mjs
+        
+        Temporary workaround for gcc-5216+ bug 4213314.  Don't use NSMake* convenience methods inside KWQ_BLOCK_EXCEPTIONS.
+
+        * kwq/KWQKConfigBase.mm:
+        (KConfig::readEntry):
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::attributedString):
+        * kwq/KWQListBox.mm:
+        (QListBox::sizeForNumberOfLines):
+        * kwq/KWQPainter.mm:
+        (QPainter::drawTiledPixmap):
+        * kwq/KWQScrollView.mm:
+        (QScrollView::resizeContents):
+        (QScrollView::contentsToViewport):
+        (QScrollView::viewportToContents):
+        (QScrollView::setContentsPosRecursive):
+        (QScrollView::ensureVisible):
+        (QScrollView::ensureRectVisibleCentered):
+
 2005-08-22  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Beth Dakin.
index 58451b9..46e2576 100644 (file)
@@ -91,7 +91,8 @@ QString KConfig::readEntry(const char *pKey, const QString& aDefault) const
                     [MIMEString appendFormat:@"%@,", extension];
                 }
                 // Delete the last ",".
-                [MIMEString deleteCharactersInRange:NSMakeRange([MIMEString length]-1, 1)];
+                NSRange tempRange = { [MIMEString length]-1, 1 }; // workaround for 4213314
+                [MIMEString deleteCharactersInRange:tempRange];
                 [MIMEString appendFormat:@":%@;", [plugin descriptionForMIMEType:MIME]];
             }
 
index f7e9b3a..29dca5b 100644 (file)
@@ -3206,7 +3206,8 @@ NSAttributedString *KWQKHTMLPart::attributedString(NodeImpl *_start, int startOf
                     KURL kURL = KWQ(linkStartNode->getDocument()->part())->completeURL(href.string());
                     
                     NSURL *URL = kURL.getNSURL();
-                    [result addAttribute:NSLinkAttributeName value:URL range:NSMakeRange(linkStartLocation, [result length]-linkStartLocation)];
+                    NSRange tempRange = { linkStartLocation, [result length]-linkStartLocation }; // workaround for 4213314
+                    [result addAttribute:NSLinkAttributeName value:URL range:tempRange];
                     linkStartNode = 0;
                 }
             }
@@ -3324,7 +3325,8 @@ NSAttributedString *KWQKHTMLPart::attributedString(NodeImpl *_start, int startOf
                         [[[NSTextTab alloc] initWithType:NSRightTabStopType location:rx-(pointSize*2/3)] autorelease],
                         [[[NSTextTab alloc] initWithType:NSLeftTabStopType location:rx] autorelease],
                         nil]];
-            [result addAttribute:NSParagraphStyleAttributeName value:mps range:NSMakeRange(info.start, info.end-info.start)];
+            NSRange tempRange = { info.start, info.end-info.start }; // workaround for 4213314
+            [result addAttribute:NSParagraphStyleAttributeName value:mps range:tempRange];
             [mps release];
         }
     }
index 57ceaad..3ebe1c9 100644 (file)
@@ -317,7 +317,8 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
         _widthGood = true;
     }
     
-    size = [NSScrollView frameSizeForContentSize:NSMakeSize(_width, [tableView rowHeight] * MAX(minLines, lines))
+    NSSize nssize = { _width, [tableView rowHeight] * MAX(minLines, lines) };
+    size = [NSScrollView frameSizeForContentSize:nssize
         hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSBezelBorder];
     size.width += [NSScroller scrollerWidthForControlSize:NSSmallControlSize] - [NSScroller scrollerWidth] + leftMargin + rightMargin;
 
index 82a0711..8cd3b4a 100644 (file)
@@ -534,7 +534,9 @@ void QPainter::drawTiledPixmap( int x, int y, int w, int h,
         return;
     
     KWQ_BLOCK_EXCEPTIONS;
-    [pixmap.imageRenderer tileInRect:NSMakeRect(x, y, w, h) fromPoint:NSMakePoint(sx, sy) context:context];
+    NSRect tempRect = { {x, y}, {w, h} }; // workaround for 4213314
+    NSPoint tempPoint = { sx, sy };
+    [pixmap.imageRenderer tileInRect:tempRect fromPoint:tempPoint context:context];
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
index 7276e25..6f08af7 100644 (file)
@@ -333,8 +333,9 @@ void QScrollView::resizeContents(int w, int h)
             _w = 0;
         if (_h < 0)
             _h = 0;
-
-        [view setFrameSize: NSMakeSize (_w,_h)];
+            
+        NSSize tempSize = { _w, _h }; // workaround for 4213314
+        [view setFrameSize:tempSize];
     } else {
         resize (_w, _h);
     }
@@ -395,7 +396,8 @@ void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
     if (docView)
         view = docView;
     
-    NSPoint np = [view convertPoint: NSMakePoint (x, y) toView: nil];
+    NSPoint tempPoint = { x, y }; // workaround for 4213314
+    NSPoint np = [view convertPoint:tempPoint toView: nil];
     vx = (int)np.x;
     vy = (int)np.y;
     
@@ -417,8 +419,9 @@ void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
     docView = getDocumentView();
     if (docView)
         view = docView;
-        
-    NSPoint np = [view convertPoint: NSMakePoint (vx, vy) fromView: nil];
+    
+    NSPoint tempPoint = { vx, vy }; // workaround for 4213314
+    NSPoint np = [view convertPoint:tempPoint fromView: nil];
     x = (int)np.x;
     y = (int)np.y;
 
@@ -446,7 +449,8 @@ void QScrollView::resizeEvent(QResizeEvent *)
 void QScrollView::setContentsPosRecursive(int x, int y)
 {
     KWQ_BLOCK_EXCEPTIONS;
-    [getDocumentView() _KWQ_scrollPointRecursive:NSMakePoint(x, y)];
+    NSPoint tempPoint = { x, y }; // workaround for 4213314
+    [getDocumentView() _KWQ_scrollPointRecursive:tempPoint];
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
@@ -457,7 +461,8 @@ void QScrollView::ensureVisible(int x, int y)
     // 50-pixel margins (if possible, otherwise centered).", which is
     // not what we're doing here.
     KWQ_BLOCK_EXCEPTIONS;
-    [getDocumentView() scrollRectToVisible:NSMakeRect(x, y, 0, 0)];
+    NSRect tempRect = { {x, y}, {0, 0} }; // workaround for 4213314
+    [getDocumentView() scrollRectToVisible:tempRect];
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
@@ -468,14 +473,16 @@ void QScrollView::ensureVisible(int x, int y, int xmargin, int ymargin)
     // xmargin and ymargin margins (if possible, otherwise centered).", which is
     // not what we're doing here.
     KWQ_BLOCK_EXCEPTIONS;
-    [getDocumentView() scrollRectToVisible:NSMakeRect(x, y, xmargin, ymargin)];
+    NSRect tempRect = { {x, y}, {xmargin, ymargin} }; // workaround for 4213314
+    [getDocumentView() scrollRectToVisible:tempRect];
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::ensureRectVisibleCentered(const QRect &rect, bool forceCentering)
 {
     KWQ_BLOCK_EXCEPTIONS;
-    [getDocumentView() _KWQ_scrollRectToVisible:NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()) forceCentering:forceCentering];
+    NSRect tempRect = { {rect.x(), rect.y()}, {rect.width(), rect.height()} }; // workaround for 4213314
+    [getDocumentView() _KWQ_scrollRectToVisible:tempRect forceCentering:forceCentering];
     KWQ_UNBLOCK_EXCEPTIONS;
 }