Merge branch 'master' into features/indexmacros

This commit is contained in:
Juergen Spitzmueller 2022-04-20 08:38:12 +02:00
commit 8917319924
9 changed files with 171 additions and 153 deletions

View File

@ -94,8 +94,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: LyX 2.4git\n" "Project-Id-Version: LyX 2.4git\n"
"Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n"
"POT-Creation-Date: 2022-04-14 10:20+0200\n" "POT-Creation-Date: 2022-04-20 08:01+0200\n"
"PO-Revision-Date: 2022-04-14 10:26+0200\n" "PO-Revision-Date: 2022-04-20 08:03+0200\n"
"Last-Translator: Jürgen Spitzmüller <spitz@lyx.org>\n" "Last-Translator: Jürgen Spitzmüller <spitz@lyx.org>\n"
"Language-Team: Deutsch <lyx-docs@lists.lyx.org>\n" "Language-Team: Deutsch <lyx-docs@lists.lyx.org>\n"
"Language: de\n" "Language: de\n"
@ -29131,15 +29131,15 @@ msgstr "Die Ausgabe ist leer"
msgid "No output file was generated." msgid "No output file was generated."
msgstr "Es wurde keine Ausgabedatei erzeugt." msgstr "Es wurde keine Ausgabedatei erzeugt."
#: src/Cursor.cpp:416 src/Text.cpp:2141 #: src/Cursor.cpp:417 src/Text.cpp:2141
msgid ", Inset: " msgid ", Inset: "
msgstr ", Einfügung: " msgstr ", Einfügung: "
#: src/Cursor.cpp:417 src/Text.cpp:2143 #: src/Cursor.cpp:418 src/Text.cpp:2143
msgid ", Cell: " msgid ", Cell: "
msgstr ", Zelle: " msgstr ", Zelle: "
#: src/Cursor.cpp:418 src/Text.cpp:2146 #: src/Cursor.cpp:419 src/Text.cpp:2146
msgid ", Position: " msgid ", Position: "
msgstr ", Position: " msgstr ", Position: "
@ -37170,28 +37170,28 @@ msgstr "%1$d Zeichenketten wurden in der Auswahl ersetzt."
msgid "%1$d strings have been replaced." msgid "%1$d strings have been replaced."
msgstr "%1$d Zeichenketten wurden ersetzt." msgstr "%1$d Zeichenketten wurden ersetzt."
#: src/lyxfind.cpp:4683 #: src/lyxfind.cpp:4679
msgid "One match has been replaced." msgid "One match has been replaced."
msgstr "Ein Treffer wurde ersetzt." msgstr "Ein Treffer wurde ersetzt."
#: src/lyxfind.cpp:4686 #: src/lyxfind.cpp:4682
msgid "Two matches have been replaced." msgid "Two matches have been replaced."
msgstr "Zwei Treffer wurden ersetzt." msgstr "Zwei Treffer wurden ersetzt."
#: src/lyxfind.cpp:4689 #: src/lyxfind.cpp:4685
#, c-format #, c-format
msgid "%1$d matches have been replaced." msgid "%1$d matches have been replaced."
msgstr "%1$d Treffer wurden ersetzt." msgstr "%1$d Treffer wurden ersetzt."
#: src/lyxfind.cpp:4695 #: src/lyxfind.cpp:4691
msgid "Match not found." msgid "Match not found."
msgstr "Die Zeichenkette wurde nicht gefunden!" msgstr "Die Zeichenkette wurde nicht gefunden!"
#: src/lyxfind.cpp:4701 #: src/lyxfind.cpp:4697
msgid "Match has been replaced." msgid "Match has been replaced."
msgstr "Die Zeichenkette wurde ersetzt." msgstr "Die Zeichenkette wurde ersetzt."
#: src/lyxfind.cpp:4703 #: src/lyxfind.cpp:4699
msgid "Match found." msgid "Match found."
msgstr "Die Zeichenkette wurde gefunden!" msgstr "Die Zeichenkette wurde gefunden!"
@ -37632,18 +37632,22 @@ msgid "Selection copy/paste mechanism"
msgstr "Auswahl kopieren/einfügen Mechanismus" msgstr "Auswahl kopieren/einfügen Mechanismus"
#: src/support/debug.cpp:74 #: src/support/debug.cpp:74
msgid "Find and replace mechanism" msgid "Find and replace mechanism, terse version"
msgstr "Mechanismus für Suchen und Ersetzen" msgstr "Mechanismus für Suchen und Ersetzen (knapp)"
#: src/support/debug.cpp:75 #: src/support/debug.cpp:75
msgid "Find and replace mechanism, verbose version"
msgstr "Mechanismus für Suchen und Ersetzen (ausführlich)"
#: src/support/debug.cpp:76
msgid "Developers' general debug messages" msgid "Developers' general debug messages"
msgstr "Allgemeine Testmeldungen der Entwickler" msgstr "Allgemeine Testmeldungen der Entwickler"
#: src/support/debug.cpp:76 src/support/debug.cpp:77 #: src/support/debug.cpp:77 src/support/debug.cpp:78
msgid "All debugging messages" msgid "All debugging messages"
msgstr "Alle Testmeldungen" msgstr "Alle Testmeldungen"
#: src/support/debug.cpp:184 #: src/support/debug.cpp:185
#, c-format #, c-format
msgid "Debugging `%1$s' (%2$s)" msgid "Debugging `%1$s' (%2$s)"
msgstr "Testen von ,%1$s` (%2$s)" msgstr "Testen von ,%1$s` (%2$s)"

BIN
po/fr.gmo

Binary file not shown.

View File

