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

[XaraXtreme-commits] Commit Complete



Commit by  : phil
Repository : xara
Revision   : 814
Date       : Thu Apr 13 17:05:32 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/bitfilt.cpp
   M /Trunk/XaraLX/Kernel/impexpop.cpp
   M /Trunk/XaraLX/Kernel/ngprop.cpp
   M /Trunk/XaraLX/Kernel/ngsentry.cpp

Removed more conditional stuff for bitmap export.


Diff:
Index: Trunk/XaraLX/Kernel/ngsentry.cpp
===================================================================
--- Trunk/XaraLX/Kernel/ngsentry.cpp	(revision 813)
+++ Trunk/XaraLX/Kernel/ngsentry.cpp	(revision 814)
@@ -405,7 +405,7 @@
 	CXaraFileRecord rec(TAG_SETPROPERTY, TAG_SETPROPERTY_SIZE);
 	if (!rec.Init() ||
 		!rec.WriteUnicode(m_strName) ||
-		!rec.WriteINT16((short) SGNameProp::nPropertyCount))
+		!rec.WriteINT16((INT16) SGNameProp::nPropertyCount))
 	{
 		pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
 		return FALSE;
@@ -414,8 +414,8 @@
 	// Write out each property in ascending index order.
 	for (INT32 i = 0; i < SGNameProp::nPropertyCount; i++)
 	{
-		ERROR3IF(m_pProp[i] == 0, "NodeSetProperty::WritePreChildrenNative: no property");
-		if (!rec.WriteINT16((short) i) || !m_pProp[i]->Write(&rec))
+		ERROR3IF(m_pProp[i] == NULL, "NodeSetProperty::WritePreChildrenNative: no property");
+		if (!rec.WriteINT16((INT16) i) || !m_pProp[i]->Write(&rec))
 		{
 			pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
 			return FALSE;			
Index: Trunk/XaraLX/Kernel/bitfilt.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bitfilt.cpp	(revision 813)
+++ Trunk/XaraLX/Kernel/bitfilt.cpp	(revision 814)
@@ -4496,8 +4496,6 @@
 {
 	if (pSpread != NULL && pOptions != NULL)
 	{
-PORTNOTE("filters","Removed BitmapExportOptions usage")
-#ifndef EXCLUDE_FROM_XARALX
 		return GenerateOptimisedPalette(pSpread,
 										pOptions->GetDepth(), 
 										pOptions->GetDPI(),
@@ -4505,7 +4503,6 @@
 										pOptions->GetNumColsInPalette(),
 										pOptions->GetUseSystemColours()
 										);
-#endif
 	}
 
 	return FALSE;
@@ -4764,11 +4761,8 @@
 ********************************************************************************************/
 BitmapExportOptions* BaseBitmapFilter::GetBitmapExportOptions() const
 {
-PORTNOTE("filters","Removed BitmapExportOptions usage")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR3IF(m_pExportOptions != NULL && !m_pExportOptions->IS_KIND_OF(BitmapExportOptions), 
+	ERROR3IF(m_pExportOptions != NULL && !m_pExportOptions->IS_KIND_OF(BitmapExportOptions),
 			"m_pExportOptions isn't");
-#endif
 	return m_pExportOptions;
 }
 
@@ -4787,11 +4781,9 @@
 
 BOOL BaseBitmapFilter::SetExportOptions ( BitmapExportOptions*	pOptions )
 {
-PORTNOTE("filters","Removed BitmapExportOptions usage")
-#ifndef EXCLUDE_FROM_XARALX
 	ERROR3IF ( pOptions != NULL && !pOptions->IS_KIND_OF ( BitmapExportOptions ),
 			   "BitmapExportOptions is wrong kind" );
-#endif
+
 	// Don't delete the old options unless specifically requested. This is to avoid the nasty
 	// access violations that might occur otherwise.
 
Index: Trunk/XaraLX/Kernel/impexpop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/impexpop.cpp	(revision 813)
+++ Trunk/XaraLX/Kernel/impexpop.cpp	(revision 814)
@@ -1180,10 +1180,7 @@
 			if (pOptions)
 			{
 				Filter * pOldFilter = pFilter;
-PORTNOTE("other", "Removed BitmapExportOptions usage" )
-#if !defined(EXCLUDE_FROM_XARALX)
 				pFilter = pOptions->FindBitmapFilterForTheseExportOptions();
-#endif
 				// change the export extent if we have changed filters
 				if (pFilter && pFilter != pOldFilter)
 				{
Index: Trunk/XaraLX/Kernel/ngprop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/ngprop.cpp	(revision 813)
+++ Trunk/XaraLX/Kernel/ngprop.cpp	(revision 814)
@@ -574,8 +574,6 @@
   : SGNameProp(strName, NamedExportProp::nIndex),
 	m_pOptions(0)
 {
-	PORTNOTETRACE("filters","NamedExportProp::NamedExportProp - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
 	// Create a default export path from the menu operation's default and the set name.
 	// If there is no implied extension in the set's name then use the default export
 	// format (ie. JPEG).
@@ -583,7 +581,14 @@
 	if( !OpMenuExport::DefaultExportFilterPath.IsEmpty() )
 		strPath = OpMenuExport::DefaultExportFilterPath;
 	else
+{
+PORTNOTE("other","Removed use of GetCurrentDirectory")
+#ifndef EXCLUDE_FROM_XARALX
 		FileUtil::GetCurrentDirectory( &strPath );
+#else
+		strPath = _T("Bodginess abounds.");
+#endif
+}
 
 	// Construct a path and set the default extension (export type) if necessary.
 	strPath += TEXT("\");
@@ -598,6 +603,7 @@
 		 m_pFilter != 0;
 		 m_pFilter = Filter::GetNext(m_pFilter))
 			if (m_pFilter->GetFlags().CanExport &&
+				m_pFilter->pOILFilter &&
 				m_pFilter->pOILFilter->DoesExtensionOfPathNameMatch(&pth))
 					break;
 
@@ -620,7 +626,6 @@
 
 		m_pOptions->RetrieveDefaults();
 	}
-#endif
 }
 
 /***********************************************************************************************
@@ -654,10 +659,7 @@
 {
 	if (m_pOptions != NULL)
 	{
-	PORTNOTETRACE("filters","NamedExportProp::~NamedExportProp - not deleting m_pOptions");
-#ifndef EXCLUDE_FROM_XARALX
 		delete m_pOptions;
-#endif
 		m_pOptions = NULL;
 	}
 }
@@ -743,17 +745,12 @@
 {
 	if (m_pOptions != NULL)
 	{
-	PORTNOTETRACE("filters","NamedExportProp::SetOptions - not deleting m_pOptions");
-#ifndef EXCLUDE_FROM_XARALX
 		delete m_pOptions;
-#endif
 		m_pOptions = NULL;
 	}
 
-PORTNOTE("filters","Removed BitmapExportOptions usage")
-#ifndef EXCLUDE_FROM_XARALX
 	if (pOptions != 0) m_pOptions = pOptions->MakeCopy();
-#endif
+
 	return m_pOptions;
 }
 
@@ -805,17 +802,12 @@
 	if (m_pFilter == 0) return pRec->WriteUINT32(FILTERID_NONE);
 	ERROR3IF(m_pOptions == 0, "NamedExportProp::Write: no options");
 	
-PORTNOTE("filters","Removed BitmapExportOptions usage")
-#ifndef EXCLUDE_FROM_XARALX
 	// Write out the filter ID, the path to the target file, the export options
 	// class name, and the export options object.
 	return pRec->WriteUINT32(m_pFilter->FilterID) &&
 		   pRec->WriteUnicode((LPTSTR) (LPCTSTR) m_Path.GetPath()) &&
-		   pRec->WriteASCII((LPSTR) m_pOptions->GetRuntimeClass()->GetClassName() ) &&
+		   pRec->WriteASCII((LPTSTR) m_pOptions->GetRuntimeClass()->GetClassName() ) &&
 		   m_pOptions->Write(pRec);
-#else
-	return FALSE;
-#endif
 }
 
 /********************************************************************************************
@@ -860,18 +852,10 @@
 	}
 
 	// Delete the existing bitmap options. This prevents a memory leak on shutdown.
-	PORTNOTETRACE("filters","NamedExportProp::Read - not deleting m_pOptions");
-#ifndef EXCLUDE_FROM_XARALX
 	delete m_pOptions;
-#endif
 
-PORTNOTE("filters","Removed BitmapExportOptions usage")
-#ifndef EXCLUDE_FROM_XARALX
 	m_pOptions = static_cast<BitmapExportOptions*> ( pClass->CreateObject () );
 	return ( m_pOptions != 0 && m_pOptions->Read ( pRec ) );
-#else
-	return FALSE;
-#endif
 }
 
 /***********************************************************************************************


Xara