X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcontacteditor%2FfrmContactEditorNickname.cpp;h=9c909a998ea6298c5800be8ae62238fb891b96ca;hb=4f4ef609869729894a13a7e37b6aa5ea0ddaa32b;hp=52619693f91af4becd3365461c9aff40725810f4;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc;p=xestiaab%2F.git
diff --git a/source/contacteditor/frmContactEditorNickname.cpp b/source/contacteditor/frmContactEditorNickname.cpp
index 5261969..9c909a9 100644
--- a/source/contacteditor/frmContactEditorNickname.cpp
+++ b/source/contacteditor/frmContactEditorNickname.cpp
@@ -1,3 +1,21 @@
+// frmContactEditorNickname.cpp - frmContactEditorNickname form.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see
+
#include "frmContactEditorNickname.h"
#include "../common/textprocessing.h"
@@ -15,15 +33,22 @@ void frmContactEditorNickname::InitAddressEditor( wxInitDialogEvent& event )
void frmContactEditorNickname::EnablePriority( wxCommandEvent& event )
{
+
+ // Enable/disable the priority.
+
if (chkUsePref->IsChecked()){
sliPriority->Enable();
} else {
sliPriority->Disable();
}
+
}
void frmContactEditorNickname::ProcessData( wxCommandEvent& event )
{
+
+ // Process the data.
+
long ListCtrlIndex;
if (EditorMode == FALSE){
@@ -139,11 +164,16 @@ void frmContactEditorNickname::ProcessData( wxCommandEvent& event )
void frmContactEditorNickname::CloseWindow( wxCommandEvent& event )
{
+
+ // Close this window.
+
this->Close();
+
}
void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType)
{
+
// Set if the editor is adding or editing an address.
// FALSE = Add
// TRUE = Edit
@@ -180,7 +210,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType
striter = NicknamesListLanguagePtr->find(NicknamesListIndex);
- if (striter->first == NicknamesListIndex){
+ if (striter->first == NicknamesListIndex &&
+ striter != NicknamesListLanguagePtr->end()){
strValue = striter->second;
@@ -193,7 +224,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType
intiter = NicknamesListPrefPtr->find(NicknamesListIndex);
- if (intiter->first == NicknamesListIndex && intiter->second > 0){
+ if (intiter->first == NicknamesListIndex && intiter->second > 0 &&
+ intiter != NicknamesListPrefPtr->end()){
sliPriority->SetValue(intiter->second);
sliPriority->Enable();
@@ -218,6 +250,8 @@ void frmContactEditorNickname::SetupPointers(std::map *NicknamesL
int NicknamesIndex )
{
+ // Setup the pointers.
+
NicknamesListPtr = NicknamesList;
NicknamesListAltIDPtr = NicknamesListAltID;
NicknamesListPIDPtr = NicknamesListPID;