Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.2 KiB

  1. /****************************************************************************
  2. Unit Bufio; Implementation
  3. *****************************************************************************
  4. Error handles all the interpretation, metafile creation, or read failures
  5. that may occur during the course of the translation.
  6. Currently it only supports saving a single error into a global variable.
  7. Module Prefix: Er
  8. ****************************************************************************/
  9. #include "headers.c"
  10. #pragma hdrstop
  11. #ifndef _OLECNV32_
  12. #define IMPDEFS
  13. #include "errdefs.h" /* Aldus error return codes */
  14. #endif
  15. /*********************** Exported Data **************************************/
  16. /*********************** Private Data ***************************************/
  17. OSErr globalError; /* not declared private for macro calls */
  18. /*********************** Private Function Definitions ***********************/
  19. /*********************** Function Implementation ****************************/
  20. #ifndef _OLECNV32_
  21. OSErr ErInternalErrorToAldus( void )
  22. /*==========================*/
  23. /* returns the appropriate Aldus error code given the current global error */
  24. {
  25. switch (globalError)
  26. {
  27. case ErNoError : return NOERR;
  28. case ErInvalidVersion :
  29. case ErInvalidVersionID :
  30. case ErBadHeaderSequence : return IE_NOT_MY_FILE;
  31. case ErCreateMetafileFail :
  32. case ErCloseMetafileFail :
  33. case ErMemoryFull : return IE_MEM_FULL;
  34. case ErMemoryFail : return IE_MEM_FAIL;
  35. case ErNullBoundingRect :
  36. case ErReadPastEOF : return IE_BAD_FILE_DATA;
  37. case ErEmptyPicture : return IE_NOPICTURES;
  38. case Er32KBoundingRect : return IE_TOO_BIG;
  39. case ErNoDialogBox :
  40. case ErOpenFail :
  41. case ErReadFail : return IE_IMPORT_ABORT;
  42. case ErNoSourceFormat :
  43. case ErNonSquarePen :
  44. case ErInvalidXferMode :
  45. case ErNonRectRegion : return IE_UNSUPP_VERSION;
  46. default : return IE_IMPORT_ABORT;
  47. }
  48. }
  49. #endif