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

[XaraXtreme-commits] Commit Complete



Commit by  : phil
Repository : xara
Revision   : 1221
Date       : Wed May 31 12:27:55 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/attraggl.cpp
   M /Trunk/XaraLX/Kernel/bitfilt.cpp
   M /Trunk/XaraLX/Kernel/debugdlg.cpp
   M /Trunk/XaraLX/Kernel/document.cpp
   M /Trunk/XaraLX/Kernel/docview.cpp
   M /Trunk/XaraLX/Kernel/drawfltr.cpp
   M /Trunk/XaraLX/Kernel/epsfiltr.cpp
   M /Trunk/XaraLX/Kernel/exprview.cpp
   M /Trunk/XaraLX/Kernel/fillattr.cpp
   M /Trunk/XaraLX/Kernel/filters.cpp
   M /Trunk/XaraLX/Kernel/htmlfltr.cpp
   M /Trunk/XaraLX/Kernel/layer.cpp
   M /Trunk/XaraLX/Kernel/makebmp.cpp
   M /Trunk/XaraLX/Kernel/sglcart.cpp
   M /Trunk/XaraLX/Kernel/spread.cpp
   M /Trunk/XaraLX/Kernel/view.cpp
   M /Trunk/XaraLX/tools/selector.cpp
   M /Trunk/XaraLX/tools/zoomops.cpp

Fixed Spread constructor and copy functions to set all member vars.
Added debug function to copy the selected chapter.
Optimised FindEnclosingSpread and called it in drag funcs.
Added PORTNOTE markers where FindFirstSpread is called without follow-up calls to FindNextSpread.


Diff:
Index: Trunk/XaraLX/tools/zoomops.cpp
===================================================================
--- Trunk/XaraLX/tools/zoomops.cpp	(revision 1220)
+++ Trunk/XaraLX/tools/zoomops.cpp	(revision 1221)
@@ -1533,6 +1533,7 @@
 
 Spread* OpZoomDescriptor::GetSpread(DocView* pDocView) const
 {
+PORTNOTE("spread", "Multi-spread warning!")
 	return pDocView->GetDoc()->FindFirstSpread();
 }
 
