WX_DECLARE_LIST(wxFontInstance, wxFontInstanceList);
WX_DEFINE_LIST(wxFontInstanceList)
WX_DEFINE_LIST(wxFontBundleList)
+
WX_DECLARE_HASH_MAP(wxString, wxFontBundle*,
wxStringHash, wxStringEqual,
- wxFontBundleHash);
+ wxFontBundleHashBase);
+// in STL build, hash class is typedef to a template, so it can't be forward
+// declared, as we do; solve it by having a dummy class:
+class wxFontBundleHash : public wxFontBundleHashBase
+{
+};
// ============================================================================
// implementation
{
wxASSERT_MSG( m_refCnt > 0, _T("font library not loaded!") );
- wxFontInstance *i;
- wxFontInstanceList::Node *node;
-
- for ( node = m_instances->GetFirst(); node; node = node->GetNext() )
+ for ( wxFontInstanceList::const_iterator i = m_instances->begin();
+ i != m_instances->end(); ++i )
{
- i = node->GetData();
- if ( i->GetPointSize() == ptSize && i->IsAntiAliased() == aa )
- return i;
+ if ( (*i)->GetPointSize() == ptSize && (*i)->IsAntiAliased() == aa )
+ return *i;
}
- i = CreateFontInstance(ptSize, aa);
+ wxFontInstance *i = CreateFontInstance(ptSize, aa);
m_instances->Append(i);
return i;
}
for ( wxDfbOverlaysList::const_iterator i = m_overlays->begin();
i != m_overlays->end(); ++i )
{
- wxOverlayImpl *overlay = *i;
+ // FIXME: the cast is necessary for STL build where the iterator
+ // (incorrectly) returns void* and not wxOverlayImpl*
+ wxOverlayImpl *overlay = (wxOverlayImpl*) *i;
wxRect orectOrig(overlay->GetRect());
wxRect orect(orectOrig);
}
int indexAccel = -1;
- for ( const wxChar *pc = label; *pc != wxT('\0'); pc++ )
+ for ( wxString::const_iterator pc = label.begin(); pc != label.end(); ++pc )
{
if ( *pc == MNEMONIC_PREFIX )
{
- pc++; // skip it
- if ( *pc != MNEMONIC_PREFIX )
+ ++pc; // skip it
+ if ( pc == label.end() )
+ break;
+ else if ( *pc != MNEMONIC_PREFIX )
{
if ( indexAccel == -1 )
{
// remember it (-1 is for MNEMONIC_PREFIX itself
- indexAccel = pc - label.c_str() - 1;
+ indexAccel = pc - label.begin() - 1;
}
else
{