diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index 23fcd8cebe..0f57a14437 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -36,7 +36,7 @@ wxSharedPtr static_db_ptr() return db; } -wxSharedPtr mmDBWrapper::Open(const wxString &dbpath, const wxString &password, bool debug) +wxSharedPtr mmDBWrapper::Open(const wxString &dbpath, const wxString &password, const bool debug) { wxSharedPtr db = static_db_ptr(); @@ -47,11 +47,13 @@ wxSharedPtr mmDBWrapper::Open(const wxString &dbpath, const w cipher.SetLegacy(true); try { - if (debug) - // open and disable flag SQLITE_CorruptRdOnly = 0x200000000 - db->Open(dbpath, cipher, password, (WXSQLITE_OPEN_READWRITE | WXSQLITE_OPEN_CREATE) & ~0x200000000); - else - db->Open(dbpath, cipher, password); + // open and disable flag SQLITE_CorruptRdOnly = 0x200000000 + const int flags = debug ? + (WXSQLITE_OPEN_READWRITE | WXSQLITE_OPEN_CREATE) & ~0x200000000 : + WXSQLITE_OPEN_READWRITE | WXSQLITE_OPEN_CREATE; + + db->Open(dbpath, cipher, password, flags); + // Ensure that an existing mmex database is not encrypted. if ((db->IsOpen()) && (db->TableExists("INFOTABLE_V1"))) { diff --git a/src/reports/reportbase.cpp b/src/reports/reportbase.cpp index fde358c2cd..8b2cf774da 100644 --- a/src/reports/reportbase.cpp +++ b/src/reports/reportbase.cpp @@ -27,10 +27,7 @@ #include "util.h" mmPrintableBase::mmPrintableBase(const wxString& title) - : m_title(title) - , m_initial(true) - , accountArray_(nullptr) - , m_settings("") + : m_title(title) { } diff --git a/src/reports/reportbase.h b/src/reports/reportbase.h index 0b573b322e..308b73e9f8 100644 --- a/src/reports/reportbase.h +++ b/src/reports/reportbase.h @@ -109,11 +109,11 @@ class mmPrintableBase bool m_only_active = false; private: - bool m_initial; + bool m_initial = true; int m_account_selection = 0; int m_id = -1; int m_parameters = 0; - wxString m_settings; + wxString m_settings = ""; }; inline void mmPrintableBase::setSelection(int sel) { m_date_selection = sel; }