On 5/18/23 11:02, Kornel Benko wrote:
commit f13808939b9ae6d8d467538d17157a87e8a1a37c
Author: Kornel Benko <kor...@lyx.org>
Date: Thu May 18 18:07:40 2023 +0200
Advaced search: check for toString() before using it.
(#12783)
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index b8819fd..fed5a74 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4314,7 +4314,7 @@ docstring Paragraph::asString(pos_type beg, pos_type end,
int options, const Out
else if (c == META_INSET && (options & AS_STR_INSETS)) {
if (c == META_INSET && (options & AS_STR_PLAINTEXT)) {
LASSERT(runparams != nullptr, return
docstring());
- if (runparams->find_effective())
+ if (runparams->find_effective() &&
getInset(i)->hasToString())
getInset(i)->toString(os);
else
getInset(i)->plaintext(os, *runparams);
I know this will be an annoying suggestion after all that work, but what
about:
if (runparams->find_effective) {
string str = getInset(i)->toString(os);
if (str.empty())
str = getInset(i)->plaintext(os, *runaparms);
}
? Then no need for the new method.
Riki
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel