]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed problem in mimetype database and put a temp. fix for font tags
authorHarco de Hilster <harcoh@caos.kun.nl>
Sun, 29 Aug 1999 20:08:53 +0000 (20:08 +0000)
committerHarco de Hilster <harcoh@caos.kun.nl>
Sun, 29 Aug 1999 20:08:53 +0000 (20:08 +0000)
like <FONT SIZE=gaga>, i.e. without an proper integer argument

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/mimetype.cpp
src/html/mod_fonts.cpp

index 2785c1f9ce89146c350031b789f307e6816eb29d..73402281456c648c61844845cd6fb5d807274c4f 100644 (file)
@@ -1105,7 +1105,7 @@ void wxMimeTypesManagerImpl::AddMimeTypeInfo(const wxString& strMimeType,
         if ( !strDesc.IsEmpty() ) {
             m_aDescriptions[index] = strDesc;   // replace old value
         }
-        m_aExtensions[index] += strExtensions;
+        m_aExtensions[index] += ' ' + strExtensions;
     }
 }
 
index 7d27a6ea0db7133221301eaccd274293e5d77573..fa34b8560927912f5f45b6aadbccd3e1d15eda90 100644 (file)
@@ -33,11 +33,11 @@ TAG_HANDLER_BEGIN(FONT, "FONT")
 
     TAG_HANDLER_PROC(tag)
     {
-        unsigned long tmp;
         wxColour oldclr = m_WParser -> GetActualColor();
         int oldsize = m_WParser -> GetFontSize();
 
         if (tag.HasParam("COLOR")) {
+           unsigned long tmp = 0; 
             wxColour clr;
             tag.ScanParam("COLOR", "#%lX", &tmp);
             clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
@@ -46,8 +46,11 @@ TAG_HANDLER_BEGIN(FONT, "FONT")
         }
 
         if (tag.HasParam("SIZE")) {
+           // give 'tmp' an initial value. If conversion fails, it will keep this value.
+           long tmp = 0;
             tag.ScanParam("SIZE", "%li", &tmp);
-            m_WParser -> SetFontSize(tmp);
+           // We *really* should check the result of (v)sscanf, but ScanParam returns void...
+            m_WParser -> SetFontSize(oldsize+tmp);
             m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
         }