commit 1edbf565e4ec9903edd7baf26909bd85ad1a7651
Author: Kornel Benko <kor...@lyx.org>
Date:   Sun Dec 31 14:09:17 2023 +0100

    Rename hasToString() to findUsesToString()
    
    There are special cases where the toString() exist,
    but still plaintext() is not to be used by find.
    
    (cherry picked from commit 8de81e8dc1cf344a9a245868aaff2c31dd0c9ce4)
---
 src/Paragraph.cpp             | 2 +-
 src/insets/Inset.h            | 2 +-
 src/insets/InsetBranch.h      | 2 +-
 src/insets/InsetCitation.h    | 2 +-
 src/insets/InsetCounter.h     | 2 +-
 src/insets/InsetHyperlink.h   | 2 +-
 src/insets/InsetIPAMacro.h    | 2 +-
 src/insets/InsetQuotes.h      | 2 +-
 src/insets/InsetRef.h         | 2 +-
 src/insets/InsetSpace.h       | 2 +-
 src/insets/InsetSpecialChar.h | 2 +-
 src/insets/InsetText.h        | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 49713a8b9a..4282defa4a 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4425,7 +4425,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() && 
getInset(i)->hasToString())
+                               if (runparams->find_effective() && 
getInset(i)->findUsesToString())
                                        getInset(i)->toString(os);
                                else
                                        getInset(i)->plaintext(os, *runparams);
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index d2b407675b..2fa3e26234 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -350,7 +350,7 @@ public:
        virtual docstring xhtml(XMLStream &, OutputParams const &) const;
 
        /// 
-       virtual bool hasToString() const { return false; }
+       virtual bool findUsesToString() const { return false; }
        /// Writes a string representation of the inset to the odocstream.
        /// This one should be called when you want the whole contents of
        /// the inset.
diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h
index e2b2958f18..5098e70afb 100644
--- a/src/insets/InsetBranch.h
+++ b/src/insets/InsetBranch.h
@@ -80,7 +80,7 @@ private:
        ///
        docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h
index 56ad45a9b6..b1b27e0291 100644
--- a/src/insets/InsetCitation.h
+++ b/src/insets/InsetCitation.h
@@ -62,7 +62,7 @@ public:
        ///
        docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetCounter.h b/src/insets/InsetCounter.h
index eb6338dde2..65a38ab325 100644
--- a/src/insets/InsetCounter.h
+++ b/src/insets/InsetCounter.h
@@ -43,7 +43,7 @@ public:
        ///
        docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetHyperlink.h b/src/insets/InsetHyperlink.h
index 59615b0d5b..36bd249902 100644
--- a/src/insets/InsetHyperlink.h
+++ b/src/insets/InsetHyperlink.h
@@ -34,7 +34,7 @@ public:
        ///
        bool isInToc() const override { return true; }
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetIPAMacro.h b/src/insets/InsetIPAMacro.h
index 5855da9e95..dc1977f977 100644
--- a/src/insets/InsetIPAMacro.h
+++ b/src/insets/InsetIPAMacro.h
@@ -154,7 +154,7 @@ public:
        ///
        docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h
index 5e6cb3c4aa..2eeb5fa866 100644
--- a/src/insets/InsetQuotes.h
+++ b/src/insets/InsetQuotes.h
@@ -157,7 +157,7 @@ public:
        docstring xhtml(XMLStream &, OutputParams const &) const override;
 
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h
index 09d5e18e34..97e64a69e2 100644
--- a/src/insets/InsetRef.h
+++ b/src/insets/InsetRef.h
@@ -65,7 +65,7 @@ public:
        ///
        docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h
index 0b1bd7bfe5..04edaed2c4 100644
--- a/src/insets/InsetSpace.h
+++ b/src/insets/InsetSpace.h
@@ -136,7 +136,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetSpecialChar.h b/src/insets/InsetSpecialChar.h
index 36afa15fed..5f7338b8dd 100644
--- a/src/insets/InsetSpecialChar.h
+++ b/src/insets/InsetSpecialChar.h
@@ -82,7 +82,7 @@ public:
        ///
        docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h
index e271478114..bce125bcca 100644
--- a/src/insets/InsetText.h
+++ b/src/insets/InsetText.h
@@ -180,7 +180,7 @@ public:
        ///
        void setMacrocontextPositionRecursive(DocIterator const & pos);
        ///
-       bool hasToString() const override { return true; }
+       bool findUsesToString() const override { return true; }
        ///
        void toString(odocstream &) const override;
        ///
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to