]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextxml.cpp
Correctly determine best wxPropertyGrid width.
[wxWidgets.git] / src / richtext / richtextxml.cpp
index 6c9aed9c6f419aa8c3b2ae3b5a3ed4faceef09a2..feb26567aea923393b6be2f165aed25093cd84e8 100644 (file)
@@ -181,9 +181,13 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
 
                     // note: 0 == wxBITMAP_TYPE_INVALID
                     if (type <= 0 || type >= wxBITMAP_TYPE_MAX)
+                    {
                         wxLogWarning("Invalid bitmap type specified for <image> tag: %d", type);
+                    }
                     else
+                    {
                         imageType = (wxBitmapType)type;
+                    }
                 }
 
                 wxString data;
@@ -1131,9 +1135,9 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttr& attr, wxXmlNode* node, bool isPa
 {
     wxString fontFacename;
     int fontSize = 12;
-    int fontFamily = wxFONTFAMILY_DEFAULT;
-    int fontWeight = wxNORMAL;
-    int fontStyle = wxNORMAL;
+    wxFontFamily fontFamily = wxFONTFAMILY_DEFAULT;
+    wxFontWeight fontWeight = wxFONTWEIGHT_NORMAL;
+    wxFontStyle fontStyle = wxFONTSTYLE_NORMAL;
     bool fontUnderlined = false;
 
     // int fontFlags = 0;
@@ -1150,14 +1154,14 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttr& attr, wxXmlNode* node, bool isPa
     value = node->GetAttribute(wxT("fontfamily"), wxEmptyString);
     if (!value.empty())
     {
-        fontFamily = wxAtoi(value);
+        fontFamily = (wxFontFamily)wxAtoi(value);
         attr.SetFontFamily(fontFamily);
     }
 
     value = node->GetAttribute(wxT("fontstyle"), wxEmptyString);
     if (!value.empty())
     {
-        fontStyle = wxAtoi(value);
+        fontStyle = (wxFontStyle)wxAtoi(value);
         attr.SetFontStyle(fontStyle);
     }
 
@@ -1171,7 +1175,7 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttr& attr, wxXmlNode* node, bool isPa
     value = node->GetAttribute(wxT("fontweight"), wxEmptyString);
     if (!value.empty())
     {
-        fontWeight = wxAtoi(value);
+        fontWeight = (wxFontWeight)wxAtoi(value);
         attr.SetFontWeight(fontWeight);
     }