Changeset 27602
- Timestamp:
- 11/17/08 08:15:44 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lyx-devel/trunk/src/frontends/qt4/GuiThesaurus.cpp
r27572 r27602 106 106 107 107 QString item = meaningsTV->currentItem()->text(col); 108 // cut out the classification in brackets 109 // (as in "hominid (generic term)") 110 // FIXME: not ideal yet. We need to cut off classifications 111 // at the beginning as well 112 // (as in "(noun) man" and "(noun) male (generic term)") 108 // cut out the classification in brackets: 109 // "hominid (generic term)" -> "hominid" 113 110 QRegExp re("^([^\\(\\)]+)\\b\\(?.*\\)?.*$"); 111 // This is for items with classifications at the beginning: 112 // "(noun) man" -> "man"; "(noun) male (generic term)" -> "male" 113 QRegExp rex("^(\\(.+\\))\\s*([^\\(\\)]+)\\s*\\(?.*\\)?.*$"); 114 114 int pos = re.indexIn(item); 115 115 if (pos > -1) 116 116 item = re.cap(1).trimmed(); 117 pos = rex.indexIn(item); 118 if (pos > -1) 119 item = rex.cap(2).trimmed(); 117 120 replaceED->setText(item); 118 121 replacePB->setEnabled(true); … … 130 133 { 131 134 QString str = item->text(col); 132 // cut out the classification in brackets 133 // (as in "hominid (generic term)") 134 // FIXME: not ideal yet. We need to cut off classifications 135 // at the beginning as well 136 // (as in "(noun) man" and "(noun) male (generic term)") 135 // cut out the classification in brackets: 136 // "hominid (generic term)" -> "hominid" 137 137 QRegExp re("^([^\\(\\)]+)\\b\\(?.*\\)?.*$"); 138 // This is for items with classifications at the beginning: 139 // "(noun) man" -> "man"; "(noun) male (generic term)" -> "male" 140 QRegExp rex("^(\\(.+\\))\\s*([^\\(\\)]+)\\s*\\(?.*\\)?.*$"); 138 141 int pos = re.indexIn(str); 139 142 if (pos > -1) 140 143 str = re.cap(1).trimmed(); 144 pos = rex.indexIn(str); 145 if (pos > -1) 146 str = rex.cap(2).trimmed(); 141 147 entryCO->insertItem(0, str); 142 148 entryCO->setCurrentIndex(0);
