_intl.i versus intl.h/cpp

niki niki at vintech.bg
Wed Oct 31 07:25:05 PDT 2007


I observed (after one day starring) small difference between intl.h and 
_intl.h

intl.h:
     virtual const wxChar *GetString(const wxChar *szOrigString,
                                     const wxChar *szDomain = NULL) const;


_intl.i:
     wxString GetString(const wxString& szOrigString,
                        const wxString& szDomain = wxPyEmptyString) const;

and code in intl.cpp can't handle empty string. Suggested patch:

=== modified file 'src/common/intl.cpp'
--- a/src/common/intl.cpp	2007-10-31 13:09:31 +0000
+++ b/src/common/intl.cpp	2007-10-31 14:11:40 +0000
@@ -2605,13 +2608,13 @@
  {
      if ( wxIsEmpty(szOrigString) )
          return wxEmptyString;

      const wxChar *pszTrans = NULL;
      wxMsgCatalog *pMsgCat;

-    if ( szDomain != NULL )
+    if ( szDomain != NULL && szDomain[0] )
      {
          pMsgCat = FindCatalog(szDomain);

          // does the catalog exist?
          if ( pMsgCat != NULL )


-- 
regards,

Niki Spahiev




More information about the wxpython-dev mailing list