commit 7d55f71107116a92501cdbe900ad96c7091cc469
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Sun Feb 16 20:16:17 2025 +0100

    Code factorization for write_attribute
    
    As a side effect, a temporary variable is omitted and Coverity Scan is
    happy.
---
 src/insets/InsetTabular.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 746b8dca27..392300c762 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -526,8 +526,7 @@ void l_getline(istream & is, string & str)
 template <class T>
 string const write_attribute(string const & name, T const & t)
 {
-       string const s = tostr(t);
-       return s.empty() ? s : " " + name + "=\"" + s + "\"";
+       return write_attribute(name, tostr(t));
 }
 
 template <>
@@ -540,7 +539,7 @@ string const write_attribute(string const & name, string 
const & t)
 template <>
 string const write_attribute(string const & name, docstring const & t)
 {
-       return t.empty() ? string() : " " + name + "=\"" + to_utf8(t) + "\"";
+       return write_attribute(name, to_utf8(t));
 }
 
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to