@ -362,8 +362,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: LyX 2.4\n" "Project-Id-Version: LyX 2.4\n"
"Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n"
"POT-Creation-Date: 2022-03-17 18:13+0100\n" "POT-Creation-Date: 2022-04-19 18:17+0200\n"
"PO-Revision-Date: 2022-03-17 18:23+0100\n" "PO-Revision-Date: 2022-04-19 18:20+0200\n"
"Last-Translator: Jean-Pierre Chrétien <jeanpierre.chretien@free.fr>\n" "Last-Translator: Jean-Pierre Chrétien <jeanpierre.chretien@free.fr>\n"
"Language-Team: lyxfr\n" "Language-Team: lyxfr\n"
"Language: fr\n" "Language: fr\n"
@ -17388,8 +17388,8 @@ msgstr "Marge"
msgid "Greyedout" msgid "Greyedout"
msgstr "Grisée" msgstr "Grisée"
#: lib/layouts/stdinsets.inc:208 src/insets/InsetERT.cpp:253 #: lib/layouts/stdinsets.inc:208 src/insets/InsetERT.cpp:251
#: src/insets/InsetERT.cpp:254 #: src/insets/InsetERT.cpp:252
msgid "ERT" msgid "ERT"
msgstr "TeX" msgstr "TeX"
@ -19954,7 +19954,7 @@ msgstr "Copier comme référence|C"
#: lib/ui/stdcontext.inc:61 lib/ui/stdcontext.inc:375 lib/ui/stdmenus.inc:108 #: lib/ui/stdcontext.inc:61 lib/ui/stdcontext.inc:375 lib/ui/stdmenus.inc:108
#: lib/ui/stdtoolbars.inc:86 src/Text3.cpp:1584 #: lib/ui/stdtoolbars.inc:86 src/Text3.cpp:1584
#: src/mathed/InsetMathNest.cpp:555 #: src/mathed/InsetMathNest.cpp:561
msgid "Cut" msgid "Cut"
msgstr "Couper" msgstr "Couper"
@ -19966,7 +19966,7 @@ msgstr "Copier"
#: lib/ui/stdcontext.inc:63 lib/ui/stdcontext.inc:377 lib/ui/stdmenus.inc:110 #: lib/ui/stdcontext.inc:63 lib/ui/stdcontext.inc:377 lib/ui/stdmenus.inc:110
#: lib/ui/stdtoolbars.inc:88 src/Text3.cpp:1528 #: lib/ui/stdtoolbars.inc:88 src/Text3.cpp:1528
#: src/frontends/qt/GuiToolbar.cpp:441 src/mathed/InsetMathGrid.cpp:1565 #: src/frontends/qt/GuiToolbar.cpp:441 src/mathed/InsetMathGrid.cpp:1565
#: src/mathed/InsetMathNest.cpp:533 #: src/mathed/InsetMathNest.cpp:539
msgid "Paste" msgid "Paste"
msgstr "Coller" msgstr "Coller"
@ -28336,8 +28336,8 @@ msgstr "texte d'insert grisé"
#: src/insets/InsetCommandParams.cpp:508 src/insets/InsetCommandParams.cpp:516 #: src/insets/InsetCommandParams.cpp:508 src/insets/InsetCommandParams.cpp:516
#: src/insets/InsetGraphics.cpp:900 src/insets/InsetGraphics.cpp:908 #: src/insets/InsetGraphics.cpp:900 src/insets/InsetGraphics.cpp:908
#: src/insets/InsetListings.cpp:299 src/insets/InsetListings.cpp:307 #: src/insets/InsetListings.cpp:299 src/insets/InsetListings.cpp:307
#: src/insets/InsetListings.cpp:332 src/mathed/MathExtern.cpp:1440 #: src/insets/InsetListings.cpp:332 src/mathed/MathExtern.cpp:1444
#: src/mathed/MathExtern.cpp:1514 #: src/mathed/MathExtern.cpp:1518
msgid "LyX Warning: " msgid "LyX Warning: "
msgstr "Avertissement LyX : " msgstr "Avertissement LyX : "
@ -28346,7 +28346,7 @@ msgstr "Avertissement LyX : "
#: src/insets/InsetCommandParams.cpp:509 src/insets/InsetCommandParams.cpp:517 #: src/insets/InsetCommandParams.cpp:509 src/insets/InsetCommandParams.cpp:517
#: src/insets/InsetGraphics.cpp:901 src/insets/InsetGraphics.cpp:909 #: src/insets/InsetGraphics.cpp:901 src/insets/InsetGraphics.cpp:909
#: src/insets/InsetListings.cpp:300 src/insets/InsetListings.cpp:308 #: src/insets/InsetListings.cpp:300 src/insets/InsetListings.cpp:308
#: src/mathed/MathExtern.cpp:1441 src/mathed/MathExtern.cpp:1515 #: src/mathed/MathExtern.cpp:1445 src/mathed/MathExtern.cpp:1519
msgid "uncodable character" msgid "uncodable character"
msgstr "caractère incodable" msgstr "caractère incodable"
@ -29440,15 +29440,15 @@ msgstr "La sortie est vide"
msgid "No output file was generated." msgid "No output file was generated."
msgstr "Aucun fichier imprimable créé." msgstr "Aucun fichier imprimable créé."
#: src/Cursor.cpp:416 src/Text.cpp:2141 #: src/Cursor.cpp:417 src/Text.cpp:2141
msgid ", Inset: " msgid ", Inset: "
msgstr ", insert : " msgstr ", insert : "
#: src/Cursor.cpp:417 src/Text.cpp:2143 #: src/Cursor.cpp:418 src/Text.cpp:2143
msgid ", Cell: " msgid ", Cell: "
msgstr ", cellule : " msgstr ", cellule : "
#: src/Cursor.cpp:418 src/Text.cpp:2146 #: src/Cursor.cpp:419 src/Text.cpp:2146
msgid ", Position: " msgid ", Position: "
msgstr ", position : " msgstr ", position : "
@ -30865,7 +30865,7 @@ msgstr "Mode éditeur mathématique"
msgid "No valid math formula" msgid "No valid math formula"
msgstr "Pas de formule mathématique valide" msgstr "Pas de formule mathématique valide"
#: src/Text3.cpp:210 src/mathed/InsetMathNest.cpp:1032 #: src/Text3.cpp:210 src/mathed/InsetMathNest.cpp:1038
msgid "Already in regular expression mode" msgid "Already in regular expression mode"
msgstr "Déjà en mode « expression régulière »" msgstr "Déjà en mode « expression régulière »"
@ -37072,7 +37072,7 @@ msgstr "Description : "
msgid "Sorting: " msgid "Sorting: "
msgstr "Tri : " msgstr "Tri : "
#: src/insets/InsetNote.cpp:252 #: src/insets/InsetNote.cpp:269
msgid "note" msgid "note"
msgstr "note" msgstr "note"
@ -37250,20 +37250,20 @@ msgstr ""
"L'information de suivi de modifications pour les lignes/colonnes de tableau " "L'information de suivi de modifications pour les lignes/colonnes de tableau "
"est incomplète. Elle sera ignorée." "est incomplète. Elle sera ignorée."
#: src/insets/InsetTabular.cpp:5680 #: src/insets/InsetTabular.cpp:5636
msgid "Column movement not supported with multi-columns." msgid "Column movement not supported with multi-columns."
msgstr "Déplacement de colonne non implanté pour les colonnes multiples." msgstr "Déplacement de colonne non implanté pour les colonnes multiples."
#: src/insets/InsetTabular.cpp:5698 #: src/insets/InsetTabular.cpp:5654
msgid "Row movement not supported with multi-rows." msgid "Row movement not supported with multi-rows."
msgstr "Déplacement de ligne non implanté pour les lignes multiples." msgstr "Déplacement de ligne non implanté pour les lignes multiples."
#: src/insets/InsetTabular.cpp:6219 #: src/insets/InsetTabular.cpp:6175
msgid "Selection size should match clipboard content." msgid "Selection size should match clipboard content."
msgstr "" msgstr ""
"La taille de la sélection doit correspondre au contenu du presse-papier." "La taille de la sélection doit correspondre au contenu du presse-papier."
#: src/insets/InsetText.cpp:1380 #: src/insets/InsetText.cpp:1381
msgid "[contains tracked changes]" msgid "[contains tracked changes]"
msgstr "[contient les modifications suivies]" msgstr "[contient les modifications suivies]"
@ -37412,28 +37412,28 @@ msgstr "%1$d chaînes remplacées dans le sélection."
msgid "%1$d strings have been replaced." msgid "%1$d strings have been replaced."
msgstr "%1$d chaînes remplacées." msgstr "%1$d chaînes remplacées."
#: src/lyxfind.cpp:4584 #: src/lyxfind.cpp:4680
msgid "One match has been replaced." msgid "One match has been replaced."
msgstr "Une correspondance a été remplacée." msgstr "Une correspondance a été remplacée."
#: src/lyxfind.cpp:4587 #: src/lyxfind.cpp:4683
msgid "Two matches have been replaced." msgid "Two matches have been replaced."
msgstr "Deux correspondances ont été remplacées." msgstr "Deux correspondances ont été remplacées."
#: src/lyxfind.cpp:4590 #: src/lyxfind.cpp:4686
#, c-format #, c-format
msgid "%1$d matches have been replaced." msgid "%1$d matches have been replaced."
msgstr "%1$d correspondances ont été remplacées." msgstr "%1$d correspondances ont été remplacées."
#: src/lyxfind.cpp:4596 #: src/lyxfind.cpp:4692
msgid "Match not found." msgid "Match not found."
msgstr "Chaîne de caractères introuvable." msgstr "Chaîne de caractères introuvable."
#: src/lyxfind.cpp:4602 #: src/lyxfind.cpp:4698
msgid "Match has been replaced." msgid "Match has been replaced."
msgstr "Chaîne de caractères remplacée." msgstr "Chaîne de caractères remplacée."
#: src/lyxfind.cpp:4604 #: src/lyxfind.cpp:4700
msgid "Match found." msgid "Match found."
msgstr "Chaîne de caractères reconnue." msgstr "Chaîne de caractères reconnue."
@ -37556,19 +37556,19 @@ msgstr "Macros mathématique : \\%1$s"
msgid "Invalid macro! \\%1$s" msgid "Invalid macro! \\%1$s"
msgstr "Macro mathématique invalide ! \\%1$s" msgstr "Macro mathématique invalide ! \\%1$s"
#: src/mathed/InsetMathNest.cpp:1018 #: src/mathed/InsetMathNest.cpp:1024
msgid "create new math text environment ($...$)" msgid "create new math text environment ($...$)"
msgstr "créé un nouvel environnement texte math ($...$)" msgstr "créé un nouvel environnement texte math ($...$)"
#: src/mathed/InsetMathNest.cpp:1021 #: src/mathed/InsetMathNest.cpp:1027
msgid "entered math text mode (textrm)" msgid "entered math text mode (textrm)"
msgstr "entré en mode texte math (textrm)" msgstr "entré en mode texte math (textrm)"
#: src/mathed/InsetMathNest.cpp:1043 #: src/mathed/InsetMathNest.cpp:1049
msgid "Regular expression editor mode" msgid "Regular expression editor mode"
msgstr "Mode d'édition « expression régulière »" msgstr "Mode d'édition « expression régulière »"
#: src/mathed/InsetMathNest.cpp:1948 #: src/mathed/InsetMathNest.cpp:1954
#, c-format #, c-format
msgid "Cannot apply %1$s here." msgid "Cannot apply %1$s here."
msgstr "Impossible d'appliquer %1$s ici." msgstr "Impossible d'appliquer %1$s ici."
@ -37875,18 +37875,22 @@ msgid "Selection copy/paste mechanism"
msgstr "Mécanisme de sélection copier/coller" msgstr "Mécanisme de sélection copier/coller"
#: src/support/debug.cpp:74 #: src/support/debug.cpp:74
msgid "Find and replace mechanism" msgid "Find and replace mechanism, terse version"
msgstr "Rechercher et remplacer" msgstr "Rechercher et remplacer, version laconique du moteur"
#: src/support/debug.cpp:75 #: src/support/debug.cpp:75
msgid "Find and replace mechanism, verbose version"
msgstr "Rechercher et remplacer, version bavarde du moteur"
#: src/support/debug.cpp:76
msgid "Developers' general debug messages" msgid "Developers' general debug messages"
msgstr "Messages de débogage généraux pour les développeurs" msgstr "Messages de débogage généraux pour les développeurs"
#: src/support/debug.cpp:76 src/support/debug.cpp:77 #: src/support/debug.cpp:77 src/support/debug.cpp:78
msgid "All debugging messages" msgid "All debugging messages"
msgstr "Tous les messages de débogage" msgstr "Tous les messages de débogage"
#: src/support/debug.cpp:184 #: src/support/debug.cpp:185
#, c-format #, c-format
msgid "Debugging `%1$s' (%2$s)" msgid "Debugging `%1$s' (%2$s)"
msgstr "Débogage de '%1$s' (%2$s)" msgstr "Débogage de '%1$s' (%2$s)"

