eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot/wxwin searchpanel.cc


From: eliot-dev
Subject: [Eliot-dev] eliot/wxwin searchpanel.cc
Date: Mon, 28 Jul 2008 19:57:46 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/07/28 19:57:46

Modified files:
        wxwin          : searchpanel.cc 

Log message:
        Oops... I forgot to update this file when simplifying the prototype of 
Dictionary::searchRegExp()

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/wxwin/searchpanel.cc?cvsroot=eliot&r1=1.17&r2=1.18

Patches:
Index: searchpanel.cc
===================================================================
RCS file: /cvsroot/eliot/eliot/wxwin/searchpanel.cc,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- searchpanel.cc      2 Mar 2008 18:45:11 -0000       1.17
+++ searchpanel.cc      28 Jul 2008 19:57:46 -0000      1.18
@@ -29,7 +29,6 @@
 
 #include "ewx.h"
 #include "dic.h"
-#include "regexp.h"
 #include "searchpanel.h"
 #include "tile.h"
 #include "configdb.h"
@@ -229,13 +228,11 @@
 
 class PRegExp : public SimpleSearchPanel
 {
-protected:
+private:
   wxTextCtrl                *omin;
   wxTextCtrl                *omax;
-  struct search_RegE_list_t llist;
 
-  virtual void build_letter_lists();
-  virtual void panel_options();
+  void panel_options();
 public:
   void compute_char(wxCommandEvent&) {}
   void compute_enter(wxCommandEvent&);
@@ -243,53 +240,6 @@
 };
 
 void
-PRegExp::build_letter_lists()
-{
-  memset (&llist, 0, sizeof(llist));
-
-  llist.minlength = 1;
-  llist.maxlength = 15;
-
-  llist.symbl[0] = RE_ALL_MATCH;
-  llist.symbl[1] = RE_VOWL_MATCH;
-  llist.symbl[2] = RE_CONS_MATCH;
-  llist.symbl[3] = RE_USR1_MATCH;
-  llist.symbl[5] = RE_USR2_MATCH;
-
-  llist.valid[0] = 1; // all letters
-  llist.valid[1] = 1; // vowels
-  llist.valid[2] = 1; // consonants
-  llist.valid[3] = 0; // user defined list 1
-  llist.valid[4] = 0; // user defined list 2
-
-  for(int i = 0; i < DIC_SEARCH_REGE_LIST; i++)
-    {
-      memset(llist.letters[i],0,sizeof(llist.letters[i]));
-    }
-
-  const std::vector<Tile>& allTiles = dic->getAllTiles();
-  std::vector<Tile>::const_iterator it;
-  for (it = allTiles.begin(); it != allTiles.end(); it++)
-    {
-      if (! it->isJoker() && ! it->isEmpty())
-       {
-         // all tiles
-         llist.letters[0][it->toCode()] = 1;
-         // vowels
-         if (it->isVowel())
-           {
-             llist.letters[1][it->toCode()] = 1;
-           }
-         // consonants
-         if (it->isConsonant())
-           {
-             llist.letters[2][it->toCode()] = 1;
-           }
-       }
-    }
-}
-
-void
 PRegExp::panel_options()
 {
   wxStaticText *otmin;
@@ -317,8 +267,6 @@
     if (!check_dic())
         return;
 
-    build_letter_lists();
-
     wstring regexp = t->GetValue().wc_str();
     debug("PRegExp::compute_enter for %ls", regexp.c_str());
 
@@ -326,8 +274,6 @@
     int lmax = atoi((const char*)omax->GetValue().mb_str());
     if (lmax <= (DIC_WORD_MAX - 1) && lmin >= 1 && lmin <= lmax)
     {
-        llist.minlength = lmin;
-        llist.maxlength = lmax;
         debug(" length %d,%d",lmin,lmax);
     }
     else
@@ -335,11 +281,12 @@
         debug(" bad length -%s,%s-",
               (const char*)omin->GetValue().mb_str(),
               (const char*)omax->GetValue().mb_str());
+        return;
     }
     debug("\n");
 
     vector<wstring> wordList;
-    dic->searchRegExp(regexp, wordList, &llist);
+    dic->searchRegExp(regexp, wordList, lmin, lmax);
 
     wxString *res = new wxString[wordList.size()];
     int resnum = 0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]