summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-25 16:46:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-25 16:46:58 +0000
commit3089ea327fcc54509d087925369c7dd7b3afc0f4 (patch)
tree989072cb4a8104f2a5b47d3a2d9a9845b84db21b /src
parent2113b6675af6f78916ea050a17cfe9370d29a134 (diff)
compatibility with the old options
git-svn-id: http://svn.miranda-ng.org/main/trunk@636 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/modules/fonts/services.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index e0b145a350..09ac106fb5 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "..\..\core\commonheaders.h"
#include "FontService.h"
+#define FontID_OLDSIZE (offsetof(FontID, backgroundGroup))
+#define FontIDW_OLDSIZE (offsetof(FontIDW, backgroundGroup))
+
COLORREF GetColorFromDefault(COLORREF cl);
void ConvertFontSettings(FontSettings* fs, FontSettingsW* fsw)
@@ -38,7 +41,7 @@ void ConvertFontSettings(FontSettings* fs, FontSettingsW* fsw)
bool ConvertFontID(FontID *fid, FontIDW* fidw)
{
- if (fid->cbSize != sizeof(FontID))
+ if (fid->cbSize != sizeof(FontID) && fid->cbSize != FontID_OLDSIZE)
return false;
memset(fidw, 0, sizeof(FontIDW));
@@ -51,8 +54,11 @@ bool ConvertFontID(FontID *fid, FontIDW* fidw)
MultiByteToWideChar(code_page, 0, fid->group, -1, fidw->group, 64);
MultiByteToWideChar(code_page, 0, fid->name, -1, fidw->name, 64);
- MultiByteToWideChar(code_page, 0, fid->backgroundGroup, -1, fidw->backgroundGroup, 64);
- MultiByteToWideChar(code_page, 0, fid->backgroundName, -1, fidw->backgroundName, 64);
+
+ if (fid->cbSize > FontID_OLDSIZE) {
+ MultiByteToWideChar(code_page, 0, fid->backgroundGroup, -1, fidw->backgroundGroup, 64);
+ MultiByteToWideChar(code_page, 0, fid->backgroundName, -1, fidw->backgroundName, 64);
+ }
return true;
}
@@ -279,7 +285,7 @@ COLORREF GetColorFromDefault(COLORREF cl)
static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack)
{
- if (font_id->cbSize != sizeof(FontIDW))
+ if (font_id->cbSize != sizeof(FontIDW) && font_id->cbSize != FontIDW_OLDSIZE)
return -1;
for (int i = 0; i < font_id_list.getCount(); i++) {