diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-10-25 21:13:42 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-12-09 13:24:46 +0100 |
commit | 1fe6e08a1bba3a1b981218bbc485c8fa162ba162 (patch) | |
tree | 9a65b65c625e65338df702ebef28e48fd553ee53 /desktop | |
parent | 1d641165a9f632708da33d7853f88d335315dbf3 (diff) |
make sure vector elements are initialized properly
Change-Id: If18268a26118ea587f474c21b7ca0f1fa4622744
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126442
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/lib/init.hxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 3f3802d17d4e..4499914839a0 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -197,7 +197,7 @@ namespace desktop { std::vector<bool> m_updatedTypes; // index is type, value is if set struct PerViewIdData { - bool set; // value is if set + bool set = false; // value is if set int sourceViewId; }; // Flat_map is used in preference to unordered_map because the map is accessed very often. diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 16ffe6f097e7..3bd212195f4d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1505,7 +1505,7 @@ void CallbackFlushHandler::setUpdatedTypePerViewId( int nType, int nViewId, int assert(isUpdatedTypePerViewId(nType)); std::vector<PerViewIdData>& types = m_updatedTypesPerViewId[ nViewId ]; if( types.size() <= o3tl::make_unsigned( nType )) - types.resize( nType + 1 ); // new are default-constructed, i.e. false + types.resize( nType + 1 ); // new are default-constructed, i.e. 'set' is false types[ nType ] = PerViewIdData{ value, nSourceViewId }; } |