]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/strconv.cpp
Don't capture the mouse until after the possible wxEVT_GRID_CELL_BEGIN_DRAG event.
[wxWidgets.git] / src / common / strconv.cpp
index b80d82fdb62a2460450f7da315530afc8319ff03..bd0a0926c3eaae36e22d52a78be4537886a48ea5 100644 (file)
@@ -3518,13 +3518,29 @@ void wxCSConv::CreateConvIfNeeded() const
     }
 }
 
+bool wxCSConv::IsOk() const
+{
+    CreateConvIfNeeded();
+
+    // special case: no convReal created for wxFONTENCODING_ISO8859_1
+    if ( m_encoding == wxFONTENCODING_ISO8859_1 )
+        return true; // always ok as we do it ourselves
+
+    // m_convReal->IsOk() is called at its own creation, so we know it must
+    // be ok if m_convReal is non-NULL
+    return m_convReal != NULL;
+}
+
 size_t wxCSConv::ToWChar(wchar_t *dst, size_t dstLen,
                          const char *src, size_t srcLen) const
 {
     CreateConvIfNeeded();
 
-    return m_convReal ? m_convReal->ToWChar(dst, dstLen, src, srcLen)
-                      : wxCONV_FAILED;
+    if (m_convReal)
+        return m_convReal->ToWChar(dst, dstLen, src, srcLen);
+
+    // latin-1 (direct)
+    return wxMBConv::ToWChar(dst, dstLen, src, srcLen);
 }
 
 size_t wxCSConv::FromWChar(char *dst, size_t dstLen,
@@ -3532,8 +3548,11 @@ size_t wxCSConv::FromWChar(char *dst, size_t dstLen,
 {
     CreateConvIfNeeded();
 
-    return m_convReal ? m_convReal->FromWChar(dst, dstLen, src, srcLen)
-                      : wxCONV_FAILED;
+    if (m_convReal)
+        return m_convReal->FromWChar(dst, dstLen, src, srcLen);
+
+    // latin-1 (direct)
+    return wxMBConv::FromWChar(dst, dstLen, src, srcLen);
 }
 
 size_t wxCSConv::MB2WC(wchar_t *buf, const char *psz, size_t n) const