diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-21 14:50:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-21 20:46:06 +0100 |
commit | eb8b769f8e5ee6383e04e08cfde4aa345a24e4c1 (patch) | |
tree | 1e9aaaf0fdfde8c8404d464944613a23c4db808e | |
parent | 5545fa0b9f88057e8b7ef4405cf15c2096d23691 (diff) |
cid#1473926 Uninitialized scalar variable
Change-Id: I794d2b58aa65f7eeb3aa32fa50e827ebf32b35ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112843
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 5 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 5 | ||||
-rw-r--r-- | editeng/source/uno/unoedhlp.cxx | 8 | ||||
-rw-r--r-- | include/editeng/editdata.hxx | 6 |
4 files changed, 10 insertions, 14 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index af80e2845bd6..2cb69858510b 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -715,10 +715,7 @@ void EditTextObjectImpl::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttr for (const auto & aAttrib : rC.maCharAttribs) { const XEditAttribute& rAttr = *aAttrib; - EECharAttrib aEEAttr; - aEEAttr.pAttr = rAttr.GetItem(); - aEEAttr.nStart = rAttr.GetStart(); - aEEAttr.nEnd = rAttr.GetEnd(); + EECharAttrib aEEAttr(rAttr.GetStart(), rAttr.GetEnd(), rAttr.GetItem()); rLst.push_back(aEEAttr); } } diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 248d78455dc4..3db8903650d1 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -744,10 +744,7 @@ void ImpEditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& for (const auto & i : rAttrs) { const EditCharAttrib& rAttr = *i; - EECharAttrib aEEAttr; - aEEAttr.pAttr = rAttr.GetItem(); - aEEAttr.nStart = rAttr.GetStart(); - aEEAttr.nEnd = rAttr.GetEnd(); + EECharAttrib aEEAttr(rAttr.GetStart(), rAttr.GetEnd(), rAttr.GetItem()); rLst.push_back(aEEAttr); } } diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index 19e14fcfc50a..9b5b98fc6df2 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -100,9 +100,7 @@ void SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nE { if (nIndex2 < aTempCharAttribs[nAttr].nStart) { - EECharAttrib aEEAttr; - aEEAttr.nStart = nIndex2; - aEEAttr.nEnd = aTempCharAttribs[nAttr].nStart; + EECharAttrib aEEAttr(nIndex2, aTempCharAttribs[nAttr].nStart); aCharAttribs.insert(aCharAttribs.begin() + nAttr, aEEAttr); } nIndex2 = aTempCharAttribs[nAttr].nEnd; @@ -110,9 +108,7 @@ void SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nE } if ( nIndex2 != nParaLen ) { - EECharAttrib aEEAttr; - aEEAttr.nStart = nIndex2; - aEEAttr.nEnd = nParaLen; + EECharAttrib aEEAttr(nIndex2, nParaLen); aCharAttribs.push_back(aEEAttr); } } diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index 40c74cb2b8c6..5ed618fc7b80 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -274,6 +274,12 @@ struct EECharAttrib sal_Int32 nStart; sal_Int32 nEnd; + EECharAttrib(sal_Int32 nSt, sal_Int32 nE, const SfxPoolItem* pA = nullptr) + : pAttr(pA) + , nStart(nSt) + , nEnd(nE) + { + } }; struct MoveParagraphsInfo |