Index: Trunk/XaraLX/tools/selector.cpp
===================================================================
--- Trunk/XaraLX/tools/selector.cpp	(revision 1220)
+++ Trunk/XaraLX/tools/selector.cpp	(revision 1221)
@@ -3092,6 +3092,7 @@
 	else
 	{
 		Document* pDoc = Document::GetSelected();
+PORTNOTE("spread", "Multi-spread warning!")
 		Spread* pSpread = pDoc->FindFirstSpread();
 		if (pSpread != NULL)
 		{
Index: Trunk/XaraLX/Kernel/filters.cpp
===================================================================
--- Trunk/XaraLX/Kernel/filters.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/filters.cpp	(revision 1221)
@@ -1313,6 +1313,7 @@
 
 Layer *Filter::GetActiveLayer(Document *pDoc)
 {
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread *pSpread = GetFirstSpread(pDoc);
 	if (pSpread != NULL)
 		return pSpread->FindActiveLayer();
@@ -1343,6 +1344,7 @@
 BOOL Filter::MakeSureLayerExists(Document* pDoc)
 {
 	// Find the spread that all the action is happening on
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread = GetFirstSpread(pDoc);
 	if (pSpread==NULL)
 		return FALSE;
@@ -1398,6 +1400,7 @@
 	Chapter *pChapter = (Chapter *) pNode;
 	
 	// pSpread is a child of pChapter
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread *pSpread = (Spread *) pChapter->FindFirstChild();
 	ENSURE(pSpread->IsKindOf(CC_RUNTIME_CLASS(Spread)),
 		   "Filter::GetFirstSpread(): Could not find Spread");
Index: Trunk/XaraLX/Kernel/attraggl.cpp
===================================================================
--- Trunk/XaraLX/Kernel/attraggl.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/attraggl.cpp	(revision 1221)
@@ -219,6 +219,7 @@
 {
 	ASSERT(m_pDocument != NULL);
 
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* const pSpread = m_pDocument->FindFirstSpread();
 	ASSERT(pSpread != NULL);
 	
Index: Trunk/XaraLX/Kernel/drawfltr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/drawfltr.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/drawfltr.cpp	(revision 1221)
@@ -545,6 +545,7 @@
 	if (Pos == NULL)
 	{
 		// For now, position Draw objects on 1st page of spread 1
+PORTNOTE("spread", "Multi-spread warning!")
 		pSpread = GetFirstSpread(DestDoc);
 		pPage = (Page *) pSpread->FindFirstPageInSpread();
 		ENSURE(pPage->IsKindOf(CC_RUNTIME_CLASS(Page)),
Index: Trunk/XaraLX/Kernel/docview.cpp
===================================================================
--- Trunk/XaraLX/Kernel/docview.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/docview.cpp	(revision 1221)
@@ -1616,9 +1616,6 @@
 
 DocRect DocView::GetDocViewRect(Spread* pSpread)
 {
-//#pragma message( __LOCMSG__ "DocView::GetDocViewRect - do nothing" )
-//	TRACE( _T("Warning - DocView::GetDocViewRect called
") );
-//	return DocRect();
 	ERROR3IF(pViewWindow == NULL, "DocView::GetDocViewRect called when we have no view");
 
 	INT32 ClientWidth = 0;
@@ -1745,8 +1742,6 @@
 						 BOOL fDeleteRegionAfter,
 						 BOOL bForceImmediate)
 {
-//#pragma message( __LOCMSG__ "DocView::RenderView - do nothing" )
-//	TRACE( _T("Warning - DocView::RenderView called
") );
 	Node* pNode = NULL;
 	BOOL CleanUp = TRUE;							// TRUE if cleanup at end, FALSE if dont
 	BOOL IsMoreBands = FALSE;
@@ -1941,8 +1936,6 @@
 								 BOOL fDeleteRegionAfter /* = TRUE */,
 								 BOOL bForceImmediate /*= FALSE*/)
 {
-//#pragma message( __LOCMSG__ "DocView::ContinueRenderView - do nothing" )
-//	TRACE( _T("Warning - DocView::ContinueRenderView called
") );
 	// Diccon 10/5/2000 my awful flag that prevents rendering of the view from occurring
 	// whilst a brush stroke is in progress
 	if (m_bPreventRenderView == TRUE)
@@ -2021,10 +2014,6 @@
 
 void DocView::RenderEntireView(RenderRegion* pRRegion, Spread* pSpread)
 {
-//#pragma message( __LOCMSG__ "DocView::RenderEntireView - do nothing" )
-//	TRACE( _T("Warning - DocView::RenderEntireView called
") );
-//	Node* pNode = NULL;
-	
 	DocRect ClipRect;
 
 	Matrix ViewTransform = ConstructRenderingMatrix(pSpread);
@@ -2520,8 +2509,6 @@
 
 void DocView::ForceRedraw(BOOL ForcePaper)
 {
-//#pragma message( __LOCMSG__ "DocView::ForceRedraw - do nothing" )
-//	TRACE( _T("Warning - DocView::ForceRedraw called
") );
 	// Make sure we use this DocView
 	SetCurrent();
 
@@ -3071,13 +3058,11 @@
 		return;						     	// If the system is disabled, ignore
 
 	// Find the spread that contains DocPos
-	// SPECIAL NOTE Diccon 26/5/2000 - because we only have one spread at the moment
-	// I don't see why we have to go to all the trouble of FindEnclosingSpread.  By profiling
-	// I reckon we can save about 25% processing time if we use GetSelectedSpread instead.
-	// If we ever move to a multi-spread system this will have to change but for now I reckon 
-	// it will be ok
+	Spread *pSpread = FindEnclosingSpread(PointerPos);
 
-	Spread *pSpread = Document::GetSelectedSpread(); // FindEnclosingSpread(PointerPos);
+// Note GetSelectedSpread is quicker in situations where you know you only have one spread
+//		but it prevents drags on multiple spread views working properly...
+//	Spread *pSpread = Document::GetSelectedSpread();
 
 	if (pSpread == NULL)
 	{
@@ -3132,14 +3117,11 @@
 		return;						     	// If the system is disabled, ignore
 
 	// Find the spread that contains DocPos
-	// Find the spread that contains DocPos
-	// SPECIAL NOTE Diccon 26/5/2000 - because we only have one spread at the moment
-	// I don't see why we have to go to all the trouble of FindEnclosingSpread.  By profiling
-	// I reckon we can save about 25% processing time if we use GetSelectedSpread instead.
-	// If we ever move to a multi-spread system this will have to change but for now I reckon 
-	// it will be ok
+	Spread *pSpread = FindEnclosingSpread(PointerPos);
 
-	Spread *pSpread = Document::GetSelectedSpread(); // FindEnclosingSpread(PointerPos);
+// Note GetSelectedSpread is quicker in situations where you know you only have one spread
+//		but it prevents drags on multiple spread views working properly...
+//	Spread *pSpread = Document::GetSelectedSpread();
 
 	if (pSpread == NULL)
 	{
@@ -3861,7 +3843,7 @@
 	Matrix RenderMatrix = ConstructRenderingMatrix(pSpread);
 
 	// Make render region for intersection between spread and cliprect.
-	// (Cliprect is still bodged)
+	// (Cliprect is still d)
 	DocRect SpreadClipRect = pSpread->GetWidePasteboard(this);
 
 	// Convert the coord to spread coords
@@ -4213,7 +4195,6 @@
 Spread *DocView::FindEnclosingSpread(OilCoord Pos)
 {
 	// Find first spread in chapter
-	Spread *pSpread = NULL;
 	Chapter* pChapter = Node::FindFirstChapter(pDoc);
 	if (pChapter==NULL)
 	{
@@ -4221,10 +4202,19 @@
 		return NULL;
 	}
 
+	Spread* pSpread = (Spread*)pChapter->FindFirstChild();
+	ERROR3IF((pSpread == NULL) || !pSpread->IsSpread(), "Chapter has no spreads");
+
+	// Optimisation for simple documents:
+	// If only one chapter containing only one spread then that must be the
+	// enclosing spread!
+	if (pSpread && pSpread->FindNext()==NULL && pChapter->FindNext()==NULL)
+		return pSpread;
+
 	// If the cursor was above the top of the document, then return the first spread
 	// if there is one
 	if (Pos.y >= 0)
-		return (Spread*)pChapter->FindFirstChild();
+		return pSpread;
 
 	// Find this position in 64-bit work coords
 	WorkCoord WorkPos = Pos.ToWork( pVState->GetScrollPos() );
@@ -4232,7 +4222,7 @@
 	do
 	{
 		pSpread = (Spread *) pChapter->FindFirstChild();
-		ERROR3IF((pSpread == NULL) || !pSpread->IsKindOf(CC_RUNTIME_CLASS(Spread)), 
+		ERROR3IF((pSpread == NULL) || !pSpread->IsSpread(), 
 				"Chapter has no spreads");
 
 		do
@@ -4253,7 +4243,7 @@
 
 			// try next spread
 			pSpread = (Spread *) pSpread->FindNext();
-			ERROR3IF((pSpread != NULL) && !(pSpread->IsKindOf(CC_RUNTIME_CLASS(Spread))),
+			ERROR3IF((pSpread != NULL) && !(pSpread->IsSpread()),
 					"Spread is not a Spread!");
 
 		} while (pSpread != NULL);
@@ -5270,6 +5260,7 @@
 	Document* pDocument=GetDoc();
 
 	//And find the first spread in that document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread=pDocument->FindFirstSpread();
 
 	//Check we got both of those
@@ -5316,6 +5307,7 @@
 	Document* pDocument=GetDoc();
 
 	//And find the first spread in that document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread=pDocument->FindFirstSpread();
 
 	//Now get the DocCoord in the centre of the view
@@ -5353,6 +5345,7 @@
 	Document* pDocument=GetDoc();
 
 	//And find the first spread in that document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread=pDocument->FindFirstSpread();
 
 	//Check we got both of those
@@ -5397,6 +5390,7 @@
 	Document* pDocument=GetDoc();
 
 	//And find the first spread in that document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread=pDocument->FindFirstSpread();
 
 	//Now get the DocCoord in the top left of the view
Index: Trunk/XaraLX/Kernel/exprview.cpp
===================================================================
--- Trunk/XaraLX/Kernel/exprview.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/exprview.cpp	(revision 1221)
@@ -179,6 +179,7 @@
 	// Connect this view state to this view
 	pVState->pView = this;
 
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread = pDoc->FindFirstSpread();
 	DocView* pView = pDoc->GetFirstDocView();
 
@@ -616,6 +617,7 @@
 	m_Bpp	= Bpp;
 
 	// Convert clip rect to OIL coords
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread = pDoc->FindFirstSpread();
 	ERROR2IF(!pSpread, FALSE, "pSpread NULL");
 
Index: Trunk/XaraLX/Kernel/fillattr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/fillattr.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/fillattr.cpp	(revision 1221)
@@ -698,6 +698,7 @@
 			Pixel32bpp Pix;
 
 			Document* TheDoc = Document::GetCurrent();
+PORTNOTE("spread", "Multi-spread warning! Should use the passed in spread pointer?")
 			pSpread = TheDoc->FindFirstSpread ();
 
 			if (TheDoc != NULL)
Index: Trunk/XaraLX/Kernel/htmlfltr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/htmlfltr.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/htmlfltr.cpp	(revision 1221)
@@ -667,6 +667,7 @@
 			return FALSE;
 		
 		Spread *pSpread = NULL;
+PORTNOTE("spread", "Multi-spread warning!")
 		pSpread = GetFirstSpread(DestDoc);
 
 		// can't be NULL
@@ -1173,6 +1174,7 @@
 	INT32 iReturned=0;
 
 	//Now get the first spread in the document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* psprFirst=pdocTarget->FindFirstSpread();
 
 	//Do some checking
Index: Trunk/XaraLX/Kernel/layer.cpp
===================================================================
--- Trunk/XaraLX/Kernel/layer.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/layer.cpp	(revision 1221)
@@ -3460,6 +3460,7 @@
 			case ColourChangingMsg::LISTUPDATED:
 				if (Msg->ScopeDoc != NULL)
 				{
+PORTNOTE("spread", "Multi-spread warning!")
 					Spread* pSpread = Msg->ScopeDoc->FindFirstSpread();
 					if (pSpread != NULL)
 					{
@@ -3473,6 +3474,7 @@
 			case ColourChangingMsg::COLOURUPDATED:
 				if (Msg->ScopeDoc != NULL)
 				{
+PORTNOTE("spread", "Multi-spread warning!")
 					Spread* pSpread = Msg->ScopeDoc->FindFirstSpread();
 					if (pSpread != NULL)
 					{
Index: Trunk/XaraLX/Kernel/spread.cpp
===================================================================
--- Trunk/XaraLX/Kernel/spread.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/spread.cpp	(revision 1221)
@@ -125,6 +125,9 @@
 #include "nodedoc.h"
 #include "backgrnd.h"	// OpBackground
 #include "animparams.h"
+#include "progress.h"
+#include "docview.h"
+#include "optsmsgs.h"
 
 //#include "prevwres.h"	// _R(IDS_TAG_LAYER_FRAMEPROPS)
 //#include "frameops.h" // for OpGrabAllFrames
@@ -174,6 +177,11 @@
 {   
 	UserOrigin				= DocCoord(0, 0);
 	SpreadOrigin			= DocCoord(0, 0);
+   	BleedOffset				= 36000;
+	ShowDropShadow			= TRUE;
+	RalphDontShowPaper		= FALSE;
+	//AnimPropertiesParam	= constructed
+	//SpreadDimScale		= constructed
 }                    
  
 
@@ -452,9 +460,10 @@
 
 	// Find out the Clip rect of the render region to help decide which rectangles to try to draw
 	DocRect SpreadPasteboard = GetWidePasteboard(pRender->GetRenderView());
+
 	DocCoordToSpreadCoord(&SpreadPasteboard);
 
-	Page* CurrentPage = FindFirstPageInSpread(); 
+	Page* CurrentPage = FindFirstPageInSpread();
 	
 	// --- Divide the pasteboard up into filled rectangles and render them ---
 	
@@ -470,7 +479,7 @@
 #endif
 	// colour the pasteboard white to hide it if we're in ralph DRAWING_VIEW mode
 	// ( this flag is set in Render() )
-	if(RalphDontShowPaper)	
+	if (RalphDontShowPaper)	
 		COLOUR_PASTEBOARD = DocColour(255L, 255L, 255L);
 	
 	COLOUR_PASTEBOARD.SetSeparable(FALSE);		// Don't colour-separate the pasteboard
@@ -893,12 +902,13 @@
 							"a node pointed to by a NULL pointer"); 
 	NodeRenderablePaper::CopyNodeContents(NodeCopy); 
 	
-	// Copy those little extras across
 	NodeCopy->BleedOffset = BleedOffset;
-
 	NodeCopy->ShowDropShadow = ShowDropShadow;
-	
+	NodeCopy->SpreadOrigin = SpreadOrigin;
+	NodeCopy->UserOrigin = UserOrigin;
 	NodeCopy->m_AnimPropertiesParam = m_AnimPropertiesParam;
+	NodeCopy->SpreadDimScale = SpreadDimScale;
+	NodeCopy->RalphDontShowPaper = RalphDontShowPaper;
 }
 
   	      
@@ -1725,7 +1735,7 @@
 		MILLIPOINT Page2Height = PageRect.Height();	
 
 		// lox,loy,hix,hiy
-		if (Page2Rect.lox == PageRect.hix && Page2Rect.loy == PageRect.loy &&
+		if (Page2Rect.lo.x == PageRect.hi.x && Page2Rect.lo.y == PageRect.lo.y &&
 			Page2Width == PageWidth && Page2Height == PageHeight)
 		{
 			if (Dps != NULL)
@@ -3161,7 +3171,7 @@
 {
 #if NEW_PASTEBOARD
 #error ("This code has been commented out for safety. Please uncomment and try again");
-/*
+
 	Progress Hourglass;		// Ensure an hourglass is running while we're busy
 
 	// Convert the Spread coordinates "IncludeRect" into Document coordinates "IncludeDocRect"
@@ -3233,7 +3243,7 @@
 	{
 		// Pretend that page size has changed to cause related UI to change (rulers mainly)
 		BROADCAST_TO_ALL(OptionsChangingMsg(pParentDoc,
-							OptionsChangingMsg::OptionsState::NEWPAGESIZE));
+							OptionsChangingMsg::NEWPAGESIZE));
 	}
 
 	// Try to keep the scroll offsets sensible
@@ -3249,7 +3259,7 @@
 	}
 
 	return(TRUE);			// return - successful
-*/
+
 #else
 	// Pasteboard can never expand. Sniffle, Sob!
 	// We return TRUE if the pasteboard already includes the specified rectangle, and
@@ -3340,8 +3350,8 @@
 			// Construct a new Pasteboard rectangle of the correct size, and move it
 			// to lie just below the previous spread's pasteboard area
 			TempPasteRect = SecondPasteRect;
-			TempPasteRect.Translate(-TempPasteRect.lox, -TempPasteRect.loy);
-			TempPasteRect.Translate(FirstPasteRect.lox, FirstPasteRect.loy - TempPasteRect.Height()); 
+			TempPasteRect.Translate(-TempPasteRect.lo.x, -TempPasteRect.lo.y);
+			TempPasteRect.Translate(FirstPasteRect.lo.x, FirstPasteRect.lo.y - TempPasteRect.Height()); 
 
 			// And force the x extent of this pasteboard to match all others in this chapter
 			TempPasteRect.lo.x = ChapterBounds.lo.x;
@@ -3350,11 +3360,11 @@
 			// Move the spread coordinate origin so that it stays at the same relative offset
 			// from the pasteboard bottom left corner, or else all objects inside the spread
 			// will suddenly shift to a new place on (or off) the pasteboard!
-			DocCoord OriginOffset(pNextSpread->SpreadOrigin.x - pNextSpread->PasteboardRect.lox,
-									pNextSpread->SpreadOrigin.y - pNextSpread->PasteboardRect.loy);
+			DocCoord OriginOffset(pNextSpread->SpreadOrigin.x - pNextSpread->PasteboardRect.lo.x,
+									pNextSpread->SpreadOrigin.y - pNextSpread->PasteboardRect.lo.y);
 
-			pNextSpread->SpreadOrigin.x = TempPasteRect.lox + OriginOffset.x;
-			pNextSpread->SpreadOrigin.y = TempPasteRect.loy + OriginOffset.y;
+			pNextSpread->SpreadOrigin.x = TempPasteRect.lo.x + OriginOffset.x;
+			pNextSpread->SpreadOrigin.y = TempPasteRect.lo.y + OriginOffset.y;
 
 			// Set the new paste rect
 			pNextSpread->ChangePasteboardRect(TempPasteRect);
Index: Trunk/XaraLX/Kernel/view.cpp
===================================================================
--- Trunk/XaraLX/Kernel/view.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/view.cpp	(revision 1221)
@@ -693,8 +693,6 @@
 
 void View::RenderPaper(RenderRegion* pRRegion, Spread* pSpread)
 {
-//#pragma message( __LOCMSG__ "View::RenderPaper - do nothing" )
-//	TRACE( _T("Warning - View::RenderPaper called
") );
 	// We always want paper to render to the same display quality level.
 	pRRegion->SetDefaultQuality();
 
@@ -703,6 +701,7 @@
 	// First render all the paper nodes in the tree through the given RenderRegion...
 	while (pn != NULL)
 	{
+//TRACEUSER("Phil", _T("RenderPaper for %x - %x
"), pSpread, pn);
 		pn->Render(pRRegion);
 		pn = pn->FindNextForClippedPaperRender();
 	}
Index: Trunk/XaraLX/Kernel/sglcart.cpp
===================================================================
--- Trunk/XaraLX/Kernel/sglcart.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/sglcart.cpp	(revision 1221)
@@ -1670,6 +1670,7 @@
 #if 1	// Do an Export of the file as a png thumbnail file to the "XaraInfo" directory
 
 							Document* OurDocument = pDoc->GetKernelDoc();
+PORTNOTE("spread", "Multi-spread warning!")
 							Spread* OurSpread = OurDocument->FindFirstSpread();
 							Layer* pLayer = OurSpread->FindFirstLayer();
 							DocRect Bounds;
Index: Trunk/XaraLX/Kernel/epsfiltr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/epsfiltr.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/epsfiltr.cpp	(revision 1221)
@@ -4959,6 +4959,7 @@
 	TheDocument = pDoc;
 
 	// Get pointer to the spread to export.
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread *pSpread = GetFirstSpread(pDoc);
 
 	// Set up device context and render region for this export.
Index: Trunk/XaraLX/Kernel/bitfilt.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bitfilt.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/bitfilt.cpp	(revision 1221)
@@ -2437,6 +2437,7 @@
 	pExportBitmap = NULL;
 
 	// Get pointer to the spread to export.
+PORTNOTE("spread", "Multi-spread warning!")
 	pSpread = GetFirstSpread(pDoc);
 	ERROR2IF(pSpread == NULL, FALSE,"BaseCamelotFilter::DoExport no spread to export");
 
@@ -2921,6 +2922,7 @@
 		}
 
 		// Get pointer to the spread to export.
+PORTNOTE("spread", "Multi-spread warning!")
 		pSpread = GetFirstSpread(pDoc);
 
 		UINT32 BitmapCount = pParam->GetBitmapCount();
@@ -3009,6 +3011,7 @@
 	Document *pDoc = Document::GetCurrent();
 
 	// Get pointer to the spread to export.
+PORTNOTE("spread", "Multi-spread warning!")
 	pSpread = GetFirstSpread(pDoc);
 	ERROR2IF(pSpread == NULL, FALSE,"BaseCamelotFilter::DoExport no spread to export");
 
@@ -3146,6 +3149,7 @@
 	}
 
 	// set up the pSpread
+PORTNOTE("spread", "Multi-spread warning!")
 	pSpread = GetFirstSpread(pDoc);
 
 	// deal with no selection
@@ -4213,6 +4217,7 @@
 		ERROR2IF(pdocCurrent==NULL, DocRect(0,0,0,0), "BaseBitmapFilter - no current document");
 
 		//And finally the current spread
+PORTNOTE("spread", "Multi-spread warning!")
 		pSpread=GetFirstSpread(pdocCurrent);
 		ERROR2IF(pSpread==NULL, DocRect(0,0,0,0), "BaseBitmapFilter - no spread");
 	}
Index: Trunk/XaraLX/Kernel/makebmp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/makebmp.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/makebmp.cpp	(revision 1221)
@@ -562,6 +562,7 @@
 	pExportBitmap = NULL;
 
 	// Get pointer to the spread to export.
+PORTNOTE("spread", "Multi-spread warning!")
 	pSpread = GetFirstSpread(pDoc);
 
 	// remember the document in the class variable
@@ -802,6 +803,7 @@
 	DocRect SelRect = GetApplication()->FindSelection()->GetBoundingRect();
 
 	// For now, position Draw objects on 1st page of spread 1
+PORTNOTE("spread", "Multi-spread warning!")
 	pSpread = GetFirstSpread(DestDoc);
 	Page *pPage = (Page *) pSpread->FindFirstPageInSpread();
 	ERROR3IF(!pPage->IsKindOf(CC_RUNTIME_CLASS(Page)),
Index: Trunk/XaraLX/Kernel/document.cpp
===================================================================
--- Trunk/XaraLX/Kernel/document.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/document.cpp	(revision 1221)
@@ -4300,6 +4300,7 @@
 BOOL Document::ExportOriginInfo(EPSExportDC *pDC)
 {
 	// find the first (and currently) only spread
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread = FindFirstSpread();
 	ERROR2IF(pSpread==NULL,FALSE,"Document::ExportOriginInfo() - could not find spread");
 	NodeGrid* pDefaultGrid = pSpread->FindFirstDefaultGridInSpread();
@@ -6129,6 +6130,7 @@
 INT32 Document::GetNumLayers()
 {
 	//Find the first spread in the document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread = FindFirstSpread();
 
 	//Now find the first layer in that spread
@@ -6165,6 +6167,7 @@
 BOOL Document::IsAnimated()
 {
 	//Find the first spread in the document
+PORTNOTE("spread", "Multi-spread warning!")
 	Spread* pSpread = FindFirstSpread();
 
 	//Find the first frame layer in that spread
Index: Trunk/XaraLX/Kernel/debugdlg.cpp
===================================================================
--- Trunk/XaraLX/Kernel/debugdlg.cpp	(revision 1220)
+++ Trunk/XaraLX/Kernel/debugdlg.cpp	(revision 1221)
@@ -163,6 +163,7 @@
 
 #include "opliveeffects.h"
 //#include "xpehost.h"
+#include "spread.h"
 
 #include <time.h>
 #include <stdlib.h>
@@ -579,7 +580,7 @@
 #if FALSE
 	ADDGROUP("Script Execution");			// Group 10
 #endif
-	ADDGROUP("Live Effects");				// Group 10
+	ADDGROUP("Phil Debug");					// Group 10
 	ADDGROUP("Gerry Debug");				// Group 11
 	// Add more groups here...
 
@@ -721,6 +722,7 @@
 			ADDCOMMAND("Invoke IXaraPhotoEditor3");						// Command 1
 			ADDCOMMAND("End IXaraPhotoEditor3 Session");				// Command 2
 			ADDCOMMAND("Dump Bitmap Cache");							// Command 3
+			ADDCOMMAND("Create new spread");							// Command 4
 			break;
 
 		case 11:	// Gerry Debug ------------------------------------------
@@ -1025,6 +1027,9 @@
 				case 3:
 					Description = TEXT("Dump a description of the bitmap cache to the debug output");
 					break;
+				case 4:
+					Description = TEXT("Create a second spread! OOER!");
+					break;
 			}
 			break;
 
@@ -1645,6 +1650,22 @@
 						pCache->DebugDump();
 					}
 					break;
+				case 4:
+					{
+#if NEW_PASTEBOARD
+						Spread* pSpread = Document::GetSelectedSpread();
+						Spread* pNewSpread = NULL;
+						pSpread->NodeCopy((Node**)&pNewSpread);
+						if (pNewSpread)
+						{
+							pNewSpread->AttachNode(pSpread, NEXT);
+							pSpread->AdjustPasteboards();
+						}
+#else
+						InformWarning(_R(IDS_SPREADTESTWARNING));
+#endif
+					}
+					break;
 				}
 			}
 			break;


Xara