]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Removed references to separate prop and porting docs. Added imagtiff.cpp
[wxWidgets.git] / src / common / string.cpp
index 917e979231d8e6c6ceee826dfb4787f338e58fc5..da23dda0f4862e0c0769879fa8e78c1aac0cb1a5 100644 (file)
@@ -1102,6 +1102,28 @@ wxString& wxString::operator<<(double d)
 // formatted output
 // ---------------------------------------------------------------------------
 
+/* static */
+wxString wxString::Format(const wxChar *pszFormat, ...)
+{
+    va_list argptr;
+    va_start(argptr, pszFormat);
+
+    wxString s;
+    s.PrintfV(pszFormat, argptr);
+
+    va_end(argptr);
+
+    return s;
+}
+
+/* static */
+wxString wxString::FormatV(const wxChar *pszFormat, va_list argptr)
+{
+    wxString s;
+    s.Printf(pszFormat, argptr);
+    return s;
+}
+
 int wxString::Printf(const wxChar *pszFormat, ...)
 {
   va_list argptr;
@@ -1780,20 +1802,8 @@ void wxArrayString::Copy(const wxArrayString& src)
   if ( src.m_nCount > ARRAY_DEFAULT_INITIAL_SIZE )
     Alloc(src.m_nCount);
 
-  // we can't just copy the pointers here because otherwise we would share
-  // the strings with another array because strings are ref counted
-#if 0
-  if ( m_nCount != 0 )
-    memcpy(m_pItems, src.m_pItems, m_nCount*sizeof(wxChar *));
-#endif // 0
-
   for ( size_t n = 0; n < src.m_nCount; n++ )
     Add(src[n]);
-
-  // if the other array is auto sorted too, we're already sorted, but
-  // otherwise we should rearrange the items
-  if ( m_autoSort && !src.m_autoSort )
-    Sort();
 }
 
 // grow the array