Skip to content

Commit

Permalink
Fixes for compiler warnings.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.mulberrymail.com/mulberry/Mulberry/branches/v4.1d1@416 a91246af-f21b-0410-bd1c-c3c7fc455132
  • Loading branch information
cyrusdaboo authored and Martin Dietze committed Dec 3, 2011
1 parent 8e79d8c commit 5b15637
Show file tree
Hide file tree
Showing 27 changed files with 99 additions and 21 deletions.
6 changes: 6 additions & 0 deletions MacOS/Sources/Application/Address_Book/CAddressTable.cp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ void CAddressTable::DropData(FlavorType theFlavor, char* drag_data, Size data_si
switch (theFlavor)
{
case cDragMsgType:
{
CMessage* theMsg = *((CMessage**) drag_data);
CEnvelope* theEnv = theMsg->GetEnvelope();
ThrowIfNil_(theEnv);
Expand Down Expand Up @@ -1149,8 +1150,10 @@ void CAddressTable::DropData(FlavorType theFlavor, char* drag_data, Size data_si
}
}
break;
}

case cDragAddrType:
{
CAddress* theAddr = *((CAddress**) drag_data);

// Check duplicate
Expand All @@ -1163,8 +1166,10 @@ void CAddressTable::DropData(FlavorType theFlavor, char* drag_data, Size data_si
delete copy;
}
break;
}

case cDragAddrGrpType:
{
CGroup* theGrp = *((CGroup**) drag_data);

// Copy all addresses and add to list
Expand All @@ -1184,6 +1189,7 @@ void CAddressTable::DropData(FlavorType theFlavor, char* drag_data, Size data_si
delete copy;
}
break;
}

case cDragAdbkAddrTextType:
{
Expand Down
12 changes: 9 additions & 3 deletions MacOS/Sources/Application/Address_Book/CGroupTable.cp
Original file line number Diff line number Diff line change
Expand Up @@ -1541,10 +1541,10 @@ void CGroupTable::DropDataIntoCell(FlavorType inFlavor, char* drag_data,
{

case cDragMsgType:
{
CMessage* theMsg = *((CMessage**) drag_data);
CEnvelope* theEnv = theMsg->GetEnvelope();
ThrowIfNil_(theEnv);
CAddress* theAddr;

// Add From
if (theEnv->GetFrom()->size())
Expand Down Expand Up @@ -1583,27 +1583,32 @@ void CGroupTable::DropDataIntoCell(FlavorType inFlavor, char* drag_data,
}

break;
}

case cDragAddrType:
theAddr = *((CAddress**) drag_data);
{
CAddress* theAddr = *((CAddress**) drag_data);
{
// Add to list
cdstring txt = theAddr->GetFullAddress();
new_grp->AddAddress(txt);
added = true;
}
break;
}

case cDragAddrGrpType:
{
CGroup* theGrp = *((CGroup**) drag_data);

// Add group to new group
new_grp->AddAddress(theGrp->GetNickName());
added = true;
break;
}

case kScrapFlavorTypeText:

{
// Parse text into list
CAddressList list(drag_data, data_size);

Expand All @@ -1616,6 +1621,7 @@ void CGroupTable::DropDataIntoCell(FlavorType inFlavor, char* drag_data,
added = true;
}
break;
}
}

// If there was a change reset both tables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,11 @@ void CPropAdbkACL::DoStylePopup(long index)

// Delete existing ACL
case eACLStyleDeleteUser:
{
CAdbkPropDialog* cmdr = (CAdbkPropDialog*) GetSuperView()->GetSuperView();
mStylePopup->DoDeleteStyle();
break;
}

// Select a style
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ void CAdbkManagerTable::ClickCell(const STableCell& inCell,
case eAdbkColumnOpen:
case eAdbkColumnResolve:
case eAdbkColumnSearch:
{
TableIndexT woRow = mCollapsableTree->GetWideOpenIndex(inCell.row + TABLE_ROW_ADJUST);

CAddressBook* adbk = GetCellNode(inCell.row);
Expand Down Expand Up @@ -432,6 +433,7 @@ void CAdbkManagerTable::ClickCell(const STableCell& inCell,
RefreshCell(inCell);
}
break;
}
default:
// Look at user action and determine what to do
if ((GetClickCount() > 1) && !inMouseDown.delaySelect)
Expand Down Expand Up @@ -798,6 +800,7 @@ void CAdbkManagerTable::DropDataIntoCell(FlavorType theFlavor, char* drag_data,
{

case cDragMsgType:
{
CMessage* theMsg = *((CMessage**) drag_data);
CEnvelope* theEnv = theMsg->GetEnvelope();
ThrowIfNil_(theEnv);
Expand Down Expand Up @@ -855,8 +858,10 @@ void CAdbkManagerTable::DropDataIntoCell(FlavorType theFlavor, char* drag_data,
}

break;
}

case cDragAddrType:
{
CAddress* theAddr = *((CAddress**) drag_data);
if (!CPreferences::sPrefs->TestSmartAddress(*theAddr) &&
!mDropAdbk->GetAddressList()->IsDuplicate(theAddr))
Expand All @@ -866,17 +871,20 @@ void CAdbkManagerTable::DropDataIntoCell(FlavorType theFlavor, char* drag_data,
mAddressAdded = true;
}
break;
}

case cDragAddrGrpType:
{
CGroup* theGrp = *((CGroup**) drag_data);

// Add group to new group
mDropAdbk->AddGroup(new CGroup(*theGrp), mDropSort);
mGroupAdded = true;
break;
}

case kScrapFlavorTypeText:

{
// Parse text into list
CAddressList list(drag_data, data_size);

Expand All @@ -893,5 +901,6 @@ void CAdbkManagerTable::DropDataIntoCell(FlavorType theFlavor, char* drag_data,
}
}
break;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ void CPropCalendarACL::ListenToMessage(
switch (inMessage)
{
case msg_CalACLCalendar:
{
long index = *(long*) ioParam;
calstore::CCalendarStoreNode* cal = static_cast<calstore::CCalendarStoreNode*>(mCalList->at(index - 1));
SetCal(cal);
break;
}

case msg_CalACLNewUser:
DoNewUser();
Expand Down Expand Up @@ -372,9 +374,11 @@ void CPropCalendarACL::DoStylePopup(long index)

// Delete existing ACL
case eCalACLStyleDeleteUser:
{
CCalendarPropDialog* cmdr = (CCalendarPropDialog*) GetSuperView()->GetSuperView();
mStylePopup->DoDeleteStyle();
break;
}

// Select a style
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ void CCalendarStoreTable::ClickCell(const STableCell& inCell, const SMouseDownEv
{
case eCalendarStoreColumnSubscribe:
case eCalendarStoreColumnColour:
{
calstore::CCalendarStoreNode* node = GetCellNode(inCell.row);

// Check for actual calendars
Expand All @@ -511,6 +512,7 @@ void CCalendarStoreTable::ClickCell(const STableCell& inCell, const SMouseDownEv
RefreshCell(inCell);
}
break;
}

default:
// Look at user action and determine what to do
Expand Down Expand Up @@ -1080,6 +1082,7 @@ bool CCalendarStoreTable::IsCopyCursor(DragReference inDragRef)
// Server always moved
return false;
case cDragCalendarType:
{
// Calendars moved if drop at or no drop cell
if (mLastDropCursor.row || !mLastDropCell.row)
return false;
Expand All @@ -1091,6 +1094,7 @@ bool CCalendarStoreTable::IsCopyCursor(DragReference inDragRef)
return false;
else
return true;
}

default:
// Anything else is an error!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,11 +842,11 @@ void CDayWeekTable::ColumnateEvents()
column_usage.push_back(NULL);

// Add each start/end position
uint32_t col = 0;
uint32_t col2 = 0;
for(CDayEventList::const_iterator iter = list.begin(); iter != list.end(); iter++)
{
data.push_back(SEventInfo(*iter, true, col++, (*iter)->GetInstancePeriod().GetStart().GetPosixTime()));
data.push_back(SEventInfo(*iter, false, col++, (*iter)->GetInstancePeriod().GetEnd().GetPosixTime()));
data.push_back(SEventInfo(*iter, true, col2++, (*iter)->GetInstancePeriod().GetStart().GetPosixTime()));
data.push_back(SEventInfo(*iter, false, col2++, (*iter)->GetInstancePeriod().GetEnd().GetPosixTime()));
}

// Sort by posix time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,15 @@ void CNewComponentAlarm::SetAlarm(const iCal::CICalendarVAlarm* valarm)
break;
}
case iCal::eAction_VAlarm_Display:
{
mAction->SetValue(eActionDisplay);
const iCal::CICalendarVAlarm::CICalendarVAlarmDisplay* display = dynamic_cast<const iCal::CICalendarVAlarm::CICalendarVAlarmDisplay*>(valarm->GetActionData());
if (display)
mDescription->SetText(display->GetDescription());
break;
}
case iCal::eAction_VAlarm_Email:
{
mAction->SetValue(eActionEmail);
const iCal::CICalendarVAlarm::CICalendarVAlarmEmail* email = dynamic_cast<const iCal::CICalendarVAlarm::CICalendarVAlarmEmail*>(valarm->GetActionData());
if (email)
Expand All @@ -335,6 +338,7 @@ void CNewComponentAlarm::SetAlarm(const iCal::CICalendarVAlarm* valarm)
mAttendees->SetTextList(email->GetAttendees());
}
break;
}
default:
mAction->SetValue(eActionNotSupported);
break;
Expand Down
3 changes: 2 additions & 1 deletion MacOS/Sources/Application/General/CMulberryApp.cp
Original file line number Diff line number Diff line change
Expand Up @@ -905,12 +905,13 @@ Boolean CMulberryApp::ObeyCommand(CommandT inCommand,void *ioParam)
cmdHandled = true;
break;
case MENU_Windows:
{
LWindow* aWindow = CWindowsMenu::GetWindow(menuID, menuItem);
if (aWindow)
FRAMEWORK_WINDOW_TO_TOP(aWindow)
cmdHandled = true;
break;

}
default:
cmdHandled = LDocApplication::ObeyCommand(inCommand, ioParam);
}
Expand Down
2 changes: 2 additions & 0 deletions MacOS/Sources/Application/Message/CMessageView.cp
Original file line number Diff line number Diff line change
Expand Up @@ -1614,10 +1614,12 @@ void CMessageView::ResetText()
switch(mParsing)
{
case eViewFormatted:
{
// Use plain text font when not using styles
bool html = ((actual_content == eContentSubEnriched) || (actual_content == eContentSubHTML)) && actual_styles;
actual_traits = html ? &CPreferences::sPrefs->mHTMLTextTraits.GetValue().traits : &CPreferences::sPrefs->mDisplayTextTraits.GetValue().traits;
break;
}
case eViewPlain:
case eViewRaw:
case eViewAsRaw:
Expand Down
2 changes: 2 additions & 0 deletions MacOS/Sources/Application/Message/CMessageWindow.cp
Original file line number Diff line number Diff line change
Expand Up @@ -1712,10 +1712,12 @@ void CMessageWindow::ResetText(void)
switch(mParsing)
{
case eViewFormatted:
{
// Use plain text font when not using styles
bool html = ((actual_content == eContentSubEnriched) || (actual_content == eContentSubHTML)) && actual_styles;
actual_traits = html ? &CPreferences::sPrefs->mHTMLTextTraits.GetValue().traits : &CPreferences::sPrefs->mDisplayTextTraits.GetValue().traits;
break;
}
case eViewPlain:
case eViewRaw:
case eViewAsRaw:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ bool CChangePswdDialog::PromptPasswordChange(const CINETAccount* acct,
icon = ICNx_UserPswdLDAP;
title =LStr255(STRx_Standards, str_ChangePswdLDAP);
break;
default:;
}

// Create the dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,14 @@ void CPrefsDisplay::ListenToMessage(
break;

case msg_ResetWindows:
{
mCopyPrefs->ResetAllStates(true);
CPreferencesDialog* prefs_dlog = (CPreferencesDialog*) GetSuperView();
while(prefs_dlog->GetPaneID() != paneid_PreferencesDialog)
prefs_dlog = (CPreferencesDialog*) prefs_dlog->GetSuperView();
prefs_dlog->SetForceWindowReset(true);
break;

}
default:
break;
}
Expand Down
6 changes: 3 additions & 3 deletions MacOS/Sources/Application/Preferences_Dialog/CPrefsSimple.cp
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,12 @@ void CPrefsSimple::UpdatePrefs(void)
// Copy info from panel into prefs
{
// Determine address list
CAddressList addr_list(id->GetFrom().c_str(), id->GetFrom().length());
CAddressList addr_list2(id->GetFrom().c_str(), id->GetFrom().length());

cdstring name = mRealName->GetText();
cdstring email = mEmailAddress->GetText();
if (CAdminLock::sAdminLock.mLockReturnAddress && addr_list.size())
email = addr_list.front()->GetMailAddress();
if (CAdminLock::sAdminLock.mLockReturnAddress && addr_list2.size())
email = addr_list2.front()->GetMailAddress();
CAddress addr(email, name);
id->SetFrom(addr.GetFullAddress(), true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void CPrefsMailboxAdvanced::ListenToMessage(
{
case msg_MAFavouriteCopyTo:
case msg_MAFavouriteAppendTo:
{
// Must force reset of menu lists
CCopyToMenu::SetMenuOptions(mFavouriteCopyTo->GetValue() == Button_On,
mFavouriteAppendTo->GetValue() == Button_On);
Expand All @@ -110,6 +111,7 @@ void CPrefsMailboxAdvanced::ListenToMessage(
prefs_dlog = (CPreferencesDialog*) prefs_dlog->GetSuperView();
prefs_dlog->SetForceMenuListReset(true);
break;
}

case msg_MARNoCacheLimit:
if (*((long*) ioParam))
Expand Down
2 changes: 2 additions & 0 deletions MacOS/Sources/Application/SMTP_Queue/CSMTPTable.cp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ void CSMTPTable::FindCommandStatus(
outMark = mTestSelectionAndPriority ? (UInt16)checkMark : (UInt16)noMark;
break;
case cmd_ToolbarSMTPEnableBtn:
{
outEnabled = CConnectionManager::sConnectionManager.IsConnected();
outUsesMark = true;

Expand All @@ -167,6 +168,7 @@ void CSMTPTable::FindCommandStatus(
::PLstrcpy(outName, txt);
}
break;
}

default:
CMailboxTable::FindCommandStatus(inCommand, outEnabled, outUsesMark,
Expand Down
Loading

0 comments on commit 5b15637

Please sign in to comment.