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

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1777
Date       : Wed Jul  4 11:37:58 BST 2007

Changed paths:
   M /Trunk/XaraLX/Kernel/colormgr.cpp
   M /Trunk/XaraLX/wxOil/camdoc.cpp
   M /Trunk/XaraLX/wxOil/coldrop.cpp

JLMs fix for handling files without standard colours. In 2 parts:- 1) Load a default doucment if it's needed. 2) Add some sanity checks to stop lack of standard colours causing issues.


Diff:
Index: Trunk/XaraLX/Kernel/colormgr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/colormgr.cpp	(revision 1776)
+++ Trunk/XaraLX/Kernel/colormgr.cpp	(revision 1777)
@@ -1107,7 +1107,8 @@
 	}
 
 	// Sanity check. Should never ever ever be the case, ever.
-	ERROR3IF(UsefulColour->IsDeleted(),
+	if (UsefulColour != NULL)
+		ERROR3IF(UsefulColour->IsDeleted(),
 				"ColourManager::FindColourOfInterestToUser - Colour found is DELETED!");
 
 	// Fill in the return results
Index: Trunk/XaraLX/wxOil/coldrop.cpp
===================================================================
--- Trunk/XaraLX/wxOil/coldrop.cpp	(revision 1776)
+++ Trunk/XaraLX/wxOil/coldrop.cpp	(revision 1777)
@@ -508,7 +508,8 @@
 	if (SelectIndex >= 0 && SelectIndex < (INT32)SpecialEntries.GetCount())
 		SelectedIndex = SelectIndex;
 
-	SetSelectedIndex(SelectedIndex);						// And set the appropriate selected item
+	if (Result)
+		SetSelectedIndex(SelectedIndex);						// And set the appropriate selected item
 
 	// Finally, enable the gadget, and trim its length down if necessary to fit the
 	// number of displayed items.
Index: Trunk/XaraLX/wxOil/camdoc.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camdoc.cpp	(revision 1776)
+++ Trunk/XaraLX/wxOil/camdoc.cpp	(revision 1777)
@@ -1075,8 +1075,6 @@
 		return TRUE;
 	}
 
-#ifndef EXCLUDE_FROM_XARALX
-PORTNOTE("other", "Assuming we actually do need a default document rather than asking the filter system");
 	// Find out the position of the filter selected by the user in the open dialog
 	INT32 SelectedPos = BaseFileDialog::SelectedFilter;
 
@@ -1124,9 +1122,6 @@
 	// If it is a filter family then we will have to work out what filter is actually
 	// required and hence ask that filter the qeustion.
 	if (!pFilter->IsDefaultDocRequired(pth.GetPath())) return TRUE;
-#else
-	return TRUE;
-#endif
 
 	//Graham 22/10/97: First set the template that this document is based on
 	SetTemplate(GetNextTemplateToUse());


Xara