]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Weekly updates
[wxWidgets.git] / src / msw / listctrl.cpp
index 9ea8e389a189eb9e8e4276742658beb9608a4780..b57021fd00b2d8e58b1a5b1913fe1310d0b4510c 100644 (file)
@@ -110,7 +110,12 @@ private:
         m_item = new LV_ITEM((LV_ITEM&)item);
         if ( (item.mask & LVIF_TEXT) && item.pszText )
         {
+#ifdef __WXWINE__
+            // FIXME
+            m_buf = new wxWC2WXbuf(wxConvLocal.cWC2WX((const __wchar_t* ) item.pszText));
+#else
             m_buf = new wxWC2WXbuf(wxConvLocal.cWC2WX(item.pszText));
+#endif
             m_item->pszText = (wxChar*)m_buf->data();
         }
         else
@@ -598,7 +603,7 @@ bool wxListCtrl::GetColumn(int col, wxListItem& item) const
         lvCol.mask |= LVCF_IMAGE;
     }
 
-    bool success = ListView_GetColumn(GetHwnd(), col, & lvCol) != 0;
+    bool success = ListView_GetColumn(GetHwnd(), col, &lvCol) != 0;
 
     //  item.m_subItem = lvCol.iSubItem;
     item.m_width = lvCol.cx;
@@ -611,12 +616,20 @@ bool wxListCtrl::GetColumn(int col, wxListItem& item) const
 
     if ( item.m_mask & wxLIST_MASK_FORMAT )
     {
-        if (lvCol.fmt == LVCFMT_LEFT)
-            item.m_format = wxLIST_FORMAT_LEFT;
-        else if (lvCol.fmt == LVCFMT_RIGHT)
-            item.m_format = wxLIST_FORMAT_RIGHT;
-        else if (lvCol.fmt == LVCFMT_CENTER)
-            item.m_format = wxLIST_FORMAT_CENTRE;
+        switch (lvCol.fmt & LVCFMT_JUSTIFYMASK) {
+            case LVCFMT_LEFT:
+                item.m_format = wxLIST_FORMAT_LEFT;
+                break;
+            case LVCFMT_RIGHT:
+                item.m_format = wxLIST_FORMAT_RIGHT;
+                break;
+            case LVCFMT_CENTER:
+                item.m_format = wxLIST_FORMAT_CENTRE;
+                break;
+            default:
+                item.m_format = -1;  // Unknown?
+                break;
+        }
     }
 
 #if _WIN32_IE >= 0x0300
@@ -962,11 +975,7 @@ bool wxListCtrl::GetItemRect(long item, wxRect& rect, int code) const
         codeWin = LVIR_BOUNDS;
     }
 
-#ifdef __WXWINE__
-    bool success = ListView_GetItemRect(GetHwnd(), (int) item, &rectWin ) != 0;
-#else
     bool success = ListView_GetItemRect(GetHwnd(), (int) item, &rectWin, codeWin) != 0;
-#endif
 
     rect.x = rectWin.left;
     rect.y = rectWin.top;