[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1120
Date       : Thu May 18 17:29:34 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/Makefile.am
   D /Trunk/XaraLX/Kernel/exceptio.cpp
   D /Trunk/XaraLX/Kernel/exceptio.h
   M /Trunk/XaraLX/Kernel/main2.cpp
   M /Trunk/XaraLX/Kernel/page.cpp
   M /Trunk/XaraLX/Kernel/spread.cpp
   M /Trunk/XaraLX/wxOil/Makefile.am
   A /Trunk/XaraLX/wxOil/exceptio.cpp (from /Trunk/XaraLX/Kernel/exceptio.cpp:1119)
   A /Trunk/XaraLX/wxOil/exceptio.h (from /Trunk/XaraLX/Kernel/exceptio.h:1108)

Enabled crash operators on debug build to test exception handling. Moved crashme stuff to wxOil as it does some oil stuff.


Diff:
Index: Trunk/XaraLX/Kernel/page.cpp
===================================================================
--- Trunk/XaraLX/Kernel/page.cpp	(revision 1119)
+++ Trunk/XaraLX/Kernel/page.cpp	(revision 1120)
@@ -268,10 +268,8 @@
 
 void Page::Render( RenderRegion* pRender )
 {      
-//#pragma message( __LOCMSG__ "Page::Render - do nothing" )
-//	TRACE( _T("Warning - Page::Render called
") );
 	// If we should blow up, then blow up - don't worry, this is a very quick inline check
-//	OpException::BlowUpOnCrashMe();
+	OpException::BlowUpOnCrashMe();
 
 	// Sanity check
 	ERROR3IF(pRender == NULL,"Page::Render null render region!");
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am	(revision 1119)
+++ Trunk/XaraLX/Kernel/Makefile.am	(revision 1120)
@@ -68,6 +68,6 @@
 	optspage.cpp optsundo.cpp optsscal.cpp optsunit.cpp pagesize.cpp radio.cpp \
 	xpfcaps.cpp xpfilter.cpp xpfrgn.cpp layerprp.cpp prpsgds.cpp prpslyrs.cpp \
 	aprps.cpp prevwdlg.cpp frameops.cpp newcol.cpp tracedlg.cpp tracectl.cpp \
-	tracergn.cpp bfxbase.cpp exceptio.cpp
+	tracergn.cpp bfxbase.cpp
 
 AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/spread.cpp
===================================================================
--- Trunk/XaraLX/Kernel/spread.cpp	(revision 1119)
+++ Trunk/XaraLX/Kernel/spread.cpp	(revision 1120)
@@ -750,10 +750,8 @@
 
 void Spread::Render( RenderRegion* pRender )
 {
-//#pragma message( __LOCMSG__ "Spread::Render - do nothing" )
-//	TRACE( _T("Warning - Spread::Render called
") );
 	// If we should blow up, then blow up - don't worry, this is a very quick inline check
-//	OpException::BlowUpOnCrashMe();
+	OpException::BlowUpOnCrashMe();
 
 // ralph only renders paper/pasteboard in some view modes  	
 #ifdef RALPH
Index: Trunk/XaraLX/Kernel/main2.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main2.cpp	(revision 1119)
+++ Trunk/XaraLX/Kernel/main2.cpp	(revision 1120)
@@ -394,8 +394,8 @@
 #ifndef STANDALONE
 			OpMenuSave::Init() &&				// Register Save operation
 #endif
+			OpException::Init() &&
 #ifndef EXCLUDE_FROM_XARALX
-			OpException::Init() &&
 			InfoBarOp::Init() &&
 			InfoBarViewOp::Init() &&
 			ExternalClipboard::Init() &&		// Create the application's external clipboard manager
Index: Trunk/XaraLX/Kernel/exceptio.h (deleted)
===================================================================
Index: Trunk/XaraLX/Kernel/exceptio.cpp (deleted)
===================================================================
Index: Trunk/XaraLX/wxOil/exceptio.cpp
===================================================================
--- Trunk/XaraLX/wxOil/exceptio.cpp	(revision 0)
+++ Trunk/XaraLX/wxOil/exceptio.cpp	(revision 1120)
@@ -0,0 +1,265 @@
+// $Id$
+/* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
+================================XARAHEADERSTART===========================
+ 
+               Xara LX, a vector drawing and manipulation program.
+                    Copyright (C) 1993-2006 Xara Group Ltd.
+       Copyright on certain contributions may be held in joint with their
+              respective authors. See AUTHORS file for details.
+
+LICENSE TO USE AND MODIFY SOFTWARE
+----------------------------------
+
+This file is part of Xara LX.
+
+Xara LX is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 as published
+by the Free Software Foundation.
+
+Xara LX and its component source files are distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with Xara LX (see the file GPL in the root directory of the
+distribution); if not, write to the Free Software Foundation, Inc., 51
+Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
+ADDITIONAL RIGHTS
+-----------------
+
+Conditional upon your continuing compliance with the GNU General Public
+License described above, Xara Group Ltd grants to you certain additional
+rights. 
+
+The additional rights are to use, modify, and distribute the software
+together with the wxWidgets library, the wxXtra library, and the "CDraw"
+library and any other such library that any version of Xara LX relased
+by Xara Group Ltd requires in order to compile and execute, including
+the static linking of that library to XaraLX. In the case of the
+"CDraw" library, you may satisfy obligation under the GNU General Public
+License to provide source code by providing a binary copy of the library
+concerned and a copy of the license accompanying it.
+
+Nothing in this section restricts any of the rights you have under
+the GNU General Public License.
+
+
+SCOPE OF LICENSE
+----------------
+
+This license applies to this program (XaraLX) and its constituent source
+files only, and does not necessarily apply to other Xara products which may
+in part share the same code base, and are subject to their own licensing
+terms.
+
+This license does not apply to files in the wxXtra directory, which
+are built into a separate library, and are subject to the wxWindows
+license contained within that directory in the file "WXXTRA-LICENSE".
+
+This license does not apply to the binary libraries (if any) within
+the "libs" directory, which are subject to a separate license contained
+within that directory in the file "LIBS-LICENSE".
+
+
+ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
+----------------------------------------------
+
+Subject to the terms of the GNU Public License (see above), you are
+free to do whatever you like with your modifications. However, you may
+(at your option) wish contribute them to Xara's source tree. You can
+find details of how to do this at:
+  http://www.xaraxtreme.org/developers/
+
+Prior to contributing your modifications, you will need to complete our
+contributor agreement. This can be found at:
+  http://www.xaraxtreme.org/developers/contribute/
+
+Please note that Xara will not accept modifications which modify any of
+the text between the start and end of this header (marked
+XARAHEADERSTART and XARAHEADEREND).
+
+
+MARKS
+-----
+
+Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
+designs are registered or unregistered trademarks, design-marks, and/or
+service marks of Xara Group Ltd. All rights in these marks are reserved.
+
+
+      Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
+                        http://www.xara.com/
+
+=================================XARAHEADEREND============================
+ */
+
+// OpException class used to test exception handling code.
+
+
+
+#include "camtypes.h"
+#include "exceptio.h"
+//#include "andy.h"
+//#include "alex.h"
+#include "errors.h"
+#include "docview.h"
+
+DECLARE_SOURCE("$Revision$");
+
+
+LPBYTE OpException::lpByte = NULL;
+INT32 OpException::iZero[2];
+double OpException::dZero[2];
+BOOL OpException::RenderTrap = FALSE;
+static BYTE GlobalByte;
+
+
+CC_IMPLEMENT_DYNCREATE(OpException, Operation)
+
+
+/*******************************************************************
+
+>	void OpException::Do(OpDescriptor*)
+
+	Author: 	Andy_Pennell (Xara Group Ltd) <camelotdev@xxxxxxxx>
+	Created:	20/10/93
+	Inputs:		None
+	Outputs:	None
+	Returns:	None
+	Purpose:	Creates various types of exceptions to verify exception handling.
+	Errors:		-
+
+*******************************************************************/
+
+
+void OpException::Do(OpDescriptor* WhichOp)
+{
+	if (WhichOp->Token == String( OPTOKEN_EXCEPTION_PTR) )
+		GlobalByte = *lpByte;
+	else if (WhichOp->Token == String( OPTOKEN_EXCEPTION_INT ) )
+		iZero[1] = 1 / iZero[0];
+	else if (WhichOp->Token == String( OPTOKEN_EXCEPTION_DBL ) )
+		dZero[1] = 1 / dZero[0];									
+	else
+	{
+		DocView *pDocView = DocView::GetSelected();
+		if (pDocView != NULL)
+		{
+			pDocView->ForceRedraw();										// posts the paint message
+			CWindowID pWnd = DocView::GetCurrentRenderWindow();
+			if (pWnd)
+			{
+				// Set trap for later
+				RenderTrap = TRUE;										
+				// Now do the paint
+				TRACE( _T("Into update explosion
"));
+				pWnd->Update();										// do the paint
+				TRACE( _T("Out of update explosion
"));
+			}
+		}
+	}
+}
+
+
+/*******************************************************************
+
+>	OpException::OpException()
+
+	Author: 	Andy_Pennell (Xara Group Ltd) <camelotdev@xxxxxxxx>
+	Created:	20/10/93
+	Inputs:
+	Outputs:
+	Returns:
+	Purpose:	Constructor for OpException operation. It is not undoable.
+	Errors:		None
+
+*******************************************************************/
+
+OpException::OpException()
+{
+}
+
+
+
+/*******************************************************************
+
+>	OpState OpException::GetState(String_256*, OpDescriptor*)
+
+	Author: 	Andy_Pennell (Xara Group Ltd) <camelotdev@xxxxxxxx>
+	Created:	20/10/93
+	Inputs:
+	Outputs:
+	Returns:
+	Purpose:	This item is always available.
+	Errors:		None
+
+*******************************************************************/
+
+OpState OpException::GetState(String_256*, OpDescriptor*)
+{
+	OpState OpSt;
+
+	return OpSt;
+}
+
+
+/*******************************************************************
+
+>	BOOL OpException::Init()
+
+	Author: 	Andy_Pennell (Xara Group Ltd) <camelotdev@xxxxxxxx>
+	Created:	20/10/93
+	Inputs:
+	Outputs:
+	Returns:	TRUE if worked, FALSE if not.
+	Purpose:	This item is always available.
+	Errors:		Uses SetError if fails.
+	Scope:		Static
+
+*******************************************************************/
+
+BOOL OpException::Init()
+{
+
+	OpDescriptor *OpEx[4];
+	
+	OpEx[0] = new OpDescriptor(	0,
+							_R(IDM_CRASHME_PTR),
+							CC_RUNTIME_CLASS(OpException),
+							OPTOKEN_EXCEPTION_PTR,
+							OpException::GetState
+											);
+
+	OpEx[1] = new OpDescriptor(
+							0,
+							_R(IDM_CRASHME_INT),
+							CC_RUNTIME_CLASS(OpException),
+							OPTOKEN_EXCEPTION_INT,
+							OpException::GetState
+											);
+
+	OpEx[2] = new OpDescriptor( 
+							0,
+							_R(IDM_CRASHME_DBL),
+							CC_RUNTIME_CLASS(OpException),
+							OPTOKEN_EXCEPTION_DBL,
+							OpException::GetState
+											);
+
+	OpEx[3] = new OpDescriptor( 
+							0,
+							_R(IDM_CRASHME_REN),
+							CC_RUNTIME_CLASS(OpException),
+							OPTOKEN_EXCEPTION_REN,
+							OpException::GetState
+											);
+
+
+	if (!( OpEx[0] && OpEx[1] && OpEx[2] && OpEx[3]))
+		return FALSE;
+
+	return TRUE;
+}

Property changes on: Trunk/XaraLX/wxOil/exceptio.cpp
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am	(revision 1119)
+++ Trunk/XaraLX/wxOil/Makefile.am	(revision 1120)
@@ -44,7 +44,7 @@
 	outptdib.cpp outptpng.cpp outptgif.cpp gpalopt.cpp bmpfiltr.cpp giffiltr.cpp \
 	fontbase.cpp ftfonts.cpp textfuns.cpp dragbmp.cpp xpoilflt.cpp xmlutils.cpp \
 	camprocess.cpp dropdown.cpp coldrop.cpp fontdrop.cpp bfxalu.cpp bfxpixop.cpp \
-	binreloc.c \
+	binreloc.c exceptio.cpp \
 	resources.cpp
 
 # Keep resources.cpp (the autogenerated resource file) on a separate line.
Index: Trunk/XaraLX/wxOil/exceptio.h
===================================================================
--- Trunk/XaraLX/wxOil/exceptio.h	(revision 0)
+++ Trunk/XaraLX/wxOil/exceptio.h	(revision 1120)
@@ -0,0 +1,158 @@
+// $Id$
+/* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
+================================XARAHEADERSTART===========================
+ 
+               Xara LX, a vector drawing and manipulation program.
+                    Copyright (C) 1993-2006 Xara Group Ltd.
+       Copyright on certain contributions may be held in joint with their
+              respective authors. See AUTHORS file for details.
+
+LICENSE TO USE AND MODIFY SOFTWARE
+----------------------------------
+
+This file is part of Xara LX.
+
+Xara LX is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 as published
+by the Free Software Foundation.
+
+Xara LX and its component source files are distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with Xara LX (see the file GPL in the root directory of the
+distribution); if not, write to the Free Software Foundation, Inc., 51
+Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
+ADDITIONAL RIGHTS
+-----------------
+
+Conditional upon your continuing compliance with the GNU General Public
+License described above, Xara Group Ltd grants to you certain additional
+rights. 
+
+The additional rights are to use, modify, and distribute the software
+together with the wxWidgets library, the wxXtra library, and the "CDraw"
+library and any other such library that any version of Xara LX relased
+by Xara Group Ltd requires in order to compile and execute, including
+the static linking of that library to XaraLX. In the case of the
+"CDraw" library, you may satisfy obligation under the GNU General Public
+License to provide source code by providing a binary copy of the library
+concerned and a copy of the license accompanying it.
+
+Nothing in this section restricts any of the rights you have under
+the GNU General Public License.
+
+
+SCOPE OF LICENSE
+----------------
+
+This license applies to this program (XaraLX) and its constituent source
+files only, and does not necessarily apply to other Xara products which may
+in part share the same code base, and are subject to their own licensing
+terms.
+
+This license does not apply to files in the wxXtra directory, which
+are built into a separate library, and are subject to the wxWindows
+license contained within that directory in the file "WXXTRA-LICENSE".
+
+This license does not apply to the binary libraries (if any) within
+the "libs" directory, which are subject to a separate license contained
+within that directory in the file "LIBS-LICENSE".
+
+
+ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
+----------------------------------------------
+
+Subject to the terms of the GNU Public License (see above), you are
+free to do whatever you like with your modifications. However, you may
+(at your option) wish contribute them to Xara's source tree. You can
+find details of how to do this at:
+  http://www.xaraxtreme.org/developers/
+
+Prior to contributing your modifications, you will need to complete our
+contributor agreement. This can be found at:
+  http://www.xaraxtreme.org/developers/contribute/
+
+Please note that Xara will not accept modifications which modify any of
+the text between the start and end of this header (marked
+XARAHEADERSTART and XARAHEADEREND).
+
+
+MARKS
+-----
+
+Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
+designs are registered or unregistered trademarks, design-marks, and/or
+service marks of Xara Group Ltd. All rights in these marks are reserved.
+
+
+      Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
+                        http://www.xara.com/
+
+=================================XARAHEADEREND============================
+ */
+
+#include "ops.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// operations to help in debugging. They are present in both retail and debug
+// builds
+
+class OpException : public Operation
+{
+	CC_DECLARE_DYNCREATE( OpException )
+
+public:
+	OpException();
+
+	void Do(OpDescriptor*);
+
+	static OpState GetState(String_256*, OpDescriptor*);
+
+	static BOOL Init();
+    inline static void BlowUpOnCrashMe()
+		{
+			if	( RenderTrap )
+			{
+				RenderTrap = FALSE ;
+				volatile BYTE data;
+				volatile BYTE * p = &data;
+				*p = *lpByte;
+			}
+		}
+
+
+private:
+	static LPBYTE lpByte;
+	static INT32 iZero[2];
+	static double dZero[2];
+	static BOOL	RenderTrap;
+};
+
+/*******************************************************************
+
+>	void OpException::BlowUpOnCrashMe()
+
+	Author: 	Alex_Bligh (Xara Group Ltd) <camelotdev@xxxxxxxx>
+	Created:	25/02/94
+	Inputs:		None
+	Outputs:	None
+	Returns:	None
+	Purpose:	Cause an exception in rendering if we were meant to
+	Errors:		-
+
+This function is declared inline so it doesn't slow down every render
+call
+
+*******************************************************************/
+
+#define	OPTOKEN_EXCEPTION_PTR	_T("CrashPtr")
+#define	OPTOKEN_EXCEPTION_INT	_T("CrashInt")
+#define	OPTOKEN_EXCEPTION_DBL	_T("CrashDbl")
+#define OPTOKEN_EXCEPTION_REN	_T("CrashRen")
+
+

Property changes on: Trunk/XaraLX/wxOil/exceptio.h
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF


Xara