From c63e733f26d3533cb00009f284d251f37df32b8d Mon Sep 17 00:00:00 2001 From: Eduardo Enrique Davila Serrano Date: Mon, 17 Oct 2022 16:30:38 +0200 Subject: [PATCH] #3325 bug windows wxstring ascii --- src/creaImageIOWxTreeView.cpp | 42 +++++++++++------------------------ 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/src/creaImageIOWxTreeView.cpp b/src/creaImageIOWxTreeView.cpp index c324fab..5ab7abc 100644 --- a/src/creaImageIOWxTreeView.cpp +++ b/src/creaImageIOWxTreeView.cpp @@ -44,34 +44,24 @@ namespace creaImageIO //===================================================================== ///Comparing function for ordering algorithm. Takes parameters as strings. -int wxCALLBACK CompareFunctionStrings(long item1, long item2, long sortData) +//int wxCALLBACK CompareFunctionStrings(long item1, long item2, long sortData) +int wxCALLBACK CompareFunctionStrings(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData) { creaImageIO::ItemData* data1 = (creaImageIO::ItemData*)item1; creaImageIO::ItemData* data2 = (creaImageIO::ItemData*)item2; - const std::string& s1(*(data1->attr)); - const std::string& s2(*(data2->attr)); - + const std::string& s2(*(data2->attr)); if(sortData==1) { // inverse the order - if (s1 < s2) - return 1; - if (s1 > s2) - return -1; - + if (s1 < s2) return 1; + if (s1 > s2) return -1; return 0; - } - else - { - if (s1 < s2) - return -1; - if (s1 > s2) - return 1; - + } else { + if (s1 < s2) return -1; + if (s1 > s2) return 1; return 0; - - } + } // if sortData } //===================================================================== @@ -566,15 +556,12 @@ namespace creaImageIO val = "X"; } item.SetText( crea::std2wx(val)); - item.SetColumn(k); - + item.SetColumn(k); GetCtrl(l)->SetItem(item); } // for k item.Clear(); - - } // for j - } // for i - + } // for j + } // for i SortLevel(l); GetCtrl(l)->Show(); } @@ -794,7 +781,6 @@ namespace creaImageIO { mLevelList[level].SortAscending = false; } - SortLevel(level); } //================================================================ @@ -960,13 +946,11 @@ namespace creaImageIO data->selected = true; nbselected++; } // if - }// for - + }// for GimmickDebugMessage(1, "WxTreeView::OnSort : " <