commit 6ae9240bbb688268efaabc774d24a8bd3eac0a0c
Author: Kornel Benko <[email protected]>
Date: Mon Jul 14 14:15:46 2025 +0200
Cmake build: turn on -Wdelete-non-abstract-non-virtual-dtor and
-Wdelete-abstract-non-virtual-dtor
---
development/checkurls/knownInvalidURLS | 6 ++++
lib/doc/Additional.lyx | 4 +--
lib/doc/EmbeddedObjects.lyx | 2 +-
lib/doc/ar/UserGuide.lyx | 2 +-
lib/doc/de/Additional.lyx | 4 +--
lib/doc/es/Additional.lyx | 4 +--
lib/doc/es/EmbeddedObjects.lyx | 2 +-
lib/doc/es/UserGuide.lyx | 2 +-
lib/doc/fr/Additional.lyx | 4 +--
lib/doc/fr/UserGuide.lyx | 2 +-
lib/doc/ja/Additional.lyx | 4 +--
lib/doc/ru/Additional.lyx | 4 +--
lib/doc/ru/EmbeddedObjects.lyx | 2 +-
src/OutputParams.h | 4 ++-
src/graphics/PreviewLoader.cpp | 2 +-
src/lyxfind.cpp | 64 ++++++++++++++++++++++++++++------
16 files changed, 82 insertions(+), 30 deletions(-)
diff --git a/development/checkurls/knownInvalidURLS
b/development/checkurls/knownInvalidURLS
index 80dc08cd30..837c6fce37 100644
--- a/development/checkurls/knownInvalidURLS
+++ b/development/checkurls/knownInvalidURLS
@@ -1,10 +1,16 @@
http://www.uon.edu/doe
+https://www.uon.edu/doe
ftp://www.test.test
http://www.test.test
#proto://host.xx.ab/abcd
http://example.com/%20foo
+https://example.com/%20foo
http://ftp.edpsciences.org/pub/aa/aa-package.zip
+https://ftp.edpsciences.org/pub/aa/aa-package.zip
http://www.istri.fr/spip/zip/CMCDDE.zip
http://prst-per.aps.org/multimedia/PRSTPER/v4/i1/e010101/e010101_vid1a.mpg
+https://prst-per.aps.org/multimedia/PRSTPER/v4/i1/e010101/e010101_vid1a.mpg
http://prst-per.aps.org/multimedia/PRSTPER/v4/i1/e010101/e010101_vid1b.mpg
+https://prst-per.aps.org/multimedia/PRSTPER/v4/i1/e010101/e010101_vid1b.mpg
http://www.issn.org/en/node/344
+https://www.issn.org/en/node/344
diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx
index b519aed9ce..02b9eb373e 100644
--- a/lib/doc/Additional.lyx
+++ b/lib/doc/Additional.lyx
@@ -27770,7 +27770,7 @@ https://www.nongnu.org/cvs/
status collapsed
\begin_layout Plain Layout
-https://cvs.nongnu.org/
+https://cvs.nongnu.org
\end_layout
\end_inset
@@ -29469,7 +29469,7 @@ literal "false"
\begin_inset CommandInset href
LatexCommand href
name "TortoiseSVN"
-target "https://tortoisesvn.net/"
+target "https://tortoisesvn.net"
literal "false"
\end_inset
diff --git a/lib/doc/EmbeddedObjects.lyx b/lib/doc/EmbeddedObjects.lyx
index 53d1cc1db7..36568207f0 100644
--- a/lib/doc/EmbeddedObjects.lyx
+++ b/lib/doc/EmbeddedObjects.lyx
@@ -42558,7 +42558,7 @@ figure This template supports specific scalable images
derived from scalable vec
\begin_inset CommandInset href
LatexCommand href
name "Inkscape"
-target "https://inkscape.org/"
+target "https://inkscape.org"
literal "false"
\end_inset
diff --git a/lib/doc/ar/UserGuide.lyx b/lib/doc/ar/UserGuide.lyx
index c890320faf..105861ff24 100644
--- a/lib/doc/ar/UserGuide.lyx
+++ b/lib/doc/ar/UserGuide.lyx
@@ -54307,7 +54307,7 @@ status collapsed
\begin_layout Plain Layout
-https://texfaq.org/
+https://texfaq.org
\end_layout
\end_inset
diff --git a/lib/doc/de/Additional.lyx b/lib/doc/de/Additional.lyx
index 6989c410d7..a10676ffd7 100644
--- a/lib/doc/de/Additional.lyx
+++ b/lib/doc/de/Additional.lyx
@@ -27872,7 +27872,7 @@ status collapsed
\begin_layout Plain Layout
-https://cvs.nongnu.org/
+https://cvs.nongnu.org
\end_layout
\end_inset
@@ -29655,7 +29655,7 @@ literal "false"
\begin_inset CommandInset href
LatexCommand href
name "TortoiseSVN"
-target "https://tortoisesvn.net/"
+target "https://tortoisesvn.net"
literal "false"
\end_inset
diff --git a/lib/doc/es/Additional.lyx b/lib/doc/es/Additional.lyx
index cf21d5a52f..80c50d734f 100644
--- a/lib/doc/es/Additional.lyx
+++ b/lib/doc/es/Additional.lyx
@@ -22530,7 +22530,7 @@ status collapsed
\begin_layout Plain Layout
-https://cvs.nongnu.org/
+https://cvs.nongnu.org
\end_layout
\end_inset
@@ -24450,7 +24450,7 @@ literal "false"
\begin_inset CommandInset href
LatexCommand href
name "TortoiseSVN"
-target "https://tortoisesvn.net/"
+target "https://tortoisesvn.net"
literal "false"
\end_inset
diff --git a/lib/doc/es/EmbeddedObjects.lyx b/lib/doc/es/EmbeddedObjects.lyx
index 59892fb5e2..ab7980d1d8 100644
--- a/lib/doc/es/EmbeddedObjects.lyx
+++ b/lib/doc/es/EmbeddedObjects.lyx
@@ -40295,7 +40295,7 @@ Inkscape
\begin_inset CommandInset href
LatexCommand href
name "Inkscape"
-target "https://inkscape.org/"
+target "https://inkscape.org"
literal "false"
\end_inset
diff --git a/lib/doc/es/UserGuide.lyx b/lib/doc/es/UserGuide.lyx
index 832afaa307..f54a79ee6e 100644
--- a/lib/doc/es/UserGuide.lyx
+++ b/lib/doc/es/UserGuide.lyx
@@ -52256,7 +52256,7 @@ status collapsed
\begin_layout Plain Layout
-https://texfaq.org/
+https://texfaq.org
\end_layout
\end_inset
diff --git a/lib/doc/fr/Additional.lyx b/lib/doc/fr/Additional.lyx
index d2eb901219..fec4dfb044 100644
--- a/lib/doc/fr/Additional.lyx
+++ b/lib/doc/fr/Additional.lyx
@@ -30028,7 +30028,7 @@ status collapsed
\begin_layout Plain Layout
-https://cvs.nongnu.org/
+https://cvs.nongnu.org
\end_layout
\end_inset
@@ -32074,7 +32074,7 @@ literal "false"
\begin_inset CommandInset href
LatexCommand href
name "TortoiseSVN"
-target "https://tortoisesvn.net/"
+target "https://tortoisesvn.net"
literal "false"
\end_inset
diff --git a/lib/doc/fr/UserGuide.lyx b/lib/doc/fr/UserGuide.lyx
index 450b7bebed..ab08db2ba9 100644
--- a/lib/doc/fr/UserGuide.lyx
+++ b/lib/doc/fr/UserGuide.lyx
@@ -58428,7 +58428,7 @@ status collapsed
\begin_layout Plain Layout
-https://texfaq.org/
+https://texfaq.org
\end_layout
\end_inset
diff --git a/lib/doc/ja/Additional.lyx b/lib/doc/ja/Additional.lyx
index 570aada229..1722985a9b 100644
--- a/lib/doc/ja/Additional.lyx
+++ b/lib/doc/ja/Additional.lyx
@@ -27599,7 +27599,7 @@ status collapsed
\begin_layout Plain Layout
-https://cvs.nongnu.org/
+https://cvs.nongnu.org
\end_layout
\end_inset
@@ -29388,7 +29388,7 @@ literal "false"
\begin_inset CommandInset href
LatexCommand href
name "TortoiseSVN"
-target "https://tortoisesvn.net/"
+target "https://tortoisesvn.net"
literal "false"
\end_inset
diff --git a/lib/doc/ru/Additional.lyx b/lib/doc/ru/Additional.lyx
index 2dab1e20e2..15aca7c5de 100644
--- a/lib/doc/ru/Additional.lyx
+++ b/lib/doc/ru/Additional.lyx
@@ -13926,7 +13926,7 @@ status collapsed
\begin_layout Plain Layout
-https://cvs.nongnu.org/
+https://cvs.nongnu.org
\end_layout
\end_inset
@@ -15634,7 +15634,7 @@ literal "false"
\begin_inset CommandInset href
LatexCommand href
name "TortoiseSVN"
-target "https://tortoisesvn.net/"
+target "https://tortoisesvn.net"
literal "false"
\end_inset
diff --git a/lib/doc/ru/EmbeddedObjects.lyx b/lib/doc/ru/EmbeddedObjects.lyx
index 6eac79851d..eca5fa6fbb 100644
--- a/lib/doc/ru/EmbeddedObjects.lyx
+++ b/lib/doc/ru/EmbeddedObjects.lyx
@@ -40608,7 +40608,7 @@ Inkscape Этот шаблон поддерживает определенные
\begin_inset CommandInset href
LatexCommand href
name "Inkscape"
-target "https://inkscape.org/"
+target "https://inkscape.org"
literal "false"
\end_inset
diff --git a/src/OutputParams.h b/src/OutputParams.h
index f6d1830dc1..ab93ce43f2 100644
--- a/src/OutputParams.h
+++ b/src/OutputParams.h
@@ -449,12 +449,14 @@ public:
SearchWithDeleted = 1,
SearchWithoutDeleted = 2,
SearchQuick = 4,
- SearchNonOutput = 8
+ SearchNonOutput = 8,
+ SearchDifferSpaces = 16
};
inline bool find_effective(void) const { return (for_search !=
OutputParams::NoSearch); }
inline bool find_with_non_output() const { return ((for_search &
OutputParams::SearchNonOutput) != 0); }
inline bool find_with_deleted() const { return ((for_search &
OutputParams::SearchWithDeleted) != 0); }
+ inline bool find_discriminate_spaces() const { return ((for_search &
OutputParams::SearchDifferSpaces) != 0); }
inline void find_set_feature(enum Search set_) { for_search = set_; }
inline void find_add_feature(enum Search add_) { for_search |= add_; }
inline void find_clean_features(void) { for_search =
OutputParams::NoSearch; }
diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index 25dcb2fd61..535effff48 100644
--- a/src/graphics/PreviewLoader.cpp
+++ b/src/graphics/PreviewLoader.cpp
@@ -624,7 +624,7 @@ void PreviewLoader::Impl::startLoading(bool wait)
// output format (see bug 9371).
Flavor flavor = docformat
? buffer_.params().getOutputFlavor()
- : Flavor::LaTeX;
+ : Flavor::PdfLaTeX;
if (buffer_.params().encoding().package() == Encoding::japanese) {
latexparam = " --latex=platex";
flavor = Flavor::LaTeX;
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index df71e12532..9665ed94a6 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -105,6 +105,10 @@ class IgnoreFormats {
///
bool getNonContent() const { return searchNonContent_; }
///
+ void setSpaceType(bool value);
+ ///
+ bool getSpaceType() const { return ignoreSpaceType_; }
+ ///
void setIgnoreFormat(string const & type, bool value, bool fromUser =
true);
private:
@@ -135,6 +139,8 @@ private:
bool ignoreDeleted_ = true;
///
bool searchNonContent_ = true;
+ ///
+ bool ignoreSpaceType_ = false;
};
void IgnoreFormats::setIgnoreFormat(string const & type, bool value, bool
fromUser)
@@ -186,6 +192,9 @@ void IgnoreFormats::setIgnoreFormat(string const & type,
bool value, bool fromUs
else if (type == "non-output-content") {
searchNonContent_ = !value;
}
+ else if (type == "ignore-space-type") {
+ ignoreSpaceType_ = value;
+ }
}
// The global variable that can be changed from outside
@@ -818,10 +827,15 @@ typedef vector<pair<string, string> > Escapes;
static string getRegexSpaceCount(int count)
{
if (count > 0) {
+ string whitespace;
+ if (ignoreFormats.getSpaceType())
+ whitespace = "[\\s" + accents["negthinspace{}"] +
accents["negmedspace{}"] + accents["negthickspace{}"] + "]";
+ else
+ whitespace = "\\s";
if (count > 1)
- return "\\s{" + std::to_string(count) + "}";
+ return whitespace + "{" + std::to_string(count) + "}";
else
- return "\\s";
+ return whitespace;
}
return "";
}
@@ -879,6 +893,17 @@ string string2regex(string in)
i += 2;
}
}
+ else if (ignoreFormats.getSpaceType()
+ && (tempx[i] == '\363')
+ && (tempx[i+1] == '\260')
+ && (tempx[i+2] == '\200')
+ && ((tempx[i+3] == '\203') || (tempx[i+3] == '\205') ||
(tempx[i+3] == '\207'))) {
+ // negthinspace
+ // negmedspace
+ // negthickspace
+ blanks++;
+ i += 3;
+ }
else {
if (blanks > 0) {
temp += getRegexSpaceCount(blanks);
@@ -920,7 +945,7 @@ string correctRegex(string t, bool withformat)
* and \{, \}, \[, \] => {, }, [, ]
*/
string s("");
- static std::regex wordre("(\\\\)*(\\\\(( |[A-Za-z]+|[\\{\\}%])(
|\\{\\})?|[\\[\\]\\{\\}]))");
+ static std::regex wordre("(\\\\)*(\\\\(( |[A-Za-z]+|[\\{\\}%,>!;:])(
|\\{\\})?|[\\[\\]\\{\\}]))");
static std::regex protectedSpace { R"(~)" };
size_t lastpos = 0;
smatch sub;
@@ -993,12 +1018,22 @@ string correctRegex(string t, bool withformat)
else if (sub.str(4) == " ")
replace = " ";
else {
- AccentsIterator it_ac =
accents.find(sub.str(4));
- if (it_ac == accents.end()) {
- replace = sub.str(2);
+ if ((!withformat ||
ignoreFormats.getSpaceType()) &&
+ ((sub.str(4) == ",") ||
+ (sub.str(4) == ">") ||
+ (sub.str(4) == "!") ||
+ (sub.str(4) == ";") ||
+ (sub.str(4) == ":"))) {
+ replace = " ";
}
else {
- replace = it_ac->second;
+ AccentsIterator it_ac =
accents.find(sub.str(4));
+ if (it_ac == accents.end()) {
+ replace = sub.str(2);
+ }
+ else {
+ replace = it_ac->second;
+ }
}
}
}
@@ -1217,6 +1252,9 @@ static docstring buffer_to_latex(Buffer & buffer)
if (ignoreFormats.getNonContent()) {
runparams.find_add_feature(OutputParams::SearchNonOutput);
}
+ if (ignoreFormats.getSpaceType()) {
+ runparams.find_add_feature(OutputParams::SearchDifferSpaces);
+ }
pit_type const endpit = buffer.paragraphs().size();
for (pit_type pit = 0; pit != endpit; ++pit) {
TeXOnePar(buffer, buffer.text(), pit, os, runparams, string(),
-1, -1, true);
@@ -2215,11 +2253,14 @@ static void buildAccentsMap()
accents["guillemotright"] = "»";
accents["guillemotleft"] = "«";
accents["hairspace"] = getutf8(0xf0000); // select from free
unicode plane 15
- accents["thinspace"] = getutf8(0xf0002); // and used _only_ by
findadv
+ accents["thinspace"] = getutf8(0x202f); // and used _only_ by
findadv
+ accents[","] = getutf8(0x202f);
accents["negthinspace{}"]= getutf8(0xf0003); // to omit backslashed
latex macros
- accents["medspace"] = getutf8(0xf0004); // See
https://en.wikipedia.org/wiki/Private_Use_Areas
+ accents["medspace"] = getutf8(0x2005); // See
https://en.wikipedia.org/wiki/Private_Use_Areas
+ accents[":"] = getutf8(0x2005);
accents["negmedspace{}"] = getutf8(0xf0005);
- accents["thickspace"] = getutf8(0xf0006);
+ accents["thickspace"] = getutf8(0x2004);
+ accents[";"] = getutf8(0x2004);
accents["negthickspace{}"]= getutf8(0xf0007);
accents["lyx"] = getutf8(0xf0010); // Used logos
accents["LyX"] = getutf8(0xf0010);
@@ -4390,6 +4431,9 @@ docstring latexifyFromCursor(DocIterator const & cur, int
len)
if (ignoreFormats.getNonContent()) {
runparams.find_add_feature(OutputParams::SearchNonOutput);
}
+ if (ignoreFormats.getSpaceType()) {
+ runparams.find_add_feature(OutputParams::SearchDifferSpaces);
+ }
if (cur.inTexted()) {
// @TODO what about searching beyond/across paragraph breaks ?
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs