[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:06:10 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3d42fac88e496b153ae20c81e9f65877d1574127
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 27 20:51:26 2003 +0000

            Reviewed by Darin.
    
    	Improved exception blocking in the following ways:
    
    	- use C++ constructors and destructors so returning or breaking out of an exception block works
    	- Remove use of volatile
    	- Collapse the caught exception case into a single function call to reduce code size.
    
            * WebCore.pbproj/project.pbxproj:
            * kwq/KWQButton.mm:
            * kwq/KWQCheckBox.mm:
            * kwq/KWQComboBox.mm:
            * kwq/KWQExceptions.h:
            * kwq/KWQExceptions.mm: Added.
            * kwq/KWQFileButton.mm:
            * kwq/KWQFont.mm:
            * kwq/KWQFrame.mm:
            * kwq/KWQKConfigBase.mm:
            * kwq/KWQKCookieJar.mm:
            * kwq/KWQKCursor.mm:
            * kwq/KWQKHTMLPart.mm:
            * kwq/KWQKHTMLPartBrowserExtension.mm:
            * kwq/KWQKHistoryProvider.mm:
            * kwq/KWQKJavaAppletWidget.mm:
            * kwq/KWQKJobClasses.mm:
            * kwq/KWQKLocale.mm:
            * kwq/KWQKPartsBrowserInterface.mm:
            * kwq/KWQLineEdit.mm:
            * kwq/KWQListBox.mm:
            * kwq/KWQLoader.mm:
            * kwq/KWQPainter.mm:
            * kwq/KWQPushButton.mm:
            * kwq/KWQRadioButton.mm:
            * kwq/KWQScrollBar.mm:
            * kwq/KWQScrollView.mm:
            * kwq/KWQTextEdit.mm:
            * kwq/KWQWidget.mm:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5278 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a99b575..3ef1968 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,43 @@
+2003-10-27  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Darin.
+
+	Improved exception blocking in the following ways:
+
+	- use C++ constructors and destructors so returning or breaking out of an exception block works
+	- Remove use of volatile
+	- Collapse the caught exception case into a single function call to reduce code size.
+
+        * WebCore.pbproj/project.pbxproj:
+        * kwq/KWQButton.mm:
+        * kwq/KWQCheckBox.mm:
+        * kwq/KWQComboBox.mm:
+        * kwq/KWQExceptions.h:
+        * kwq/KWQExceptions.mm: Added.
+        * kwq/KWQFileButton.mm:
+        * kwq/KWQFont.mm:
+        * kwq/KWQFrame.mm:
+        * kwq/KWQKConfigBase.mm:
+        * kwq/KWQKCookieJar.mm:
+        * kwq/KWQKCursor.mm:
+        * kwq/KWQKHTMLPart.mm:
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        * kwq/KWQKHistoryProvider.mm:
+        * kwq/KWQKJavaAppletWidget.mm:
+        * kwq/KWQKJobClasses.mm:
+        * kwq/KWQKLocale.mm:
+        * kwq/KWQKPartsBrowserInterface.mm:
+        * kwq/KWQLineEdit.mm:
+        * kwq/KWQListBox.mm:
+        * kwq/KWQLoader.mm:
+        * kwq/KWQPainter.mm:
+        * kwq/KWQPushButton.mm:
+        * kwq/KWQRadioButton.mm:
+        * kwq/KWQScrollBar.mm:
+        * kwq/KWQScrollView.mm:
+        * kwq/KWQTextEdit.mm:
+        * kwq/KWQWidget.mm:
+        
 2003-10-26  Darin Adler  <darin at apple.com>
 
         * khtml/khtml_part.cpp: (findWordBoundary): Fix small mistake from NULL check-in earlier.
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 26518f4..1d72e68 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -771,6 +771,7 @@
 				BC32C2EE048BF95C00A8000B,
 				55998A5F052B59CC0017A6C1,
 				55998A61052B59CC0017A6C1,
+				65F80698054D9F86008BF776,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1025,6 +1026,20 @@
 				);
 			};
 		};
+		65F80697054D9F86008BF776 = {
+			expectedFileType = sourcecode.cpp.objcpp;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = KWQExceptions.mm;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		65F80698054D9F86008BF776 = {
+			fileRef = 65F80697054D9F86008BF776;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 //650
 //651
 //652
@@ -2331,6 +2346,7 @@
 				F587854402DE375901EA4122,
 				BC7B2AF80450824100A8000F,
 				BC7B2AF90450824100A8000F,
+				65F80697054D9F86008BF776,
 			);
 			isa = PBXGroup;
 			name = other;
diff --git a/WebCore/kwq/KWQButton.mm b/WebCore/kwq/KWQButton.mm
index 927efc8..1b17cd3 100644
--- a/WebCore/kwq/KWQButton.mm
+++ b/WebCore/kwq/KWQButton.mm
@@ -140,7 +140,7 @@
 QButton::QButton()
     : m_clicked(this, SIGNAL(clicked()))
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     KWQButton *button = [[KWQButton alloc] initWithQButton:this];
     setView(button);
@@ -153,39 +153,39 @@ QButton::QButton()
     [[button cell] setControlSize:NSSmallControlSize];
     [button setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QButton::~QButton()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSButton *button = (NSButton *)getView();
     [button setTarget:nil];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QButton::setText(const QString &s)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSButton *button = (NSButton *)getView();
     [button setTitle:s.getNSString()];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QString QButton::text() const
 {
     QString result;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSButton *button = (NSButton *)getView();
     result = QString::fromNSString([button title]);
     
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return result;
 }
@@ -198,7 +198,7 @@ void QButton::clicked()
     //   3) clicked
     // Proper behavior of check boxes, at least, depends on this order.
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     KWQButton *button = (KWQButton *)getView();
     [button sendConsumedMouseUpIfNeeded];
@@ -208,22 +208,22 @@ void QButton::clicked()
         m_clicked.call();
     }
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QButton::simulateClick()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     KWQButton *button = (KWQButton *)getView();
     [button simulateClick];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QButton::setFont(const QFont &f)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     QWidget::setFont(f);
 
@@ -232,7 +232,7 @@ void QButton::setFont(const QFont &f)
     [[button cell] setControlSize:size];
     [button setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:size]]];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 NSControlSize KWQNSControlSizeForFont(const QFont &f)
@@ -254,20 +254,16 @@ NSControlSize KWQNSControlSizeForFont(const QFont &f)
 
 QWidget::FocusPolicy QButton::focusPolicy() const
 {
-    volatile bool fullKeyboardMode = false;
-    
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     // Add an additional check here.
     // For now, buttons are only focused when full
     // keyboard access is turned on.
-    fullKeyboardMode = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] == WebCoreFullKeyboardAccess;
-
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    if (!fullKeyboardMode)
+    if (![KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] == WebCoreFullKeyboardAccess)
         return NoFocus;
 
+    KWQ_UNBLOCK_EXCEPTIONS;
+
     return QWidget::focusPolicy();
 }
 
diff --git a/WebCore/kwq/KWQCheckBox.mm b/WebCore/kwq/KWQCheckBox.mm
index c299555..e1c32fb 100644
--- a/WebCore/kwq/KWQCheckBox.mm
+++ b/WebCore/kwq/KWQCheckBox.mm
@@ -39,12 +39,12 @@ enum {
 QCheckBox::QCheckBox(QWidget *w)
     : m_stateChanged(this, SIGNAL(stateChanged(int)))
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSButton *button = (NSButton *)getView();
     [button setButtonType:NSSwitchButton];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QSize QCheckBox::sizeHint() const 
@@ -69,26 +69,22 @@ void QCheckBox::setFrameGeometry(const QRect &r)
 
 void QCheckBox::setChecked(bool isChecked)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSButton *button = (NSButton *)getView();
     [button setState:isChecked ? NSOnState : NSOffState];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QCheckBox::isChecked()
 {
-    volatile bool result = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-
+    KWQ_BLOCK_EXCEPTIONS;
     NSButton *button = (NSButton *)getView();
-    result = [button state] == NSOnState;
-
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    return [button state] == NSOnState;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 void QCheckBox::clicked()
@@ -117,11 +113,10 @@ const int *QCheckBox::dimensions() const
         { 4, 3, 3, 3, 2, 10, 10 },
     };
     NSControl * const button = static_cast<NSControl *>(getView());
-    volatile NSControlSize size = NSSmallControlSize;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    size = [[button cell] controlSize];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return w[[[button cell] controlSize]];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return w[size];
+    return w[NSSmallControlSize];
 }
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 6482474..0c377c9 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -73,7 +73,7 @@ QComboBox::QComboBox()
     , _widthGood(false)
     , _activated(this, SIGNAL(activated(int)))
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     _adapter = [[KWQComboBoxAdapter alloc] initWithQComboBox:this];
     KWQPopUpButton *button = [[KWQPopUpButton alloc] init];
@@ -92,23 +92,23 @@ QComboBox::QComboBox()
 
     updateCurrentItem();
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QComboBox::~QComboBox()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     KWQPopUpButton *button = (KWQPopUpButton *)getView();
     [button setTarget:nil];
     [_adapter release];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QComboBox::insertItem(const QString &text, int i)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     int index = i;
 
@@ -129,14 +129,14 @@ void QComboBox::insertItem(const QString &text, int i)
 
     updateCurrentItem();
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QSize QComboBox::sizeHint() const 
 {
     NSSize size = {0,0};
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     KWQPopUpButton *button = (KWQPopUpButton *)getView();
     
@@ -161,7 +161,7 @@ QSize QComboBox::sizeHint() const
     
     size = [[button cell] cellSize];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QSize((int)_width + dimensions()[widthNotIncludingText],
         (int)size.height - (dimensions()[topMargin] + dimensions()[bottomMargin]));
@@ -199,12 +199,12 @@ void QComboBox::clear()
 
 void QComboBox::setCurrentItem(int index)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     KWQPopUpButton *button = (KWQPopUpButton *)getView();
     [button selectItemAtIndex:index];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     updateCurrentItem();
 }
@@ -213,16 +213,15 @@ bool QComboBox::updateCurrentItem() const
 {
     KWQPopUpButton *button = (KWQPopUpButton *)getView();
 
-    volatile int i = 0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    i = [button indexOfSelectedItem];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    int i = [button indexOfSelectedItem];
 
     if (_currentItem == i) {
         return false;
     }
     _currentItem = i;
+    KWQ_UNBLOCK_EXCEPTIONS;
+
     return true;
 }
 
@@ -240,7 +239,7 @@ void QComboBox::setFont(const QFont &f)
     const NSControlSize size = KWQNSControlSizeForFont(f);
     NSControl * const button = static_cast<NSControl *>(getView());
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     if (size != [[button cell] controlSize]) {
         [[button cell] setControlSize:size];
@@ -248,7 +247,7 @@ void QComboBox::setFont(const QFont &f)
         _widthGood = false;
     }
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 const int *QComboBox::dimensions() const
@@ -262,12 +261,11 @@ const int *QComboBox::dimensions() const
     };
     NSControl * const button = static_cast<NSControl *>(getView());
 
-    volatile NSControlSize size = NSSmallControlSize;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    size = [[button cell] controlSize];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return  w[[[button cell] controlSize]];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return w[size];
+    return w[NSSmallControlSize];
 }
 
 QWidget::FocusPolicy QComboBox::focusPolicy() const
diff --git a/WebCore/kwq/KWQExceptions.h b/WebCore/kwq/KWQExceptions.h
index 77049d8..31d2209 100644
--- a/WebCore/kwq/KWQExceptions.h
+++ b/WebCore/kwq/KWQExceptions.h
@@ -26,16 +26,30 @@
 #import <Foundation/NSException.h>
 #import "KWQAssertions.h"
 
