]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/mimetype.cpp
support underlined fonts (patch 1448089)
[wxWidgets.git] / src / unix / mimetype.cpp
index e159a60e7e777ae21e6590734662e1b349961ab5..f5e986fe9949677aee47791669ec398e2f61a811 100644 (file)
@@ -124,6 +124,11 @@ public:
             if ( idx )
                 *idx = n;
         }
+        else if ( idx )
+        {
+            // different from any valid index
+            *idx = (size_t)-1;
+        }
 
         return s;
     }
@@ -1400,13 +1405,17 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs,
                  count++;
                  if ( vrb.IsSameAs(wxT("open")))
                  {
-                     verbs->Insert(vrb, 0u);
-                     commands ->Insert(cmd, 0u);
+                     if ( verbs )
+                        verbs->Insert(vrb, 0u);
+                     if ( commands )
+                        commands ->Insert(cmd, 0u);
                  }
                  else
                  {
-                     verbs->Add(vrb);
-                     commands->Add(cmd);
+                     if ( verbs )
+                        verbs->Add(vrb);
+                     if ( commands )
+                        commands->Add(cmd);
                  }
              }
         }