commit bd7a67f5741c248403cc15a1099bf61221c6bc78
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Fri May 9 15:45:06 2025 +0200

    Copy ParagraphMetrics::id() when needed.
---
 src/ParagraphMetrics.cpp | 2 ++
 src/ParagraphMetrics.h   | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/ParagraphMetrics.cpp b/src/ParagraphMetrics.cpp
index 34edaff167..464c088bfe 100644
--- a/src/ParagraphMetrics.cpp
+++ b/src/ParagraphMetrics.cpp
@@ -52,6 +52,7 @@ ParagraphMetrics & ParagraphMetrics::operator=(
 {
        rows_ = pm.rows_;
        dim_ = pm.dim_;
+       id_ = pm.id_;
        par_ = pm.par_;
        position_ = pm.position_;
        return *this;
@@ -61,6 +62,7 @@ ParagraphMetrics & ParagraphMetrics::operator=(
 void ParagraphMetrics::reset(Paragraph const & par)
 {
        par_ = &par;
+       id_ = par.id();
        dim_ = Dimension();
        //position_ = pm_npos;
 }
diff --git a/src/ParagraphMetrics.h b/src/ParagraphMetrics.h
index c1749947aa..ff5677dfa4 100644
--- a/src/ParagraphMetrics.h
+++ b/src/ParagraphMetrics.h
@@ -95,7 +95,8 @@ public:
 private:
        ///
        int position_ = 0;
-       ///
+       /// This is stored separately from the paragraph to work around
+       /// InsetInfo messiness in ticket #12639.
        int id_ = -1;
        ///
        mutable Rows rows_;
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to