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>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user