From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/dlg_propsheet.cpp | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'plugins/UserInfoEx/dlg_propsheet.cpp') diff --git a/plugins/UserInfoEx/dlg_propsheet.cpp b/plugins/UserInfoEx/dlg_propsheet.cpp index cefb8e777e..0b9db512cd 100644 --- a/plugins/UserInfoEx/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/dlg_propsheet.cpp @@ -43,6 +43,8 @@ Last change by : $Author: ing.u.horn $ #include #include +#define OPTIONPAGE_OLD_SIZE (offsetof(OPTIONSDIALOGPAGE, hLangpack)) + #define UPDATEANIMFRAMES 20 // internal dialog message handler @@ -389,13 +391,9 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) // check size of the handled structures if (pPsh == NULL || odp == NULL || pPsh->_dwSize != sizeof(CPsHdr)) - { return 1; - } - if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) && - odp->cbSize != OPTIONPAGE_OLD_SIZE2 && - odp->cbSize != OPTIONPAGE_OLD_SIZE3) - { + + if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) && odp->cbSize != OPTIONPAGE_OLD_SIZE) { MsgErr(NULL, LPGENT("The Page to add has invalid size %d bytes!"), odp->cbSize); return 1; } @@ -403,34 +401,28 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) // try to check whether the flag member is initialized or not odp->flags = odp->flags > (ODPF_UNICODE|ODPF_BOLDGROUPS|ODPF_ICON|PSPF_PROTOPREPENDED) ? 0 : odp->flags; - if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY|PSF_PROTOPAGESONLY_INIT)) - { + if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY|PSF_PROTOPAGESONLY_INIT)) { BOOLEAN bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE; TCHAR* ptszTitle = bIsUnicode ? mir_tstrdup(odp->ptszTitle) : mir_a2t(odp->pszTitle); // avoid adding pages for a meta subcontact, which have been added for a metacontact. - if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) - { - if (pPsh->_ignore.getIndex(ptszTitle) != -1) - { + if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) { + if (pPsh->_ignore.getIndex(ptszTitle) != -1) { mir_free(ptszTitle); return 0; } } // init ignore list with pages added by metacontact else if (pPsh->_dwFlags & PSF_PROTOPAGESONLY_INIT) - { pPsh->_ignore.insert(mir_tstrdup(ptszTitle)); - } + mir_free(ptszTitle); } // create the new tree item CPsTreeItem *pNew = new CPsTreeItem(); - if (pNew) - { - if (pNew->Create(pPsh, odp)) - { + if (pNew) { + if (pNew->Create(pPsh, odp)) { MIR_DELETE(pNew); return 1; } @@ -715,7 +707,7 @@ VOID DlgContactInfoLoadModule() ghDetailsInitEvent = CreateHookableEvent(ME_USERINFO_INITIALISE); myCreateServiceFunction(MS_USERINFO_SHOWDIALOG, ShowDialog); - myCreateServiceFunction(MS_USERINFO_ADDPAGE, AddPage); + myCreateServiceFunction("UserInfo/AddPage", AddPage); HookEvent(ME_DB_CONTACT_DELETED, OnDeleteContact); HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown); -- cgit v1.2.3