]> git.lyx.org Git - lyx.git/commitdiff
Pass strings as reference
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 Jan 2024 13:34:45 +0000 (14:34 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 Jan 2024 13:34:45 +0000 (14:34 +0100)
Spotted by coverity.

src/mathed/InsetMathMacroTemplate.cpp

index 555c4aa896804962459110cb82148853f1ed4b4f..2a721833b0cc8ffaed7ce91c0cb1682d1e4f1205 100644 (file)
@@ -61,9 +61,9 @@ using support::bformat;
 class InsetLabelBox : public InsetMathNest {
 public:
        ///
-       InsetLabelBox(Buffer * buf, MathAtom const & atom, docstring label,
+       InsetLabelBox(Buffer * buf, MathAtom const & atom, docstring const & label,
                      InsetMathMacroTemplate const & parent, bool frame = false);
-       InsetLabelBox(Buffer * buf, docstring label, InsetMathMacroTemplate const & parent,
+       InsetLabelBox(Buffer * buf, docstring const & label, InsetMathMacroTemplate const & parent,
                      bool frame = false);
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const override;
@@ -82,7 +82,7 @@ protected:
 };
 
 
-InsetLabelBox::InsetLabelBox(Buffer * buf, MathAtom const & atom, docstring label,
+InsetLabelBox::InsetLabelBox(Buffer * buf, MathAtom const & atom, docstring const & label,
        InsetMathMacroTemplate const & parent, bool frame)
        : InsetMathNest(buf, 1), parent_(parent), label_(label), frame_(frame)
 {
@@ -90,7 +90,7 @@ InsetLabelBox::InsetLabelBox(Buffer * buf, MathAtom const & atom, docstring labe
 }
 
 
-InsetLabelBox::InsetLabelBox(Buffer * buf, docstring label,
+InsetLabelBox::InsetLabelBox(Buffer * buf, docstring const & label,
                             InsetMathMacroTemplate const & parent, bool frame)
        : InsetMathNest(buf, 1), parent_(parent), label_(label), frame_(frame)
 {
@@ -185,7 +185,7 @@ void InsetLabelBox::draw(PainterInfo & pi, int x, int y) const
 class InsetDisplayLabelBox : public InsetLabelBox {
 public:
        ///
-       InsetDisplayLabelBox(Buffer * buf, MathAtom const & atom, docstring label,
+       InsetDisplayLabelBox(Buffer * buf, MathAtom const & atom, docstring const & label,
                        InsetMathMacroTemplate const & parent);
 
        ///
@@ -202,7 +202,7 @@ protected:
 
 
 InsetDisplayLabelBox::InsetDisplayLabelBox(Buffer * buf, MathAtom const & atom,
-                                docstring label,
+                                docstring const & label,
                                 InsetMathMacroTemplate const & parent)
        : InsetLabelBox(buf, atom, label, parent, true)
 {