summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-25 21:13:42 +0200
committerAndras Timar <andras.timar@collabora.com>2022-02-14 11:25:40 +0100
commit05bac006ea18bcbc24a86035664f096787fff613 (patch)
tree5c8554de62e86c53c1cda700f80fd8dbc8275d51 /desktop
parent7217d1ba3abfffa17c330ac279130c66cc9d2ca2 (diff)
make sure vector elements are initialized properly
Change-Id: If18268a26118ea587f474c21b7ca0f1fa4622744 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126469 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/lib/init.hxx2
-rw-r--r--desktop/source/lib/init.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index b8918729cff9..5ebda0a245d6 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 64143e8d7582..718c9d09afd0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1500,7 +1500,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 };
}