���������滻����
| 199 | |
| 200 | //���������滻���� |
| 201 | void BatchFindReplace::on_replaceBtClick() |
| 202 | { |
| 203 | if (m_mainNotepad != nullptr) |
| 204 | { |
| 205 | int rowNums = ui.findReplaceTable->rowCount(); |
| 206 | if (rowNums == 0) |
| 207 | { |
| 208 | CTipWin::showTips(this, tr("Please fresh first !"), 1200); |
| 209 | return; |
| 210 | } |
| 211 | |
| 212 | |
| 213 | QStringList findKeyList; |
| 214 | QStringList replaceKeyList; |
| 215 | |
| 216 | for (int i = 0; i < rowNums; ++i) |
| 217 | { |
| 218 | QTableWidgetItem* item = ui.findReplaceTable->item(i, 0); |
| 219 | if (item != nullptr && !item->text().isEmpty()) |
| 220 | { |
| 221 | QTableWidgetItem* replaceItem = ui.findReplaceTable->item(i, 1); |
| 222 | if (replaceItem != nullptr) |
| 223 | { |
| 224 | if (item->text() != replaceItem->text()) |
| 225 | { |
| 226 | findKeyList.append(item->text()); |
| 227 | replaceKeyList.append(replaceItem->text()); |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | m_mainNotepad->replaceAtBack(findKeyList, replaceKeyList); |
| 233 | |
| 234 | ui.statusBar->showMessage(tr("Batch Replace Finished, total Replace %1 times !").arg(findKeyList.size()), 10000); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | void BatchFindReplace::on_swapFindReplace() |
| 239 | { |
nothing calls this directly
no test coverage detected