Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 2924) +++ trunk/src/buffer.c (revision 2925) @@ -771,12 +771,12 @@ * parse the file with enabled 'PCB mode' (see parser) * if successful, update some other stuff */ -bool LoadLayoutToBuffer(BufferTypePtr Buffer, char *Filename) +bool LoadLayoutToBuffer(BufferTypePtr Buffer, const char *Filename, const char *fmt) { PCBTypePtr newPCB = CreateNewPCB(); /* new data isn't added to the undo list */ - if (!ParsePCB(newPCB, Filename, CFR_invalid)) { + if (!ParsePCB(newPCB, Filename, fmt, CFR_invalid)) { /* clear data area and replace pointer */ ClearBuffer(Buffer); free(Buffer->Data); Index: trunk/src/buffer.h =================================================================== --- trunk/src/buffer.h (revision 2924) +++ trunk/src/buffer.h (revision 2925) @@ -40,7 +40,7 @@ bool LoadElementToBuffer(BufferTypePtr, const char *); bool ConvertBufferToElement(BufferTypePtr); bool SmashBufferElement(BufferTypePtr); -bool LoadLayoutToBuffer(BufferTypePtr, char *); +bool LoadLayoutToBuffer(BufferTypePtr Buffer, const char *Filename, const char *fmt); void RotateBuffer(BufferTypePtr, BYTE); void SelectPasteBuffer(int); void pcb_swap_buffers(void); Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 2924) +++ trunk/src/file_act.c (revision 2925) @@ -129,7 +129,7 @@ else if (strcasecmp(function, "LayoutToBuffer") == 0) { notify_crosshair_change(false); - if (LoadLayoutToBuffer(PASTEBUFFER, name)) + if (LoadLayoutToBuffer(PASTEBUFFER, name, format)) SetMode(PCB_MODE_PASTE_BUFFER); notify_crosshair_change(true); } Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 2924) +++ trunk/src/plug_io.c (revision 2925) @@ -100,7 +100,7 @@ } } -int ParsePCB(PCBTypePtr Ptr, char *Filename, int load_settings) +int ParsePCB(PCBTypePtr Ptr, const char *Filename, const char *fmt, int load_settings) { int res = -1; @@ -246,7 +246,7 @@ * If revert is true, we pass "revert" as a parameter * to the HID's PCBChanged action. */ -static int real_load_pcb(char *Filename, bool revert, bool require_font, int how) +static int real_load_pcb(const char *Filename, const char *fmt, bool revert, bool require_font, int how) { const char *unit_suffix; char *new_filename; @@ -276,7 +276,7 @@ } /* new data isn't added to the undo list */ - if (!ParsePCB(PCB, new_filename, settings_dest)) { + if (!ParsePCB(PCB, new_filename, fmt, settings_dest)) { RemovePCB(oldPCB); CreateNewPCBPost(PCB, 0); @@ -539,7 +539,7 @@ */ int LoadPCB(const char *file, const char *fmt, bool require_font, int how) { - return real_load_pcb(file, false, require_font, how); + return real_load_pcb(file, fmt, false, require_font, how); } /* --------------------------------------------------------------------------- @@ -547,7 +547,8 @@ */ int RevertPCB(void) { - return real_load_pcb(PCB->Filename, true, true, true); +#warning TODO: use the format saved with PCB + return real_load_pcb(PCB->Filename, NULL, true, true, true); } /* --------------------------------------------------------------------------- Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 2924) +++ trunk/src/plug_io.h (revision 2925) @@ -85,7 +85,7 @@ /********** hook wrappers **********/ -int ParsePCB(PCBTypePtr Ptr, char *Filename, int load_settings); +int ParsePCB(PCBTypePtr Ptr, const char *Filename, const char *fmt, int load_settings); int ParseElement(DataTypePtr Ptr, const char *name); int ParseFont(FontTypePtr Ptr, char *Filename); int WriteBuffer(FILE *f, BufferType *buff, const char *fmt);