BIN
po/messages.mo Normal file

Binary file not shown.

View File

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: LyX-2.4\n" "Project-Id-Version: LyX-2.4\n"
"Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n"
"POT-Creation-Date: 2022-03-22 11:42+0100\n" "POT-Creation-Date: 2022-04-19 16:14+0200\n"
"PO-Revision-Date: 2022-03-24 10:17+0000\n" "PO-Revision-Date: 2022-04-19 14:15+0000\n"
"Last-Translator: Kornel Benko <kornel@lyx.org>\n" "Last-Translator: Kornel Benko <kornel@lyx.org>\n"
"Language-Team: Slovak <kornel@lyx.org>\n" "Language-Team: Slovak <kornel@lyx.org>\n"
"Language: sk\n" "Language: sk\n"
@ -37160,9 +37160,13 @@ msgstr "Lokalizácia/Nastavenie jazyka"
msgid "Selection copy/paste mechanism" msgid "Selection copy/paste mechanism"
msgstr "Výber kopírovania/vlepenia z/do schránky" msgstr "Výber kopírovania/vlepenia z/do schránky"
#: src/support/debug.cpp:73 #: src/support/debug.cpp:74
msgid "Find and replace mechanism" msgid "Find and replace mechanism, terse version"
msgstr "Mechanizmus hľadať a nahradiť" msgstr "Mechanizmus hľadať a nahradiť, lapidárna verzia"
#: src/support/debug.cpp:75
msgid "Find and replace mechanism, verbose version"
msgstr "Mechanizmus hľadať a nahradiť, táravá verzia"
#: src/support/debug.cpp:74 #: src/support/debug.cpp:74
msgid "Developers' general debug messages" msgid "Developers' general debug messages"
@ -37310,6 +37314,9 @@ msgstr ""
msgid "Unknown user" msgid "Unknown user"
msgstr "Neznámy používateľ" msgstr "Neznámy používateľ"
#~ msgid "Find and replace mechanism"
#~ msgstr "Mechanizmus hľadať a nahradiť"
#~ msgid "Set all lines" #~ msgid "Set all lines"
#~ msgstr "Nastaviť všetky čiary" #~ msgstr "Nastaviť všetky čiary"

View File

