From 0d9ab6010c0084ea6bc3b080a7ef7eaed97940f6 Mon Sep 17 00:00:00 2001 From: unodgs Date: Sun, 2 Jan 2011 12:26:38 +0000 Subject: [PATCH] TabBar: Fixed id serializing git-svn-id: svn://ultimatepp.org/upp/trunk@2955 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/TabBar/TabBar.cpp | 11 +++++++---- uppsrc/TabBar/TabBar.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/uppsrc/TabBar/TabBar.cpp b/uppsrc/TabBar/TabBar.cpp index 8a94946dc..a78634322 100644 --- a/uppsrc/TabBar/TabBar.cpp +++ b/uppsrc/TabBar/TabBar.cpp @@ -295,6 +295,7 @@ TabBar::TabBar() { Clear(); + id = 0; display = NULL; crosses = true; crosses_side = RIGHT; @@ -332,6 +333,8 @@ void TabBar::Set(const TabBar& t) { CopyBaseSettings(t); + id = t.id; + tabs.Clear(); tabs <<= t.tabs; groups.Clear(); @@ -375,8 +378,7 @@ void TabBar::CloseAll(int exception) int TabBar::GetNextId() { - static int id = 0; - return ++id; + return id++; } void TabBar::ContextMenu(Bar& bar) @@ -2361,7 +2363,8 @@ void TabBar::Serialize(Stream& s) { int version = 1; s / version; - + + s % id; s % crosses; s % crosses_side; s % grouping; @@ -2387,7 +2390,7 @@ void TabBar::Serialize(Stream& s) groups.SetCount(n); for(int i = 0; i < groups.GetCount(); i++) - s % groups[i]; + s % groups[i]; n = tabs.GetCount(); s % n; diff --git a/uppsrc/TabBar/TabBar.h b/uppsrc/TabBar/TabBar.h index e2c1af413..d42eccc77 100644 --- a/uppsrc/TabBar/TabBar.h +++ b/uppsrc/TabBar/TabBar.h @@ -228,6 +228,7 @@ protected: Vector tabs; Vector separators; int active; + int id; private: int highlight;