X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d699f48ba33c96c24f7ab3764ad98ded0633c1c5..edb89f7e356761b4fbdaebb8b5ebd5c7a7643da7:/contrib/src/applet/prepifelse.cpp diff --git a/contrib/src/applet/prepifelse.cpp b/contrib/src/applet/prepifelse.cpp index cc209ce795..2880af3bef 100644 --- a/contrib/src/applet/prepifelse.cpp +++ b/contrib/src/applet/prepifelse.cpp @@ -86,14 +86,19 @@ wxString wxIfElsePrep::Process( { int b; char ft[] = " - int end, c, n; + bool notval = false; + int off = 0; + int end, c, n; wxString usecode, code; wxString cname; wxString tag; @@ -101,6 +106,15 @@ wxString wxIfElsePrep::Process( code = wxString(""); + if (output.Mid(b, strlen(ftnot) ).CmpNoCase(ftnot) == 0 ) { + notval = true; + off = 4; + } + else if (output.Mid(b, strlen(ftnot2) ).CmpNoCase(ftnot2) == 0 ) { + notval = true; + off = 1; + } + // grab the tag and get the name of the variable end = (output.Mid(b)).Find("-->"); if (end == -1) { @@ -118,10 +132,10 @@ wxString wxIfElsePrep::Process( n = c; // find the classname - c = (tag.Mid(8, n-8)).Find(" "); - if (c == -1) n -= 8; + c = (tag.Mid(8+off, n-(8+off))).Find(" "); + if (c == -1) n -= (8+off); else n = c; - cname = tag.Mid(8, n); + cname = tag.Mid(8+off, n); cname.Trim(false); c = cname.Find("\""); @@ -131,6 +145,7 @@ wxString wxIfElsePrep::Process( // Grab the value from the variable class identified by cname value = wxIfElseVariable::FindValue(cname); + if (notval) value = !value; // Find the end of the tag () and copy it all into the variable code end = ((output.Mid(b)).Lower()).Find("");