Commit cd0b2316 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Minor fixes, dead code removal, and coding policy fixes.

* Use version of DateAndTime that returns a wxString and delete the
  version that takes a char* as it is no longer required.
* Merge StrNumICmp() and StrLenNumICmp() into StrLenNumCmp() to create a
  single function for comparing strings with integers and remove a lot
  of duplicate code.
* Remove unused strupper from string.cpp.
* Use wxArrayString for sorting the EDA_LIST_DIALOG contents.
parent b88505dd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_ITEM( aType )
{
    m_drawList         = NULL;   /* Draw items list */
    m_UndoRedoCountMax = 10;     /* undo/Redo command Max depth, 10 is a reasonable value */
    m_FirstRedraw      = TRUE;
    m_FirstRedraw      = true;
    m_ScreenNumber     = 1;
    m_NumberOfScreen   = 1;      /* Hierarchy: Root: ScreenNumber = 1 */
    m_Zoom             = 32.0;
+2 −4
Original line number Diff line number Diff line
@@ -44,8 +44,6 @@ void GERBER_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror
 */
bool GERBER_PLOTTER::start_plot( FILE* aFile )
{
    char Line[1024];

    wxASSERT( !output_file );
    final_file  = aFile;

@@ -59,9 +57,9 @@ bool GERBER_PLOTTER::start_plot( FILE* aFile )
    if( output_file == NULL )
        return false;

    DateAndTime( Line );
    wxString Title = creator + wxT( " " ) + GetBuildVersion();
    fprintf( output_file, "G04 (created by %s) date %s*\n", TO_UTF8( Title ), Line );
    fprintf( output_file, "G04 (created by %s) date %s*\n",
             TO_UTF8( Title ), TO_UTF8( DateAndTime() ) );

    // Specify linear interpol (G01), unit = INCH (G70), abs format (G90):
    fputs( "G01*\nG70*\nG90*\n", output_file );
+13 −24
Original line number Diff line number Diff line
/*
* confirm.cpp
 * @file confirm.cpp
 * utilities to display some error, warning and info short messges
 */

@@ -9,11 +9,7 @@
#include "wx/html/htmlwin.h"
#include "html_messagebox.h"

/* Display an error or warning message.
 * TODO:
 *  If display time > 0 the dialog disappears after displayTime ( in 0.1 second )
 *
 */

void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
{
    wxMessageDialog* dialog;
@@ -30,12 +26,7 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
}


/* Display an informational message.
 * TODO:
 *  If display time > 0 the message disappears after displayTime (in 0.1 second )
 */
void DisplayInfoMessage( wxWindow* parent, const wxString& text,
                         int displaytime )
void DisplayInfoMessage( wxWindow* parent, const wxString& text, int displaytime )
{
    wxMessageDialog* dialog;

@@ -47,8 +38,6 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text,
}


 /* Display a simple message window in html format.
 */
void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title,
                             const wxString& text, const wxSize& size )
{
@@ -63,10 +52,10 @@ bool IsOK( wxWindow* parent, const wxString& text )
{
    int ii;

    ii = wxMessageBox( text, _( "Confirmation" ),
                       wxYES_NO | wxCENTRE | wxICON_HAND, parent );
    ii = wxMessageBox( text, _( "Confirmation" ), wxYES_NO | wxCENTRE | wxICON_HAND, parent );

    if( ii == wxYES )
        return TRUE;
    return FALSE;
}
        return true;

    return false;
}
+2 −5
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
static bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame );


/* calls the function to copy the current page or the current bock to
 * the clipboard
 */
void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
{
    DrawPageOnClipboard( this );
@@ -41,7 +38,7 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
 */
bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
{
    bool    success = TRUE;
    bool    success = true;

#ifdef __WINDOWS__
    int     tmpzoom;
@@ -58,7 +55,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )

    if( screen->IsBlockActive() )
    {
        DrawBlock = TRUE;
        DrawBlock = true;
        DrawArea.SetX( screen->m_BlockLocate.GetX() );
        DrawArea.SetY( screen->m_BlockLocate.GetY() );
        DrawArea.SetWidth( screen->m_BlockLocate.GetWidth() );
+0 −1
Original line number Diff line number Diff line
/////////////////////////////////////////////////////////////////////////////

// Name:        svg.cpp
// Purpose:     SVG plot
// Author:      Chris Elliott
Loading