Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
getcontactinfo.cpp: Fix issue with using wxTransparentColour
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 29 Oct 2017 21:32:22 +0000 (21:32 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 29 Oct 2017 21:32:22 +0000 (21:32 +0000)
source/common/getcontactinfo.cpp
source/common/getcontactinfo.h
source/frmContact.cpp
source/frmMain.cpp

index 1b4a5e6..a07ec4a 100644 (file)
@@ -32,7 +32,7 @@
 #include "../vcard/vcard34conv.h"
 
 void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, 
-       wxString OldSID, std::map<wxString, wxString> *MemoryFSList, wxString backgroundColour){
+       wxString OldSID, std::map<wxString, wxString> *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("<table CELLPADDING=4 style=\"{background-color: ");
-               PageData.append(backgroundColour);
+               PageData.append(backgroundColour.GetAsString(wxC2S_CSS_SYNTAX));
                PageData.append("; width: 100%;}\"><tr><td>");          
        } else {
                PageData.append("<table CELLPADDING=4 style=\"{width: 100%;}\"><tr><td>");
index d71e6f3..4e6623a 100644 (file)
@@ -27,7 +27,7 @@
 #define GETCONTACTINFO_H
 
 void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, 
-                       wxString OldSID, std::map<wxString, wxString> *MemoryFSList, wxString backgroundColour);
+                       wxString OldSID, std::map<wxString, wxString> *MemoryFSList, wxColour backgroundColour);
 void ProcessIMPPType(wxString *PageData, wxString *IMPPType, bool PreferredContact);
 void SplitPropertyData(wxString *PropertyLine, std::map<int,int> *SplitPoints, std::map<int,int> *SplitLength, 
                        int intSize, std::map<wxString,wxString> *SplitData);
index d02be95..992ef25 100644 (file)
@@ -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"));
        
index bcbad5c..f21a0be 100644 (file)
@@ -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];
     
 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy