From: Ove Kaaven Date: Fri, 29 Oct 1999 01:59:38 +0000 (+0000) Subject: Unicode fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7dd62924826c2015d9c2563ce0e9443e73dbddc1?ds=sidebyside Unicode fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp index db66e05e73..4ac9238294 100644 --- a/src/gtk/data.cpp +++ b/src/gtk/data.cpp @@ -31,7 +31,7 @@ wxResourceCache *wxTheResourceCache = (wxResourceCache *) NULL; XrmDatabase wxResourceDatabase; /* Useful buffer, initialized in wxCommonInit */ -char *wxBuffer = (char *) NULL; +wxChar *wxBuffer = (wxChar *) NULL; /* Windows List */ wxWindowList wxTopLevelWindows; diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index fdd1f25e8f..4349abe348 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -401,7 +401,7 @@ GdkAtom wxDropTarget::GetMatchingPair() wxDataFormat format( formatAtom ); #ifdef __WXDEBUG__ - wxLogDebug("Drop target: drag has format: %s", format.GetId().c_str() ); + wxLogDebug( wxT("Drop target: drag has format: %s"), format.GetId().c_str() ); #endif // Debug if (m_dataObject->IsSupportedFormat( format )) diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 7b40f4ccbe..77cc2b8fe5 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -165,7 +165,7 @@ void wxSpinCtrl::SetValue( const wxString& value ) else { // invalid number - set text as is (wxMSW compatible) - gtk_entry_set_text( GTK_ENTRY(m_widget), value.c_str() ); + gtk_entry_set_text( GTK_ENTRY(m_widget), value.mbc_str() ); } } diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp index db66e05e73..4ac9238294 100644 --- a/src/gtk1/data.cpp +++ b/src/gtk1/data.cpp @@ -31,7 +31,7 @@ wxResourceCache *wxTheResourceCache = (wxResourceCache *) NULL; XrmDatabase wxResourceDatabase; /* Useful buffer, initialized in wxCommonInit */ -char *wxBuffer = (char *) NULL; +wxChar *wxBuffer = (wxChar *) NULL; /* Windows List */ wxWindowList wxTopLevelWindows; diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index fdd1f25e8f..4349abe348 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -401,7 +401,7 @@ GdkAtom wxDropTarget::GetMatchingPair() wxDataFormat format( formatAtom ); #ifdef __WXDEBUG__ - wxLogDebug("Drop target: drag has format: %s", format.GetId().c_str() ); + wxLogDebug( wxT("Drop target: drag has format: %s"), format.GetId().c_str() ); #endif // Debug if (m_dataObject->IsSupportedFormat( format )) diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index 7b40f4ccbe..77cc2b8fe5 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -165,7 +165,7 @@ void wxSpinCtrl::SetValue( const wxString& value ) else { // invalid number - set text as is (wxMSW compatible) - gtk_entry_set_text( GTK_ENTRY(m_widget), value.c_str() ); + gtk_entry_set_text( GTK_ENTRY(m_widget), value.mbc_str() ); } } diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 5d149d8c24..fb16e317bb 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -212,7 +212,7 @@ public: { m_started = TRUE; return wxTimer::Start(millisecs, FALSE); } virtual void Notify() - { wxLogTrace("Checking dial up network status."); m_dupman->CheckStatus(); } + { wxLogTrace(wxT("Checking dial up network status.")); m_dupman->CheckStatus(); } virtual void Stop() { if ( m_started ) wxTimer::Stop(); } @@ -281,7 +281,7 @@ wxDialUpManagerImpl::Dial(const wxString &isp, m_IsOnline = -1; m_ISPname = isp; wxString cmd; - if(m_ConnectCommand.Find("%s")) + if(m_ConnectCommand.Find(wxT("%s"))) cmd.Printf(m_ConnectCommand,m_ISPname.c_str()); else cmd = m_ConnectCommand; @@ -315,7 +315,7 @@ wxDialUpManagerImpl::HangUp(void) } m_IsOnline = -1; wxString cmd; - if(m_HangUpCommand.Find("%s")) + if(m_HangUpCommand.Find(wxT("%s"))) cmd.Printf(m_HangUpCommand,m_ISPname.c_str(), m_DialProcess); else cmd = m_HangUpCommand; @@ -361,11 +361,11 @@ void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno) { /// does hostname contain a port number? - wxString port = hostname.After(':'); + wxString port = hostname.After(wxT(':')); if(port.Length()) { - m_BeaconHost = hostname.Before(':'); - m_BeaconPort = atoi(port); + m_BeaconHost = hostname.Before(wxT(':')); + m_BeaconPort = wxAtoi(port); } else { @@ -470,7 +470,7 @@ wxDialUpManagerImpl::CheckStatusInternal(void) struct sockaddr_in serv_addr; m_IsOnline = 0; // assume false - if((hp = gethostbyname(m_BeaconHost)) == NULL) + if((hp = gethostbyname(m_BeaconHost.mb_str())) == NULL) return; // no DNS no net serv_addr.sin_family = hp->h_addrtype; diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index fdc00b9142..fceeff6ca2 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -62,7 +62,7 @@ static char **CreateFontList(wxChar spacing, int *nFonts) pattern.Printf(wxT("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing); // get the list of all fonts - return XListFonts((Display *)wxGetDisplay(), pattern, 32767, nFonts); + return XListFonts((Display *)wxGetDisplay(), pattern.mb_str(), 32767, nFonts); } static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, @@ -74,7 +74,7 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, for ( int n = 0; n < nFonts; n++ ) { char *font = fonts[n]; - if ( !wxString(font).Matches("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") ) + if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) ) { // it's not a full font name (probably an alias) continue; @@ -84,16 +84,17 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, char *family = dash + 1; dash = strchr(family, '-'); *dash = '\0'; // !NULL because Matches() above succeeded + wxString fam(family); - if ( families.Index(family) == wxNOT_FOUND ) + if ( families.Index(fam) == wxNOT_FOUND ) { - if ( !This->OnFontFamily(family) ) + if ( !This->OnFontFamily(fam) ) { // stop enumerating return FALSE; } - families.Add(family); + families.Add(fam); } //else: already seen } @@ -159,7 +160,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) // get the list of all fonts int nFonts; - char **fonts = XListFonts((Display *)wxGetDisplay(), pattern, + char **fonts = XListFonts((Display *)wxGetDisplay(), pattern.mb_str(), 32767, &nFonts); if ( !fonts ) @@ -173,7 +174,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) for ( int n = 0; n < nFonts; n++ ) { char *font = fonts[n]; - if ( !wxString(font).Matches("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") ) + if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) ) { // it's not a full font name (probably an alias) continue;