summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/window/salobj.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-10-03 16:36:26 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-10-25 13:41:52 +0100
commitc529623457889a67473f773d080941903e2784fc (patch)
treea8a41cbb19a3063d10c22db8e6fe6d5dddc5960b /vcl/unx/generic/window/salobj.cxx
parentf88ff49c733392e66dd178928efa3d807f2cffca (diff)
generic: re-work X error push/pop and error message handling
Diffstat (limited to 'vcl/unx/generic/window/salobj.cxx')
-rw-r--r--vcl/unx/generic/window/salobj.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index cc9487fda4be..da0937858150 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -134,7 +134,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
static_cast<unsigned int> (pSalDisp->GetVisual( nScreen ).GetVisualId()),
static_cast<unsigned int> (aVisID) );
#endif
- pSalDisp->GetXLib()->PushXErrorLevel( true );
+ GetGenericData()->ErrorTrapPush();
// create colormap for visual - there might not be one
pObject->maColormap = aAttribs.colormap = XCreateColormap(
@@ -152,9 +152,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pVisual,
CWEventMask|CWColormap, &aAttribs );
XSync( pDisp, False );
- sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
- pSalDisp->GetXLib()->PopXErrorLevel();
- if( bWasXError )
+ if( GetGenericData()->ErrorTrapPop( false ) )
{
pObject->maSecondary = None;
delete pObject;
@@ -163,7 +161,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
XReparentWindow( pDisp, pObject->maSecondary, pObject->maPrimary, 0, 0 );
}
- pSalDisp->GetXLib()->PushXErrorLevel( true );
+ GetGenericData()->ErrorTrapPush();
if( bShow ) {
XMapWindow( pDisp, pObject->maSecondary );
XMapWindow( pDisp, pObject->maPrimary );
@@ -179,9 +177,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pObjData->pAppContext = NULL;
XSync(pDisp, False);
- sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
- pSalDisp->GetXLib()->PopXErrorLevel();
- if( bWasXError )
+ if( GetGenericData()->ErrorTrapPop( false ) )
{
delete pObject;
return NULL;
@@ -278,7 +274,8 @@ X11SalObject::~X11SalObject()
std::list< SalObject* >& rObjects = GetGenericData()->GetSalDisplay()->getSalObjects();
rObjects.remove( this );
SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
- pSalDisp->GetXLib()->PushXErrorLevel( true );
+
+ GetGenericData()->ErrorTrapPush();
if ( maSecondary )
XDestroyWindow( (Display*)maSystemChildData.pDisplay, maSecondary );
if ( maPrimary )
@@ -286,7 +283,7 @@ X11SalObject::~X11SalObject()
if ( maColormap )
XFreeColormap((Display*)maSystemChildData.pDisplay, maColormap);
XSync( (Display*)maSystemChildData.pDisplay, False );
- pSalDisp->GetXLib()->PopXErrorLevel();
+ GetGenericData()->ErrorTrapPop();
}