[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : luke
Repository : xara
Revision : 805
Date : Wed Apr 12 12:03:42 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/impexpop.cpp
M /Trunk/XaraLX/wxOil/filedlgs.cpp
M /Trunk/XaraLX/wxOil/oilbitmap.cpp
Completed changes needed to import PNG\JPEG bitmaps
Diff:
Index: Trunk/XaraLX/Kernel/impexpop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/impexpop.cpp (revision 804)
+++ Trunk/XaraLX/Kernel/impexpop.cpp (revision 805)
@@ -345,6 +345,7 @@
// Remember the filter for next time.
SelectedFilter = FDialog.GetSelectedFilterIndex();
+ TRACEUSER( "luke", _T("Looking for ordinal %d"), SelectedFilter );
// Get the filename, ensuring that the path is valid
PathName Path;
@@ -366,17 +367,29 @@
Filter *pFilter = Filter::GetFirst();
while (pFilter != 0)
{
+ if( NULL != pFilter->pOILFilter )
+ {
PORTNOTE("other", "Removed CamelotEPSFilter check" )
#if !defined(EXCLUDE_FROM_XARALX)
- if( ( pFilter->GetFlags().CanImport && !IS_A( pFilter, CamelotEPSFilter ) ) &&
+ if( ( pFilter->GetFlags().CanImport && !IS_A( pFilter, CamelotEPSFilter ) ) &&
#else
- if( pFilter->GetFlags().CanImport &&
+ if( pFilter->GetFlags().CanImport &&
#endif
- NULL != pFilter->pOILFilter && pFilter->pOILFilter->Position == SelectedFilter )
- {
- // This is the filter!
- break;
+ pFilter->pOILFilter->Position == SelectedFilter )
+ {
+ TRACEUSER( "luke", _T("%s is THE filter (%d)"),
+ (TCHAR*)pFilter->FilterName, pFilter->pOILFilter->Position );
+
+ // This is the filter!
+ break;
+ }
+
+ TRACEUSER( "luke", _T("%s is not selected (ord=%d)"),
+ (TCHAR*)pFilter->FilterName, pFilter->pOILFilter->Position );
}
+ else
+ TRACEUSER( "luke", _T("Can't handle NULL pFilter->pOILFilter for %s"),
+ (TCHAR*)pFilter->FilterName );
// Try the next filter
pFilter = Filter::GetNext(pFilter);
Index: Trunk/XaraLX/wxOil/oilbitmap.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilbitmap.cpp (revision 804)
+++ Trunk/XaraLX/wxOil/oilbitmap.cpp (revision 805)
@@ -111,9 +111,9 @@
#include "camelot.h"
#include "bitmpinf.h"
//#include "rndrgn.h"
-//#include "nativeps.h" // The old style EPS native filter, used in v1.1
+#include "nativeps.h" // The old style EPS native filter, used in v1.1
#include "saveeps.h"
-//#include "cameleps.h"
+#include "cameleps.h"
//#include "bmpfiltr.h"
//#include "giffiltr.h" // TI_GIFFilter
//#include "gifutil.h"
@@ -2791,8 +2791,6 @@
BOOL CWxBitmap::ImportBitmap(Filter *pFilter, const BitmapInfo *pInfo, INT32 BitmapType)
{
- PORTNOTETRACE("other","CWxBitmap::ImportBitmap - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
// Check to see what the specified filter type is and take the appropriate action
// If a bitmap type of filter (derived off BaseBitmapFilter) e.g. BMPFilter or
// AccusoftFilters then pInfo will be NULL and we just need to load the bitmap in
@@ -2812,13 +2810,15 @@
return FALSE;
}
-
+PORTNOTETRACE("other","Removed CamelotNativeEPSFilter usage");
+#ifndef EXCLUDE_FROM_XARALX
if (!pFilter->IsKindOf(CC_RUNTIME_CLASS(CamelotEPSFilter)))
{
ENSURE(FALSE, "Trying to import a bitmap with a non-Camelot EPS filter");
return FALSE;
}
-
+#endif
+
// Sanity checks
ENSURE((pInfo->PixelDepth == 1) ||
(pInfo->PixelDepth == 4) ||
@@ -2888,6 +2888,8 @@
// And read in the image data
// if (IsUserName("Alex")) if (BitmapType !=0) return(TRUE);
+PORTNOTETRACE("other","Removed CamelotNativeEPSFilter usage");
+#ifndef EXCLUDE_FROM_XARALX
// Read in the Bitmap info
if (pFilter->IsKindOf(CC_RUNTIME_CLASS(CamelotNativeEPSFilter)))
{
@@ -2904,11 +2906,12 @@
return TRUE;
}
else
+#endif
{
// Load it all in, in one go.
return pEPSFilter->ImportBinary(BMBytes, BMInfo->bmiHeader.biSizeImage);
}
-#endif
+
// Should not get here really.
return FALSE;
}
Index: Trunk/XaraLX/wxOil/filedlgs.cpp
===================================================================
--- Trunk/XaraLX/wxOil/filedlgs.cpp (revision 804)
+++ Trunk/XaraLX/wxOil/filedlgs.cpp (revision 805)
@@ -638,7 +638,7 @@
}
// Construct the string, and set up the position numbers for the filters.
- UINT32 Position = 1;
+ UINT32 Position = 0;
FilterString[0] = 0;
pFilter = Filter::GetFirst();
@@ -748,10 +748,7 @@
INT32 BaseFileDialog::SetSelectedFilterIndex(INT32 NewIndex)
{
INT32 Old = GetFilterIndex();
- // Must not set this to zero as this is illegal
- ERROR3IF(NewIndex == 0, "BaseFileDialog::SetSelectedFilterIndex Trying to set bad index ");
- if (NewIndex != 0)
- SetFilterIndex( NewIndex );
+ SetFilterIndex( NewIndex );
TRACEUSER( "Neville", _T("SetSelectedFilterIndex - new %d (old = %d)
"), NewIndex, Old);
return Old;
}
@@ -831,7 +828,7 @@
BOOL BaseFileDialog::GetChosenFileName(PathName * pName)
{
- pName->SetPathName( GetFilename() );
+ pName->SetPathName( GetPath() );
return pName->IsValid();
}
@@ -885,7 +882,7 @@
{
//We've found it
//So set this as the selected filter
- SetSelectedFilterIndex(pFilter->pOILFilter->Position);
+ SetSelectedFilterIndex( pFilter->pOILFilter->Position );
return;
}
pFilter = Filter::GetNext(pFilter);
@@ -2498,7 +2495,7 @@
return NULL;
// Construct the string, and set up the position numbers for the filters.
- UINT32 Position = 1;
+ UINT32 Position = 0;
FilterString[0] = 0;
pFilter = Filter::GetFirst();
Xara