-#define KWQ_BLOCK_NS_EXCEPTIONS NS_DURING
+class KWQNSHandler
+{
+ public:
+    KWQNSHandler() { _NSAddHandler2(&handler); }
+    ~KWQNSHandler() { _NSRemoveHandler2(&handler); }
 
-#define KWQ_UNBLOCK_NS_EXCEPTIONS NS_HANDLER \
-     if (ASSERT_DISABLED) { \
-     NSLog(@"Uncaught exception - %@\n", localException); \
-     } else { \
-     ASSERT_WITH_MESSAGE(0, "Uncaught exception - %@", localException); \
-     } \
-NS_ENDHANDLER
+    NSHandler2 handler;
+ private:
+    KWQNSHandler(const KWQNSHandler &);
+    KWQNSHandler &operator=(const KWQNSHandler &);
+};
 
-#define KWQ_UNBLOCK_RETURN_VALUE(val,type) NS_VALUERETURN(val,type)
 
-#define KWQ_UNBLOCK_RETURN NS_VOIDRETURN
+void KWQReportBlockedException(KWQNSHandler& _localHandler);
+
+#define KWQ_BLOCK_EXCEPTIONS                            \
+{                                                       \
+    KWQNSHandler _localHandler;	                        \
+    if (!_NSSETJMP(_localHandler.handler._state, 0)) {
+
+
+#define KWQ_UNBLOCK_EXCEPTIONS                    \
+    } else {                                      \
+        KWQReportBlockedException(_localHandler); \
+    }                                             \
+}
+
diff --git a/WebCore/kwq/KWQKPartsFactory.h b/WebCore/kwq/KWQExceptions.mm
similarity index 80%
copy from WebCore/kwq/KWQKPartsFactory.h
copy to WebCore/kwq/KWQExceptions.mm
index 1bd7e39..21cc218 100644
--- a/WebCore/kwq/KWQKPartsFactory.h
+++ b/WebCore/kwq/KWQExceptions.mm
@@ -23,14 +23,14 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef FACTORY_H_
-#define FACTORY_H_
-
-#include "KWQKPartsPart.h"
-
-namespace KParts {
-    class Factory;
-}
+#import "KWQExceptions.h"
 
+void KWQReportBlockedException(KWQNSHandler& _localHandler)
+{
+        NSException *localException = _NSExceptionObjectFromHandler2(&_localHandler.handler);
+#if ASSERT_DISABLED
+	NSLog(@"Uncaught exception - %@\n", localException);
+#else
+	ASSERT_WITH_MESSAGE(0, "Uncaught exception - %@", localException );
 #endif
-
+}
diff --git a/WebCore/kwq/KWQFileButton.mm b/WebCore/kwq/KWQFileButton.mm
index a219904..ff1e7fe 100644
--- a/WebCore/kwq/KWQFileButton.mm
+++ b/WebCore/kwq/KWQFileButton.mm
@@ -48,29 +48,29 @@ KWQFileButton::KWQFileButton(KHTMLPart *part)
     , _textChanged(this, SIGNAL(textChanged(const QString &)))
     , _adapter(0)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     setView([KWQ(part)->bridge() fileButton]);
     _adapter = [[KWQFileButtonAdapter alloc] initWithKWQFileButton:this];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 KWQFileButton::~KWQFileButton()
 {
     _adapter->button = 0;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_adapter release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
     
 void KWQFileButton::setFilename(const QString &f)
 {
     NSView <WebCoreFileButton> *button = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [button setFilename:f.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QSize KWQFileButton::sizeForCharacterWidth(int characters) const
@@ -79,9 +79,9 @@ QSize KWQFileButton::sizeForCharacterWidth(int characters) const
     NSView <WebCoreFileButton> *button = getView();
 
     NSSize size = {0,0};
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     size = [button bestVisualFrameSizeForCharacterCount:characters];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QSize(size);
 }
@@ -91,9 +91,9 @@ QRect KWQFileButton::frameGeometry() const
     NSView <WebCoreFileButton> *button = getView();
 
     NSRect frame = {{0,0},{0,0}};
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     frame = [button visualFrame];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QRect(frame);
 }
@@ -102,21 +102,20 @@ void KWQFileButton::setFrameGeometry(const QRect &rect)
 {
     NSView <WebCoreFileButton> *button = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [button setVisualFrame:rect];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 int KWQFileButton::baselinePosition(int height) const
 {
     NSView <WebCoreFileButton> *button = getView();
 
-    volatile int position = 0;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    position = (int)([button frame].origin.y + [button baseline] - [button visualFrame].origin.y);
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return (int)([button frame].origin.y + [button baseline] - [button visualFrame].origin.y);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return position;
+    return 0;
 }
 
 void KWQFileButton::filenameChanged()
@@ -124,9 +123,9 @@ void KWQFileButton::filenameChanged()
     NSView <WebCoreFileButton> *button = getView();
 
     QString filename;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     filename = QString::fromNSString([button filename]);
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     _textChanged.call();
 }
diff --git a/WebCore/kwq/KWQFont.mm b/WebCore/kwq/KWQFont.mm
index 3e18c88..525ae91 100644
--- a/WebCore/kwq/KWQFont.mm
+++ b/WebCore/kwq/KWQFont.mm
@@ -147,11 +147,10 @@ bool QFont::bold() const
 
 bool QFont::isFixedPitch() const
 {
-    volatile bool isFixed = false;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    isFixed = [[WebCoreTextRendererFactory sharedFactory] isFontFixedPitch: getNSFont()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-    return isFixed;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [[WebCoreTextRendererFactory sharedFactory] isFontFixedPitch: getNSFont()];
+    KWQ_UNBLOCK_EXCEPTIONS;
+    return false;
 }
 
 
@@ -167,12 +166,12 @@ NSFont *QFont::getNSFont() const
 {
     if (!_NSFont) {
         CREATE_FAMILY_ARRAY(*this, families);
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
         _NSFont = [[[WebCoreTextRendererFactory sharedFactory] 
             fontWithFamilies:families
                       traits:getNSTraits() 
                         size:getNSSize()] retain];
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
     }
     return _NSFont;
 }
diff --git a/WebCore/kwq/KWQFrame.mm b/WebCore/kwq/KWQFrame.mm
index 993746a..24ae6a3 100644
--- a/WebCore/kwq/KWQFrame.mm
+++ b/WebCore/kwq/KWQFrame.mm
@@ -39,9 +39,9 @@ void QFrame::setFrameStyle(int s)
     if (view) {
         KHTMLPart *part = view->part();
         if (part) {
-	    KWQ_BLOCK_NS_EXCEPTIONS;
+	    KWQ_BLOCK_EXCEPTIONS;
             [KWQ(part)->bridge() setHasBorder:(s != NoFrame)];
-	    KWQ_UNBLOCK_NS_EXCEPTIONS;
+	    KWQ_UNBLOCK_EXCEPTIONS;
         }
     }
 }
diff --git a/WebCore/kwq/KWQKConfigBase.mm b/WebCore/kwq/KWQKConfigBase.mm
index ec68a88..75de526 100644
--- a/WebCore/kwq/KWQKConfigBase.mm
+++ b/WebCore/kwq/KWQKConfigBase.mm
@@ -70,9 +70,9 @@ void KConfig::writeEntry(const QString &pKey, const QStringList &rValue,
 QString KConfig::readEntry(const char *pKey, const QString& aDefault) const
 {
     if (impl->isPluginInfo) {
-	NSString * volatile result = @"";
+	KWQ_BLOCK_EXCEPTIONS;
 
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	NSString *result = nil;
 
         id <WebCorePluginInfo> plugin = [[[WebCoreViewFactory sharedFactory] pluginsInfo] objectAtIndex:impl->pluginIndex];
         if (strcmp(pKey, "name") == 0) {
@@ -104,9 +104,11 @@ QString KConfig::readEntry(const char *pKey, const QString& aDefault) const
             result = MIMEString;
         }
 
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
-	
 	return QString::fromNSString(result);
+
+	KWQ_UNBLOCK_EXCEPTIONS;
+
+	return QString();
     }
     
     ERROR("not yet implemented");
@@ -116,12 +118,11 @@ QString KConfig::readEntry(const char *pKey, const QString& aDefault) const
 int KConfig::readNumEntry(const char *pKey, int nDefault) const
 {
     if (impl->isPluginInfo && strcmp(pKey, "number") == 0) {
-        volatile int count = 0;
-	KWQ_BLOCK_NS_EXCEPTIONS;
-	count = [[[WebCoreViewFactory sharedFactory] pluginsInfo] count];
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
-	return count;
-
+        KWQ_BLOCK_EXCEPTIONS;
+	return [[[WebCoreViewFactory sharedFactory] pluginsInfo] count];
+	KWQ_UNBLOCK_EXCEPTIONS;
+	
+	return 0;
     }
     ERROR("not yet implemented");
     return nDefault;
@@ -159,8 +160,8 @@ QStringList KConfig::readListEntry(const QString &pKey, char sep) const
 
 void RefreshPlugins(bool reload)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [[WebCoreViewFactory sharedFactory] refreshPlugins:reload];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
diff --git a/WebCore/kwq/KWQKCookieJar.mm b/WebCore/kwq/KWQKCookieJar.mm
index 60b4c1a..f0cde65 100644
--- a/WebCore/kwq/KWQKCookieJar.mm
+++ b/WebCore/kwq/KWQKCookieJar.mm
@@ -32,32 +32,28 @@
 
 QString KWQKCookieJar::cookie(const KURL &url)
 {
-    NSString * volatile result = nil;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([[WebCoreCookieAdapter sharedAdapter] cookiesForURL:url.url().getNSString()]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [[WebCoreCookieAdapter sharedAdapter] cookiesForURL:url.url().getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    return QString::fromNSString(result);
+    return QString();
 }
 
 void KWQKCookieJar::setCookie(const KURL &url, const KURL &policyBaseURL, const QString &cookie)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     [[WebCoreCookieAdapter sharedAdapter] setCookies:cookie.getNSString()
      forURL:url.url().getNSString() policyBaseURL:policyBaseURL.url().getNSString()];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool KWQKCookieJar::cookieEnabled()
 {
-    volatile bool enabled = false;
-    
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    enabled = [[WebCoreCookieAdapter sharedAdapter] cookiesEnabled];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [[WebCoreCookieAdapter sharedAdapter] cookiesEnabled];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return enabled;
+    return false;
 }
diff --git a/WebCore/kwq/KWQKCursor.mm b/WebCore/kwq/KWQKCursor.mm
index dcd87ed..a137fba 100644
--- a/WebCore/kwq/KWQKCursor.mm
+++ b/WebCore/kwq/KWQKCursor.mm
@@ -48,9 +48,9 @@
         nameToCursor = [[NSMutableDictionary alloc] init];
     }
     
-    NSCursor * volatile cursor = [nameToCursor objectForKey:name];
+    KWQ_BLOCK_EXCEPTIONS;
+    NSCursor * cursor = [nameToCursor objectForKey:name];
     if (!cursor) { 
-	KWQ_BLOCK_NS_EXCEPTIONS;
 	NSImage *cursorImage = [[NSImage alloc] initWithContentsOfFile:
             [[NSBundle bundleForClass:[KWQKCursorBundleDummy class]]
             pathForResource:name ofType:@"tiff"]];
@@ -60,10 +60,12 @@
             [nameToCursor setObject:cursor forKey:name];
             [cursor release];
         }
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
-    }
 
+    }
     return cursor;
+    KWQ_UNBLOCK_EXCEPTIONS;
+    
+    return nil;
 }
 
 @end
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 84b4b2e..4f8c506 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -182,13 +182,11 @@ void KWQKHTMLPart::setSettings (KHTMLSettings *settings)
 
 QString KWQKHTMLPart::generateFrameName()
 {
-    NSString * volatile name = @"";
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([_bridge generateFrameName]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    name = [_bridge generateFrameName];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    return QString::fromNSString(name);
+    return QString();
 }
 
 void KWQKHTMLPart::provisionalLoadStarted()
@@ -201,7 +199,9 @@ void KWQKHTMLPart::provisionalLoadStarted()
 
 bool KWQKHTMLPart::openURL(const KURL &url)
 {
-    volatile bool onLoad = false;
+    KWQ_BLOCK_EXCEPTIONS;
+
+    bool onLoad = false;
     
     if (jScript() && jScript()->interpreter()) {
         KHTMLPart *rootPart;
@@ -217,8 +217,6 @@ bool KWQKHTMLPart::openURL(const KURL &url)
         }
     }
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-
     // FIXME: The lack of args here to get the reload flag from
     // indicates a problem in how we use KHTMLPart::processObjectRequest,
     // where we are opening the URL before the args are set up.
@@ -231,14 +229,14 @@ bool KWQKHTMLPart::openURL(const KURL &url)
                 form:nil
           formValues:nil];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return true;
 }
 
 void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     [_bridge loadURL:url.getNSURL()
             referrer:[_bridge referrer]
@@ -249,7 +247,7 @@ void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
                 form:nil
           formValues:nil];
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::didNotOpenURL(const KURL &URL)
@@ -578,7 +576,7 @@ void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, HT
 
 void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     // The form multi-submit logic here is only right when we are submitting a form that affects this frame.
     // Eventually when we find a better fix we can remove this altogether.
@@ -625,7 +623,7 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
     }
     clearRecordedFormValues();
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::setEncoding(const QString &name, bool userChosen)
@@ -647,9 +645,9 @@ void KWQKHTMLPart::addData(const char *bytes, int length)
 
 void KHTMLPart::frameDetached()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [KWQ(this)->bridge() frameDetached];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     // FIXME: There may be a better place to do this that works for KHTML too.
     FrameList& parentFrames = parentPart()->d->m_frames;
