From 2d9df592b25bbed0e26680dcf900bc23faf83efa Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 12 Sep 2020 08:39:41 +0000 Subject: [PATCH] Core: Fixed issue with bool serialization git-svn-id: svn://ultimatepp.org/upp/trunk@15020 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Stream.h | 2 +- uppsrc/ide/Insert.cpp | 7 +++++++ uppsrc/ide/ide.h | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/uppsrc/Core/Stream.h b/uppsrc/Core/Stream.h index 7a6b7ea56..d35b93557 100644 --- a/uppsrc/Core/Stream.h +++ b/uppsrc/Core/Stream.h @@ -198,7 +198,7 @@ public: Stream& SerializeRaw(dword *data) { if(IsLoading()) *data = Get32le(); else Put32le(*data); return *this; } Stream& SerializeRaw(uint64 *data) { if(IsLoading()) *data = Get64le(); else Put64le(*data); return *this; } - Stream& operator%(bool& d) { return SerializeRaw((byte *)&d); } + Stream& operator%(bool& d) { byte b = d; SerializeRaw(&b); d = b; return *this; } Stream& operator%(char& d) { return SerializeRaw((byte *)&d); } Stream& operator%(signed char& d) { return SerializeRaw((byte *)&d); } Stream& operator%(unsigned char& d) { return SerializeRaw((byte *)&d); } diff --git a/uppsrc/ide/Insert.cpp b/uppsrc/ide/Insert.cpp index e69f33d2a..d6176dfdc 100644 --- a/uppsrc/ide/Insert.cpp +++ b/uppsrc/ide/Insert.cpp @@ -307,8 +307,15 @@ void Ide::InsertInclude(Bar& bar) void Ide::ToggleWordwrap() { + RLOG("==========="); + RDUMPHEX((int)*(byte *)&wordwrap); + RDUMP(wordwrap); wordwrap = !wordwrap; + RDUMPHEX((int)*(byte *)&wordwrap); + RDUMP(wordwrap); SetupEditor(); + RDUMP(wordwrap); + RLOG("........."); } void Ide::EditorMenu(Bar& bar) diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index e452877b5..86117d1e9 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -601,8 +601,8 @@ public: bool auto_rescan; bool auto_check; int spellcheck_comments; - bool wordwrap_comments; - bool wordwrap; + bool wordwrap_comments = true; + bool wordwrap = false; bool setmain_newide; bool gui_font_override = false; Font gui_font = StdFont();