Commit 76aa0ba7 authored by maciej.'s avatar maciej. Committed by Dick Hollenbeck

Fix compile errors when wx3.x is built with --enable-stl

parent a3211b2b
......@@ -57,11 +57,6 @@
static const wxChar* CommonConfigPath = wxT( "kicad_common" );
#ifdef __UNIX__
# define TMP_FILE "/tmp/kicad.tmp"
#endif
// some key strings used to store parameters in config
static const wxChar backgroundColorKey[] = wxT( "BackgroundColor" );
static const wxChar showPageLimitsKey[] = wxT( "ShowPageLimits" );
......@@ -90,7 +85,7 @@ struct LANGUAGE_DESCR
BITMAP_DEF m_Lang_Icon;
/// Labels used in menus
const wxChar* m_Lang_Label;
wxString m_Lang_Label;
/// Set to true if the m_Lang_Label must not be translated
bool m_DoNotTranslate;
......
......@@ -1451,12 +1451,12 @@ EDA_COLOR_T ColorMix( EDA_COLOR_T aColor1, EDA_COLOR_T aColor2 )
}
EDA_COLOR_T ColorByName( const wxChar *aName )
EDA_COLOR_T ColorByName( const wxString& aName )
{
// look for a match in the palette itself
for( EDA_COLOR_T trying = BLACK; trying < NBCOLORS; trying = NextColor(trying) )
{
if( 0 == wxStricmp( aName, g_ColorRefs[trying].m_Name ) )
if( 0 == aName.CmpNoCase( g_ColorRefs[trying].m_Name ) )
return trying;
}
......
......@@ -430,7 +430,7 @@ const wxPoint WORKSHEET_DATAITEM_POLYPOLYGON::GetCornerPositionUi( unsigned aIdx
return wxPoint( int(pos.x), int(pos.y) );
}
WORKSHEET_DATAITEM_TEXT::WORKSHEET_DATAITEM_TEXT( const wxChar* aTextBase ) :
WORKSHEET_DATAITEM_TEXT::WORKSHEET_DATAITEM_TEXT( const wxString& aTextBase ) :
WORKSHEET_DATAITEM( WS_TEXT )
{
m_TextBase = aTextBase;
......
......@@ -211,31 +211,33 @@ wxString DateAndTime()
}
int StrNumCmp( const wxChar* aString1, const wxChar* aString2, int aLength, bool aIgnoreCase )
int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength, bool aIgnoreCase )
{
int i;
int nb1 = 0, nb2 = 0;
if( ( aString1 == NULL ) || ( aString2 == NULL ) )
wxString::const_iterator str1 = aString1.begin(), str2 = aString2.begin();
if( ( str1 == aString1.end() ) || ( str2 == aString2.end() ) )
return 0;
for( i = 0; i < aLength; i++ )
{
if( isdigit( *aString1 ) && isdigit( *aString2 ) ) /* digit found */
if( isdigit( *str1 ) && isdigit( *str2 ) ) /* digit found */
{
nb1 = 0;
nb2 = 0;
while( isdigit( *aString1 ) )
while( isdigit( *str1 ) )
{
nb1 = nb1 * 10 + *aString1 - '0';
aString1++;
nb1 = nb1 * 10 + (int) *str1 - '0';
str1++;
}
while( isdigit( *aString2 ) )
while( isdigit( *str2 ) )
{
nb2 = nb2 * 10 + *aString2 - '0';
aString2++;
nb2 = nb2 * 10 + (int) *str2 - '0';
str2++;
}
if( nb1 < nb2 )
......@@ -247,29 +249,29 @@ int StrNumCmp( const wxChar* aString1, const wxChar* aString2, int aLength, bool
if( aIgnoreCase )
{
if( toupper( *aString1 ) < toupper( *aString2 ) )
if( toupper( *str1 ) < toupper( *str2 ) )
return -1;
if( toupper( *aString1 ) > toupper( *aString2 ) )
if( toupper( *str1 ) > toupper( *str2 ) )
return 1;
if( ( *aString1 == 0 ) && ( *aString2 == 0 ) )
if( ( *str1 == 0 ) && ( *str2 == 0 ) )
return 0;
}
else
{
if( *aString1 < *aString2 )
if( *str1 < *str2 )
return -1;
if( *aString1 > *aString2 )
if( *str1 > *str2 )
return 1;
if( ( *aString1 == 0 ) && ( *aString2 == 0 ) )
if( ( str1 == aString1.end() ) && ( str2 == aString2.end() ) )
return 0;
}
aString1++;
aString2++;
str1++;
str2++;
}
return 0;
......
......@@ -44,18 +44,18 @@
#include <wx/tokenzr.h>
#include <wx/regex.h>
static const wxChar* duplicate_name_msg =
static const wxString duplicate_name_msg =
_( "Library <%s> has duplicate entry name <%s>.\n\
This may cause some unexpected behavior when loading components into a schematic." );
bool operator==( const CMP_LIBRARY& aLibrary, const wxChar* aName )
bool operator==( const CMP_LIBRARY& aLibrary, const wxString& aName )
{
return aLibrary.GetName().CmpNoCase( aName ) == 0;
}
bool operator!=( const CMP_LIBRARY& aLibrary, const wxChar* aName )
bool operator!=( const CMP_LIBRARY& aLibrary, const wxString& aName )
{
return !( aLibrary == aName );
}
......@@ -224,10 +224,10 @@ bool CMP_LIBRARY::Conflicts( LIB_COMPONENT* aComponent )
}
LIB_ALIAS* CMP_LIBRARY::FindEntry( const wxChar* aName )
LIB_ALIAS* CMP_LIBRARY::FindEntry( const wxString& aName )
{
LIB_ALIAS_MAP::iterator it = aliases.find( wxString( aName ) );
LIB_ALIAS_MAP::iterator it = aliases.find( aName );
if( it != aliases.end() )
return (*it).second;
......@@ -245,7 +245,7 @@ LIB_ALIAS* CMP_LIBRARY::GetFirstEntry()
}
LIB_COMPONENT* CMP_LIBRARY::FindComponent( const wxChar* aName )
LIB_COMPONENT* CMP_LIBRARY::FindComponent( const wxString& aName )
{
LIB_COMPONENT* component = NULL;
LIB_ALIAS* entry = FindEntry( aName );
......@@ -392,12 +392,12 @@ LIB_COMPONENT* CMP_LIBRARY::ReplaceComponent( LIB_COMPONENT* aOldComponent,
}
LIB_ALIAS* CMP_LIBRARY::GetNextEntry( const wxChar* aName )
LIB_ALIAS* CMP_LIBRARY::GetNextEntry( const wxString& aName )
{
if( aliases.empty() )
return NULL;
LIB_ALIAS_MAP::iterator it = aliases.find( wxString( aName ) );
LIB_ALIAS_MAP::iterator it = aliases.find( aName );
it++;
......@@ -408,12 +408,12 @@ LIB_ALIAS* CMP_LIBRARY::GetNextEntry( const wxChar* aName )
}
LIB_ALIAS* CMP_LIBRARY::GetPreviousEntry( const wxChar* aName )
LIB_ALIAS* CMP_LIBRARY::GetPreviousEntry( const wxString& aName )
{
if( aliases.empty() )
return NULL;
LIB_ALIAS_MAP::iterator it = aliases.find( wxString( aName ) );
LIB_ALIAS_MAP::iterator it = aliases.find( aName );
if( it == aliases.begin() )
it = aliases.end();
......
......@@ -240,7 +240,7 @@ public:
* @param aName - Name of entry, case insensitive.
* @return Entry if found. NULL if not found.
*/
LIB_ALIAS* FindEntry( const wxChar* aName );
LIB_ALIAS* FindEntry( const wxString& aName );
/**
* Find component by \a aName.
......@@ -251,7 +251,7 @@ public:
* @param aName - Name of component, case insensitive.
* @return Component if found. NULL if not found.
*/
LIB_COMPONENT* FindComponent( const wxChar* aName );
LIB_COMPONENT* FindComponent( const wxString& aName );
/**
* Find alias by \a nName.
......@@ -262,7 +262,7 @@ public:
* @param aName - Name of alias, case insensitive.
* @return Alias if found. NULL if not found.
*/
LIB_ALIAS* FindAlias( const wxChar* aName )
LIB_ALIAS* FindAlias( const wxString& aName )
{
return (LIB_ALIAS*) FindEntry( aName );
}
......@@ -331,7 +331,7 @@ public:
* @param aName - Name of current entry.
* @return Next entry if entry name is found. Otherwise NULL.
*/
LIB_ALIAS* GetNextEntry( const wxChar* aName );
LIB_ALIAS* GetNextEntry( const wxString& aName );
/**
......@@ -343,7 +343,7 @@ public:
* @param aName - Name of current entry.
* @return Previous entry if entry name is found, otherwise NULL.
*/
LIB_ALIAS* GetPreviousEntry( const wxChar* aName );
LIB_ALIAS* GetPreviousEntry( const wxString& aName );
/**
* Return the file name without path or extension.
......@@ -525,7 +525,7 @@ public:
/**
* Case insensitive library name comparison.
*/
extern bool operator==( const CMP_LIBRARY& aLibrary, const wxChar* aName );
extern bool operator!=( const CMP_LIBRARY& aLibrary, const wxChar* aName );
extern bool operator==( const CMP_LIBRARY& aLibrary, const wxString& aName );
extern bool operator!=( const CMP_LIBRARY& aLibrary, const wxString& aName );
#endif // CLASS_LIBRARY_H
......@@ -290,10 +290,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
wxPoint txtpos;
txtpos.x = x + (bitmap_size.x / 2);
txtpos.y = y - text_height;
text = new wxStaticText( m_matrixPanel,
-1,
CommentERC_V[ii],
txtpos );
text = new wxStaticText( m_matrixPanel, -1, CommentERC_V[ii], txtpos );
}
int event_id = ID_MATRIX_0 + ii + ( jj * PIN_NMAX );
......
......@@ -17,8 +17,6 @@
extern int DiagErc[PIN_NMAX][PIN_NMAX];
extern bool DiagErcTableInit; // go to true after DiagErc init
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
extern const wxChar* CommentERC_H[];
extern const wxChar* CommentERC_V[];
/* Control identifiers */
#define ID_MATRIX_0 1800
......
......@@ -82,7 +82,7 @@
*/
// Messages for matrix rows:
const wxChar* CommentERC_H[] =
const wxString CommentERC_H[] =
{
_( "Input Pin.........." ),
_( "Output Pin........." ),
......@@ -94,12 +94,11 @@ const wxChar* CommentERC_H[] =
_( "Power Output Pin..." ),
_( "Open Collector....." ),
_( "Open Emitter......." ),
_( "No Connection......" ),
NULL
_( "No Connection......" )
};
// Messages for matrix columns
const wxChar* CommentERC_V[] =
const wxString CommentERC_V[] =
{
_( "Input Pin" ),
_( "Output Pin" ),
......@@ -111,8 +110,7 @@ const wxChar* CommentERC_V[] =
_( "Power Output Pin" ),
_( "Open Collector" ),
_( "Open Emitter" ),
_( "No Connection" ),
NULL
_( "No Connection" )
};
......
......@@ -45,6 +45,8 @@ enum errortype
UNC // Error: unconnected pin
};
extern const wxString CommentERC_H[];
extern const wxString CommentERC_V[];
/// DRC error codes:
#define ERCE_UNSPECIFIED 0
......
......@@ -267,6 +267,7 @@ public:
}
};
class WORKSHEET_DATAITEM_POLYPOLYGON : public WORKSHEET_DATAITEM
{
public:
......@@ -355,26 +356,27 @@ public:
bool IsInsidePage( int ii ) const;
};
class WORKSHEET_DATAITEM_TEXT : public WORKSHEET_DATAITEM
{
public:
wxString m_TextBase; // The basic text, with format symbols
wxString m_FullText; // The expanded text, shown on screen
double m_Orient; // Orientation in degrees
enum EDA_TEXT_HJUSTIFY_T m_Hjustify;
enum EDA_TEXT_VJUSTIFY_T m_Vjustify;
DSIZE m_TextSize;
DSIZE m_BoundingBoxSize; // When not null, this is the max
// size of the full text.
// the text size will be modified
// to keep the full text insite this
// bound.
DSIZE m_ConstrainedTextSize;// Actual text size, if constrained by
// the m_BoundingBoxSize constraint
wxString m_TextBase; // The basic text, with format symbols
wxString m_FullText; // The expanded text, shown on screen
double m_Orient; // Orientation in degrees
EDA_TEXT_HJUSTIFY_T m_Hjustify;
EDA_TEXT_VJUSTIFY_T m_Vjustify;
DSIZE m_TextSize;
DSIZE m_BoundingBoxSize; // When not null, this is the max
// size of the full text.
// the text size will be modified
// to keep the full text insite this
// bound.
DSIZE m_ConstrainedTextSize; // Actual text size, if constrained by
// the m_BoundingBoxSize constraint
public:
WORKSHEET_DATAITEM_TEXT( const wxChar* aTextBase );
WORKSHEET_DATAITEM_TEXT( const wxString& aTextBase );
/**
* @return false (no end point)
......@@ -467,6 +469,7 @@ public:
}
};
class BITMAP_BASE;
class WORKSHEET_DATAITEM_BITMAP : public WORKSHEET_DATAITEM
{
......
......@@ -134,7 +134,7 @@ inline void ColorApplyHighlightFlag( EDA_COLOR_T *aColor )
}
/// Find a color by name
EDA_COLOR_T ColorByName( const wxChar *aName );
EDA_COLOR_T ColorByName( const wxString& aName );
/// Find the nearest color match
EDA_COLOR_T ColorFindNearest( const wxColour &aColor );
......
......@@ -99,8 +99,8 @@ wxString DateAndTime();
* except that strings containing numbers are compared by their integer value not
* by their ASCII code.
*
* @param aString1 A wxChar pointer to the reference string.
* @param aString2 A wxChar pointer to the comparison string.
* @param aString1 A wxString reference to the reference string.
* @param aString2 A wxString reference to the comparison string.
* @param aLength The number of characters to compare. Set to -1 to compare
* the entire string.
* @param aIgnoreCase Use true to make the comparison case insensitive.
......@@ -108,7 +108,7 @@ wxString DateAndTime();
* \a aString1 is equal to \a aString2, or 1 if \a aString1 is greater
* than \a aString2.
*/
int StrNumCmp( const wxChar* aString1, const wxChar* aString2, int aLength = INT_MAX,
int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength = INT_MAX,
bool aIgnoreCase = false );
/**
......
......@@ -280,7 +280,7 @@ void PCB_LAYER_WIDGET::ReFill()
{
if( enabledLayers & GetLayerMask( layer ) )
{
const wxChar *dsc;
wxString dsc;
switch( layer )
{
case LAYER_N_FRONT:
......
......@@ -55,8 +55,8 @@ class LIST_MOD // An helper class used to build a list of useful footprints
{
public:
MODULE* m_Module; // Link to the actual footprint
const wxChar* m_Reference; // Its schematic reference
const wxChar* m_Value; // Its schematic value
wxString m_Reference; // Its schematic reference
wxString m_Value; // Its schematic value
LAYER_NUM m_Layer; // its side (LAYER_N_BACK, or LAYER_N_FRONT)
};
......
......@@ -108,7 +108,7 @@ int SPECCTRA_DB::findLayerName( const std::string& aLayerName ) const
}
void SPECCTRA_DB::ThrowIOError( const wxChar* fmt, ... ) throw( IO_ERROR )
void SPECCTRA_DB::ThrowIOError( const wxString& fmt, ... ) throw( IO_ERROR )
{
wxString errText;
va_list args;
......
......@@ -3910,7 +3910,7 @@ public:
*/
void LoadSESSION( const wxString& filename ) throw( IO_ERROR );
void ThrowIOError( const wxChar* fmt, ... ) throw( IO_ERROR );
void ThrowIOError( const wxString& fmt, ... ) throw( IO_ERROR );
/**
* Function ExportPCB
......
......@@ -198,7 +198,7 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) thro
{
wxString layerName = FROM_UTF8( aPath->layer_id.c_str() );
ThrowIOError( _("Session file uses invalid layer id \"%s\""),
GetChars(layerName) );
GetChars( layerName ) );
}
TRACK* track = new TRACK( sessionBoard );
......@@ -247,7 +247,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
if( shapeCount == 0 )
{
ThrowIOError( _( "Session via padstack has no shapes") );
ThrowIOError( _( "Session via padstack has no shapes" ) );
}
else if( shapeCount == 1 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment