- strcat(descrBuf, templates[i]->GetDescription());
- strcat(descrBuf, " (");
- strcat(descrBuf, templates[i]->GetFileFilter());
- strcat(descrBuf, ") ");
- strcat(descrBuf, "|");
- strcat(descrBuf, templates[i]->GetFileFilter());
- strcat(descrBuf, "|");
+ if (templates[i]->IsVisible())
+ {
+ // add a '|' to separate this filter from the previous one
+ if ( !descrBuf.IsEmpty() )
+ descrBuf << '|';
+
+ descrBuf << templates[i]->GetDescription()
+ << " (" << templates[i]->GetFileFilter() << ") |"
+ << templates[i]->GetFileFilter();
+ }