summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-19 15:59:46 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-20 13:45:32 +0100
commitbeafe72de3427f20c0cb59f7c7ff7852ebcc7427 (patch)
tree5634bf2b103248f8268748f31d9cb4fcd41d2873 /cui/source
parent55a96efaacd2e932c7616f6a6072f794266f5948 (diff)
cid#1473926 Uninitialized scalar variable
Change-Id: I75911b7eff074b684a7f9c854fe8e63d102ae01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112780 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/inc/autocdlg.hxx6
-rw-r--r--cui/source/tabpages/autocdlg.cxx13
2 files changed, 10 insertions, 9 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 86218a58a581..b084bdbd685a 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -135,6 +135,12 @@ struct DoubleString
OUString sShort;
OUString sLong;
void* pUserData; ///< CheckBox -> form. Text Bool -> selection text
+ DoubleString(const OUString& rShort, const OUString& rLong)
+ : sShort(rShort)
+ , sLong(rLong)
+ , pUserData(nullptr)
+ {
+ }
};
typedef std::vector<DoubleString> DoubleStringArray;
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 00ac479bac09..55fee3ede945 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -802,10 +802,9 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset,
}
m_xReplaceTLB->all_foreach([this, &pArray](weld::TreeIter& rIter) {
- pArray->push_back(DoubleString());
+ pArray->push_back(DoubleString(m_xReplaceTLB->get_text(rIter, 0),
+ m_xReplaceTLB->get_text(rIter, 1)));
DoubleString& rDouble = pArray->back();
- rDouble.sShort = m_xReplaceTLB->get_text(rIter, 0);
- rDouble.sLong = m_xReplaceTLB->get_text(rIter, 1);
rDouble.pUserData = reinterpret_cast<void*>(m_xReplaceTLB->get_id(rIter).toInt64());
return false;
});
@@ -961,9 +960,7 @@ void OfaAutocorrReplacePage::NewEntry(const OUString& sShort, const OUString& sL
}
}
- DoubleString aNewString;
- aNewString.sShort = sShort;
- aNewString.sLong = sLong;
+ DoubleString aNewString(sShort, sLong);
rNewArray.push_back(aNewString);
if (bKeepSourceFormatting)
rNewArray.back().pUserData = &bHasSelectionText;
@@ -991,9 +988,7 @@ void OfaAutocorrReplacePage::DeleteEntry(const OUString& sShort, const OUString&
}
}
- DoubleString aDeletedString;
- aDeletedString.sShort = sShort;
- aDeletedString.sLong = sLong;
+ DoubleString aDeletedString(sShort, sLong);
rDeletedArray.push_back(aDeletedString);
}