summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-23 21:25:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-23 21:25:22 +0000
commitf86be8fc0ea87cafcd2dd630af1c08e0cdacdaa9 (patch)
treed14aa8a961906601b6170b930896672724d223b7 /plugins/Db3x_mmap/src
parent75115d35a7477110938f056a18edbbd43ac9a840 (diff)
minor addition
git-svn-id: http://svn.miranda-ng.org/main/trunk@1145 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r--plugins/Db3x_mmap/src/dbintf.h2
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h
index e77658767e..2aa1ceea73 100644
--- a/plugins/Db3x_mmap/src/dbintf.h
+++ b/plugins/Db3x_mmap/src/dbintf.h
@@ -206,6 +206,8 @@ protected:
protected:
virtual DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName) = 0;
+ virtual void InvalidateSettingsGroupOfsCacheEntry(DWORD ofsSettingsGroup) {}
+
virtual void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) = 0;
virtual PBYTE DBRead(DWORD ofs, int bytesRequired, int *bytesAvail) = 0;
virtual void DBWrite(DWORD ofs, PVOID pData, int bytes) = 0;
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp
index 4f3a2e5516..4a92bf7d4a 100644
--- a/plugins/Db3x_mmap/src/dbsettings.cpp
+++ b/plugins/Db3x_mmap/src/dbsettings.cpp
@@ -612,7 +612,7 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT
//make sure the module group exists
ofsSettingsGroup = GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsContact,ofsModuleName);
if (ofsSettingsGroup == 0) { //module group didn't exist - make it
- if (tmp.value.type&DBVTF_VARIABLELENGTH) {
+ if (tmp.value.type & DBVTF_VARIABLELENGTH) {
if (tmp.value.type == DBVT_ASCIIZ || tmp.value.type == DBVT_UTF8) bytesRequired = (int)strlen(tmp.value.pszVal)+2;
else if (tmp.value.type == DBVT_BLOB) bytesRequired = tmp.value.cpbVal+2;
}
@@ -705,6 +705,7 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT
DBContactSettings *dbcsPrev;
DWORD ofsDbcsPrev,ofsNew;
+ InvalidateSettingsGroupOfsCacheEntry(ofsSettingsGroup);
bytesRequired += (DB_SETTINGS_RESIZE_GRANULARITY-(bytesRequired%DB_SETTINGS_RESIZE_GRANULARITY))%DB_SETTINGS_RESIZE_GRANULARITY;
//find previous group to change its offset
ofsDbcsPrev = dbc.ofsFirstSettings;