diff --git a/pcbnew/import_dxf/dxf2brd_items.cpp b/pcbnew/import_dxf/dxf2brd_items.cpp index 13a8c4b429..e143830ee3 100644 --- a/pcbnew/import_dxf/dxf2brd_items.cpp +++ b/pcbnew/import_dxf/dxf2brd_items.cpp @@ -52,7 +52,6 @@ DXF2BRD_CONVERTER::DXF2BRD_CONVERTER() : DRW_Interface() m_xOffset = 0.0; // X coord offset for conversion (in mm) m_yOffset = 0.0; // Y coord offset for conversion (in mm) m_Dfx2mm = 1.0; // The scale factor to convert DXF units to mm - m_dxf = NULL; m_brd = NULL; m_version = 0; m_defaultThickness = 0.1; @@ -84,28 +83,16 @@ int DXF2BRD_CONVERTER::mapDim( double aDxfValue ) } -/** - * Implementation of the method used for communicate - * with this filter. - * - * @param aFile = the full filename. - * @param aLayersList = where to store the list of layer names - */ bool DXF2BRD_CONVERTER::ImportDxfFile( const wxString& aFile, BOARD* aBoard ) { m_brd = aBoard; - m_dxf = new dxfRW( aFile.ToUTF8() ); - bool success = m_dxf->read( this, true ); + dxfRW* dxf = new dxfRW( aFile.ToUTF8() ); + bool success = dxf->read( this, true ); - if( success==false ) - { - return false; - } + delete dxf; - delete m_dxf; - m_dxf = NULL; - return true; + return success; } // Add aItem the the board diff --git a/pcbnew/import_dxf/dxf2brd_items.h b/pcbnew/import_dxf/dxf2brd_items.h index 57680862c7..0dcd676571 100644 --- a/pcbnew/import_dxf/dxf2brd_items.h +++ b/pcbnew/import_dxf/dxf2brd_items.h @@ -29,7 +29,6 @@ #include "drw_interface.h" #include "wx/wx.h" -class dxfRW; class BOARD; class BOARD_ITEM; @@ -54,7 +53,6 @@ private: int m_brdLayer; // The board layer to place imported dfx items int m_version; // the dxf version, not used here std::string m_codePage; // The code page, not used here - dxfRW* m_dxf; // the dxf reader public: DXF2BRD_CONVERTER(); @@ -80,6 +78,13 @@ public: */ void SetBrdLayer( int aBrdLayer ) { m_brdLayer = aBrdLayer; } + /** + * Implementation of the method used for communicate + * with this filter. + * + * @param aFile = the full filename. + * @param aBoard = where to store the graphical items and text + */ bool ImportDxfFile( const wxString& aFile, BOARD * aBoard ); /**