Subject:
[LyX/master] Fix a comparison of arrays to compare *contents*
From:
Scott Kostyshak <scott.kostys...@gmail.com>
Date:
12/31/20, 2:06 PM

To:
lyx-cvs@lists.lyx.org


commit eaebe404ae6c8305161bd5f41496f36cf6a2ab78
Author: Scott Kostyshak<scott.kostys...@gmail.com>
Date:   Thu Dec 31 13:15:14 2020 -0500

    Fix a comparison of arrays to compare*contents*
The previous code was mistakenly comparing addresses of the arrays.
    This issue was caught by a warning when compiling with Clang in
    C++20 mode, since comparing array addresses in this way is
    deprecated.
This commit should prevent some unnecessary dispatches of
    LFUN_SCREEN_FONT_UPDATE.
---
 src/LyXRC.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 52a7168..8416cd3 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -2947,7 +2947,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const 
& lyxrc_new)
                || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
                || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
                || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
-               || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
+               || !std::equal(std::begin(lyxrc_orig.font_sizes), 
std::end(lyxrc_orig.font_sizes),
+                              std::begin(lyxrc_new.font_sizes))
                || lyxrc_orig.typewriter_font_foundry != 
lyxrc_new.typewriter_font_foundry
                || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
                        dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));



-------- Forwarded Message --------
Subject:        Auto-discard notification
Date:   Thu, 31 Dec 2020 19:06:52 +0000
From:   lyx-cvs-boun...@lists.lyx.org
To:     lyx-cvs-ow...@lists.lyx.org



The attached message has been automatically discarded.
--- Begin Message ---
commit eaebe404ae6c8305161bd5f41496f36cf6a2ab78
Author: Scott Kostyshak <scott.kostys...@gmail.com>
Date:   Thu Dec 31 13:15:14 2020 -0500

    Fix a comparison of arrays to compare *contents*
    
    The previous code was mistakenly comparing addresses of the arrays.
    This issue was caught by a warning when compiling with Clang in
    C++20 mode, since comparing array addresses in this way is
    deprecated.
    
    This commit should prevent some unnecessary dispatches of
    LFUN_SCREEN_FONT_UPDATE.
---
 src/LyXRC.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 52a7168..8416cd3 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -2947,7 +2947,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC 
const & lyxrc_new)
                || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
                || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
                || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
-               || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
+               || !std::equal(std::begin(lyxrc_orig.font_sizes), 
std::end(lyxrc_orig.font_sizes),
+                              std::begin(lyxrc_new.font_sizes))
                || lyxrc_orig.typewriter_font_foundry != 
lyxrc_new.typewriter_font_foundry
                || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
                        dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));

--- End Message ---
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to