@ -115,9 +115,9 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
case Qt::Key_Tab: case Qt::Key_Tab:
if (e->modifiers() == Qt::NoModifier) { if (e->modifiers() == Qt::NoModifier) {
if (obj == find_work_area_){ if (obj == find_work_area_){
LYXERR(Debug::FIND, "Focusing replace WA"); LYXERR(Debug::FINDVERBOSE, "Focusing replace WA");
replace_work_area_->setFocus(); replace_work_area_->setFocus();
LYXERR(Debug::FIND, "Selecting entire replace buffer"); LYXERR(Debug::FINDVERBOSE, "Selecting entire replace buffer");
dispatch(FuncRequest(LFUN_BUFFER_BEGIN)); dispatch(FuncRequest(LFUN_BUFFER_BEGIN));
dispatch(FuncRequest(LFUN_BUFFER_END_SELECT)); dispatch(FuncRequest(LFUN_BUFFER_END_SELECT));
return true; return true;
@ -127,9 +127,9 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
case Qt::Key_Backtab: case Qt::Key_Backtab:
if (obj == replace_work_area_) { if (obj == replace_work_area_) {
LYXERR(Debug::FIND, "Focusing find WA"); LYXERR(Debug::FINDVERBOSE, "Focusing find WA");
find_work_area_->setFocus(); find_work_area_->setFocus();
LYXERR(Debug::FIND, "Selecting entire find buffer"); LYXERR(Debug::FINDVERBOSE, "Selecting entire find buffer");
dispatch(FuncRequest(LFUN_BUFFER_BEGIN)); dispatch(FuncRequest(LFUN_BUFFER_BEGIN));
dispatch(FuncRequest(LFUN_BUFFER_END_SELECT)); dispatch(FuncRequest(LFUN_BUFFER_END_SELECT));
return true; return true;
@ -172,7 +172,7 @@ static vector<string> const & allManualsFiles()
static bool nextDocumentBuffer(Buffer * & buf) static bool nextDocumentBuffer(Buffer * & buf)
{ {
ListOfBuffers const children = buf->allRelatives(); ListOfBuffers const children = buf->allRelatives();
LYXERR(Debug::FIND, "children.size()=" << children.size()); LYXERR(Debug::FINDVERBOSE, "children.size()=" << children.size());
ListOfBuffers::const_iterator it = ListOfBuffers::const_iterator it =
find(children.begin(), children.end(), buf); find(children.begin(), children.end(), buf);
LASSERT(it != children.end(), return false); LASSERT(it != children.end(), return false);
@ -193,7 +193,7 @@ static bool nextDocumentBuffer(Buffer * & buf)
static bool prevDocumentBuffer(Buffer * & buf) static bool prevDocumentBuffer(Buffer * & buf)
{ {
ListOfBuffers const children = buf->allRelatives(); ListOfBuffers const children = buf->allRelatives();
LYXERR(Debug::FIND, "children.size()=" << children.size()); LYXERR(Debug::FINDVERBOSE, "children.size()=" << children.size());
ListOfBuffers::const_iterator it = ListOfBuffers::const_iterator it =
find(children.begin(), children.end(), buf); find(children.begin(), children.end(), buf);
LASSERT(it != children.end(), return false) LASSERT(it != children.end(), return false)
@ -344,9 +344,9 @@ bool FindAndReplaceWidget::findAndReplaceScope(FindAndReplaceOptions & opt, bool
UndoGroupHelper helper(buf); UndoGroupHelper helper(buf);
do { do {
LYXERR(Debug::FIND, "Dispatching LFUN_WORD_FINDADV"); LYXERR(Debug::FINDVERBOSE, "Dispatching LFUN_WORD_FINDADV");
dispatch(cmd); dispatch(cmd);
LYXERR(Debug::FIND, "dispatched"); LYXERR(Debug::FINDVERBOSE, "dispatched");
if (bv->cursor().result().dispatched()) { if (bv->cursor().result().dispatched()) {
// New match found and selected (old selection replaced if needed) // New match found and selected (old selection replaced if needed)
if (replace_all) if (replace_all)
@ -398,7 +398,7 @@ bool FindAndReplaceWidget::findAndReplaceScope(FindAndReplaceOptions & opt, bool
//lyx::dispatch(FuncRequest(LFUN_BUFFER_END)); //lyx::dispatch(FuncRequest(LFUN_BUFFER_END));
bv->cursor().setCursor(doc_iterator_end(buf)); bv->cursor().setCursor(doc_iterator_end(buf));
bv->cursor().backwardPos(); bv->cursor().backwardPos();
LYXERR(Debug::FIND, "findBackAdv5: cur: " LYXERR(Debug::FINDVERBOSE, "findBackAdv5: cur: "
<< bv->cursor()); << bv->cursor());
} }
bv->clearSelection(); bv->clearSelection();
@ -454,7 +454,7 @@ bool FindAndReplaceWidget::findAndReplace(
? FindAndReplaceOptions::R_ONLY_MATHS ? FindAndReplaceOptions::R_ONLY_MATHS
: FindAndReplaceOptions::R_EVERYTHING; : FindAndReplaceOptions::R_EVERYTHING;
LYXERR(Debug::FIND, "FindAndReplaceOptions: " LYXERR(Debug::FINDVERBOSE, "FindAndReplaceOptions: "
<< "find_buf_name=" << find_buf_name << "find_buf_name=" << find_buf_name
<< ", casesensitiv=" << casesensitive << ", casesensitiv=" << casesensitive
<< ", matchword=" << matchword << ", matchword=" << matchword
@ -556,7 +556,7 @@ void FindAndReplaceWidget::showEvent(QShowEvent * /* ev */)
replace_work_area_->installEventFilter(this); replace_work_area_->installEventFilter(this);
view_.setCurrentWorkArea(find_work_area_); view_.setCurrentWorkArea(find_work_area_);
LYXERR(Debug::FIND, "Selecting entire find buffer"); LYXERR(Debug::FINDVERBOSE, "Selecting entire find buffer");
dispatch(FuncRequest(LFUN_BUFFER_BEGIN)); dispatch(FuncRequest(LFUN_BUFFER_BEGIN));
dispatch(FuncRequest(LFUN_BUFFER_END_SELECT)); dispatch(FuncRequest(LFUN_BUFFER_END_SELECT));
} }

View File

@ -875,7 +875,7 @@ string correctRegex(string t, bool withformat)
replace = accents["braceright"]; replace = accents["braceright"];
else { else {
// else part should not exist // else part should not exist
LASSERT(1, /**/); LASSERT(0, /**/);
} }
} }
else { else {
@ -885,7 +885,7 @@ string correctRegex(string t, bool withformat)
replace = "\\}"; replace = "\\}";
else { else {
// else part should not exist // else part should not exist
LASSERT(1, /**/); LASSERT(0, /**/);
} }
} }
} }
@ -1109,7 +1109,7 @@ static docstring buffer_to_latex(Buffer & buffer)
pit_type const endpit = buffer.paragraphs().size(); pit_type const endpit = buffer.paragraphs().size();
for (pit_type pit = 0; pit != endpit; ++pit) { for (pit_type pit = 0; pit != endpit; ++pit) {
TeXOnePar(buffer, buffer.text(), pit, os, runparams); TeXOnePar(buffer, buffer.text(), pit, os, runparams);
LYXERR(Debug::FIND, "searchString up to here: " << ods.str()); LYXERR(Debug::FINDVERBOSE, "searchString up to here: " << ods.str());
} }
return ods.str(); return ods.str();
} }
@ -1156,7 +1156,7 @@ static string latexNamesToUtf8(docstring strIn)
add = addtmp; add = addtmp;
else if (addtmp.length() > lastpos) else if (addtmp.length() > lastpos)
add += addtmp.substr(lastpos, addtmp.length() - lastpos); add += addtmp.substr(lastpos, addtmp.length() - lastpos);
LYXERR(Debug::FIND, "Adding to search string: '" LYXERR(Debug::FINDVERBOSE, "Adding to search string: '"
<< add << "'"); << add << "'");
return add; return add;
} }
@ -1190,7 +1190,7 @@ static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions co
string add = latexNamesToUtf8(par.asString(pos_type(0), par.size(), string add = latexNamesToUtf8(par.asString(pos_type(0), par.size(),
option, option,
&runparams)); &runparams));
LYXERR(Debug::FIND, "Adding to search string: '" LYXERR(Debug::FINDVERBOSE, "Adding to search string: '"
<< add << "'"); << add << "'");
t += add; t += add;
} }
@ -1221,7 +1221,7 @@ static size_t identifyLeading(string const & s)
|| regex_replace(t, t, "^ ?\\\\item\\{[a-z]+\\}", "") || regex_replace(t, t, "^ ?\\\\item\\{[a-z]+\\}", "")
|| regex_replace(t, t, "^\\\\begin\\{[a-zA-Z_]*\\*?\\}", "")) || regex_replace(t, t, "^\\\\begin\\{[a-zA-Z_]*\\*?\\}", ""))
; ;
LYXERR(Debug::FIND, " after removing leading $, \\[ , \\emph{, \\textbf{, etc.: '" << t << "'"); LYXERR(Debug::FINDVERBOSE, " after removing leading $, \\[ , \\emph{, \\textbf{, etc.: '" << t << "'");
return s.find(t); return s.find(t);
} }
@ -2025,7 +2025,7 @@ void Intervall::handleCloseP(int i, bool closingAllowed)
{ {
if (actualdeptindex <= 0) { if (actualdeptindex <= 0) {
if (! closingAllowed) if (! closingAllowed)
LYXERR(Debug::FIND, "Bad closing parenthesis in latex"); /* should not happen, but the latex input may be wrong */ LYXERR(Debug::FINDVERBOSE, "Bad closing parenthesis in latex"); /* should not happen, but the latex input may be wrong */
// if we are at the very end // if we are at the very end
addIntervall(i, i+1); addIntervall(i, i+1);
} }
@ -3363,7 +3363,7 @@ static string correctlanguagesetting(string par, bool isPatternString, bool with
if (withformat) { if (withformat) {
// Split the latex input into pieces which // Split the latex input into pieces which
// can be digested by our search engine // can be digested by our search engine
LYXERR(Debug::FIND, "input: \"" << par << "\""); LYXERR(Debug::FINDVERBOSE, "input: \"" << par << "\"");
if (isPatternString && (pbuf != nullptr)) { // Check if we should disable/enable test for language if (isPatternString && (pbuf != nullptr)) { // Check if we should disable/enable test for language
// We check for polyglossia, because in runparams.flavor we use Flavor::XeTeX // We check for polyglossia, because in runparams.flavor we use Flavor::XeTeX
string doclang = pbuf->params().language->polyglossia(); string doclang = pbuf->params().language->polyglossia();
@ -3381,7 +3381,7 @@ static string correctlanguagesetting(string par, bool isPatternString, bool with
} }
result = splitOnKnownMacros(par.substr(0,parlen), isPatternString); result = splitOnKnownMacros(par.substr(0,parlen), isPatternString);
LYXERR(Debug::FIND, "After splitOnKnownMacros:\n\"" << result << "\""); LYXERR(Debug::FINDVERBOSE, "After splitOnKnownMacros:\n\"" << result << "\"");
} }
else else
result = par.substr(0, parlen); result = par.substr(0, parlen);
@ -3396,7 +3396,7 @@ static string correctlanguagesetting(string par, bool isPatternString, bool with
features += " " + a; features += " " + a;
// LYXERR(Debug::INFO, "Identified regex format:" << a); // LYXERR(Debug::INFO, "Identified regex format:" << a);
} }
LYXERR(Debug::FIND, "Identified Features" << features); LYXERR(Debug::FINDVERBOSE, "Identified Features" << features);
} }
} else if (regex_with_format) { } else if (regex_with_format) {
@ -3406,7 +3406,7 @@ static string correctlanguagesetting(string par, bool isPatternString, bool with
bool b = it->second; bool b = it->second;
if (b && ! info[a]) { if (b && ! info[a]) {
missed++; missed++;
LYXERR(Debug::FIND, "Missed(" << missed << " " << a <<", srclen = " << parlen ); LYXERR(Debug::FINDVERBOSE, "Missed(" << missed << " " << a <<", srclen = " << parlen );
return ""; return "";
} }
} }
@ -3420,24 +3420,23 @@ static string correctlanguagesetting(string par, bool isPatternString, bool with
// Remove trailing closure of math, macros and environments, so to catch parts of them. // Remove trailing closure of math, macros and environments, so to catch parts of them.
static int identifyClosing(string & t) static void identifyClosing(string & t, bool ignoreformat)
{ {
int open_braces = 0;
do { do {
LYXERR(Debug::FIND, "identifyClosing(): t now is '" << t << "'"); LYXERR(Debug::FINDVERBOSE, "identifyClosing(): t now is '" << t << "'");
if (regex_replace(t, t, "(.*[^\\\\])\\$$", "$1")) if (regex_replace(t, t, "(.*[^\\\\])\\$$", "$1"))
continue; continue;
if (regex_replace(t, t, "(.*[^\\\\])\\\\\\]$", "$1")) if (regex_replace(t, t, "(.*[^\\\\])\\\\\\]$", "$1"))
continue; continue;
if (regex_replace(t, t, "(.*[^\\\\])\\\\end\\{[a-zA-Z_]*\\*?\\}$", "$1")) if (regex_replace(t, t, "(.*[^\\\\])\\\\end\\{[a-zA-Z_]+\\*?\\}$", "$1"))
continue;
if (regex_replace(t, t, "(.*[^\\\\])\\}$", "$1")) {
++open_braces;
continue; continue;
if (! ignoreformat) {
if (regex_replace(t, t, "(.*[^\\\\])\\}$", "$1"))
continue;
} }
break; break;
} while (true); } while (true);
return open_braces; return;
} }
static int num_replaced = 0; static int num_replaced = 0;
@ -3564,7 +3563,7 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
} }
opt.matchAtStart = false; opt.matchAtStart = false;
if (!use_regexp) { if (!use_regexp) {
identifyClosing(par_as_string); // Removes math closings ($, ], ...) at end of string identifyClosing(par_as_string, opt.ignoreformat); // Removes math closings ($, ], ...) at end of string
if (opt.ignoreformat) { if (opt.ignoreformat) {
lead_size = 0; lead_size = 0;
} }
@ -3585,14 +3584,14 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
string regexp2_str = "(" + lead_as_regex_string + ")(.*?)" + par_as_regex_string_nolead; string regexp2_str = "(" + lead_as_regex_string + ")(.*?)" + par_as_regex_string_nolead;
CreateRegexp(opt, regexp_str, regexp2_str); CreateRegexp(opt, regexp_str, regexp2_str);
use_regexp = true; use_regexp = true;
LYXERR(Debug::FIND, "Setting regexp to : '" << regexp_str << "'"); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp to : '" << regexp_str << "'");
LYXERR(Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'"); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'");
return; return;
} }
if (!opt.ignoreformat) { if (!opt.ignoreformat) {
lead_size = identifyLeading(par_as_string); lead_size = identifyLeading(par_as_string);
LYXERR(Debug::FIND, "Lead_size: " << lead_size); LYXERR(Debug::FINDVERBOSE, "Lead_size: " << lead_size);
lead_as_string = par_as_string.substr(0, lead_size); lead_as_string = par_as_string.substr(0, lead_size);
par_as_string_nolead = par_as_string.substr(lead_size, par_as_string.size() - lead_size); par_as_string_nolead = par_as_string.substr(lead_size, par_as_string.size() - lead_size);
} }
@ -3606,13 +3605,13 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
(void)regex_replace(par_as_string_nolead, par_as_string_nolead, "\\$$", ""); (void)regex_replace(par_as_string_nolead, par_as_string_nolead, "\\$$", "");
(void)regex_replace(par_as_string_nolead, par_as_string_nolead, "}$", ""); (void)regex_replace(par_as_string_nolead, par_as_string_nolead, "}$", "");
par_as_string = par_as_string_nolead; par_as_string = par_as_string_nolead;
LYXERR(Debug::FIND, "lead_as_regexp is '" << lead_as_regexp << "'"); LYXERR(Debug::FINDVERBOSE, "lead_as_regexp is '" << lead_as_regexp << "'");
LYXERR(Debug::FIND, "par_as_string now is '" << par_as_string << "'"); LYXERR(Debug::FINDVERBOSE, "par_as_string now is '" << par_as_string << "'");
} }
// LYXERR(Debug::FIND, "par_as_string before escape_for_regex() is '" << par_as_string << "'"); // LYXERR(Debug::FINDVERBOSE, "par_as_string before escape_for_regex() is '" << par_as_string << "'");
par_as_string = escape_for_regex(par_as_string, !opt.ignoreformat); par_as_string = escape_for_regex(par_as_string, !opt.ignoreformat);
// Insert (.*?) before trailing closure of math, macros and environments, so to catch parts of them. // Insert (.*?) before trailing closure of math, macros and environments, so to catch parts of them.
// LYXERR(Debug::FIND, "par_as_string now is '" << par_as_string << "'"); // LYXERR(Debug::FINDVERBOSE, "par_as_string now is '" << par_as_string << "'");
++close_wildcards; ++close_wildcards;
size_t lng = par_as_string.size(); size_t lng = par_as_string.size();
if (!opt.ignoreformat) { if (!opt.ignoreformat) {
@ -3632,15 +3631,15 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
if (lng < par_as_string.size()) if (lng < par_as_string.size())
par_as_string = par_as_string.substr(0,lng); par_as_string = par_as_string.substr(0,lng);
} }
LYXERR(Debug::FIND, "par_as_string after correctRegex is '" << par_as_string << "'"); LYXERR(Debug::FINDVERBOSE, "par_as_string after correctRegex is '" << par_as_string << "'");
if ((lng > 0) && (par_as_string[0] == '^')) { if ((lng > 0) && (par_as_string[0] == '^')) {
par_as_string = par_as_string.substr(1); par_as_string = par_as_string.substr(1);
--lng; --lng;
opt.matchAtStart = true; opt.matchAtStart = true;
} }
// LYXERR(Debug::FIND, "par_as_string now is '" << par_as_string << "'"); // LYXERR(Debug::FINDVERBOSE, "par_as_string now is '" << par_as_string << "'");
// LYXERR(Debug::FIND, "Open braces: " << open_braces); // LYXERR(Debug::FINDVERBOSE, "Open braces: " << open_braces);
// LYXERR(Debug::FIND, "Replaced text (to be used as regex): " << par_as_string); // LYXERR(Debug::FINDVERBOSE, "Replaced text (to be used as regex): " << par_as_string);
// If entered regexp must match at begin of searched string buffer // If entered regexp must match at begin of searched string buffer
// Kornel: Added parentheses to use $1 for size of the leading string // Kornel: Added parentheses to use $1 for size of the leading string
@ -3662,8 +3661,8 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
regexp_str = "(" + lead_as_regexp + ")()" + par_as_string; regexp_str = "(" + lead_as_regexp + ")()" + par_as_string;
regexp2_str = "(" + lead_as_regexp + ")(.*?)" + par_as_string; regexp2_str = "(" + lead_as_regexp + ")(.*?)" + par_as_string;
} }
LYXERR(Debug::FIND, "Setting regexp to : '" << regexp_str << "'"); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp to : '" << regexp_str << "'");
LYXERR(Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'"); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'");
CreateRegexp(opt, regexp_str, regexp2_str, par_as_string); CreateRegexp(opt, regexp_str, regexp2_str, par_as_string);
} }
} }
@ -3694,12 +3693,12 @@ MatchResult MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_be
mres.match_len = -1; mres.match_len = -1;
return mres; return mres;
} }
LYXERR(Debug::FIND, "After normalization: Matching against:\n'" << str << "'"); LYXERR(Debug::FINDVERBOSE, "After normalization: Matching against:\n'" << str << "'");
LASSERT(use_regexp, /**/); LASSERT(use_regexp, /**/);
{ {
// use_regexp always true // use_regexp always true
LYXERR(Debug::FIND, "Searching in regexp mode: at_begin=" << at_begin); LYXERR(Debug::FINDVERBOSE, "Searching in regexp mode: at_begin=" << at_begin);
#if QTSEARCH #if QTSEARCH
QString qstr = QString::fromStdString(str); QString qstr = QString::fromStdString(str);
QRegularExpression const *p_regexp; QRegularExpression const *p_regexp;
@ -3833,7 +3832,7 @@ MatchResult MatchStringAdv::operator()(DocIterator const & cur, int len, bool at
{ {
MatchResult mres = findAux(cur, len, at_begin); MatchResult mres = findAux(cur, len, at_begin);
int res = mres.match_len; int res = mres.match_len;
LYXERR(Debug::FIND, LYXERR(Debug::FINDVERBOSE,
"res=" << res << ", at_begin=" << at_begin "res=" << res << ", at_begin=" << at_begin
<< ", matchAtStart=" << opt.matchAtStart << ", matchAtStart=" << opt.matchAtStart
<< ", inTexted=" << cur.inTexted()); << ", inTexted=" << cur.inTexted());
@ -3919,11 +3918,11 @@ string MatchStringAdv::normalize(docstring const & s, bool ignore_format) const
// Remove stale empty \emph{}, \textbf{} and similar blocks from latexify // Remove stale empty \emph{}, \textbf{} and similar blocks from latexify
// Kornel: Added textsl, textsf, textit, texttt and noun // Kornel: Added textsl, textsf, textit, texttt and noun
// + allow to seach for colored text too // + allow to seach for colored text too
LYXERR(Debug::FIND, "Removing stale empty macros from: " << t); LYXERR(Debug::FINDVERBOSE, "Removing stale empty macros from: " << t);
while (regex_replace(t, t, "\\\\(emph|noun|text(bf|sl|sf|it|tt)|(u|uu)line|(s|x)out|uwave)(\\{(\\{\\})?\\})+", "")) while (regex_replace(t, t, "\\\\(emph|noun|text(bf|sl|sf|it|tt)|(u|uu)line|(s|x)out|uwave)(\\{(\\{\\})?\\})+", ""))
LYXERR(Debug::FIND, " further removing stale empty \\emph{}, \\textbf{} macros from: " << t); LYXERR(Debug::FINDVERBOSE, " further removing stale empty \\emph{}, \\textbf{} macros from: " << t);
while (regex_replace(t, t, "\\\\((sub)?(((sub)?section)|paragraph)|part)\\*?(\\{(\\{\\})?\\})+", "")) while (regex_replace(t, t, "\\\\((sub)?(((sub)?section)|paragraph)|part)\\*?(\\{(\\{\\})?\\})+", ""))
LYXERR(Debug::FIND, " further removing stale empty \\emph{}, \\textbf{} macros from: " << t); LYXERR(Debug::FINDVERBOSE, " further removing stale empty \\emph{}, \\textbf{} macros from: " << t);
while (regex_replace(t, t, "\\\\(foreignlanguage|textcolor|item)\\{[a-z]+\\}(\\{(\\{\\})?\\})+", "")); while (regex_replace(t, t, "\\\\(foreignlanguage|textcolor|item)\\{[a-z]+\\}(\\{(\\{\\})?\\})+", ""));
return t; return t;
@ -3932,7 +3931,7 @@ string MatchStringAdv::normalize(docstring const & s, bool ignore_format) const
docstring stringifyFromCursor(DocIterator const & cur, int len) docstring stringifyFromCursor(DocIterator const & cur, int len)
{ {
LYXERR(Debug::FIND, "Stringifying with len=" << len << " from cursor at pos: " << cur); LYXERR(Debug::FINDVERBOSE, "Stringifying with len=" << len << " from cursor at pos: " << cur);
if (cur.inTexted()) { if (cur.inTexted()) {
Paragraph const & par = cur.paragraph(); Paragraph const & par = cur.paragraph();
// TODO what about searching beyond/across paragraph breaks ? // TODO what about searching beyond/across paragraph breaks ?
@ -3957,11 +3956,13 @@ docstring stringifyFromCursor(DocIterator const & cur, int len)
if (ignoreFormats.getNonContent()) { if (ignoreFormats.getNonContent()) {
runparams.for_search |= OutputParams::SearchNonOutput; runparams.for_search |= OutputParams::SearchNonOutput;
} }
LYXERR(Debug::FIND, "Stringifying with cur: " LYXERR(Debug::FINDVERBOSE, "Stringifying with cur: "
<< cur << ", from pos: " << cur.pos() << ", end: " << end); << cur << ", from pos: " << cur.pos() << ", end: " << end);
return from_utf8(latexNamesToUtf8(par.asString(cur.pos(), end, docstring res = from_utf8(latexNamesToUtf8(par.asString(cur.pos(), end,
option, option,
&runparams))); &runparams)));
LYXERR(Debug::FIND, "Stringified text from pos(" << cur.pos() << ") len(" << len << "): " << res);
return res;
} else if (cur.inMathed()) { } else if (cur.inMathed()) {
CursorSlice cs = cur.top(); CursorSlice cs = cur.top();
MathData md = cs.cell(); MathData md = cs.cell();
@ -3972,11 +3973,11 @@ docstring stringifyFromCursor(DocIterator const & cur, int len)
MathData md2; MathData md2;
for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it) for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it)
md2.push_back(*it); md2.push_back(*it);
docstring s = from_utf8(latexNamesToUtf8(asString(md2))); docstring res = from_utf8(latexNamesToUtf8(asString(md2)));
LYXERR(Debug::FIND, "Stringified math: '" << s << "'"); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Stringified math from pos(" << cur.pos() << ") len(" << len << "): " << res);
return s; return res;
} }
LYXERR(Debug::FIND, "Don't know how to stringify from here: " << cur); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Don't know how to stringify from here: " << cur);
return docstring(); return docstring();
} }
@ -3987,8 +3988,8 @@ docstring stringifyFromCursor(DocIterator const & cur, int len)
docstring latexifyFromCursor(DocIterator const & cur, int len) docstring latexifyFromCursor(DocIterator const & cur, int len)
{ {
/* /*
LYXERR(Debug::FIND, "Latexifying with len=" << len << " from cursor at pos: " << cur); LYXERR(Debug::FINDVERBOSE, "Latexifying with len=" << len << " from cursor at pos: " << cur);
LYXERR(Debug::FIND, " with cur.lastpost=" << cur.lastpos() << ", cur.lastrow=" LYXERR(Debug::FINDVERBOSE, " with cur.lastpost=" << cur.lastpos() << ", cur.lastrow="
<< cur.lastrow() << ", cur.lastcol=" << cur.lastcol()); << cur.lastrow() << ", cur.lastcol=" << cur.lastcol());
*/ */
Buffer const & buf = *cur.buffer(); Buffer const & buf = *cur.buffer();
@ -4019,9 +4020,8 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
endpos = cur.pos() + len; endpos = cur.pos() + len;
TeXOnePar(buf, *cur.innerText(), cur.pit(), os, runparams, TeXOnePar(buf, *cur.innerText(), cur.pit(), os, runparams,
string(), cur.pos(), endpos); string(), cur.pos(), endpos);
string s = lyx::to_utf8(ods.str()); LYXERR(Debug::FIND, "Latexified text from pos(" << cur.pos() << ") len(" << len << "): " << ods.str());
LYXERR(Debug::FIND, "Latexified +modified text: '" << s << "'"); return(ods.str());
return(lyx::from_utf8(s));
} else if (cur.inMathed()) { } else if (cur.inMathed()) {
// Retrieve the math environment type, and add '$' or '$[' or others (\begin{equation}) accordingly // Retrieve the math environment type, and add '$' or '$[' or others (\begin{equation}) accordingly
for (int s = cur.depth() - 1; s >= 0; --s) { for (int s = cur.depth() - 1; s >= 0; --s) {
@ -4056,9 +4056,9 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
break; break;
} }
} }
LYXERR(Debug::FIND, "Latexified math: '" << lyx::to_utf8(ods.str()) << "'"); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Latexified math from pos(" << cur.pos() << ") len(" << len << "): " << ods.str());
} else { } else {
LYXERR(Debug::FIND, "Don't know how to stringify from here: " << cur); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Don't know how to stringify from here: " << cur);
} }
return ods.str(); return ods.str();
} }
@ -4158,7 +4158,7 @@ MatchResult findAdvFinalize(DocIterator & cur, MatchStringAdv const & match, Mat
max_match = mres; max_match = mres;
} }
if (max_match.match_len <= 0) return fail; if (max_match.match_len <= 0) return fail;
LYXERR(Debug::FIND, "Ok"); LYXERR(Debug::FINDVERBOSE, "Ok");
// Compute the match length // Compute the match length
int len = 1; int len = 1;
@ -4254,7 +4254,7 @@ int findForwardAdv(DocIterator & cur, MatchStringAdv & match)
MatchResult orig_mres; MatchResult orig_mres;
while (!theApp()->longOperationCancelled() && cur) { while (!theApp()->longOperationCancelled() && cur) {
//(void) findAdvForwardInnermost(cur); //(void) findAdvForwardInnermost(cur);
LYXERR(Debug::FIND, "findForwardAdv() cur: " << cur); LYXERR(Debug::FINDVERBOSE, "findForwardAdv() cur: " << cur);
MatchResult mres = match(cur, -1, false); MatchResult mres = match(cur, -1, false);
string msg = "Starting"; string msg = "Starting";
if (repeat) if (repeat)
@ -4268,7 +4268,7 @@ int findForwardAdv(DocIterator & cur, MatchStringAdv & match)
if (match_len <= 0) { if (match_len <= 0) {
// This should exit nested insets, if any, or otherwise undefine the currsor. // This should exit nested insets, if any, or otherwise undefine the currsor.
cur.pos() = cur.lastpos(); cur.pos() = cur.lastpos();
LYXERR(Debug::FIND, "Advancing pos: cur=" << cur); LYXERR(Debug::FINDVERBOSE, "Advancing pos: cur=" << cur);
cur.forwardPos(); cur.forwardPos();
} }
else { // match_len > 0 else { // match_len > 0
@ -4285,7 +4285,7 @@ int findForwardAdv(DocIterator & cur, MatchStringAdv & match)
if (increment < 1) if (increment < 1)
increment = 1; increment = 1;
} }
LYXERR(Debug::FIND, "Set increment to " << increment); LYXERR(Debug::FINDVERBOSE, "Set increment to " << increment);
while (increment > 0) { while (increment > 0) {
DocIterator old_cur = cur; DocIterator old_cur = cur;
if (cur.pos() + increment >= cur.lastpos()) { if (cur.pos() + increment >= cur.lastpos()) {
@ -4339,10 +4339,9 @@ int findForwardAdv(DocIterator & cur, MatchStringAdv & match)
mres = orig_mres; mres = orig_mres;
} }
// LYXERR0("Leaving first loop"); // LYXERR0("Leaving first loop");
LYXERR(Debug::FIND, "Finalizing 1"); LYXERR(Debug::FINDVERBOSE, "Finalizing 1");
MatchResult found_match = findAdvFinalize(cur, match, mres); MatchResult found_match = findAdvFinalize(cur, match, mres);
if (found_match.match_len > 0) { if (found_match.match_len > 0) {
LASSERT(found_match.pos_len > 0, /**/);
match.FillResults(found_match); match.FillResults(found_match);
return found_match.pos_len; return found_match.pos_len;
} }
@ -4367,7 +4366,7 @@ MatchResult findMostBackwards(DocIterator & cur, MatchStringAdv const & match, M
MatchResult mr = findAdvFinalize(tmp_cur, match, expected); MatchResult mr = findAdvFinalize(tmp_cur, match, expected);
Inset & inset = cur.inset(); Inset & inset = cur.inset();
for (; cur != cur_begin; cur.backwardPos()) { for (; cur != cur_begin; cur.backwardPos()) {
LYXERR(Debug::FIND, "findMostBackwards(): cur=" << cur); LYXERR(Debug::FINDVERBOSE, "findMostBackwards(): cur=" << cur);
DocIterator new_cur = cur; DocIterator new_cur = cur;
new_cur.backwardPos(); new_cur.backwardPos();
if (new_cur == cur || &new_cur.inset() != &inset || !match(new_cur).match_len) if (new_cur == cur || &new_cur.inset() != &inset || !match(new_cur).match_len)
@ -4377,7 +4376,7 @@ MatchResult findMostBackwards(DocIterator & cur, MatchStringAdv const & match, M
break; break;
mr = new_mr; mr = new_mr;
} }
LYXERR(Debug::FIND, "findMostBackwards(): exiting with cur=" << cur); LYXERR(Debug::FINDVERBOSE, "findMostBackwards(): exiting with cur=" << cur);
return mr; return mr;
} }
@ -4403,11 +4402,11 @@ int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match)
cur.pos() = cur.lastpos(); cur.pos() = cur.lastpos();
else else
cur.pos() = cur_orig.pos(); cur.pos() = cur_orig.pos();
LYXERR(Debug::FIND, "findBackAdv2: cur: " << cur); LYXERR(Debug::FINDVERBOSE, "findBackAdv2: cur: " << cur);
DocIterator cur_prev_iter; DocIterator cur_prev_iter;
do { do {
found_match = match(cur); found_match = match(cur);
LYXERR(Debug::FIND, "findBackAdv3: found_match=" LYXERR(Debug::FINDVERBOSE, "findBackAdv3: found_match="
<< (found_match.match_len > 0) << ", cur: " << cur); << (found_match.match_len > 0) << ", cur: " << cur);
if (found_match.match_len > 0) { if (found_match.match_len > 0) {
MatchResult found_mr = findMostBackwards(cur, match, found_match); MatchResult found_mr = findMostBackwards(cur, match, found_match);
@ -4472,7 +4471,7 @@ static bool allNonLowercase(Cursor const & cur, int len)
pos_type beg_pos = cur.selectionBegin().pos(); pos_type beg_pos = cur.selectionBegin().pos();
pos_type end_pos = cur.selectionBegin().pos() + len; pos_type end_pos = cur.selectionBegin().pos() + len;
if (len > cur.lastpos() + 1 - beg_pos) { if (len > cur.lastpos() + 1 - beg_pos) {
LYXERR(Debug::FIND, "This should not happen, more debug needed"); LYXERR(Debug::FINDVERBOSE, "This should not happen, more debug needed");
len = cur.lastpos() + 1 - beg_pos; len = cur.lastpos() + 1 - beg_pos;
end_pos = beg_pos + len; end_pos = beg_pos + len;
} }
@ -4489,13 +4488,13 @@ static bool firstUppercase(Cursor const & cur)
char_type ch1, ch2; char_type ch1, ch2;
pos_type pos = cur.selectionBegin().pos(); pos_type pos = cur.selectionBegin().pos();
if (pos >= cur.lastpos() - 1) { if (pos >= cur.lastpos() - 1) {
LYXERR(Debug::FIND, "No upper-case at cur: " << cur); LYXERR(Debug::FINDVERBOSE, "No upper-case at cur: " << cur);
return false; return false;
} }
ch1 = cur.paragraph().getChar(pos); ch1 = cur.paragraph().getChar(pos);
ch2 = cur.paragraph().getChar(pos + 1); ch2 = cur.paragraph().getChar(pos + 1);
bool result = isUpperCase(ch1) && isLowerCase(ch2); bool result = isUpperCase(ch1) && isLowerCase(ch2);
LYXERR(Debug::FIND, "firstUppercase(): " LYXERR(Debug::FINDVERBOSE, "firstUppercase(): "
<< "ch1=" << ch1 << "(" << char(ch1) << "), ch2=" << "ch1=" << ch1 << "(" << char(ch1) << "), ch2="
<< ch2 << "(" << char(ch2) << ")" << ch2 << "(" << char(ch2) << ")"
<< ", result=" << result << ", cur=" << cur); << ", result=" << result << ", cur=" << cur);
@ -4562,7 +4561,7 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma
|| sel_beg.idx() != sel_end.idx()) || sel_beg.idx() != sel_end.idx())
return 0; return 0;
int sel_len = sel_end.pos() - sel_beg.pos(); int sel_len = sel_end.pos() - sel_beg.pos();
LYXERR(Debug::FIND, "sel_beg: " << sel_beg << ", sel_end: " << sel_end LYXERR(Debug::FINDVERBOSE, "sel_beg: " << sel_beg << ", sel_end: " << sel_end
<< ", sel_len: " << sel_len << endl); << ", sel_len: " << sel_len << endl);
if (sel_len == 0) if (sel_len == 0)
return 0; return 0;
@ -4583,7 +4582,7 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma
repl_buffer.setUnnamed(true); repl_buffer.setUnnamed(true);
LASSERT(repl_buffer.readString(lyx), return 0); LASSERT(repl_buffer.readString(lyx), return 0);
if (opt.keep_case && sel_len >= 2) { if (opt.keep_case && sel_len >= 2) {
LYXERR(Debug::FIND, "keep_case true: cur.pos()=" << cur.pos() << ", sel_len=" << sel_len); LYXERR(Debug::FINDVERBOSE, "keep_case true: cur.pos()=" << cur.pos() << ", sel_len=" << sel_len);
if (cur.inTexted()) { if (cur.inTexted()) {
if (firstUppercase(cur)) if (firstUppercase(cur))
changeFirstCase(repl_buffer, text_uppercase, text_lowercase); changeFirstCase(repl_buffer, text_uppercase, text_lowercase);
@ -4596,13 +4595,13 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma
repl_buffer.changeLanguage( repl_buffer.changeLanguage(
repl_buffer.language(), repl_buffer.language(),
cur.getFont().language()); cur.getFont().language());
LYXERR(Debug::FIND, "Replacing by pasteParagraphList()ing repl_buffer"); LYXERR(Debug::FINDVERBOSE, "Replacing by pasteParagraphList()ing repl_buffer");
LYXERR(Debug::FIND, "Before pasteParagraphList() cur=" << cur << endl); LYXERR(Debug::FINDVERBOSE, "Before pasteParagraphList() cur=" << cur << endl);
cap::pasteParagraphList(cur, repl_buffer.paragraphs(), cap::pasteParagraphList(cur, repl_buffer.paragraphs(),
repl_buffer.params().documentClassPtr(), repl_buffer.params().documentClassPtr(),
repl_buffer.params().authors(), repl_buffer.params().authors(),
bv->buffer().errorList("Paste")); bv->buffer().errorList("Paste"));
LYXERR(Debug::FIND, "After pasteParagraphList() cur=" << cur << endl); LYXERR(Debug::FINDVERBOSE, "After pasteParagraphList() cur=" << cur << endl);
sel_len = repl_buffer.paragraphs().begin()->size(); sel_len = repl_buffer.paragraphs().begin()->size();
} else if (cur.inMathed()) { } else if (cur.inMathed()) {
odocstringstream ods; odocstringstream ods;
@ -4616,23 +4615,23 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma
TeXOnePar(repl_buffer, repl_buffer.text(), 0, os, runparams); TeXOnePar(repl_buffer, repl_buffer.text(), 0, os, runparams);
//repl_buffer.getSourceCode(ods, 0, repl_buffer.paragraphs().size(), false); //repl_buffer.getSourceCode(ods, 0, repl_buffer.paragraphs().size(), false);
docstring repl_latex = ods.str(); docstring repl_latex = ods.str();
LYXERR(Debug::FIND, "Latexified replace_buffer: '" << repl_latex << "'"); LYXERR(Debug::FINDVERBOSE, "Latexified replace_buffer: '" << repl_latex << "'");
string s; string s;
(void)regex_replace(to_utf8(repl_latex), s, "\\$(.*)\\$", "$1"); (void)regex_replace(to_utf8(repl_latex), s, "\\$(.*)\\$", "$1");
(void)regex_replace(s, s, "\\\\\\[(.*)\\\\\\]", "$1"); (void)regex_replace(s, s, "\\\\\\[(.*)\\\\\\]", "$1");
repl_latex = from_utf8(s); repl_latex = from_utf8(s);
LYXERR(Debug::FIND, "Replacing by insert()ing latex: '" << repl_latex << "' cur=" << cur << " with depth=" << cur.depth()); LYXERR(Debug::FINDVERBOSE, "Replacing by insert()ing latex: '" << repl_latex << "' cur=" << cur << " with depth=" << cur.depth());
MathData ar(cur.buffer()); MathData ar(cur.buffer());
asArray(repl_latex, ar, Parse::NORMAL); asArray(repl_latex, ar, Parse::NORMAL);
cur.insert(ar); cur.insert(ar);
sel_len = ar.size(); sel_len = ar.size();
LYXERR(Debug::FIND, "After insert() cur=" << cur << " with depth: " << cur.depth() << " and len: " << sel_len); LYXERR(Debug::FINDVERBOSE, "After insert() cur=" << cur << " with depth: " << cur.depth() << " and len: " << sel_len);
} }
if (cur.pos() >= sel_len) if (cur.pos() >= sel_len)
cur.pos() -= sel_len; cur.pos() -= sel_len;
else else
cur.pos() = 0; cur.pos() = 0;
LYXERR(Debug::FIND, "After pos adj cur=" << cur << " with depth: " << cur.depth() << " and len: " << sel_len); LYXERR(Debug::FINDVERBOSE, "After pos adj cur=" << cur << " with depth: " << cur.depth() << " and len: " << sel_len);
bv->putSelectionAt(DocIterator(cur), sel_len, !opt.forward); bv->putSelectionAt(DocIterator(cur), sel_len, !opt.forward);
bv->processUpdateFlags(Update::Force); bv->processUpdateFlags(Update::Force);
return 1; return 1;
@ -4704,7 +4703,7 @@ bool findAdv(BufferView * bv, FindAndReplaceOptions & opt)
// Should never happen, maybe LASSERT() here? // Should never happen, maybe LASSERT() here?
pos_len = cur.lastpos() - cur.pos(); pos_len = cur.lastpos() - cur.pos();
} }
LYXERR(Debug::FIND, "Putting selection at cur=" << cur << " with len: " << pos_len); LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Putting selection at cur=" << cur << " with len: " << pos_len);
bv->putSelectionAt(cur, pos_len, !opt.forward); bv->putSelectionAt(cur, pos_len, !opt.forward);
return true; return true;
@ -4725,7 +4724,7 @@ ostringstream & operator<<(ostringstream & os, FindAndReplaceOptions const & opt
<< int(opt.scope) << ' ' << int(opt.scope) << ' '
<< int(opt.restr); << int(opt.restr);
LYXERR(Debug::FIND, "built: " << os.str()); LYXERR(Debug::FINDVERBOSE, "built: " << os.str());
return os; return os;
} }
@ -4733,7 +4732,7 @@ ostringstream & operator<<(ostringstream & os, FindAndReplaceOptions const & opt
istringstream & operator>>(istringstream & is, FindAndReplaceOptions & opt) istringstream & operator>>(istringstream & is, FindAndReplaceOptions & opt)
{ {
// LYXERR(Debug::FIND, "parsing"); // LYXERR(Debug::FINDVERBOSE, "parsing");
string s; string s;
string line; string line;
getline(is, line); getline(is, line);
@ -4745,7 +4744,7 @@ istringstream & operator>>(istringstream & is, FindAndReplaceOptions & opt)
break; break;
getline(is, line); getline(is, line);
} }
// LYXERR(Debug::FIND, "file_buf_name: '" << s << "'"); // LYXERR(Debug::FINDVERBOSE, "file_buf_name: '" << s << "'");
opt.find_buf_name = from_utf8(s); opt.find_buf_name = from_utf8(s);
is >> opt.casesensitive >> opt.matchword >> opt.forward >> opt.expandmacros >> opt.ignoreformat >> opt.replace_all; is >> opt.casesensitive >> opt.matchword >> opt.forward >> opt.expandmacros >> opt.ignoreformat >> opt.replace_all;
is.get(); // Waste space before replace string is.get(); // Waste space before replace string
@ -4759,7 +4758,7 @@ istringstream & operator>>(istringstream & is, FindAndReplaceOptions & opt)
break; break;
getline(is, line); getline(is, line);
} }
// LYXERR(Debug::FIND, "repl_buf_name: '" << s << "'"); // LYXERR(Debug::FINDVERBOSE, "repl_buf_name: '" << s << "'");
opt.repl_buf_name = from_utf8(s); opt.repl_buf_name = from_utf8(s);
is >> opt.keep_case; is >> opt.keep_case;
int i; int i;
@ -4769,7 +4768,7 @@ istringstream & operator>>(istringstream & is, FindAndReplaceOptions & opt)
opt.restr = FindAndReplaceOptions::SearchRestriction(i); opt.restr = FindAndReplaceOptions::SearchRestriction(i);
/* /*
LYXERR(Debug::FIND, "parsed: " << opt.casesensitive << ' ' << opt.matchword << ' ' << opt.forward << ' ' LYXERR(Debug::FINDVERBOSE, "parsed: " << opt.casesensitive << ' ' << opt.matchword << ' ' << opt.forward << ' '
<< opt.expandmacros << ' ' << opt.ignoreformat << ' ' << opt.keep_case << ' ' << opt.expandmacros << ' ' << opt.ignoreformat << ' ' << opt.keep_case << ' '
<< opt.scope << ' ' << opt.restr); << opt.scope << ' ' << opt.restr);
*/ */

View File

@ -71,7 +71,8 @@ DebugErrorItem errorTags[] = {
{ Debug::RTL, "rtl", N_("RTL/Bidi")}, { Debug::RTL, "rtl", N_("RTL/Bidi")},
{ Debug::LOCALE, "locale", N_("Locale/Internationalisation")}, { Debug::LOCALE, "locale", N_("Locale/Internationalisation")},
{ Debug::SELECTION, "selection", N_("Selection copy/paste mechanism")}, { Debug::SELECTION, "selection", N_("Selection copy/paste mechanism")},
{ Debug::FIND, "find", N_("Find and replace mechanism")}, { Debug::FIND, "find", N_("Find and replace mechanism, terse version")},
{ Debug::FINDVERBOSE,"findverbose", N_("Find and replace mechanism, verbose version")},
{ Debug::DEBUG, "debug", N_("Developers' general debug messages")}, { Debug::DEBUG, "debug", N_("Developers' general debug messages")},
{ Debug::ANY, "any", N_("All debugging messages")}, { Debug::ANY, "any", N_("All debugging messages")},
{ Debug::ANY, "all", N_("All debugging messages")} { Debug::ANY, "all", N_("All debugging messages")}
@ -193,7 +194,7 @@ void Debug::showLevel(ostream & os, Debug::Type level)
void Debug::showTags(ostream & os) void Debug::showTags(ostream & os)
{ {
for (DebugErrorItem const & item : errorTags) for (DebugErrorItem const & item : errorTags)
os << setw(10) << static_cast<unsigned int>(item.level) os << setw(12) << static_cast<Debug::base_type>(item.level)
<< setw(13) << item.name << setw(13) << item.name
<< " " << to_utf8(_(item.desc)) << '\n'; << " " << to_utf8(_(item.desc)) << '\n';
os.flush(); os.flush();
@ -212,7 +213,7 @@ void LyXErr::enable()
} }
bool LyXErr::debugging(Debug::Type t) const bool LyXErr::debugging(Debug::base_type t) const
{ {
return (dt_ & t); return (dt_ & t);
} }

View File

@ -37,7 +37,8 @@ namespace lyx {
/// This is all the different debug levels that we have. /// This is all the different debug levels that we have.
namespace Debug { namespace Debug {
/// ///
enum Type { typedef uint64_t base_type;
enum Type : base_type {
/// ///
NONE = 0, NONE = 0,
/// ///
@ -103,9 +104,11 @@ namespace Debug {
/// Find and Replace /// Find and Replace
FIND = (1u << 30), FIND = (1u << 30),
/// ///
DEBUG = (1u << 31), FINDVERBOSE= (1u << 31),
/// ///
ANY = 0xffffffff DEBUG = (1L << 32),
///
ANY = 0x1ffffffff
}; };
/// Return number of levels /// Return number of levels
@ -179,7 +182,7 @@ public:
/// Returns the current debug level /// Returns the current debug level
Debug::Type level() const { return dt_; } Debug::Type level() const { return dt_; }
/// Returns true if t is part of the current debug level /// Returns true if t is part of the current debug level
bool debugging(Debug::Type t = Debug::ANY) const; bool debugging(Debug::base_type t = Debug::ANY) const;
/// ///
static char const * stripName(char const *); static char const * stripName(char const *);