@@ -665,7 +663,7 @@ void KHTMLPart::frameDetached()
 
 void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URLArgs &args)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge loadURL:url.getNSURL()
             referrer:[_bridge referrer]
               reload:args.reload
@@ -674,7 +672,7 @@ void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URL
      triggeringEvent:_currentEvent
                 form:nil
           formValues:nil];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 class KWQPluginPart : public ReadOnlyPart
@@ -685,9 +683,8 @@ class KWQPluginPart : public ReadOnlyPart
 
 ReadOnlyPart *KWQKHTMLPart::createPart(const ChildFrame &child, const KURL &url, const QString &mimeType)
 {
-    ReadOnlyPart * volatile part = NULL;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    ReadOnlyPart *part;
 
     BOOL needFrame = [_bridge frameRequiredForMIMEType:mimeType.getNSString() URL:url.getNSURL()];
     if (child.m_type == ChildFrame::Object && !needFrame) {
@@ -725,9 +722,11 @@ ReadOnlyPart *KWQKHTMLPart::createPart(const ChildFrame &child, const KURL &url,
         part = [childBridge part];
     }
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
     return part;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return NULL;
 }
     
 void KWQKHTMLPart::setView(KHTMLView *view)
@@ -764,9 +763,9 @@ void KWQKHTMLPart::setTitle(const DOMString &title)
     QString text = title.string();
     text.replace('\\', backslashAsCurrencySymbol());
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge setTitle:text.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::setStatusBarText(const QString &status)
@@ -774,23 +773,23 @@ void KWQKHTMLPart::setStatusBarText(const QString &status)
     QString text = status;
     text.replace('\\', backslashAsCurrencySymbol());
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge setStatusText:text.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::scheduleClose()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge closeWindowSoon];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::unfocusWindow()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge unfocusWindow];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::jumpToSelection()
@@ -813,7 +812,7 @@ void KWQKHTMLPart::jumpToSelection()
  
         NSView *docView = d->m_view->getDocumentView();
 
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
         NSRect selRect = NSRect(selectionRect());
         NSRect visRect = [docView visibleRect];
         if (!NSContainsRect(visRect, selRect)) {
@@ -822,7 +821,7 @@ void KWQKHTMLPart::jumpToSelection()
             selRect = NSIntersectionRect(selRect, [docView bounds]);
             [docView scrollRectToVisible:selRect];
         }
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
 */
     }
 }
