From 2a30393d59c892349cffec18ec16907c2358fd0f Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 29 Oct 2017 21:32:22 +0000 Subject: [PATCH] getcontactinfo.cpp: Fix issue with using wxTransparentColour --- source/common/getcontactinfo.cpp | 6 +++--- source/common/getcontactinfo.h | 2 +- source/frmContact.cpp | 17 ++++++++++++++++- source/frmMain.cpp | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/source/common/getcontactinfo.cpp b/source/common/getcontactinfo.cpp index 1b4a5e6..a07ec4a 100644 --- a/source/common/getcontactinfo.cpp +++ b/source/common/getcontactinfo.cpp @@ -32,7 +32,7 @@ #include "../vcard/vcard34conv.h" void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, - wxString OldSID, std::map *MemoryFSList, wxString backgroundColour){ + wxString OldSID, std::map *MemoryFSList, wxColour backgroundColour){ // Load the vCard contact data into the wxHTMLWindow given. @@ -554,9 +554,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, } - if (!backgroundColour.IsEmpty()){ + if (backgroundColour != wxTransparentColour){ PageData.append("
"); } else { PageData.append("
"); diff --git a/source/common/getcontactinfo.h b/source/common/getcontactinfo.h index d71e6f3..4e6623a 100644 --- a/source/common/getcontactinfo.h +++ b/source/common/getcontactinfo.h @@ -27,7 +27,7 @@ #define GETCONTACTINFO_H void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, - wxString OldSID, std::map *MemoryFSList, wxString backgroundColour); + wxString OldSID, std::map *MemoryFSList, wxColour backgroundColour); void ProcessIMPPType(wxString *PageData, wxString *IMPPType, bool PreferredContact); void SplitPropertyData(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength, int intSize, std::map *SplitData); diff --git a/source/frmContact.cpp b/source/frmContact.cpp index d02be95..992ef25 100644 --- a/source/frmContact.cpp +++ b/source/frmContact.cpp @@ -121,7 +121,22 @@ bool frmContact::SetupContactData(vCard *vCardObj){ OldSessionID = SessionID; SessionID = wxString::Format(wxT("%i"), rand() % 32768); - LoadContactData(vCardObj, htmContactData, SessionID, OldSessionID, MemoryFSListPtr, backgroundColour); + wxColour formattedBackgroundColour; + if (backgroundColour.IsEmpty()) + { + + formattedBackgroundColour = wxTransparentColour; + + } + else + { + + formattedBackgroundColour.Set(backgroundColour); + + } + + + LoadContactData(vCardObj, htmContactData, SessionID, OldSessionID, MemoryFSListPtr, formattedBackgroundColour); ArrayvCardOutData FNList; FNList = vCardObj->GetByPartial(wxT("FN")); diff --git a/source/frmMain.cpp b/source/frmMain.cpp index bcbad5c..f21a0be 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -1108,7 +1108,7 @@ void frmMain::ShowContactInfo( wxListEvent& event ) OldSessionID = SessionID; SessionID = wxString::Format(wxT("%i"), rand() % 32768); - LoadContactData(&Person, htmContactData, SessionID, OldSessionID, &MemoryFileList, ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX)); + LoadContactData(&Person, htmContactData, SessionID, OldSessionID, &MemoryFileList, ContactBackgroundColour); ActiveFilename = ContactsFileIndex[ContactSeekNum]; } -- 2.39.2