summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-12-01 12:55:35 +0100
committerJulien Nabet <serval2412@yahoo.fr>2019-12-01 19:21:51 +0100
commitbcf1a726e875d36f7cf38c0e74a5287f46327fce (patch)
tree9bd6d1a51f97a7b001135f28063cfe4e63d626ff
parentaddb177559778d771f0eec92ae173552d8e1a1e5 (diff)
cppcheck: performing init in init list (desktop/editeng)
Change-Id: Ie489d36852b9c6be449c44f7fcc0cf1ee0164833 Reviewed-on: https://gerrit.libreoffice.org/84144 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--desktop/source/app/updater.cxx14
-rw-r--r--editeng/source/outliner/outlundo.cxx7
2 files changed, 12 insertions, 9 deletions
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index adcc130751e7..ea9be47a8348 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -353,9 +353,12 @@ class invalid_hash : public std::exception
public:
invalid_hash(const OUString& rExpectedHash, const OUString& rReceivedHash)
+ : maMessage(
+ OUStringToOString(
+ OUString("Invalid hash found.\nExpected: " + rExpectedHash + ";\nReceived: " + rReceivedHash),
+ RTL_TEXTENCODING_UTF8)
+ )
{
- OUString aMsg = "Invalid hash found.\nExpected: " + rExpectedHash + ";\nReceived: " + rReceivedHash;
- maMessage = OUStringToOString(aMsg, RTL_TEXTENCODING_UTF8);
}
const char* what() const noexcept override
@@ -370,9 +373,12 @@ class invalid_size : public std::exception
public:
invalid_size(const size_t nExpectedSize, const size_t nReceivedSize)
+ : maMessage(
+ OUStringToOString(
+ OUString("Invalid file size found.\nExpected: " + OUString::number(nExpectedSize) + ";\nReceived: " + OUString::number(nReceivedSize)),
+ RTL_TEXTENCODING_UTF8)
+ )
{
- OUString aMsg = "Invalid file size found.\nExpected: " + OUString::number(nExpectedSize) + ";\nReceived: " + OUString::number(nReceivedSize);
- maMessage = OUStringToOString(aMsg, RTL_TEXTENCODING_UTF8);
}
const char* what() const noexcept override
diff --git a/editeng/source/outliner/outlundo.cxx b/editeng/source/outliner/outlundo.cxx
index 65f390f62487..76232c090dbf 100644
--- a/editeng/source/outliner/outlundo.cxx
+++ b/editeng/source/outliner/outlundo.cxx
@@ -68,10 +68,8 @@ void OutlinerUndoChangeParaFlags::ImplChangeFlags( ParaFlag nFlags )
OutlinerUndoChangeParaNumberingRestart::OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_Int32 nPara,
sal_Int16 nOldNumberingStartValue, sal_Int16 nNewNumberingStartValue,
bool bOldParaIsNumberingRestart, bool bNewParaIsNumberingRestart )
-: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
+: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ), mnPara(nPara)
{
- mnPara = nPara;
-
maUndoData.mnNumberingStartValue = nOldNumberingStartValue;
maUndoData.mbParaIsNumberingRestart = bOldParaIsNumberingRestart;
maRedoData.mnNumberingStartValue = nNewNumberingStartValue;
@@ -111,9 +109,8 @@ void OutlinerUndoChangeDepth::Redo()
}
OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, sal_Int32 nPara )
- : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
+ : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ), mnPara(nPara)
{
- mnPara = nPara;
}
void OutlinerUndoCheckPara::Undo()