]> git.saurik.com Git - wxWidgets.git/commitdiff
Various fixes.
authorJulian Smart <julian@anthemion.co.uk>
Wed, 25 Nov 1998 12:01:23 +0000 (12:01 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 25 Nov 1998 12:01:23 +0000 (12:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
include/wx/confbase.h
include/wx/list.h
include/wx/msw/setup.h
include/wx/msw/taskbar.h
include/wx/textfile.h
src/common/config.cpp
src/common/list.cpp
src/common/string.cpp
src/common/textfile.cpp
src/msw/makefile.b32
src/msw/makefile.nt
utils/ogl/src/misc.cpp

index e7ed119cb87522198632abac7a5973edbacd3c5c..2ce903fec70c0365e0c26fc502399d498f737340 100644 (file)
@@ -208,15 +208,7 @@ public:
   void SetRecordDefaults(bool bDoIt = TRUE) { m_bRecordDefaults = bDoIt; }
   bool IsRecordingDefaults() const { return m_bRecordDefaults; }
   // does expansion only if needed
-  wxString ExpandEnvVars(const wxString& str) const
-    {
-        wxString tmp; // Required for BC++
-        if (IsExpandingEnvVars())
-            tmp = wxExpandEnvVars(str);
-        else
-            tmp = str;
-        return tmp;
-    }
+  wxString ExpandEnvVars(const wxString& str) const;
 
     // misc accessors
   inline wxString GetAppName() const { return m_appName; }
index afda75ffce59f10db2fbe25b5ce3a26c24d709c7..dc52fc248cb53c7b98901a204082cf1298b792f5 100644 (file)
@@ -106,23 +106,10 @@ public:
     long GetNumber() const
         { wxASSERT( m_keyType == wxKEY_INTEGER ); return m_key.integer; }
 
-    // comparaison
-    bool operator==(wxListKeyValue value) const
-    {
-        switch ( m_keyType )
-        {
-            default:
-                wxFAIL_MSG("bad key type.");
-                // let compiler optimize the line above away in release build
-                // by not putting return here...
-
-            case wxKEY_STRING:
-                return strcmp(m_key.string, value.string) == 0;
-
-            case wxKEY_INTEGER:
-                return m_key.integer == value.integer;
-        }
-    }
+    // comparison
+    // Note: implementation moved to list.cpp to prevent BC++ inline
+    // expansion warning.
+    bool operator==(wxListKeyValue value) const ;
 
     // dtor
     ~wxListKey()
@@ -267,7 +254,7 @@ protected:
 
     // this function allows the sorting of arbitrary lists by giving
     // a function to compare two list elements. The list is sorted in place.
-    void Sort(wxSortCompareFunction compfunc);
+    void Sort(const wxSortCompareFunction compfunc);
 
     // functions for iterating over the list
     void *FirstThat(wxListIterateFunction func);
index d8db707bba7815265f04826bd1d25d6df8c762c4..5aacae2c3c060a33b1eb763202a7a0bd565b7d66 100644 (file)
 
 #define wxUSE_SCROLLBAR   1
                                     // Define 1 to compile contributed wxScrollBar class
-#define wxUSE_XPM_IN_X    1
-#define wxUSE_XPM_IN_MSW  1
+#define wxUSE_XPM_IN_MSW  0
                                     // Define 1 to support the XPM package in wxBitmap,
                                     // separated by platform. If 1, you must link in
                                     // the XPM library to your applications.
-#define wxUSE_IMAGE_LOADING_IN_X          1
-                                  // Use dynamic icon/bitmap loading/saving code in utils/image under X.
-                                  // If this is 1, you will need to link your applications
-                                  // with image_X.lib. where X is motif, ol, or hp.
-
 #define wxUSE_IMAGE_LOADING_IN_MSW        1
                                   // Use dynamic DIB loading/saving code in utils/dib under MSW.
 #define wxUSE_RESOURCE_LOADING_IN_MSW     1
 #define wxUSE_WX_RESOURCES        1
                                   // Use .wxr resource mechanism (requires PrologIO library)
 
-#define wxUSE_GNU_WXSTRING        0
-                                  // Define 1 to use modified GNU wxString class
-                                  // from (stefan.hammes@urz.uni-heidelberg.de) in contrib\string
-                                  // TODO: why does this give an unresolved 'wxRegex::Search'
-                                  // symbol if 1?
-
 #define HAVE_SOCKET             1
                                   // Use WinSock if 1
 #define wxUSE_DOC_VIEW_ARCHITECTURE 1
index 4e0abf0d70bc8ba62909ff1478de33e8ab25a54b..6b177b469760d0950d9fcd6a6a9c32073a0b4cfc 100644 (file)
@@ -61,7 +61,7 @@ protected:
     static bool     sm_registeredClass;
     static unsigned int sm_taskbarMsg;
 
-    DECLARE_EVENT_TABLE();
+    DECLARE_EVENT_TABLE()
 };
 
 
index 2433f02c58ed01a97dee040af6de31da922716a4..3ac74cfc2a1d91e72d30729f0630a2d4d9ccf3e1 100644 (file)
@@ -108,19 +108,8 @@ public:
   bool Write(Type typeNew = Type_None);
 
   // get the file termination string
-  inline static const char *GetEOL(Type type = typeDefault)
-  {
-    switch ( type ) {
-      case Type_None: return "";
-      case Type_Unix: return "\n";
-      case Type_Dos:  return "\r\n";
-      case Type_Mac:  return "\r";
-
-      default:
-        wxFAIL_MSG("bad file type in wxTextFile::GetEOL.");
-        return (const char *) NULL;
-    }
-  }
+  // Note: implementation moved to textfile to prevent warning due to switch.
+  static const char *GetEOL(Type type = typeDefault);
 
   // dtor
   ~wxTextFile();
index 5aac22351b3411559950e727a24669155d5525f9..6a4eff0b33a32f6917fec10d582371ab72431e65 100644 (file)
@@ -210,6 +210,16 @@ bool wxConfigBase::Write(const wxString& key, bool value)
     return Write(key, l);
 }
 
+wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
+    {
+        wxString tmp; // Required for BC++
+        if (IsExpandingEnvVars())
+            tmp = wxExpandEnvVars(str);
+        else
+            tmp = str;
+        return tmp;
+    }
+
 
 // ----------------------------------------------------------------------------
 // wxConfigPathChanger
index 730134ae7df7755204d2b68bc1cc2815e6be4ef7..f7b1ab0543789d6681923983fc74c1e0066985e3 100644 (file)
@@ -440,6 +440,23 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
     delete[] objArray;
 }
 
+bool wxListKey::operator==(wxListKeyValue value) const
+    {
+        switch ( m_keyType )
+        {
+            default:
+                wxFAIL_MSG("bad key type.");
+                // let compiler optimize the line above away in release build
+                // by not putting return here...
+
+            case wxKEY_STRING:
+                return strcmp(m_key.string, value.string) == 0;
+
+            case wxKEY_INTEGER:
+                return m_key.integer == value.integer;
+        }
+    }
+
 // -----------------------------------------------------------------------------
 // wxList (a.k.a. wxObjectList)
 // -----------------------------------------------------------------------------
index 84b2bb55496af39407b1ea0110f430b432ca8478..cb949eb6886d14ce11dad67a5f769df73f35a2da 100644 (file)
@@ -923,6 +923,15 @@ int wxString::Printf(const char *pszFormat, ...)
 
 int wxString::PrintfV(const char* pszFormat, va_list argptr)
 {
+#ifdef __BORLANDC__
+  static char s_szScratch[1024];
+
+  int iLen = vsprintf(s_szScratch, pszFormat, argptr);
+  AllocBeforeWrite(iLen);
+  strcpy(m_pchData, s_szScratch);
+
+  return iLen;
+#else
 #ifdef __WXMSW__
   #ifdef _MSC_VER
     #define wxVsprintf     _vsnprintf
@@ -972,6 +981,7 @@ int wxString::PrintfV(const char* pszFormat, va_list argptr)
       free(buffer);
 
   return iLen;
+#endif
 }
 
 // ----------------------------------------------------------------------------
index 711b8de6ef19dc060a908b380b683234f43736ab..c09b7e86473895d8694f75a2b91647cb6ce41d29 100644 (file)
@@ -232,3 +232,18 @@ bool wxTextFile::Write(Type typeNew)
   // replace the old file with this one
   return fileTmp.Commit();
 }
+
+const char *wxTextFile::GetEOL(Type type)
+  {
+    switch ( type ) {
+      case Type_None: return "";
+      case Type_Unix: return "\n";
+      case Type_Dos:  return "\r\n";
+      case Type_Mac:  return "\r";
+
+      default:
+        wxFAIL_MSG("bad file type in wxTextFile::GetEOL.");
+        return (const char *) NULL;
+    }
+  }
+
index f0429cb5e6e6292da3816d20575c1ea499682234..ae581ed5f86c351641d58b26a215ad57af3e4eb2 100644 (file)
@@ -79,8 +79,6 @@ GENERICOBJS= \
   $(MSWDIR)\laywin.obj \
   $(MSWDIR)\msgdlgg.obj \
   $(MSWDIR)\panelg.obj \
-  $(MSWDIR)\printps.obj \
-  $(MSWDIR)\prntdlgg.obj \
   $(MSWDIR)\sashwin.obj \
   $(MSWDIR)\scrolwin.obj \
   $(MSWDIR)\splitter.obj \
@@ -88,6 +86,9 @@ GENERICOBJS= \
   $(MSWDIR)\tabg.obj \
   $(MSWDIR)\textdlgg.obj
 
+#  $(MSWDIR)\printps.obj \
+#  $(MSWDIR)\prntdlgg.obj \
+
 COMMONOBJS = \
   $(MSWDIR)\config.obj \
   $(MSWDIR)\cmndata.obj \
index a8eb8fa988a7eb5c3f2201f00219247f62745cc7..efc18040c894c1b529d81204ce1fe0f24d16e58a 100644 (file)
@@ -309,7 +309,7 @@ $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
 
 $(MSWDIR)/app.obj:     $*.$(SRCSUFF)
         cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
+$(CPPFLAGS) /D__NO_VC_CRTDBG__ /c /Tp $*.$(SRCSUFF) /Fo$@
 <<
 
 $(MSWDIR)/bitmap.obj:     $*.$(SRCSUFF)
index 4c0008ea14c12fbf3c2c08674f3001838b6da6c8..50ed2669dc20e55544cb9d73927425954d0a6d73 100644 (file)
@@ -444,12 +444,12 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
     {
       word[j] = 0;
       j = 0;
-      word_list.Append((wxObject *)copystring(word));
+      word_list.Add(word);
       end_word = FALSE;
     }
     if (new_line)
     {
-      word_list.Append((wxObject *)NULL);
+      word_list.Append(NULL);
       new_line = FALSE;
     }
   }