Make wxCocoa work with wxUSE_STL==1:
Use compatibility_iterator instead of Node and Erase instead of DeleteNode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -46,7 +46,7 @@ protected:
|
||||
bool CocoaUnwindStackAndTakeFocus();
|
||||
inline bool CocoaTakeFocus()
|
||||
{
|
||||
wxCocoaDCStack::Node *node = sm_cocoaDCStack.GetFirst();
|
||||
wxCocoaDCStack::compatibility_iterator node = sm_cocoaDCStack.GetFirst();
|
||||
if(node && (node->GetData() == this))
|
||||
return true;
|
||||
return CocoaUnwindStackAndTakeFocus();
|
||||
|
@@ -98,10 +98,10 @@ void wxDC::CocoaShutdownTextSystem()
|
||||
|
||||
void wxDC::CocoaUnwindStackAndLoseFocus()
|
||||
{
|
||||
wxCocoaDCStack::Node *ourNode=sm_cocoaDCStack.Find(this);
|
||||
wxCocoaDCStack::compatibility_iterator ourNode=sm_cocoaDCStack.Find(this);
|
||||
if(ourNode)
|
||||
{
|
||||
wxCocoaDCStack::Node *node=sm_cocoaDCStack.GetFirst();
|
||||
wxCocoaDCStack::compatibility_iterator node=sm_cocoaDCStack.GetFirst();
|
||||
for(;node!=ourNode; node=sm_cocoaDCStack.GetFirst())
|
||||
{
|
||||
wxDC *dc = node->GetData();
|
||||
@@ -111,18 +111,18 @@ void wxDC::CocoaUnwindStackAndLoseFocus()
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unable to unlock focus on higher-level DC!"));
|
||||
}
|
||||
sm_cocoaDCStack.DeleteNode(node);
|
||||
sm_cocoaDCStack.Erase(node);
|
||||
}
|
||||
wxASSERT(node==ourNode);
|
||||
wxASSERT(ourNode->GetData() == this);
|
||||
ourNode->GetData()->CocoaUnlockFocus();
|
||||
sm_cocoaDCStack.DeleteNode(ourNode);
|
||||
sm_cocoaDCStack.Erase(ourNode);
|
||||
}
|
||||
}
|
||||
|
||||
bool wxDC::CocoaUnwindStackAndTakeFocus()
|
||||
{
|
||||
wxCocoaDCStack::Node *node=sm_cocoaDCStack.GetFirst();
|
||||
wxCocoaDCStack::compatibility_iterator node=sm_cocoaDCStack.GetFirst();
|
||||
for(;node;node = sm_cocoaDCStack.GetFirst())
|
||||
{
|
||||
wxDC *dc = node->GetData();
|
||||
@@ -133,7 +133,7 @@ bool wxDC::CocoaUnwindStackAndTakeFocus()
|
||||
// If unable to unlockFocus (e.g. wxPaintDC) stop here
|
||||
if(!dc->CocoaUnlockFocus())
|
||||
break;
|
||||
sm_cocoaDCStack.DeleteNode(node);
|
||||
sm_cocoaDCStack.Erase(node);
|
||||
}
|
||||
return CocoaLockFocus();
|
||||
}
|
||||
|
Reference in New Issue
Block a user