@@ -834,7 +833,7 @@ void KWQKHTMLPart::redirectionTimerStartedOrStopped()
         return;
     }
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (d->m_redirectionTimer.isActive()) {
         [_bridge reportClientRedirectToURL:KURL(d->m_redirectURL).getNSURL()
                                      delay:d->m_delayRedirect
@@ -844,7 +843,7 @@ void KWQKHTMLPart::redirectionTimerStartedOrStopped()
     } else {
         [_bridge reportClientRedirectCancelled:d->m_cancelWithLoadInProgress];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::paint(QPainter *p, const QRect &rect)
@@ -901,25 +900,22 @@ RenderObject *KWQKHTMLPart::renderer()
 
 QString KWQKHTMLPart::userAgent() const
 {
-    NSString * volatile us = nil;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    us = [_bridge userAgentForURL:m_url.getNSURL()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([_bridge userAgentForURL:m_url.getNSURL()]);
+    KWQ_UNBLOCK_EXCEPTIONS;
          
-    return QString::fromNSString(us);
+    return QString();
 }
 
 QString KWQKHTMLPart::mimeTypeForFileName(const QString &fileName) const
 {
     NSString *ns = fileName.getNSString();
-    NSString * volatile mimeType = @"";
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    mimeType = [_bridge MIMETypeForPath:ns];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([_bridge MIMETypeForPath:ns]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(mimeType);
+    return QString();
 }
 
 NSView *KWQKHTMLPart::nextKeyViewInFrame(NodeImpl *node, KWQSelectionDirection direction)
@@ -978,22 +974,24 @@ NSView *KWQKHTMLPart::nextKeyViewInFrameHierarchy(NodeImpl *node, KWQSelectionDi
 
 NSView *KWQKHTMLPart::nextKeyView(NodeImpl *node, KWQSelectionDirection direction)
 {
-    NSView * volatile next = nextKeyViewInFrameHierarchy(node, direction);
+    KWQ_BLOCK_EXCEPTIONS;
+
+    NSView * next = nextKeyViewInFrameHierarchy(node, direction);
     if (next) {
         return next;
     }
 
     // Look at views from the top level part up, looking for a next key view that we can use.
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
     next = direction == KWQSelectingNext
         ? [_bridge nextKeyViewOutsideWebFrameViews]
         : [_bridge previousKeyViewOutsideWebFrameViews];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
 
     if (next) {
         return next;
     }
+
+    KWQ_UNBLOCK_EXCEPTIONS;
     
     // If all else fails, make a loop by starting from 0.
     return nextKeyViewInFrameHierarchy(0, direction);
@@ -1010,13 +1008,8 @@ NSView *KWQKHTMLPart::nextKeyViewForWidget(QWidget *startingWidget, KWQSelection
 
 bool KWQKHTMLPart::currentEventIsMouseDownInWidget(QWidget *candidate)
 {
-    volatile NSEventType eventType = (NSEventType)0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    eventType = [[NSApp currentEvent] type];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    switch (eventType) {
+    KWQ_BLOCK_EXCEPTIONS;
+    switch ([[NSApp currentEvent] type]) {
         case NSLeftMouseDown:
         case NSRightMouseDown:
         case NSOtherMouseDown:
@@ -1024,6 +1017,7 @@ bool KWQKHTMLPart::currentEventIsMouseDownInWidget(QWidget *candidate)
         default:
             return NO;
     }
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     NodeImpl *node = nodeForWidget(candidate);
     ASSERT(node);
@@ -1250,17 +1244,17 @@ void KWQKHTMLPart::saveDocumentState()
     // Do not save doc state if the page has a password field and a form that would be submitted
     // via https
     if (!(d->m_doc && d->m_doc->hasPasswordField() && d->m_doc->hasSecureForm())) {
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
         [_bridge saveDocumentState];
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
     }
 }
 
 void KWQKHTMLPart::restoreDocumentState()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge restoreDocumentState];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QPtrList<KWQKHTMLPart> &KWQKHTMLPart::mutableInstances()
@@ -1294,24 +1288,20 @@ void KWQKHTMLPart::setPolicyBaseURL(const DOMString &s)
 
 QString KWQKHTMLPart::requestedURLString() const
 {
-    NSString * volatile URL = @"";
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    URL = [_bridge requestedURLString];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([_bridge requestedURLString]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(URL);
+    return QString();
 }
 
 QString KWQKHTMLPart::incomingReferrer() const
 {
-    NSString * volatile referrer = @"";
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    referrer = [_bridge incomingReferrer];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([_bridge incomingReferrer]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(referrer);
+    return QString();
 }
 
 void KWQKHTMLPart::forceLayout()
@@ -1358,22 +1348,21 @@ void KWQKHTMLPart::runJavaScriptAlert(const QString &message)
 {
     QString text = message;
     text.replace('\\', backslashAsCurrencySymbol());
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_bridge runJavaScriptAlertPanelWithMessage:text.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool KWQKHTMLPart::runJavaScriptConfirm(const QString &message)
 {
     QString text = message;
     text.replace('\\', backslashAsCurrencySymbol());
-    volatile bool result = false;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [_bridge runJavaScriptConfirmPanelWithMessage:text.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [_bridge runJavaScriptConfirmPanelWithMessage:text.getNSString()];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 bool KWQKHTMLPart::runJavaScriptPrompt(const QString &prompt, const QString &defaultValue, QString &result)
@@ -1383,13 +1372,12 @@ bool KWQKHTMLPart::runJavaScriptPrompt(const QString &prompt, const QString &def
     QString defaultValueText = defaultValue;
     defaultValueText.replace('\\', backslashAsCurrencySymbol());
 
-    NSString * volatile returnedText = @"";
-    volatile bool ok = false;
+    KWQ_BLOCK_EXCEPTIONS;
+    NSString *returnedText = nil;
+    bool ok = false;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
     [_bridge runJavaScriptTextInputPanelWithPrompt:prompt.getNSString()
         defaultText:defaultValue.getNSString() returningText:(NSString **)&returnedText];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
 
     if (ok) {
         result = QString::fromNSString(returnedText);
@@ -1397,6 +1385,9 @@ bool KWQKHTMLPart::runJavaScriptPrompt(const QString &prompt, const QString &def
     }
 
     return ok;
+    KWQ_UNBLOCK_EXCEPTIONS;
+    
+    return false;
 }
 
 void KWQKHTMLPart::createEmptyDocument()
@@ -1405,9 +1396,9 @@ void KWQKHTMLPart::createEmptyDocument()
     // it does nothing if we already have a document, and just creates an
     // empty one if we have no document at all.
     if (!d->m_doc) {
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
         [_bridge loadEmptyDocumentSynchronously];
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
     }
 }
 
@@ -1418,9 +1409,7 @@ void KWQKHTMLPart::addMetaData(const QString &key, const QString &value)
 
 bool KWQKHTMLPart::keyEvent(NSEvent *event)
 {
-    volatile bool result = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     ASSERT([event type] == NSKeyDown || [event type] == NSKeyUp);
 
@@ -1428,14 +1417,14 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
     // from pressing return in the location bar.
     DocumentImpl *doc = xmlDocImpl();
     if (!doc) {
-        KWQ_UNBLOCK_RETURN_VALUE(false, bool);
+        return false;
     }
     NodeImpl *node = doc->focusNode();
     if (!node && docImpl()) {
 	node = docImpl()->body();
     }
     if (!node) {
-        KWQ_UNBLOCK_RETURN_VALUE(false, bool);
+        return false;
     }
     
     NSEvent *oldCurrentEvent = _currentEvent;
@@ -1450,7 +1439,7 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 		     stateForCurrentEvent(),
 		     QString::fromNSString([event characters]),
 		     [event isARepeat]);
-    result = !node->dispatchKeyEvent(&qEvent);
+    bool result = !node->dispatchKeyEvent(&qEvent);
 
     // We want to send both a down and a press for the initial key event.
     // This is a temporary hack; we need to do this a better way.
@@ -1470,9 +1459,11 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
     [event release];
     _currentEvent = oldCurrentEvent;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
     return result;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return false;
 }
 
 // This does the same kind of work that KHTMLPart::openURL does, except it relies on the fact
@@ -1511,11 +1502,11 @@ void KWQKHTMLPart::khtmlMousePressEvent(MousePressEvent *event)
         // because we don't want to do it until we know we didn't hit a widget.
         NSView *view = d->m_view->getDocumentView();
 
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
         if ([_currentEvent clickCount] <= 1 && [_bridge firstResponder] != view) {
             [_bridge makeFirstResponder:view];
         }
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
 
         KHTMLPart::khtmlMousePressEvent(event);
     }
@@ -1566,7 +1557,7 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(QWidget* widget)
         return true;
     }
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     
     NSView *nodeView = widget->getView();
     ASSERT(nodeView);
@@ -1579,7 +1570,7 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(QWidget* widget)
     NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[_currentEvent locationInWindow] fromView:topView]];
     if (view == nil) {
         ERROR("KHTML says we hit a RenderWidget, but AppKit doesn't agree we hit the corresponding NSView");
-        KWQ_UNBLOCK_RETURN_VALUE(true, bool);
+        return true;
     }
     
     if ([_bridge firstResponder] == view) {
@@ -1617,7 +1608,7 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(QWidget* widget)
     _mouseDownView = view;
     _mouseDownWasInSubframe = false;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return true;
 }
@@ -1628,18 +1619,17 @@ bool KWQKHTMLPart::lastEventIsMouseUp()
     // When they finish, currentEvent is the mouseUp that they exited on.  We need to update
     // the khtml state with this mouseUp, which khtml never saw.  This method lets us detect
     // that state.
-    volatile bool result = false;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];
     if (_currentEvent != currentEventAfterHandlingMouseDown) {
         if ([currentEventAfterHandlingMouseDown type] == NSLeftMouseUp) {
-            result = true;
+            return true;
         }
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
     
 // Note that this does the same kind of check as [target isDescendantOf:superview].
@@ -1647,19 +1637,17 @@ bool KWQKHTMLPart::lastEventIsMouseUp()
 // tree, and this works in cases where the target has already been deallocated.
 static bool findViewInSubviews(NSView *superview, NSView *target)
 {
-    volatile bool result = false;
-    
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSEnumerator *e = [[superview subviews] objectEnumerator];
     NSView *subview;
     while ((subview = [e nextObject])) {
         if (subview == target || findViewInSubviews(subview, target)) {
-            result = true;
+            return true;
 	}
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     
-    return result;
+    return false;
 }
 
 NSView *KWQKHTMLPart::mouseDownViewIfStillGood()
@@ -1682,7 +1670,7 @@ NSView *KWQKHTMLPart::mouseDownViewIfStillGood()
 
 void KWQKHTMLPart::khtmlMouseMoveEvent(MouseMoveEvent *event)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     if ([_currentEvent type] == NSLeftMouseDragged) {
     	NSView *view = mouseDownViewIfStillGood();
@@ -1691,7 +1679,7 @@ void KWQKHTMLPart::khtmlMouseMoveEvent(MouseMoveEvent *event)
             _sendingEventToSubview = true;
             [view mouseDragged:_currentEvent];
             _sendingEventToSubview = false;
-            KWQ_UNBLOCK_RETURN;
+            return;
         }
 
 	if (_mouseDownMayStartDrag &&
@@ -1702,14 +1690,14 @@ void KWQKHTMLPart::khtmlMouseMoveEvent(MouseMoveEvent *event)
             // We are starting a text/image/url drag, so the cursor should be an arrow
             d->m_view->resetCursor();
             [_bridge handleMouseDragged:_currentEvent];
-            KWQ_UNBLOCK_RETURN;
+            return;
 	} else if (_mouseDownMayStartSelect) {
 	    // we use khtml's selection but our own autoscrolling
 	    [_bridge handleAutoscrollForMouseDragged:_currentEvent];
             // Don't allow dragging after we've started selecting.
             _mouseDownMayStartDrag = false;
 	} else {
-            KWQ_UNBLOCK_RETURN;
+            return;
 	}
     } else {
 	// If we allowed the other side of the bridge to handle a drag
@@ -1721,7 +1709,7 @@ void KWQKHTMLPart::khtmlMouseMoveEvent(MouseMoveEvent *event)
 
     KHTMLPart::khtmlMouseMoveEvent(event);
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
@@ -1733,9 +1721,9 @@ void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
     }
     
     _sendingEventToSubview = true;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [view mouseUp:_currentEvent];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     _sendingEventToSubview = false;
 }
 
@@ -1752,13 +1740,9 @@ void KWQKHTMLPart::clearTimers()
 
 bool KWQKHTMLPart::passSubframeEventToSubframe(NodeImpl::MouseEvent &event)
 {
-    volatile NSEventType eventType = (NSEventType)0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    eventType = [_currentEvent type];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
-    switch (eventType) {
+    switch ([_currentEvent type]) {
     	case NSLeftMouseDown: {
             NodeImpl *node = event.innerNode.handle();
             if (!node) {
@@ -1784,10 +1768,8 @@ bool KWQKHTMLPart::passSubframeEventToSubframe(NodeImpl::MouseEvent &event)
             }
             ASSERT(!_sendingEventToSubview);
             _sendingEventToSubview = true;
-	    KWQ_BLOCK_NS_EXCEPTIONS;
-            [view mouseUp:_currentEvent];
-	    KWQ_UNBLOCK_NS_EXCEPTIONS;
-            _sendingEventToSubview = false;
+	    [view mouseUp:_currentEvent];
+	    _sendingEventToSubview = false;
             return true;
         }
         case NSLeftMouseDragged: {
@@ -1800,26 +1782,23 @@ bool KWQKHTMLPart::passSubframeEventToSubframe(NodeImpl::MouseEvent &event)
             }
             ASSERT(!_sendingEventToSubview);
             _sendingEventToSubview = true;
-	    KWQ_BLOCK_NS_EXCEPTIONS;
-            [view mouseDragged:_currentEvent];
-	    KWQ_UNBLOCK_NS_EXCEPTIONS;
-            _sendingEventToSubview = false;
+	    [view mouseDragged:_currentEvent];
+	    _sendingEventToSubview = false;
             return true;
         }
         default:
             return false;
     }
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return false;
 }
 
 int KWQKHTMLPart::buttonForCurrentEvent()
 {
-    volatile NSEventType eventType = (NSEventType)0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    eventType = [_currentEvent type];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     
-    switch (eventType) {
+    switch ([_currentEvent type]) {
     case NSLeftMouseDown:
     case NSLeftMouseUp:
         return Qt::LeftButton;
@@ -1832,17 +1811,17 @@ int KWQKHTMLPart::buttonForCurrentEvent()
     default:
         return 0;
     }
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return 0;
 }
 
 int KWQKHTMLPart::stateForCurrentEvent()
 {
-    volatile int state = buttonForCurrentEvent();
-    
-    volatile unsigned modifiers = 0;
+    KWQ_BLOCK_EXCEPTIONS;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    modifiers = [_currentEvent modifierFlags];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    int state = buttonForCurrentEvent();
+    unsigned modifiers =  [_currentEvent modifierFlags];
 
     if (modifiers & NSControlKeyMask)
         state |= Qt::ControlButton;
@@ -1856,6 +1835,10 @@ int KWQKHTMLPart::stateForCurrentEvent()
         state |= Qt::Keypad;
     
     return state;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return buttonForCurrentEvent();
 }
 
 void KWQKHTMLPart::mouseDown(NSEvent *event)
@@ -1865,7 +1848,7 @@ void KWQKHTMLPart::mouseDown(NSEvent *event)
         return;
     }
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     _mouseDownView = nil;
 
@@ -1897,7 +1880,7 @@ void KWQKHTMLPart::mouseDown(NSEvent *event)
     [event release];
     _currentEvent = oldCurrentEvent;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::mouseDragged(NSEvent *event)
@@ -1907,7 +1890,7 @@ void KWQKHTMLPart::mouseDragged(NSEvent *event)
         return;
     }
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = [event retain];
@@ -1923,7 +1906,7 @@ void KWQKHTMLPart::mouseDragged(NSEvent *event)
     [event release];
     _currentEvent = oldCurrentEvent;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::mouseUp(NSEvent *event)
@@ -1933,7 +1916,7 @@ void KWQKHTMLPart::mouseUp(NSEvent *event)
         return;
     }
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = [event retain];
@@ -1966,7 +1949,7 @@ void KWQKHTMLPart::mouseUp(NSEvent *event)
     
     _mouseDownView = nil;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 /*
@@ -1980,7 +1963,7 @@ void KWQKHTMLPart::mouseUp(NSEvent *event)
  */
 void KWQKHTMLPart::sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     _sendingEventToSubview = false;
     int eventType = [initiatingEvent type];
@@ -2026,7 +2009,7 @@ void KWQKHTMLPart::sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent)
                                    pressure:0];
     mouseMoved(fakeEvent);
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQKHTMLPart::mouseMoved(NSEvent *event)
@@ -2038,7 +2021,7 @@ void KWQKHTMLPart::mouseMoved(NSEvent *event)
         return;
     }
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = [event retain];
@@ -2054,7 +2037,7 @@ void KWQKHTMLPart::mouseMoved(NSEvent *event)
     [event release];
     _currentEvent = oldCurrentEvent;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool KWQKHTMLPart::sendContextMenuEvent(NSEvent *event)
@@ -2065,9 +2048,7 @@ bool KWQKHTMLPart::sendContextMenuEvent(NSEvent *event)
         return false;
     }
 
-    volatile bool swallowEvent = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = [event retain];
@@ -2084,7 +2065,7 @@ bool KWQKHTMLPart::sendContextMenuEvent(NSEvent *event)
     // Sending an event can result in the destruction of the view and part.
     // We ref so that happens after we return from the KHTMLView function.
     v->ref();
-    swallowEvent = v->dispatchMouseEvent(EventImpl::CONTEXTMENU_EVENT,
+    bool swallowEvent = v->dispatchMouseEvent(EventImpl::CONTEXTMENU_EVENT,
         mev.innerNode.handle(), true, 0, &qev, true, NodeImpl::MousePress);
     v->deref();
 
@@ -2092,9 +2073,11 @@ bool KWQKHTMLPart::sendContextMenuEvent(NSEvent *event)
     [event release];
     _currentEvent = oldCurrentEvent;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
     return swallowEvent;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return false;
 }
 
 struct ListItemInfo {
@@ -2107,17 +2090,17 @@ static NSFileWrapper *fileWrapperForElement(ElementImpl *e)
     RenderImage *renderer = static_cast<RenderImage *>(e->renderer());
     NSImage *image = renderer->pixmap().image();
 
-    NSFileWrapper * volatile wrapper = nil;
-    
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSData *tiffData = [image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:0.0];
 
-    wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:tiffData];
+    NSFileWrapper *wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:tiffData];
     [wrapper setPreferredFilename:@"image.tiff"];
     [wrapper autorelease];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
 
     return wrapper;
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return nil;
 }
 
 static ElementImpl *listParent(ElementImpl *item)
