diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-08 09:37:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-08 13:24:29 +0200 |
commit | de9b6e3deeeffa2405fe890946714c2e439e1583 (patch) | |
tree | eec8bf661864d31f0cff909352982d3d08e29ca9 /editeng | |
parent | 1e56a952cecabcaa04fa442c7891ca67e9d4601a (diff) |
cid#1485166 silence Uninitialized scalar variable
seeing as there are no warnings about
SvxRTFItemStackType::SetStartPos
try that pattern
Change-Id: Icad28503047323b01d8e048061c6b037bcdcb83c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116817
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 661a6cb11163..e94159e29e77 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -935,12 +935,17 @@ SvxRTFItemStackType::SvxRTFItemStackType( const EditPosition& rPos ) : aAttrSet( rPool, pWhichRange ) , mxStartNodeIdx(rPos.MakeNodeIdx()) - // coverity[read_parm_fld : FALSE] - difficulty with std::optional leading to bogus 'Uninitialized scalar variable' +#if !defined(__COVERITY__) + // coverity 2020 has difficulty wrt std::optional leading to bogus 'Uninitialized scalar variable' , mxEndNodeIdx(mxStartNodeIdx) +#endif , nSttCnt(rPos.GetCntIdx()) , nEndCnt(nSttCnt) , nStyleNo(0) { +#if defined(__COVERITY__) + mxEndNodeIdx = mxStartNodeIdx; +#endif } SvxRTFItemStackType::SvxRTFItemStackType( @@ -949,12 +954,17 @@ SvxRTFItemStackType::SvxRTFItemStackType( bool const bCopyAttr ) : aAttrSet( *rCpy.aAttrSet.GetPool(), rCpy.aAttrSet.GetRanges() ) , mxStartNodeIdx(rPos.MakeNodeIdx()) - // coverity[read_parm_fld : FALSE] - difficulty with std::optional leading to bogus 'Uninitialized scalar variable' +#if !defined(__COVERITY__) + // coverity 2020 has difficulty wrt std::optional leading to bogus 'Uninitialized scalar variable' , mxEndNodeIdx(mxStartNodeIdx) +#endif , nSttCnt(rPos.GetCntIdx()) , nEndCnt(nSttCnt) , nStyleNo(rCpy.nStyleNo) { +#if defined(__COVERITY__) + mxEndNodeIdx = mxStartNodeIdx; +#endif aAttrSet.SetParent( &rCpy.aAttrSet ); if( bCopyAttr ) aAttrSet.Put( rCpy.aAttrSet ); |