From 99e320d3cb52177083c68fc13b635deae380b4cf Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 13 Mar 2016 12:45:34 +0000 Subject: [PATCH] Indented code properly contacteditor/frmContactEditor-Logo.cpp --- .../contacteditor/frmContactEditor-Logo.cpp | 193 +++++++++--------- 1 file changed, 99 insertions(+), 94 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Logo.cpp b/source/contacteditor/frmContactEditor-Logo.cpp index 808e2d5..2f02a8a 100644 --- a/source/contacteditor/frmContactEditor-Logo.cpp +++ b/source/contacteditor/frmContactEditor-Logo.cpp @@ -23,141 +23,146 @@ void frmContactEditor::LoadLogo( wxListEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, - &longSelected, - &intSelectedData)){ - return; - } + if (!GetSelectedItem(lboLogos, + &longSelected, + &intSelectedData)){ + return; + } - std::string base64dec; + std::string base64dec; - std::map::iterator initier; - std::map::iterator pictypeiter; + std::map::iterator initier; + std::map::iterator pictypeiter; - initier = ContactEditorData.LogosList.find(intSelectedData); - pictypeiter = ContactEditorData.LogosListPictureType.find(intSelectedData); + initier = ContactEditorData.LogosList.find(intSelectedData); + pictypeiter = ContactEditorData.LogosListPictureType.find(intSelectedData); - base64dec = base64_decode(initier->second); + base64dec = base64_decode(initier->second); - wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size()); - wxImage photo; - //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size()); + wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size()); + wxImage photo; + //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size()); - if (pictypeiter->second == wxT("image/jpeg")){ + if (pictypeiter->second == wxT("image/jpeg")){ - if (!photo.LoadFile(istream, wxBITMAP_TYPE_JPEG)){ + if (!photo.LoadFile(istream, wxBITMAP_TYPE_JPEG)){ - return; + return; - } + } - } else if (pictypeiter->second == wxT("image/png")){ + } else if (pictypeiter->second == wxT("image/png")){ - if (!photo.LoadFile(istream, wxBITMAP_TYPE_PNG)){ + if (!photo.LoadFile(istream, wxBITMAP_TYPE_PNG)){ - return; + return; - } + } - } else if (pictypeiter->second == wxT("image/gif")){ + } else if (pictypeiter->second == wxT("image/gif")){ - if (!photo.LoadFile(istream, wxBITMAP_TYPE_GIF)){ + if (!photo.LoadFile(istream, wxBITMAP_TYPE_GIF)){ - return; + return; - } + } - } else { + } else { - return; + return; - } + } - LogoImage = (wxBitmap)photo; - imgLogo->SetBitmap(LogoImage); + LogoImage = (wxBitmap)photo; + imgLogo->SetBitmap(LogoImage); } void frmContactEditor::AddLogo( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this ); - frameCELogo->SetEditorMode(FALSE); - intResult = GetLastInt(&ContactEditorData.LogosList); - frameCELogo->SetupPointers(&ContactEditorData.LogosList, - &ContactEditorData.LogosListAltID, - &ContactEditorData.LogosListPID, - &ContactEditorData.LogosListType, - &ContactEditorData.LogosListPicEncType, - &ContactEditorData.LogosListPictureType, - &ContactEditorData.LogosListTokens, - &ContactEditorData.LogosListMediatype, - &ContactEditorData.LogosListPref, - lboLogos, - (intValueSeek), - FALSE); - frameCELogo->ShowModal(); - delete frameCELogo; - frameCELogo = NULL; + int intResult = 0; + + frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this ); + frameCELogo->SetEditorMode(FALSE); + intResult = GetLastInt(&ContactEditorData.LogosList); + frameCELogo->SetupPointers(&ContactEditorData.LogosList, + &ContactEditorData.LogosListAltID, + &ContactEditorData.LogosListPID, + &ContactEditorData.LogosListType, + &ContactEditorData.LogosListPicEncType, + &ContactEditorData.LogosListPictureType, + &ContactEditorData.LogosListTokens, + &ContactEditorData.LogosListMediatype, + &ContactEditorData.LogosListPref, + lboLogos, + (intValueSeek), + FALSE); + frameCELogo->ShowModal(); + delete frameCELogo; + frameCELogo = NULL; + } void frmContactEditor::ModifyLogo( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this ); - frameCELogo->SetupPointers(&ContactEditorData.LogosList, - &ContactEditorData.LogosListAltID, - &ContactEditorData.LogosListPID, - &ContactEditorData.LogosListType, - &ContactEditorData.LogosListPicEncType, - &ContactEditorData.LogosListPictureType, - &ContactEditorData.LogosListTokens, - &ContactEditorData.LogosListMediatype, - &ContactEditorData.LogosListPref, - lboLogos, - intSelectedData, - FALSE); - frameCELogo->SetEditorMode(TRUE); - frameCELogo->ShowModal(); - delete frameCELogo; - frameCELogo = NULL; + if (!GetSelectedItem(lboLogos, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this ); + frameCELogo->SetupPointers(&ContactEditorData.LogosList, + &ContactEditorData.LogosListAltID, + &ContactEditorData.LogosListPID, + &ContactEditorData.LogosListType, + &ContactEditorData.LogosListPicEncType, + &ContactEditorData.LogosListPictureType, + &ContactEditorData.LogosListTokens, + &ContactEditorData.LogosListMediatype, + &ContactEditorData.LogosListPref, + lboLogos, + intSelectedData, + FALSE); + frameCELogo->SetEditorMode(TRUE); + frameCELogo->ShowModal(); + delete frameCELogo; + frameCELogo = NULL; + } void frmContactEditor::DeleteLogo( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, - &longSelected, - &intSelectedData)){ - return; - } + if (!GetSelectedItem(lboLogos, + &longSelected, + &intSelectedData)){ + return; + } - lboLogos->DeleteItem(longSelected); + lboLogos->DeleteItem(longSelected); - DeleteMapData(intSelectedData, - &ContactEditorData.LogosList, &ContactEditorData.LogosListAltID, &ContactEditorData.LogosListPID, &ContactEditorData.LogosListType, - &ContactEditorData.LogosListPicEncType, &ContactEditorData.LogosListPictureType, &ContactEditorData.LogosListTokens, - &ContactEditorData.LogosListMediatype, &ContactEditorData.LogosListPref); + DeleteMapData(intSelectedData, + &ContactEditorData.LogosList, &ContactEditorData.LogosListAltID, &ContactEditorData.LogosListPID, &ContactEditorData.LogosListType, + &ContactEditorData.LogosListPicEncType, &ContactEditorData.LogosListPictureType, &ContactEditorData.LogosListTokens, + &ContactEditorData.LogosListMediatype, &ContactEditorData.LogosListPref); - wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png)); - wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG); - LogoImage = (wxBitmap)misc_emptyimage_png; + wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png)); + wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG); + LogoImage = (wxBitmap)misc_emptyimage_png; - imgLogo->SetBitmap(LogoImage); + imgLogo->SetBitmap(LogoImage); + } void frmContactEditor::SaveLogo( wxCommandEvent &event ) -- 2.39.5