@@ -2156,7 +2139,9 @@ static NodeImpl* isTextFirstInListItem(NodeImpl *e)
 
 NSAttributedString *KWQKHTMLPart::attributedString(NodeImpl *_start, int startOffset, NodeImpl *endNode, int endOffset)
 {
-    NodeImpl * volatile _startNode = _start;
+    KWQ_BLOCK_EXCEPTIONS;
+
+    NodeImpl * _startNode = _start;
 
     if (_startNode == nil) {
         return nil;
@@ -2164,9 +2149,7 @@ NSAttributedString *KWQKHTMLPart::attributedString(NodeImpl *_start, int startOf
 
     // This allocation and autorelease won't raise so it's OK to do it
     // outside the exception block
-    NSMutableAttributedString * volatile result = [[[NSMutableAttributedString alloc] init] autorelease];
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
 
     bool hasNewLine = true;
     bool addedSpace = true;
@@ -2551,10 +2534,12 @@ NSAttributedString *KWQKHTMLPart::attributedString(NodeImpl *_start, int startOf
         }
     }
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
     //NSLog (@"%@", result);
     return result;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return nil;
 }
 
 QRect KWQKHTMLPart::selectionRect() const
@@ -2646,11 +2631,9 @@ NSColor *KWQKHTMLPart::bodyBackgroundColor(void) const
 
 WebCoreKeyboardUIMode KWQKHTMLPart::keyboardUIMode() const
 {
-    volatile WebCoreKeyboardUIMode mode = WebCoreDefaultKeyboardAccess;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    mode = [_bridge keyboardUIMode];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [_bridge keyboardUIMode];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return mode;
+    return WebCoreDefaultKeyboardAccess;
 }
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 6afe2fd..2a1452b 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -80,7 +80,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
 						const KParts::WindowArgs &winArgs, 
 						KParts::ReadOnlyPart **partResult)
 { 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     NSString *frameName = urlArgs.frameName.length() == 0 ? nil : urlArgs.frameName.getNSString();
     
@@ -96,7 +96,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
 	    if (partResult) {
 		*partResult = [bridge part];
 	    }
-	    KWQ_UNBLOCK_RETURN;
+	    return;
 	}
     }
     
@@ -149,9 +149,9 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
     if (partResult) {
 	*partResult = [bridge part];
     }
-    KWQ_UNBLOCK_RETURN;
+    return;
 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     if (partResult) {
 	*partResult = NULL;
@@ -160,14 +160,14 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
 
 void KHTMLPartBrowserExtension::setIconURL(const KURL &url)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_part->bridge() setIconURL:url.getNSURL()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KHTMLPartBrowserExtension::setTypedIconURL(const KURL &url, const QString &type)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_part->bridge() setIconURL:url.getNSURL() withType:type.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
diff --git a/WebCore/kwq/KWQKHistoryProvider.mm b/WebCore/kwq/KWQKHistoryProvider.mm
index b44c716..5d8c1cf 100644
--- a/WebCore/kwq/KWQKHistoryProvider.mm
+++ b/WebCore/kwq/KWQKHistoryProvider.mm
@@ -44,15 +44,11 @@ void HistoryProvider::insert(const QString &s)
 
 bool HistoryProvider::contains(const QString &s) const
 {
-    volatile bool result = false;
-    
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [[WebCoreHistory historyProvider] containsItemForURLString: KURL(s).canonicalURL().getNSString()];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    result = [[WebCoreHistory historyProvider] containsItemForURLString: KURL(s).canonicalURL().getNSString()];
-
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    return result;
+    return false;
 }
 
 } // namespace KParts
diff --git a/WebCore/kwq/KWQKJavaAppletWidget.mm b/WebCore/kwq/KWQKJavaAppletWidget.mm
index d6bce70..9fed103 100644
--- a/WebCore/kwq/KWQKJavaAppletWidget.mm
+++ b/WebCore/kwq/KWQKJavaAppletWidget.mm
@@ -60,7 +60,7 @@ void KJavaAppletWidget::showApplet()
 {
     // If the view is a KWQView, we haven't replaced it with the Java view yet.
     // Only set the Java view once.
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([getView() isKindOfClass:[KWQView class]]) {
         setView([KWQ(_context->part())->bridge()
             viewForJavaAppletWithFrame:NSMakeRect(x(), y(), width(), height())
@@ -69,5 +69,5 @@ void KJavaAppletWidget::showApplet()
         // Add the view to the main view now so the applet starts immediately rather than until the first paint.
         _context->part()->view()->addChild(this, x(), y());
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
diff --git a/WebCore/kwq/KWQKJobClasses.mm b/WebCore/kwq/KWQKJobClasses.mm
index c479191..001055a 100644
--- a/WebCore/kwq/KWQKJobClasses.mm
+++ b/WebCore/kwq/KWQKJobClasses.mm
@@ -73,9 +73,9 @@ TransferJob::TransferJob(const KURL &url, const QByteArray &postData, bool showP
 TransferJob::~TransferJob()
 {
     // This will cancel the handle, and who knows what that could do
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [d->loader jobWillBeDeallocated];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     delete d;
 }
 
diff --git a/WebCore/kwq/KWQKLocale.mm b/WebCore/kwq/KWQKLocale.mm
index f3df94c..2a2b4b7 100644
--- a/WebCore/kwq/KWQKLocale.mm
+++ b/WebCore/kwq/KWQKLocale.mm
@@ -32,54 +32,45 @@
 
 QString inputElementAltText()
 {
-    NSString * volatile altText = @"";
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    altText = [[WebCoreViewFactory sharedFactory] inputElementAltText];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([[WebCoreViewFactory sharedFactory] inputElementAltText]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(altText);
+    return QString();
 }
 
 QString resetButtonDefaultLabel()
 {
-    NSString * volatile defaultLabel = @"";
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([[WebCoreViewFactory sharedFactory] resetButtonDefaultLabel]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    defaultLabel = [[WebCoreViewFactory sharedFactory] resetButtonDefaultLabel];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    return QString::fromNSString(defaultLabel);
+    return QString();
 }
 
 QString searchableIndexIntroduction()
 {
-    NSString * volatile introduction = @"";
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    introduction = [[WebCoreViewFactory sharedFactory] searchableIndexIntroduction];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([[WebCoreViewFactory sharedFactory] searchableIndexIntroduction]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(introduction);
+    return QString();
 }
 
 QString submitButtonDefaultLabel()
 {
-    NSString * volatile defaultLabel = @"";
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([[WebCoreViewFactory sharedFactory] submitButtonDefaultLabel]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    defaultLabel = [[WebCoreViewFactory sharedFactory] submitButtonDefaultLabel];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    return QString::fromNSString(defaultLabel);
+    return QString();
 }
 
 QString KLocale::language()
 {
-    NSString * volatile code = @"";
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    code = [[WebCoreViewFactory sharedFactory] defaultLanguageCode];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([[WebCoreViewFactory sharedFactory] defaultLanguageCode]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(code);
+    return QString();
 }
diff --git a/WebCore/kwq/KWQKPartsBrowserInterface.mm b/WebCore/kwq/KWQKPartsBrowserInterface.mm
index c1eb7e7..27bd845 100644
--- a/WebCore/kwq/KWQKPartsBrowserInterface.mm
+++ b/WebCore/kwq/KWQKPartsBrowserInterface.mm
@@ -45,9 +45,9 @@ void BrowserInterface::callMethod(const char *name, const QVariant &argument)
 {
     if (strcmp(name, "goHistory(int)") == 0) {
         int distance = argument.toInt();
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
 	[_part->bridge() goBackOrForward:distance];
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
         return;
     }
     ERROR("method %s not implemented", name);
diff --git a/WebCore/kwq/KWQLineEdit.mm b/WebCore/kwq/KWQLineEdit.mm
index 7b912b8..9af9b70 100644
--- a/WebCore/kwq/KWQLineEdit.mm
+++ b/WebCore/kwq/KWQLineEdit.mm
@@ -40,28 +40,28 @@ QLineEdit::QLineEdit()
 {
     KWQTextField *view = nil;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     view = [[KWQTextField alloc] initWithQLineEdit:this];
     setView(view);
     [view release];
     [view setSelectable:YES]; // must do this explicitly so setEditable:NO does not make it NO
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QLineEdit::~QLineEdit()
 {
     KWQTextField* textField = (KWQTextField*)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField invalidate];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QLineEdit::setEchoMode(EchoMode mode)
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField setPasswordMode:mode == Password];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QLineEdit::setCursorPosition(int)
@@ -79,32 +79,31 @@ void QLineEdit::setFont(const QFont &font)
 {
     QWidget::setFont(font);
     KWQTextField *textField = (KWQTextField *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField setFont:font.getNSFont()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QLineEdit::setText(const QString &s)
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField setStringValue:s.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QString QLineEdit::text()
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    NSString * volatile result = @"";
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSMutableString *text = [[[textField stringValue] mutableCopy] autorelease];
-    result = text;
     [text replaceOccurrencesOfString:@"\r\n" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0, [text length])];
     [text replaceOccurrencesOfString:@"\r" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0, [text length])];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    return QString::fromNSString(text);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(result);
+    return QString();
 }
 
 void QLineEdit::setMaxLength(int len)
@@ -116,61 +115,58 @@ void QLineEdit::setMaxLength(int len)
 bool QLineEdit::isReadOnly() const
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    volatile bool result = true;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = ![textField isEditable];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return ![textField isEditable];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return true;
 }
 
 void QLineEdit::setReadOnly(bool flag)
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField setEditable:!flag];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 int QLineEdit::maxLength() const
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    volatile int result = 0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [textField maximumLength];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    
+    KWQ_BLOCK_EXCEPTIONS;
+    return [textField maximumLength];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return 0;
 }
 
 void QLineEdit::selectAll()
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField selectText:nil];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QLineEdit::edited() const
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    volatile bool result = false;
+    
+    KWQ_BLOCK_EXCEPTIONS;
+    return [textField edited];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [textField edited];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    return result;
+    return false;
 }
 
 void QLineEdit::setEdited(bool flag)
 {
     KWQTextField *textField = (KWQTextField *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField setEdited:flag];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
@@ -185,7 +181,7 @@ QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
 
     NSSize size = {0,0};
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSMutableString *nominalWidthString = [NSMutableString stringWithCapacity:numCharacters];
     for (int i = 0; i < numCharacters; ++i) {
         [nominalWidthString appendString:@"0"];
@@ -198,7 +194,7 @@ QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
     size = [[textField cell] cellSize];
     [textField setMaximumLength:maximumLength];
     [textField setStringValue:value];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QSize(size);
 }
@@ -207,16 +203,14 @@ int QLineEdit::baselinePosition(int height) const
 {
     KWQTextField *textField = (KWQTextField *)getView();
 
-    volatile int result = 0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSRect bounds = [textField bounds];
     NSFont *font = [textField font];
-    result = (int)ceil([[textField cell] drawingRectForBounds:bounds].origin.y - bounds.origin.y
+    return (int)ceil([[textField cell] drawingRectForBounds:bounds].origin.y - bounds.origin.y
         + [font defaultLineHeightForFont] + [font descender]);
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return 0;
 }
 
 void QLineEdit::clicked()
@@ -228,9 +222,9 @@ void QLineEdit::setAlignment(AlignmentFlags alignment)
 {
     ASSERT(alignment == AlignLeft || alignment == AlignRight);
     KWQTextField *textField = getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textField setAlignment:(alignment == AlignRight ? NSRightTextAlignment : NSLeftTextAlignment)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QLineEdit::checksDescendantsForFocus() const
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index 9e3b72f..a398a94 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -60,7 +60,7 @@ QListBox::QListBox(QWidget *parent)
     , _clicked(this, SIGNAL(clicked(QListBoxItem *)))
     , _selectionChanged(this, SIGNAL(selectionChanged()))
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
 
     _items = [[NSMutableArray alloc] init];
     NSScrollView *scrollView = [[KWQListBoxScrollView alloc] init];
@@ -87,42 +87,40 @@ QListBox::QListBox(QWidget *parent)
     [tableView release];
     [scrollView setVerticalLineScroll:[tableView rowHeight]];
     
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QListBox::~QListBox()
 {
     NSScrollView *scrollView = getView();
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSTableView *tableView = [scrollView documentView];
     [tableView setDelegate:nil];
     [tableView setDataSource:nil];
     [_items release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 uint QListBox::count() const
 {
-    volatile uint result = 0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [_items count];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [_items count];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return 0;
 }
 
 void QListBox::clear()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [_items removeAllObjects];
     if (!_insertingItems) {
         NSScrollView *scrollView = getView();
         NSTableView *tableView = [scrollView documentView];
         [tableView reloadData];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     _widthGood = NO;
 }
 
@@ -130,17 +128,17 @@ void QListBox::setSelectionMode(SelectionMode mode)
 {
     NSScrollView *scrollView = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSTableView *tableView = [scrollView documentView];
     [tableView setAllowsMultipleSelection:mode != Single];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QListBox::insertItem(NSObject *o, unsigned index)
 {
     unsigned c = count();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (index >= c) {
         [_items addObject:o];
     } else {
@@ -152,7 +150,7 @@ void QListBox::insertItem(NSObject *o, unsigned index)
         NSTableView *tableView = [scrollView documentView];
         [tableView reloadData];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     _widthGood = NO;
 }
@@ -166,7 +164,7 @@ void QListBox::insertGroupLabel(const QString &text, unsigned index)
 {
     static NSDictionary *groupLabelAttributes;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (groupLabelAttributes == nil) {
         groupLabelAttributes = [[NSDictionary dictionaryWithObject:
             [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName] retain];
@@ -176,7 +174,7 @@ void QListBox::insertGroupLabel(const QString &text, unsigned index)
         initWithString:text.getNSString() attributes:groupLabelAttributes];
     insertItem(s, index);
     [s release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QListBox::beginBatchInsert()
@@ -191,10 +189,10 @@ void QListBox::endBatchInsert()
     _insertingItems = false;
     NSScrollView *scrollView = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSTableView *tableView = [scrollView documentView];
     [tableView reloadData];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QListBox::setSelected(int index, bool selectIt)
@@ -202,7 +200,7 @@ void QListBox::setSelected(int index, bool selectIt)
     ASSERT(!_insertingItems);
     NSScrollView *scrollView = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSTableView *tableView = [scrollView documentView];
     _changingSelection = true;
     if (selectIt) {
@@ -211,7 +209,7 @@ void QListBox::setSelected(int index, bool selectIt)
     } else {
         [tableView deselectRow:index];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     _changingSelection = false;
 }
 
@@ -220,24 +218,22 @@ bool QListBox::isSelected(int index) const
     ASSERT(!_insertingItems);
     NSScrollView *scrollView = getView();
 
-    volatile bool result = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSTableView *tableView = [scrollView documentView];
-    result = [tableView isRowSelected:index]; 
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    return [tableView isRowSelected:index]; 
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 void QListBox::setEnabled(bool enabled)
 {
     _enabled = enabled;
     // You would think this would work, but not until AK fixes 2177792
-    //KWQ_BLOCK_NS_EXCEPTIONS;
+    //KWQ_BLOCK_EXCEPTIONS;
     //NSTableView *tableView = [(NSScrollView *)getView() documentView];
     //[tableView setEnabled:enabled];
-    //KWQ_UNBLOCK_NS_EXCEPTIONS;
+    //KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QListBox::isEnabled()
@@ -253,7 +249,7 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
 
     NSSize size = {0,0};
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSTableView *tableView = [scrollView documentView];
     
     float width;
@@ -278,7 +274,7 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
     contentSize.height = ceil(([tableView rowHeight] + [tableView intercellSpacing].height) * MAX(MIN_LINES, lines));
     size = [NSScrollView frameSizeForContentSize:contentSize
         hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSBezelBorder];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QSize(size);
 }
@@ -289,14 +285,10 @@ QWidget::FocusPolicy QListBox::focusPolicy() const
     // For now, selects are only focused when full
     // keyboard access is turned on.
 
-    volatile bool fullKeyboardAccess = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    fullKeyboardAccess = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] == WebCoreFullKeyboardAccess;
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-    if (!fullKeyboardAccess)
-        return NoFocus;
+    KWQ_BLOCK_EXCEPTIONS;
+    if (![KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] == WebCoreFullKeyboardAccess)
+	return NoFocus;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QScrollView::focusPolicy();
 }
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index 40f8c8f..3347c8a 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -49,17 +49,15 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
     
     WebCoreBridge *bridge = static_cast<KWQKHTMLPart *>(request->m_docLoader->part())->bridge();
 
-    volatile id <WebCoreResourceHandle> handle = nil;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     KWQResourceLoader *resourceLoader = [[KWQResourceLoader alloc] initWithLoader:loader job:job];
-    handle = [bridge startLoadingResource:resourceLoader withURL:job->url().getNSURL()];
+    id <WebCoreResourceHandle> handle = [bridge startLoadingResource:resourceLoader withURL:job->url().getNSURL()];
     [resourceLoader setHandle:handle];
     [resourceLoader release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
-
     return handle != nil;
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return true;
 }
 
 int KWQNumberOfPendingOrLoadingRequests(khtml::DocLoader *dl)
@@ -69,13 +67,11 @@ int KWQNumberOfPendingOrLoadingRequests(khtml::DocLoader *dl)
 
 bool KWQCheckIfReloading(DocLoader *loader)
 {
-    volatile bool reloading = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    reloading = [static_cast<KWQKHTMLPart *>(loader->part())->bridge() isReloading];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [static_cast<KWQKHTMLPart *>(loader->part())->bridge() isReloading];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return reloading;
+    return false;
 }
 
 void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
@@ -100,11 +96,11 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
     // Notify the caller that we "loaded".
     WebCoreBridge *bridge = static_cast<KWQKHTMLPart *>(loader->part())->bridge();
     CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [bridge objectLoadedFromCacheWithURL:KURL(cachedObject->url().string()).getNSURL()
                                 response:(id)cachedObject->response()
                                     size:cachedImage ? cachedImage->dataSize() : cachedObject->size()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void KWQRetainResponse(void *response)
@@ -116,9 +112,9 @@ void KWQRetainResponse(void *response)
 void KWQReleaseResponse(void *response)
 {
     // A release could raise if it deallocs, though...
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [(id)response release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 @interface NSObject (WebPrivateResponse)
@@ -127,13 +123,11 @@ void KWQReleaseResponse(void *response)
 
 void *KWQResponseMIMEType(void *response)
 {
-    void * volatile result = NULL;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [(id)response MIMEType];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [(id)response MIMEType];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return NULL;
 }
 
 
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 2111065..c4676b6 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -432,21 +432,21 @@ void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix, const QRect &r)
 void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
                            int sx, int sy, int sw, int sh )
 {
-    volatile int _sw = sw;
-    volatile int _sh = sh;
-
     if (data->state.paintingDisabled)
         return;
         
-    if (_sw == -1)
-        _sw = pixmap.width();
-    if (_sh == -1)
-        _sh = pixmap.height();
+    if (sw == -1)
+        sw = pixmap.width();
+    if (sh == -1)
+        sh = pixmap.height();
+
+    NSRect inRect = NSMakeRect(x, y, sw, sh);
+    NSRect fromRect = NSMakeRect(sx, sy, sw, sh);
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    [pixmap.imageRenderer beginAnimationInRect:NSMakeRect(x, y, _sw, _sh)
-                                      fromRect:NSMakeRect(sx, sy, _sw, _sh)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    [pixmap.imageRenderer beginAnimationInRect:inRect
+                                      fromRect:fromRect];
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QPainter::drawTiledPixmap( int x, int y, int w, int h,
@@ -455,9 +455,9 @@ void QPainter::drawTiledPixmap( int x, int y, int w, int h,
     if (data->state.paintingDisabled)
         return;
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [pixmap.imageRenderer tileInRect:NSMakeRect(x, y, w, h) fromPoint:NSMakePoint(sx, sy)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QPainter::_updateRenderer(NSString **families)
@@ -465,12 +465,12 @@ void QPainter::_updateRenderer(NSString **families)
     if (data->textRenderer == 0 || data->state.font != data->textRendererFont) {
         data->textRendererFont = data->state.font;
         id <WebCoreTextRenderer> oldRenderer = data->textRenderer;
-	KWQ_BLOCK_NS_EXCEPTIONS;
+	KWQ_BLOCK_EXCEPTIONS;
         data->textRenderer = [[[WebCoreTextRendererFactory sharedFactory]
             rendererWithFont:data->textRendererFont.getNSFont()
             usingPrinterFont:data->textRendererFont.isPrinterFont()] retain];
         [oldRenderer release];
-	KWQ_UNBLOCK_NS_EXCEPTIONS;
+	KWQ_UNBLOCK_EXCEPTIONS;
     }
 }
     
diff --git a/WebCore/kwq/KWQPushButton.mm b/WebCore/kwq/KWQPushButton.mm
index 95f2751..fb8a859 100644
--- a/WebCore/kwq/KWQPushButton.mm
+++ b/WebCore/kwq/KWQPushButton.mm
@@ -38,18 +38,18 @@ enum {
 QPushButton::QPushButton(QWidget *)
 {
     NSButton *button = (NSButton *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [button setBezelStyle:NSRoundedBezelStyle];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QPushButton::QPushButton(const QString &text, QWidget *)
 {
     NSButton *button = (NSButton *)getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [button setBezelStyle:NSRoundedBezelStyle];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     setText(text);
 }
@@ -60,10 +60,10 @@ QSize QPushButton::sizeHint() const
 
     QSize size;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     size = QSize((int)[[button cell] cellSize].width - (dimensions()[leftMargin] + dimensions()[rightMargin]),
         (int)[[button cell] cellSize].height - (dimensions()[topMargin] + dimensions()[bottomMargin]));
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return size;
 }
@@ -88,18 +88,18 @@ int QPushButton::baselinePosition(int height) const
     // Button text is centered vertically, with a fudge factor to account for the shadow.
     NSButton *button = (NSButton *)getView();
 
-    volatile float ascender = 0;
-    volatile float descender = 0;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSFont *font = [button font];
-    ascender = [font ascender];
-    descender = [font descender];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-
+    float ascender = [font ascender];
+    float descender = [font descender];
     return (int)ceil(-dimensions()[topMargin]
         + ((height + dimensions()[topMargin] + dimensions()[bottomMargin]) - (ascender - descender)) / 2.0
         + ascender - dimensions()[baselineFudgeFactor]);
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return (int)ceil(-dimensions()[topMargin]
+        + ((height + dimensions()[topMargin] + dimensions()[bottomMargin])) / 2.0
+        - dimensions()[baselineFudgeFactor]);
 }
 
 const int *QPushButton::dimensions() const
@@ -112,11 +112,10 @@ const int *QPushButton::dimensions() const
         { 0, 1, 1, 1, 1 }
     };
     NSControl * const button = static_cast<NSControl *>(getView());
-    volatile NSControlSize size = NSSmallControlSize;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    size = [[button cell] controlSize];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return w[[[button cell] controlSize]];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return w[size];
+    return w[NSSmallControlSize];
 }
diff --git a/WebCore/kwq/KWQRadioButton.mm b/WebCore/kwq/KWQRadioButton.mm
index 29b025a..e06b341 100644
--- a/WebCore/kwq/KWQRadioButton.mm
+++ b/WebCore/kwq/KWQRadioButton.mm
@@ -40,9 +40,9 @@ enum {
 QRadioButton::QRadioButton(QWidget *w)
 {
     NSButton *button = (NSButton *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [button setButtonType:NSRadioButton];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QSize QRadioButton::sizeHint() const 
@@ -68,21 +68,20 @@ void QRadioButton::setFrameGeometry(const QRect &r)
 void QRadioButton::setChecked(bool isChecked)
 {
     NSButton *button = (NSButton *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [button setState:isChecked ? NSOnState : NSOffState];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QRadioButton::isChecked() const
 {
     NSButton *button = (NSButton *)getView();
     
-    volatile bool result = false;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = [button state] == NSOnState;
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [button state] == NSOnState;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 int QRadioButton::baselinePosition(int height) const
@@ -101,10 +100,9 @@ const int *QRadioButton::dimensions() const
     };
     NSControl * const button = static_cast<NSControl *>(getView());
 
-    volatile NSControlSize size = NSSmallControlSize;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    size = [[button cell] controlSize];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return w[[[button cell] controlSize]];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return w[size];
+    return w[NSSmallControlSize];
 }
diff --git a/WebCore/kwq/KWQScrollBar.mm b/WebCore/kwq/KWQScrollBar.mm
index 925e258..3c7b6f8 100644
--- a/WebCore/kwq/KWQScrollBar.mm
+++ b/WebCore/kwq/KWQScrollBar.mm
@@ -80,21 +80,21 @@ QScrollBar::QScrollBar(Qt::Orientation orientation, QWidget* parent)
     m_pageStep = 0;
     m_scroller = 0;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     m_scroller = [[KWQScrollBar alloc] initWithQScrollBar:this];
     setView(m_scroller);
     [m_scroller release];
     [parent->getView() addSubview: m_scroller];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     setFocusPolicy(NoFocus);
 }
 
 QScrollBar::~QScrollBar()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [m_scroller removeFromSuperview];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollBar::setValue(int v)
@@ -106,10 +106,10 @@ void QScrollBar::setValue(int v)
     if (m_currentPos == v)
         return; // Our value stayed the same.
     m_currentPos = v;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [m_scroller setFloatValue: (float)m_currentPos/maxPos
                knobProportion: [m_scroller knobProportion]];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     valueChanged(); // Emit the signal that indicates our value has changed.
 }
 
@@ -125,10 +125,10 @@ void QScrollBar::setKnobProportion(int visibleArea, int totalArea)
     m_totalSize = totalArea;
     float val = (float)m_visibleSize/m_totalSize;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (!(val == [m_scroller knobProportion] || val < 0.0))
 	[m_scroller setFloatValue: [m_scroller floatValue] knobProportion: val];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollBar::scrollbarHit(NSScrollerPart hitPart)
@@ -155,9 +155,9 @@ void QScrollBar::scrollbarHit(NSScrollerPart hitPart)
             // If the thumb is hit, then the scrollbar changed its value for us.
         case NSScrollerKnob:
         case NSScrollerKnobSlot:
-	    KWQ_BLOCK_NS_EXCEPTIONS;
+	    KWQ_BLOCK_EXCEPTIONS;
             newPos = (int)([m_scroller floatValue]*maxPos);
-	    KWQ_UNBLOCK_NS_EXCEPTIONS;
+	    KWQ_UNBLOCK_EXCEPTIONS;
             break;
         default: ;
     }
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 7272871..d2dacfd 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -65,33 +65,31 @@ QWidget* QScrollView::viewport() const
 int QScrollView::visibleWidth() const
 {
     NSScrollView *view = (NSScrollView *)getView();
-    volatile int visibleWidth = 0;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView]) {
-        visibleWidth = (int)[view documentVisibleRect].size.width;
+        return (int)[view documentVisibleRect].size.width;
     } else {
-        visibleWidth = (int)[view bounds].size.width;
+        return (int)[view bounds].size.width;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return visibleWidth;
+    return 0;
 }
 
 int QScrollView::visibleHeight() const
 {
     NSScrollView *view = (NSScrollView *)getView();
-    volatile int visibleHeight = 0;
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView]) {
-        visibleHeight = (int)[view documentVisibleRect].size.height;
+        return (int)[view documentVisibleRect].size.height;
     } else {
-        visibleHeight = (int)[view bounds].size.height;
+        return (int)[view bounds].size.height;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
     
-    return visibleHeight;
+    return 0;
 }
 
 int QScrollView::contentsWidth() const
@@ -99,16 +97,15 @@ int QScrollView::contentsWidth() const
     NSView *docView, *view = getView();
     docView = getDocumentView();
 
-    volatile int result = 0;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (docView) {
-        result = (int)[docView bounds].size.width;
+        return (int)[docView bounds].size.width;
     } else {
-	result = (int)[view bounds].size.width;
+	return (int)[view bounds].size.width;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return 0;
 }
 
 int QScrollView::contentsHeight() const
@@ -116,50 +113,47 @@ int QScrollView::contentsHeight() const
     NSView *docView, *view = getView();
     docView = getDocumentView();
 
-    volatile int result = 0;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (docView) {
-        result = (int)[docView bounds].size.height;
+        return (int)[docView bounds].size.height;
     } else {
-	result = (int)[view bounds].size.height;
+	return (int)[view bounds].size.height;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return 0;
 }
 
 int QScrollView::contentsX() const
 {
     NSView *view = getView();
-    volatile float vx = 0;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView]) {
         NSScrollView *sview = view;
-        vx = (int)[sview documentVisibleRect].origin.x;
+        return (int)[sview documentVisibleRect].origin.x;
     } else {
-        vx = (int)[view visibleRect].origin.x;
+        return (int)[view visibleRect].origin.x;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return (int)vx;
+    return 0;
 }
 
 int QScrollView::contentsY() const
 {
     NSView *view = getView();
-    volatile float vy = 0;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView]) {
         NSScrollView *sview = view;
-        vy = (int)[sview documentVisibleRect].origin.y;
+        return (int)[sview documentVisibleRect].origin.y;
     } else {
-        vy = (int)[view visibleRect].origin.y;
+        return (int)[view visibleRect].origin.y;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return (int)vy;
+    return 0;
 }
 
 int QScrollView::childX(QWidget *)
@@ -179,54 +173,55 @@ void QScrollView::scrollBy(int dx, int dy)
 
 void QScrollView::setContentsPos(int x, int y)
 {
+    x = (x < 0) ? 0 : x;
+    y = (y < 0) ? 0 : y;
+    NSPoint p =  NSMakePoint(x,y);
+
+    KWQ_BLOCK_EXCEPTIONS;
     NSView *docView;
-    NSView * volatile view = getView();    
+    NSView *view = getView();    
     docView = getDocumentView();
     if (docView)
         view = docView;
         
-    volatile int _x = (x < 0) ? 0 : x;
-    volatile int _y = (y < 0) ? 0 : y;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    [view scrollPoint: NSMakePoint(_x,_y)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    [view scrollPoint:p];
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::setVScrollBarMode(ScrollBarMode vMode)
 {
     NSView* view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
         [frameView setVerticalScrollingMode: (WebCoreScrollBarMode)vMode];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::setHScrollBarMode(ScrollBarMode hMode)
 {
     NSView* view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
         [frameView setHorizontalScrollingMode: (WebCoreScrollBarMode)hMode];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::setScrollBarsMode(ScrollBarMode mode)
 {
     NSView* view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
         [frameView setScrollingMode: (WebCoreScrollBarMode)mode];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QScrollView::ScrollBarMode
@@ -234,15 +229,14 @@ QScrollView::vScrollBarMode() const
 {
     NSView* view = getView();
 
-    volatile QScrollView::ScrollBarMode mode = Auto;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
-        mode = (ScrollBarMode)[frameView verticalScrollingMode];
+        return (ScrollBarMode)[frameView verticalScrollingMode];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return mode;
+    return Auto;
 }
 
 QScrollView::ScrollBarMode
@@ -250,65 +244,63 @@ QScrollView::hScrollBarMode() const
 {
     NSView* view = getView();
 
-    volatile QScrollView::ScrollBarMode mode = Auto;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
-        mode = (ScrollBarMode)[frameView horizontalScrollingMode];
+        return (ScrollBarMode)[frameView horizontalScrollingMode];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return mode;
+    return Auto;
 }
 
 bool QScrollView::hasVerticalScrollBar() const
 {
     NSScrollView *view = (NSScrollView *)getView();
-    volatile bool result = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView])
-        result = [view hasVerticalScroller];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+        return  [view hasVerticalScroller];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 bool QScrollView::hasHorizontalScrollBar() const
 {
     NSScrollView *view = (NSScrollView *)getView();
-    volatile bool result = false;
-
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView])
-        result = [view hasHorizontalScroller];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+        return [view hasHorizontalScroller];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 void QScrollView::suppressScrollBars(bool suppressed,  bool repaintOnUnsuppress)
 {
     NSView* view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
         [frameView setScrollBarsSuppressed: suppressed
                        repaintOnUnsuppress: repaintOnUnsuppress];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::addChild(QWidget* child, int x, int y)
 {
-    NSView * volatile thisView;
-    NSView *thisDocView, *subview;
-
     ASSERT(child != this);
     
     child->move(x, y);
+
+    KWQ_BLOCK_EXCEPTIONS;
+
+    NSView * thisView;
+    NSView *thisDocView, *subview;
     
     thisView = getView();
     thisDocView = getDocumentView();
@@ -318,7 +310,6 @@ void QScrollView::addChild(QWidget* child, int x, int y)
     subview = child->getOuterView();
     ASSERT(subview != thisView);
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
     if ([subview superview] != thisView) {
 	[subview removeFromSuperview];
 	
@@ -327,19 +318,19 @@ void QScrollView::addChild(QWidget* child, int x, int y)
 	
 	[thisView addSubview:subview];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::removeChild(QWidget* child)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [child->getOuterView() removeFromSuperview];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::resizeContents(int w, int h)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     int _w = w;
     int _h = h;
 
@@ -358,7 +349,7 @@ void QScrollView::resizeContents(int w, int h)
     } else {
         resize (_w, _h);
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::updateContents(int x, int y, int w, int h, bool now)
@@ -368,9 +359,9 @@ void QScrollView::updateContents(int x, int y, int w, int h, bool now)
 
 void QScrollView::updateContents(const QRect &rect, bool now)
 {
-    NSView * volatile view = getView();
+    KWQ_BLOCK_EXCEPTIONS;
+    NSView * view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
     if ([view _KWQ_isScrollView])
         view = getDocumentView();
 
@@ -378,7 +369,7 @@ void QScrollView::updateContents(const QRect &rect, bool now)
         [view displayRect: rect];
     else
         [view setNeedsDisplayInRect:rect];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::repaintContents(int x, int y, int w, int h, bool erase)
@@ -395,47 +386,57 @@ QPoint QScrollView::contentsToViewport(const QPoint &p)
 
 void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
 {
+    KWQ_BLOCK_EXCEPTIONS;
+
     NSView *docView;
-    NSView * volatile view = getView();    
+    NSView *view = getView();    
      
     docView = getDocumentView();
     if (docView)
         view = docView;
     
-    NSPoint np = {0,0};
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    np = [view convertPoint: NSMakePoint (x, y) toView: nil];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-    
+    NSPoint np = [view convertPoint: NSMakePoint (x, y) toView: nil];
     vx = (int)np.x;
     vy = (int)np.y;
+    
+    return;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+    
+    vx = 0;
+    vy = 0;
 }
 
 void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
 {
+    KWQ_BLOCK_EXCEPTIONS;
+
     NSView *docView;
-    NSView * volatile view = getView();    
+    NSView *view = getView();    
 
     docView = getDocumentView();
     if (docView)
         view = docView;
         
-    NSPoint np;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    np = [view convertPoint: NSMakePoint (vx, vy) fromView: nil];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
-    
+    NSPoint np = [view convertPoint: NSMakePoint (vx, vy) fromView: nil];
     x = (int)np.x;
     y = (int)np.y;
+
+    return;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    x = 0;
+    y = 0;
 }
 
 void QScrollView::setStaticBackground(bool b)
 {
     NSScrollView *view = (NSScrollView *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view _KWQ_isScrollView])
         [[view contentView] setCopiesOnScroll: !b];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::resizeEvent(QResizeEvent *)
@@ -444,27 +445,26 @@ void QScrollView::resizeEvent(QResizeEvent *)
 
 void QScrollView::ensureVisible(int x, int y)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getDocumentView() scrollRectToVisible:NSMakeRect(x, y, 0, 0)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QScrollView::ensureVisible(int x, int y, int w, int h)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getDocumentView() scrollRectToVisible:NSMakeRect(x, y, w, h)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 NSView *QScrollView::getDocumentView() const
 {
     id view = getView();
-    NSView * volatile result = nil;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view respondsToSelector:@selector(documentView)]) 
-	result = [view documentView];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+	return [view documentView];
+    KWQ_UNBLOCK_EXCEPTIONS;
     
-    return result;
+    return nil;
 }
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index 13c2e5f..c1aa81c 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -33,43 +33,41 @@ QTextEdit::QTextEdit(QWidget *parent)
     : _clicked(this, SIGNAL(clicked()))
     , _textChanged(this, SIGNAL(textChanged()))
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     KWQTextArea *textView = [[KWQTextArea alloc] initWithQTextEdit:this];
     setView(textView);
     [textView release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QTextEdit::setText(const QString &string)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView setText:string.getNSString()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QString QTextEdit::text() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    NSString * volatile text = @"";
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    text = [textView text];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([textView text]);
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return QString::fromNSString(text);
+    return QString();
 }
 
 QString QTextEdit::textWithHardLineBreaks() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    NSString * volatile text = @"";
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    text = [textView textWithHardLineBreaks];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return QString::fromNSString([textView textWithHardLineBreaks]);
+    KWQ_UNBLOCK_EXCEPTIONS;
     
-    return QString::fromNSString(text);
+    return QString();
 }
 
 void QTextEdit::getCursorPosition(int *paragraph, int *index) const
@@ -80,38 +78,38 @@ void QTextEdit::getCursorPosition(int *paragraph, int *index) const
     if (paragraph)
 	*paragraph = 0;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView getCursorPositionAsIndex:index inParagraph:paragraph];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QTextEdit::setCursorPosition(int paragraph, int index)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView setCursorPositionToIndex:index inParagraph:paragraph];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QTextEdit::WrapStyle QTextEdit::wordWrap() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    volatile bool wrap = false;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    wrap = [textView wordWrap];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [textView wordWrap] ? WidgetWidth : NoWrap;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return wrap  ? WidgetWidth : NoWrap;
+    return NoWrap;
 }
 
+
 void QTextEdit::setWordWrap(WrapStyle style)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView setWordWrap:style == WidgetWidth];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QTextEdit::setTextFormat(TextFormat)
@@ -125,52 +123,50 @@ void QTextEdit::setTabStopWidth(int)
 bool QTextEdit::isReadOnly() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    volatile bool result = false;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = ![textView isEditable];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return ![textView isEditable];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 void QTextEdit::setReadOnly(bool flag)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView setEditable:!flag];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QTextEdit::isDisabled() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
-    volatile bool result = false;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    result = ![textView isEnabled];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return ![textView isEnabled];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return false;
 }
 
 void QTextEdit::setDisabled(bool flag)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView setEnabled:!flag];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QTextEdit::selectAll()
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView selectAll];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QTextEdit::setFont(const QFont &font)
@@ -178,9 +174,9 @@ void QTextEdit::setFont(const QFont &font)
     QWidget::setFont(font);
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textView setFont:font.getNSFont()];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QTextEdit::clicked()
@@ -196,10 +192,10 @@ void QTextEdit::setAlignment(AlignmentFlags alignment)
     ASSERT(alignment == AlignLeft || alignment == AlignRight);
     KWQTextArea *textArea = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [textArea setAlignment:(alignment == AlignRight ? NSRightTextAlignment : NSLeftTextAlignment)];
     [textArea setBaseWritingDirection:(alignment == AlignRight ? NSWritingDirectionRightToLeft : NSWritingDirectionLeftToRight)];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QSize QTextEdit::sizeWithColumnsAndRows(int numColumns, int numRows) const
@@ -207,9 +203,9 @@ QSize QTextEdit::sizeWithColumnsAndRows(int numColumns, int numRows) const
     KWQTextArea *textArea = getView();
     NSSize size = {0,0};
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     size = [textArea sizeWithColumns:numColumns rows:numRows];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QSize((int)ceil(size.width), (int)ceil(size.height));
 }
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 1ddf95a..645fd41 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -61,9 +61,9 @@ QWidget::QWidget()
 {
     data->view = nil;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     data->view = [[KWQView alloc] initWithWidget:this];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     static QStyle defaultStyle;
     data->style = &defaultStyle;
@@ -83,9 +83,9 @@ QWidget::QWidget(NSView *view)
 
 QWidget::~QWidget() 
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [data->view release];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     delete data;
 }
@@ -103,33 +103,32 @@ void QWidget::resize(int w, int h)
 
 void QWidget::setActiveWindow() 
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [KWQKHTMLPart::bridgeForWidget(this) focusWindow];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::setEnabled(bool enabled)
 {
     id view = data->view;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view respondsToSelector:@selector(setEnabled:)]) {
         [view setEnabled:enabled];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 bool QWidget::isEnabled() const
 {
     id view = data->view;
 
-    volatile bool result = true;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view respondsToSelector:@selector(isEnabled)]) {
-        result = [view isEnabled];
+        return [view isEnabled];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return result;
+    return true;
 }
 
 long QWidget::winId() const
@@ -186,9 +185,9 @@ QRect QWidget::frameGeometry() const
 {
     QRect rect;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     rect = QRect([getOuterView() frame]);
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return rect;
 }
@@ -202,14 +201,14 @@ bool QWidget::hasFocus() const
 {
     NSView *view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSView *firstResponder = [KWQKHTMLPart::bridgeForWidget(this) firstResponder];
 
     if (!firstResponder) {
-        KWQ_UNBLOCK_RETURN_VALUE(false, bool);
+        return false;
     }
     if (firstResponder == view) {
-        KWQ_UNBLOCK_RETURN_VALUE(true, bool);
+        return true;
     }
 
     // Some widgets, like text fields, secure text fields, text areas, and selects
@@ -221,9 +220,9 @@ bool QWidget::hasFocus() const
         [firstResponder isKindOfClass:[NSView class]] && 
         [(NSView *)firstResponder isDescendantOf:view]) {
         // Return true when the first responder is a subview of this widget's view
-        KWQ_UNBLOCK_RETURN_VALUE(true, bool);
+        return true;
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return false;
 }
@@ -250,11 +249,11 @@ void QWidget::setFocus()
     
     NSView *view = getView();
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if ([view acceptsFirstResponder]) {
         [KWQKHTMLPart::bridgeForWidget(this) makeFirstResponder:view];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::clearFocus()
@@ -287,13 +286,12 @@ QWidget::FocusPolicy QWidget::focusPolicy() const
     if (!isEnabled())
         return NoFocus;
     
-    volatile QWidget::FocusPolicy policy = TabFocus;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     if (![getView() acceptsFirstResponder])
-        policy = NoFocus;
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+        return NoFocus;
+    KWQ_UNBLOCK_EXCEPTIONS;
     
-    return policy;
+    return TabFocus;
 }
 
 const QPalette& QWidget::palette() const
@@ -345,18 +343,17 @@ bool QWidget::isVisible() const
 {
     // FIXME - rewrite interms of top level widget?
     
-    volatile bool visible = false;
-    KWQ_BLOCK_NS_EXCEPTIONS;
-    visible = [[KWQKHTMLPart::bridgeForWidget(this) window] isVisible];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    return [[KWQKHTMLPart::bridgeForWidget(this) window] isVisible];
+    KWQ_UNBLOCK_EXCEPTIONS;
 
-    return visible;
+    return false;
 }
 
 void QWidget::setCursor(const QCursor &cur)
 {
-    volatile id view = data->view;
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
+    id view = data->view;
     while (view) {
         if ([view respondsToSelector:@selector(setDocumentCursor:)]) {
             [view setDocumentCursor:cur.handle()];
@@ -364,24 +361,26 @@ void QWidget::setCursor(const QCursor &cur)
         }
         view = [view superview];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QCursor QWidget::cursor()
 {
-    volatile id view = data->view;
+    KWQ_BLOCK_EXCEPTIONS;
     QCursor cursor;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    id view = data->view;
     while (view) {
         if ([view respondsToSelector:@selector(documentCursor)]) { 
             cursor = QCursor([view documentCursor]);
         }
         view = [view superview];
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
 
     return cursor;
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return QCursor();
 }
 
 void QWidget::unsetCursor()
@@ -412,9 +411,9 @@ void QWidget::show()
 
     data->visible = true;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getOuterView() setHidden: NO];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::hide()
@@ -424,27 +423,27 @@ void QWidget::hide()
 
     data->visible = false;
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getOuterView() setHidden: YES];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::setFrameGeometry(const QRect &rect)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getOuterView() setNeedsDisplay: YES];
     [getOuterView() setFrame:rect];
     [getOuterView() setNeedsDisplay: YES];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 QPoint QWidget::mapFromGlobal(const QPoint &p) const
 {
     NSPoint bp = {0,0};
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     bp = [[KWQKHTMLPart::bridgeForWidget(this) window] convertScreenToBase:[data->view convertPoint:p toView:nil]];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 
     return QPoint(bp);
 }
@@ -460,10 +459,10 @@ void QWidget::setView(NSView *view)
         return;
     }
     
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [data->view release];
     data->view = [view retain];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 NSView *QWidget::getOuterView() const
@@ -471,31 +470,36 @@ NSView *QWidget::getOuterView() const
     // A QScrollView is a widget normally used to represent a frame.
     // If this widget's view is a WebCoreFrameView the we resize its containing view, a WebFrameView.
     // The scroll view contained by the WebFrameView will be autosized.
-    NSView * volatile view = data->view;
+
+    KWQ_BLOCK_EXCEPTIONS;
+
+    NSView * view = data->view;
     ASSERT(view);
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         view = [view superview];
         ASSERT(view);
     }
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
 
     return view;
+
+    KWQ_UNBLOCK_EXCEPTIONS;
+
+    return nil;
 }
 
 void QWidget::lockDrawingFocus()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getView() lockFocus];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::unlockDrawingFocus()
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [getView() unlockFocus];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::disableFlushDrawing()
@@ -503,9 +507,9 @@ void QWidget::disableFlushDrawing()
     // It's OK to use the real window here, because if the view's not
     // in the view hierarchy, then we don't actually want to affect
     // flushing.
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [[getView() window] disableFlushWindow];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::enableFlushDrawing()
@@ -513,18 +517,18 @@ void QWidget::enableFlushDrawing()
     // It's OK to use the real window here, because if the view's not
     // in the view hierarchy, then we don't actually want to affect
     // flushing.
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     NSWindow *window = [getView() window];
     [window enableFlushWindow];
     [window flushWindow];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::setDrawingAlpha(float alpha)
 {
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     CGContextSetAlpha((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], alpha);
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::paint(QPainter *p, const QRect &r)
@@ -535,9 +539,9 @@ void QWidget::paint(QPainter *p, const QRect &r)
     NSView *view = getOuterView();
     // KWQTextArea and KWQTextField both rely on the fact that we use this particular
     // NSView display method. If you change this, be sure to update them as well.
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     [view displayRectIgnoringOpacity:[view convertRect:r fromView:[view superview]]];
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }
 
 void QWidget::sendConsumedMouseUp()
@@ -545,9 +549,9 @@ void QWidget::sendConsumedMouseUp()
     khtml::RenderWidget *widget = const_cast<khtml::RenderWidget *>
 	(static_cast<const khtml::RenderWidget *>(eventFilterObject()));
 
-    KWQ_BLOCK_NS_EXCEPTIONS;
+    KWQ_BLOCK_EXCEPTIONS;
     widget->sendConsumedMouseUp(QPoint([[NSApp currentEvent] locationInWindow]),
 			      // FIXME: should send real state and button
 			      0, 0);
-    KWQ_UNBLOCK_NS_EXCEPTIONS;
+    KWQ_UNBLOCK_EXCEPTIONS;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list