WP2LaTeX sources.
Revision | 511c1a0f9f61c31dc5777c1e97e5903e81bf3093 (tree) |
---|---|
Time | 2021-09-27 07:38:26 |
Author | Fojtik |
Commiter | Fojtik |
Using str.isEmpty() is more effective and faster than comparison str=="".
@@ -614,12 +614,12 @@ | ||
614 | 614 | |
615 | 615 | arg.erase(); |
616 | 616 | |
617 | - while(str != "" && str[0] == ' ') | |
617 | + while(!str.isEmpty() && str[0]==' ') | |
618 | 618 | str = copy(str,1,length(str)-1); |
619 | 619 | |
620 | 620 | LastC = '\0'; |
621 | 621 | i = 0; |
622 | - while (str != "" && (str[0] != ' ' || i != 0)) | |
622 | + while(!str.isEmpty() && (str[0]!=' ' || i!=0)) | |
623 | 623 | { |
624 | 624 | c = str[0]; |
625 | 625 |
@@ -681,7 +681,7 @@ | ||
681 | 681 | } |
682 | 682 | } |
683 | 683 | if ((c=='\\' || c=='+') && |
684 | - i==0 && arg != "") | |
684 | + i==0 && !arg.isEmpty()) | |
685 | 685 | { |
686 | 686 | str=c+str; |
687 | 687 | break; |
@@ -721,7 +721,7 @@ | ||
721 | 721 | LastC = c; |
722 | 722 | } |
723 | 723 | |
724 | - if(arg=="") return(LastC); | |
724 | + if(arg.isEmpty()) return(LastC); | |
725 | 725 | DeleteCurlyBraces(arg); |
726 | 726 | |
727 | 727 | InternalArg = arg; //Check whether arg contains any non-terminal symbol that need to be expanded |
@@ -771,16 +771,16 @@ | ||
771 | 771 | |
772 | 772 | arg.erase(); |
773 | 773 | |
774 | - while(str!="" && str[0]==' ') | |
774 | + while(!str.isEmpty() && str[0]==' ') | |
775 | 775 | str=copy(str,1,length(str)-1); |
776 | 776 | |
777 | 777 | LastSupSub = LastC = '\0'; |
778 | 778 | ZeroPass = i = 0; |
779 | - while(str!="") | |
779 | + while(!str.isEmpty()) | |
780 | 780 | { |
781 | 781 | c = str[0]; |
782 | 782 | if(i<=0 && !isspace(c) && !LastSupSub) |
783 | - if(arg!="") //argument is not empty | |
783 | + if(!arg.isEmpty()) //argument is not empty | |
784 | 784 | { |
785 | 785 | if( (isspace(LastC) || |
786 | 786 | LastC=='}' || LastC==']' || LastC==')' || LastC=='"' || LastC=='\'') && |
@@ -839,13 +839,13 @@ | ||
839 | 839 | LastC = c; |
840 | 840 | } |
841 | 841 | |
842 | -while (arg != "" && arg[length(arg)-1] == ' ') | |
843 | - arg=copy(arg,0,length(arg)-1); | |
842 | +while(!arg.isEmpty() && arg[length(arg)-1]==' ') | |
843 | + arg = copy(arg,0,length(arg)-1); | |
844 | 844 | if(ZeroPass==1 && arg[0]=='{' && arg[length(arg)-1]=='}') |
845 | 845 | arg = copy(arg,1,length(arg)-2); |
846 | 846 | |
847 | 847 | |
848 | -if(arg=="") return(0); | |
848 | +if(arg.isEmpty()) return(0); | |
849 | 849 | |
850 | 850 | InternalArg=arg; //Check whether arg contains any non-terminal symbol that need to be expanded |
851 | 851 | InternalArg.ToUpper(); |
@@ -888,13 +888,13 @@ | ||
888 | 888 | |
889 | 889 | LastC=0; |
890 | 890 | arg.erase(); |
891 | - while(str != "" && str[length(str) - 1] == ' ') | |
891 | + while(!str.isEmpty() && str[length(str)-1] == ' ') | |
892 | 892 | { |
893 | 893 | str = copy(str,0,length(str)-1); |
894 | 894 | } |
895 | 895 | |
896 | 896 | i=0; //Tady je chyba !!!!!!!!!!!!!!!!!!!!! |
897 | - while (str != "") // && (str[length(str) - 1] != ' ' || i != 0)) | |
897 | + while(!str.isEmpty()) // && (str[length(str) - 1] != ' ' || i != 0)) | |
898 | 898 | { |
899 | 899 | c = str[length(str) - 1]; |
900 | 900 | if (i <= 0) |
@@ -922,7 +922,7 @@ | ||
922 | 922 | i++; |
923 | 923 | if (i == 1) |
924 | 924 | { |
925 | - if(arg=="") continue; | |
925 | + if(arg.isEmpty()) continue; | |
926 | 926 | str+='}'; // fix the situation "{...}arg" |
927 | 927 | i--; |
928 | 928 | break; |
@@ -983,13 +983,13 @@ | ||
983 | 983 | |
984 | 984 | LastCBrace=LastSupSub=LastC=0; |
985 | 985 | arg.erase(); |
986 | - while(str != "" && str[length(str) - 1] == ' ') | |
986 | + while(!str.isEmpty() && str[length(str) - 1] == ' ') | |
987 | 987 | { |
988 | 988 | str=copy(str,0,length(str)-1); |
989 | 989 | } |
990 | 990 | |
991 | 991 | i=0; //Tady je chyba !!!!!!!!!!!!!!!!!!!!! |
992 | - while(str != "") // && (str[length(str) - 1] != ' ' || i != 0)) | |
992 | + while(!str.isEmpty()) // && (str[length(str) - 1] != ' ' || i != 0)) | |
993 | 993 | { |
994 | 994 | c = str[length(str) - 1]; |
995 | 995 | if (i <= 0) |
@@ -1017,7 +1017,7 @@ | ||
1017 | 1017 | i++; |
1018 | 1018 | if(i==1 && !LastSupSub) |
1019 | 1019 | { |
1020 | - if(arg=="") {LastCBrace=1;continue;} //The curly brace was temporarily omitted | |
1020 | + if(arg.isEmpty()) {LastCBrace=1;continue;} //The curly brace was temporarily omitted | |
1021 | 1021 | str+='}'; // fix the situation "{...}arg" |
1022 | 1022 | i--; |
1023 | 1023 | break; |
@@ -1152,7 +1152,7 @@ | ||
1152 | 1152 | case '4':Numeral=arg[4];seq++;break; |
1153 | 1153 | default: Numeral='|'; break; |
1154 | 1154 | }; |
1155 | - if(Numeral=="") | |
1155 | + if(Numeral.isEmpty()) | |
1156 | 1156 | { |
1157 | 1157 | if (cq->err != NULL) |
1158 | 1158 | { |
@@ -1180,7 +1180,7 @@ | ||
1180 | 1180 | case '4':Numeral=arg[4];seq++;break; |
1181 | 1181 | default: Numeral.erase(); break; |
1182 | 1182 | }; |
1183 | - if(Numeral=="") | |
1183 | + if(Numeral.isEmpty()) | |
1184 | 1184 | { |
1185 | 1185 | if (cq->err != NULL) |
1186 | 1186 | { |
@@ -1459,7 +1459,7 @@ | ||
1459 | 1459 | StrBeg = copy(StrBeg,0,length(StrBeg)-1); |
1460 | 1460 | //We have all equation contents in the string StrBeg at this point |
1461 | 1461 | |
1462 | - if(StrBeg == "") return(false); /*equation is empty-nothing to do*/ | |
1462 | + if(StrBeg.isEmpty()) return(false); /*equation is empty-nothing to do*/ | |
1463 | 1463 | |
1464 | 1464 | StrBeg = replacesubstring(StrBeg,"\1}","\\}"); /*fix \} in WP -> \1 -> "\}"*/ |
1465 | 1465 | StrBeg = replacesubstring(StrBeg,"\1{","\\{"); /*fix \} in WP -> \1 -> "\}"*/ |
@@ -47,9 +47,9 @@ | ||
47 | 47 | if (StrStr(temp,"$(")!=NULL) |
48 | 48 | temp=expand_spec(temp); |
49 | 49 | //puts(temp.ch); |
50 | - if(temp!="") | |
50 | + if(!temp.isEmpty()) | |
51 | 51 | { |
52 | - temp=getenv(temp); | |
52 | + temp = getenv(temp); | |
53 | 53 | } |
54 | 54 | //puts(temp.ch); |
55 | 55 | name = copy(name,0,pos)+temp+copy(name,end+1,length(name)-end-1); |
@@ -94,7 +94,7 @@ | ||
94 | 94 | (line[i]!='\\')|| (line[i]!=':')) temp+=line[i]; |
95 | 95 | else break; |
96 | 96 | } |
97 | - if(temp!="") putenv(temp.ExtractString()); //The string must not be released!!! | |
97 | + if(!temp.isEmpty()) putenv(temp.ExtractString()); //The string must not be released!!! | |
98 | 98 | //puts(temp.ch); |
99 | 99 | } |
100 | 100 | fclose(f); |
@@ -121,14 +121,14 @@ | ||
121 | 121 | if (Locale_Dir=="") |
122 | 122 | { |
123 | 123 | Locale_Dir = expand_spec("$(DJDIR)"); |
124 | - if (Locale_Dir=="%:/>DJGPP%") | |
124 | + if(Locale_Dir == "%:/>DJGPP%") | |
125 | 125 | { |
126 | 126 | Locale_Dir = getenv("DJGPP"); |
127 | 127 | Locale_Dir = copy(Locale_Dir,0,GetPathEnd(Locale_Dir)); |
128 | 128 | } |
129 | - if (Locale_Dir!="") | |
129 | + if(!Locale_Dir.isEmpty()) | |
130 | 130 | { |
131 | - Locale_Dir+="/share/locale"; | |
131 | + Locale_Dir += "/share/locale"; | |
132 | 132 | } |
133 | 133 | else Locale_Dir = "c:/usr/local/share/locale"; |
134 | 134 | } |
@@ -2379,7 +2379,7 @@ | ||
2379 | 2379 | ss = GetExtension(Filename); |
2380 | 2380 | if(ss!=NULL) if(*ss!=0) FileExtension=ToUpper(ss+1); |
2381 | 2381 | |
2382 | - if(NewFilename!="") | |
2382 | + if(!NewFilename.isEmpty()) | |
2383 | 2383 | for(i=StrLen(OutputDir);i<length(NewFilename);i++) |
2384 | 2384 | { |
2385 | 2385 | if(NewFilename[i]==' ' || NewFilename[i]=='#' || NewFilename[i]=='%' || NewFilename[i]=='$' || NewFilename[i]=='*') |
@@ -274,7 +274,7 @@ | ||
274 | 274 | string s; |
275 | 275 | |
276 | 276 | _AttrOff(cq->attr,attr_num,s); |
277 | - if(s!="") fputs(s(),cq->strip); | |
277 | + if(!s.isEmpty()) fputs(s(),cq->strip); | |
278 | 278 | |
279 | 279 | if(attr_num==Heb_Font && cq->Font==FONT_HEBREW) |
280 | 280 | { |
@@ -347,7 +347,7 @@ | ||
347 | 347 | if ((b==7) && ((LaTeX_Version & 0xFF00) < 0x300)) goto RejectAttr; |
348 | 348 | |
349 | 349 | _AttrOff(cq->attr,b & 0xF,s); |
350 | - if(s!="") fputs(s(),cq->strip); | |
350 | + if(!s.isEmpty()) fputs(s(),cq->strip); | |
351 | 351 | |
352 | 352 | RejectAttr: |
353 | 353 | sprintf(cq->ObjType, "Attr %d Off",(int)b); |
@@ -405,7 +405,7 @@ | ||
405 | 405 | * @return LaTeX string that causes selected attributes to close. */ |
406 | 406 | temp_string Attributes2String(DWORD Attributes) |
407 | 407 | { |
408 | -temp_string TexAttrib; | |
408 | +string TexAttrib; | |
409 | 409 | //Solve attributes for columns |
410 | 410 | if(Attributes & 1) {TexAttrib+="\\LARGE";goto SizeOK;} |
411 | 411 | if(Attributes & 2) {TexAttrib+="\\Large";goto SizeOK;} |
@@ -429,7 +429,7 @@ | ||
429 | 429 | if(Attributes & 32768)TexAttrib+="\\sc"; |
430 | 430 | //65536 blink |
431 | 431 | //131072 reverse video |
432 | -return TexAttrib; | |
432 | +return temp_string(TexAttrib); | |
433 | 433 | } |
434 | 434 | |
435 | 435 |
@@ -1063,7 +1063,7 @@ | ||
1063 | 1063 | |
1064 | 1064 | if(OptimizeSection && cq->envir!='B') _AttrOff(cq->attr,b,s); |
1065 | 1065 | else _AttrOff(cq->attr,Last_com_section+1,s); |
1066 | - if(s!="") fputs(s(),cq->strip); | |
1066 | + if(!s.isEmpty()) fputs(s(),cq->strip); | |
1067 | 1067 | } |
1068 | 1068 | |
1069 | 1069 |
@@ -1650,7 +1650,7 @@ | ||
1650 | 1650 | fseek(cq->wpd, 14L + 2L*IDs, SEEK_CUR); |
1651 | 1651 | Rd_dword(cq->wpd, &Attributes); |
1652 | 1652 | PgNumAttrS = Attributes2String(Attributes); |
1653 | - if(PgNumAttrS!="") PgNumAttr=PgNumAttrS(); | |
1653 | + if(!PgNumAttrS.isEmpty()) PgNumAttr=PgNumAttrS(); | |
1654 | 1654 | fseek(cq->wpd, -9L, SEEK_CUR); |
1655 | 1655 | } |
1656 | 1656 | /* + old information */ |
@@ -1888,7 +1888,7 @@ | ||
1888 | 1888 | i=1; |
1889 | 1889 | } |
1890 | 1890 | if(FontName != NULL) |
1891 | - if(TexFontName != "") | |
1891 | + if(!TexFontName.isEmpty()) | |
1892 | 1892 | { |
1893 | 1893 | fprintf(cq->strip,"\\fontshape{%s}",TexFontName()); |
1894 | 1894 | i|=2; |
@@ -81,7 +81,7 @@ | ||
81 | 81 | case 2:translator="koi8cs";break; //koi8cs |
82 | 82 | default:cq->ConvertCpg = NULL; |
83 | 83 | } |
84 | -if(translator!="") | |
84 | + if(!translator.isEmpty()) | |
85 | 85 | { |
86 | 86 | translator+="TOinternal"; |
87 | 87 | cq->ConvertCpg = GetTranslator(translator); |
@@ -615,7 +615,7 @@ | ||
615 | 615 | |
616 | 616 | attr.InitAttr(); |
617 | 617 | i = OptimizeFormulaStr(this,StrBeg); |
618 | - if(StrBeg=="") goto LEqEmpty; | |
618 | + if(StrBeg.isEmpty()) goto LEqEmpty; | |
619 | 619 | if(i!=0 && Box.AnchorType==2) StrBeg+='\n'; |
620 | 620 | |
621 | 621 | attr = OldAttr; |
@@ -658,7 +658,7 @@ | ||
658 | 658 | |
659 | 659 | attr.InitAttr(); |
660 | 660 | i = OptimizeFormulaStr(this,StrBeg); |
661 | - if(StrBeg=="") goto LEqEmpty; | |
661 | + if(StrBeg.isEmpty()) goto LEqEmpty; | |
662 | 662 | if(i!=0 && Box.AnchorType==2) StrBeg+='\n'; |
663 | 663 | |
664 | 664 | attr = OldAttr; |
@@ -1422,7 +1422,7 @@ | ||
1422 | 1422 | } |
1423 | 1423 | |
1424 | 1424 | AttrFit(attr,OldAttr,s); |
1425 | - if(s!="") fputs(s(),strip); | |
1425 | + if(!s.isEmpty()) fputs(s(),strip); | |
1426 | 1426 | |
1427 | 1427 | recursion--; |
1428 | 1428 | strcpy(ObjType, "Overstrike"); |
@@ -1557,7 +1557,7 @@ | ||
1557 | 1557 | { |
1558 | 1558 | TexAttrib = Attributes2String(Atbl[i].attribute); //Solve attributes for columns |
1559 | 1559 | |
1560 | - if(TexAttrib != "") | |
1560 | + if(!TexAttrib.isEmpty()) | |
1561 | 1561 | { |
1562 | 1562 | fprintf(strip,"@{%s}",TexAttrib()); |
1563 | 1563 | } |
@@ -1073,7 +1073,7 @@ | ||
1073 | 1073 | recursion--; |
1074 | 1074 | |
1075 | 1075 | i = OptimizeFormulaStr(this,StrBeg); |
1076 | - if(StrBeg=="") goto LEqEmpty; | |
1076 | + if(StrBeg.isEmpty()) goto LEqEmpty; | |
1077 | 1077 | if(i!=0 && Box.AnchorType==2) StrBeg+='\n'; |
1078 | 1078 | |
1079 | 1079 | while(attr.Opened_Depth>0) //discard temporarily created attributes |
@@ -1869,7 +1869,7 @@ | ||
1869 | 1869 | } |
1870 | 1870 | |
1871 | 1871 | AttrFit(cq->attr,OldAttr,s); |
1872 | - if(s!="") fputs(s(),cq->strip); | |
1872 | + if(!s.isEmpty()) fputs(s(),cq->strip); | |
1873 | 1873 | |
1874 | 1874 | cq->recursion--; |
1875 | 1875 | if(CharCount>0) cq->char_on_line = true; |
@@ -1904,7 +1904,7 @@ | ||
1904 | 1904 | } |
1905 | 1905 | |
1906 | 1906 | SetFont(this,0,FontName()); |
1907 | - if(NFSS && FontName!="") ig=""; | |
1907 | + if(NFSS && !FontName.isEmpty()) ig=""; | |
1908 | 1908 | |
1909 | 1909 | BadResource: |
1910 | 1910 | if(length(FontName)>(int)sizeof(ObjType)-7) |
@@ -1964,7 +1964,7 @@ | ||
1964 | 1964 | |
1965 | 1965 | NumID--; |
1966 | 1966 | } |
1967 | - if(CounterName=="") goto BadResource; | |
1967 | + if(CounterName.isEmpty()) goto BadResource; | |
1968 | 1968 | |
1969 | 1969 | FixCounterName(CounterName); |
1970 | 1970 | Counters|=CounterName; |
@@ -2014,7 +2014,7 @@ | ||
2014 | 2014 | |
2015 | 2015 | NumID--; |
2016 | 2016 | } |
2017 | - if(CounterName=="") goto BadResource; | |
2017 | + if(CounterName.isEmpty()) goto BadResource; | |
2018 | 2018 | |
2019 | 2019 | FixCounterName(CounterName); |
2020 | 2020 | Counters|=CounterName; |
@@ -2068,7 +2068,7 @@ | ||
2068 | 2068 | } |
2069 | 2069 | NumID--; |
2070 | 2070 | } |
2071 | - if(CounterName=="") goto BadResource; | |
2071 | + if(CounterName.isEmpty()) goto BadResource; | |
2072 | 2072 | |
2073 | 2073 | FixCounterName(CounterName); |
2074 | 2074 | Counters|=CounterName; |
@@ -2350,7 +2350,7 @@ | ||
2350 | 2350 | fseek(wpd,SavePos,SEEK_SET); |
2351 | 2351 | NumID--; |
2352 | 2352 | } |
2353 | - if(CounterName=="") goto BadResource; | |
2353 | + if(CounterName.isEmpty()) goto BadResource; | |
2354 | 2354 | |
2355 | 2355 | fseek(wpd,4l,SEEK_CUR); |
2356 | 2356 | Rd_word(wpd, &Wchr); |
@@ -2559,7 +2559,7 @@ | ||
2559 | 2559 | } |
2560 | 2560 | |
2561 | 2561 | TexAttrib = Attributes2String(attributes); //Solve attributes for columns |
2562 | - if(TexAttrib != "") | |
2562 | + if(!TexAttrib.isEmpty()) | |
2563 | 2563 | { |
2564 | 2564 | fprintf(strip,"@{%s}",TexAttrib()); |
2565 | 2565 | } |
@@ -175,7 +175,7 @@ | ||
175 | 175 | } |
176 | 176 | |
177 | 177 | AttrFit(attr,NewAttr,s); |
178 | - if(s!="") fputs(s(),strip); | |
178 | + if(!s.isEmpty()) fputs(s(),strip); | |
179 | 179 | |
180 | 180 | return; |
181 | 181 | } |
@@ -589,7 +589,7 @@ | ||
589 | 589 | BYTE by, subby; |
590 | 590 | |
591 | 591 | *ObjType = 0; |
592 | - if(TAG=="") ReadXMLTag(); | |
592 | + if(TAG.isEmpty()) ReadXMLTag(); | |
593 | 593 | by = this->by; |
594 | 594 | subby = this->subby; |
595 | 595 |
@@ -605,7 +605,7 @@ | ||
605 | 605 | } |
606 | 606 | break; |
607 | 607 | case XML_extchar: |
608 | - if(TAG=="") break; //Extended chatacter &xxx; | |
608 | + if(TAG.isEmpty()) break; //Extended chatacter &xxx; | |
609 | 609 | TAG = Ext_chr_str(TAG[0],this) + copy(TAG,1,length(TAG)-1); |
610 | 610 | tag=TAG(); |
611 | 611 | by=201; |
@@ -641,7 +641,7 @@ | ||
641 | 641 | case XML_comment: //comment |
642 | 642 | break; |
643 | 643 | case XML_badextchar: |
644 | - if(TAG=="") break; //Extended chatacter &xxx | |
644 | + if(TAG.isEmpty()) break; //Extended chatacter &xxx | |
645 | 645 | TAG[length(TAG)-1] = ' '; |
646 | 646 | TAG=Ext_chr_str(TAG[0],this) + copy(TAG,1,length(TAG)-1); |
647 | 647 | tag = TAG(); |
@@ -78,7 +78,7 @@ | ||
78 | 78 | BYTE by,subby; |
79 | 79 | |
80 | 80 | *cq->ObjType=0; |
81 | - if(cq->TAG=="") cq->ReadXMLTag(); | |
81 | + if(cq->TAG.isEmpty()) cq->ReadXMLTag(); | |
82 | 82 | by=cq->by; |
83 | 83 | subby=cq->subby; |
84 | 84 |
@@ -94,7 +94,7 @@ | ||
94 | 94 | } |
95 | 95 | break; |
96 | 96 | case XML_extchar: |
97 | - if(cq->TAG=="") break; //Extended chatacter &xxx; | |
97 | + if(cq->TAG.isEmpty()) break; //Extended chatacter &xxx; | |
98 | 98 | TAG=Ext_chr_str(cq->TAG[0],cq)+copy(cq->TAG,1,length(cq->TAG)-1); |
99 | 99 | tag=TAG(); |
100 | 100 | by=201; |
@@ -193,7 +193,7 @@ | ||
193 | 193 | case XML_comment: //comment |
194 | 194 | break; |
195 | 195 | case XML_badextchar: |
196 | - if(cq->TAG=="") break; //Extended chatacter &xxx | |
196 | + if(cq->TAG.isEmpty()) break; //Extended chatacter &xxx | |
197 | 197 | cq->TAG[length(cq->TAG)-1]=' '; |
198 | 198 | TAG = Ext_chr_str(cq->TAG[0],cq)+copy(cq->TAG,1,length(cq->TAG)-1); |
199 | 199 | tag = TAG(); |
@@ -190,7 +190,7 @@ | ||
190 | 190 | int i; |
191 | 191 | |
192 | 192 | *cq->ObjType=0; |
193 | - if(cq->TAG=="") cq->ReadXMLTag(false); | |
193 | + if(cq->TAG.isEmpty()) cq->ReadXMLTag(false); | |
194 | 194 | by=cq->by; |
195 | 195 | subby=cq->subby; |
196 | 196 |
@@ -205,7 +205,7 @@ | ||
205 | 205 | case 32:by=32;break; //Space |
206 | 206 | } |
207 | 207 | break; |
208 | -/* case 1:if(cq->TAG=="") break; //Extended chatacter &xxx; | |
208 | +/* case 1:if(cq->TAG.isEmpty()) break; //Extended chatacter &xxx; | |
209 | 209 | TAG=Ext_chr_str(cq->TAG[0],cq)+copy(cq->TAG,1,length(cq->TAG)-1); |
210 | 210 | tag=TAG(); |
211 | 211 | by=201; |
@@ -26,7 +26,7 @@ | ||
26 | 26 | |
27 | 27 | list HTMLChars(Table_html,sizeof(Table_html)/sizeof(char *)); |
28 | 28 | |
29 | -#define HTMLVersion "0.28" | |
29 | +#define HTMLVersion "0.29" | |
30 | 30 | |
31 | 31 | |
32 | 32 | /** Base class for HTML document conversion. */ |
@@ -670,7 +670,7 @@ | ||
670 | 670 | int i; |
671 | 671 | |
672 | 672 | *ObjType = 0; |
673 | - if(this->TAG=="") ReadXMLTag(); | |
673 | + if(this->TAG.isEmpty()) ReadXMLTag(); | |
674 | 674 | by = this->by; |
675 | 675 | subby = this->subby; |
676 | 676 |
@@ -1216,7 +1216,7 @@ | ||
1216 | 1216 | ProcessKeyMTEFSymbol(this); |
1217 | 1217 | } |
1218 | 1218 | |
1219 | - if(Formula!="") | |
1219 | + if(!Formula.isEmpty()) | |
1220 | 1220 | { |
1221 | 1221 | int i,j; |
1222 | 1222 |
@@ -644,8 +644,7 @@ | ||
644 | 644 | psaveOld = cq->psave; |
645 | 645 | |
646 | 646 | AttrFit(cq->attr,psaveOld->CharA,s); |
647 | - if(s!="") fputs(s(),cq->strip); | |
648 | - | |
647 | + if(!s.isEmpty()) fputs(s(),cq->strip); | |
649 | 648 | |
650 | 649 | cq->fSkipDestIfUnk=psaveOld->fSkipDestIfUnk && |
651 | 650 | (cq->fSkipDestIfUnk || (!cq->fSkipDestIfUnk && (cq->rds!=rdsNorm))); |
@@ -835,7 +834,7 @@ | ||
835 | 834 | #ifdef DEBUG |
836 | 835 | fprintf(cq->log,"\n#ChangeCpTranslator() ");fflush(cq->log); |
837 | 836 | #endif |
838 | - if(cq->Parameter=="") | |
837 | + if(cq->Parameter.isEmpty()) | |
839 | 838 | {cq->ConvertCpg = NULL;return;} |
840 | 839 | cq->ConvertCpg = GetTranslator(string("cp"+cq->Parameter+"TOinternal")); |
841 | 840 | if(cq->ConvertCpg==NULL || cq->ConvertCpg==&Dummy) |
@@ -954,13 +953,13 @@ | ||
954 | 953 | state=0; |
955 | 954 | break; |
956 | 955 | |
957 | - case 10:if(Str!="") | |
956 | + case 10:if(!Str.isEmpty()) | |
958 | 957 | { |
959 | 958 | fprintf(cq->strip, " \\pageref{%s}",Str()); |
960 | 959 | state=0; |
961 | 960 | } |
962 | 961 | break; |
963 | - case 20:if(Str!="") | |
962 | + case 20:if(!Str.isEmpty()) | |
964 | 963 | { |
965 | 964 | fprintf(cq->strip, " \\ref{%s}",Str()); |
966 | 965 | state=0; |
@@ -985,7 +984,7 @@ | ||
985 | 984 | continue; |
986 | 985 | } |
987 | 986 | } |
988 | - } while(Str!=""); | |
987 | + } while(!Str.isEmpty()); | |
989 | 988 | } |
990 | 989 | |
991 | 990 |
@@ -1389,7 +1388,7 @@ | ||
1389 | 1388 | cq->rds=rdsSkip; |
1390 | 1389 | } |
1391 | 1390 | else c=fgetc(cq->wpd); //read the closing curly brace |
1392 | - if(LBL_Text!="") | |
1391 | + if(!LBL_Text.isEmpty()) | |
1393 | 1392 | { |
1394 | 1393 | fprintf(cq->strip, "%s\\label{%s}",cq->char_on_line>0?" ":"",LBL_Text()); |
1395 | 1394 | if(cq->char_on_line == false) |
@@ -1966,7 +1965,7 @@ | ||
1966 | 1965 | putc(cq->by, cq->log); |
1967 | 1966 | break; |
1968 | 1967 | default: |
1969 | - if(cq->Keyword != "") | |
1968 | + if(!cq->Keyword.isEmpty()) | |
1970 | 1969 | { |
1971 | 1970 | char *Str; |
1972 | 1971 | fprintf(cq->log, "\n%*s[\\%s", |
@@ -1552,14 +1552,14 @@ | ||
1552 | 1552 | if(fib.fcMin<ActualPos || fib.fcMin>fib.fcMac) |
1553 | 1553 | { |
1554 | 1554 | if(err != NULL) |
1555 | - {perc.Hide();fprintf(err,_("\nError: FIB.fcMin is corrupted %ld!"),fib.fcMin);} | |
1556 | - fib.fcMin=ActualPos; | |
1555 | + {perc.Hide();fprintf(err,_("\nError: FIB.fcMin is corrupted %ld!"), (long)fib.fcMin);} | |
1556 | + fib.fcMin = ActualPos; | |
1557 | 1557 | } |
1558 | 1558 | if(fib.fcMac>fsize) |
1559 | 1559 | { |
1560 | 1560 | if(err != NULL) |
1561 | - {perc.Hide();fprintf(err,_("\nError: FIB.fcMac is bigger than file size %ld!"),fib.fcMac);} | |
1562 | - fib.fcMac=fsize; | |
1561 | + {perc.Hide();fprintf(err,_("\nError: FIB.fcMac is bigger than file size %ld!"), (long)fib.fcMac);} | |
1562 | + fib.fcMac = fsize; | |
1563 | 1563 | } |
1564 | 1564 | |
1565 | 1565 | //printf("%s\n",wvAutoCharset(&cq)); |
@@ -682,13 +682,13 @@ | ||
682 | 682 | break; |
683 | 683 | |
684 | 684 | case 'I': |
685 | - case 'i':if(Lines[cur].Lstring=="") //indent nothing ?? | |
685 | + case 'i':if(Lines[cur].Lstring.isEmpty()) //indent nothing ?? | |
686 | 686 | { |
687 | 687 | return true; // Signalise special handling to the caller. |
688 | 688 | } |
689 | 689 | if((Lines[cur].Indent_Level<2)||(toupper(Lines[pre].envir)!='I')) |
690 | 690 | { |
691 | - if(Lines[pre].Lstring!="") | |
691 | + if(!Lines[pre].Lstring.isEmpty()) | |
692 | 692 | fprintf(LaTeX,"\\testlastline\n\n"); |
693 | 693 | else fprintf(LaTeX,"\\zerotestlastline\n"); |
694 | 694 | } |
@@ -874,7 +874,7 @@ | ||
874 | 874 | |
875 | 875 | static int FixBracket(string & Line) |
876 | 876 | { |
877 | - if(Line == "") return 0; | |
877 | + if(Line.isEmpty()) return 0; | |
878 | 878 | |
879 | 879 | Line="{}"+Line; |
880 | 880 |
@@ -1456,12 +1456,12 @@ | ||
1456 | 1456 | /** fix occurence \/ in the vertical mode - remove it */ |
1457 | 1457 | void TconvertedPass2::FixItallicAlignment(string *aLineStr) |
1458 | 1458 | { |
1459 | - if( (Lines[pre].Lstring=="")&&(length(*aLineStr)>=2) ) | |
1459 | + if( (Lines[pre].Lstring.isEmpty())&&(length(*aLineStr)>=2) ) | |
1460 | 1460 | if ( (*aLineStr)[0]=='\\' && (*aLineStr)[1]=='/' ) |
1461 | 1461 | *aLineStr=copy(*aLineStr,2,length(*aLineStr)-2); |
1462 | 1462 | |
1463 | 1463 | if( (length(Lines[next].Lstring)>=2) && |
1464 | - (*aLineStr=="" || | |
1464 | + (aLineStr->isEmpty() || | |
1465 | 1465 | Lines[cur].line_term=='h' || Lines[cur].line_term=='p') ) |
1466 | 1466 | if( (Lines[next].Lstring)[0]=='\\' && (Lines[next].Lstring)[1]=='/' ) |
1467 | 1467 | Lines[next].Lstring=copy(Lines[next].Lstring,2,length(Lines[next].Lstring)-2); |
@@ -1510,7 +1510,7 @@ | ||
1510 | 1510 | NextLine->Lstring = copy(NextLine->Lstring,strlen(CHelpS),length(NextLine->Lstring)-strlen(CHelpS)); |
1511 | 1511 | |
1512 | 1512 | // and append it to a current line |
1513 | - if(CurLine->Lstring=="" && Lines[pre].Lstring!="") | |
1513 | + if(CurLine->Lstring.isEmpty() && !Lines[pre].Lstring.isEmpty()) | |
1514 | 1514 | { // When a current line is empty, add \n |
1515 | 1515 | CurLine->Lstring += CHelpS; |
1516 | 1516 | CurLine->Lstring += "\n"; |
@@ -1601,7 +1601,7 @@ | ||
1601 | 1601 | cq2.Lines[cq2.next2].Empty = EmptyLine(cq2.Lines[cq2.next2].Lstring); |
1602 | 1602 | |
1603 | 1603 | |
1604 | - while((!feof(Strip) || cq2.Lines[cq2.cur].Lstring!="" || cq2.Lines[cq2.next].Lstring!="" || cq2.Lines[cq2.next2].Lstring!="")) | |
1604 | + while((!feof(Strip) || !cq2.Lines[cq2.cur].Lstring.isEmpty() || !cq2.Lines[cq2.next].Lstring.isEmpty() || !cq2.Lines[cq2.next2].Lstring.isEmpty())) | |
1605 | 1605 | { |
1606 | 1606 | cq2.Update_global_information(); |
1607 | 1607 |
@@ -1750,7 +1750,7 @@ | ||
1750 | 1750 | /* Some optimizations of text on current line */ |
1751 | 1751 | |
1752 | 1752 | //fix beginning paragraph with \raise command |
1753 | - if(cq2.Lines[cq2.pre].Lstring=="" && length(*aLineStr)>=6) | |
1753 | + if(cq2.Lines[cq2.pre].Lstring.isEmpty() && length(*aLineStr)>=6) | |
1754 | 1754 | { |
1755 | 1755 | if(!strncmp((*aLineStr),"\\raise",6)) |
1756 | 1756 | *aLineStr="\\strut"+*aLineStr; |
@@ -1787,7 +1787,7 @@ | ||
1787 | 1787 | |
1788 | 1788 | //fix closed attributes problem |
1789 | 1789 | if(cq2.Lines[cq2.cur].attr.ClosedAttr()) /* Are attributes closed? */ |
1790 | - if(*aLineStr == "") | |
1790 | + if(aLineStr->isEmpty()) | |
1791 | 1791 | { |
1792 | 1792 | if(cq2.Lines[cq2.next].attr.Closed_Depth==cq2.Lines[cq2.cur].attr.Closed_Depth) |
1793 | 1793 | { |
@@ -1806,9 +1806,9 @@ | ||
1806 | 1806 | } |
1807 | 1807 | |
1808 | 1808 | |
1809 | - if(*aLineStr!="" || cq2.Lines[cq2.next].envir=='!') | |
1809 | + if(!aLineStr->isEmpty() || cq2.Lines[cq2.next].envir=='!') | |
1810 | 1810 | { /* Attributes are closed */ |
1811 | - if(cq2.Lines[cq2.cur].LineFlag & 1 && (*aLineStr == '%'||*aLineStr == "")) | |
1811 | + if(cq2.Lines[cq2.cur].LineFlag & 1 && (aLineStr->isEmpty()||*aLineStr=='%')) | |
1812 | 1812 | { |
1813 | 1813 | if(cq2.Change_envir_EOL()) |
1814 | 1814 | cq2.CloseEnvironment(); |
@@ -1884,7 +1884,7 @@ | ||
1884 | 1884 | if (cq2.Lines[cq2.next].attr.Opened_Depth>0) /* Attributes are opened */ |
1885 | 1885 | { |
1886 | 1886 | Close_All_Attr(cq2.Lines[cq2.next].attr,s); /* close attributes on EOL */ |
1887 | - if((cq2.Lines[cq2.pre].Lstring=="") && cq2.Lines[cq2.cur].Empty) | |
1887 | + if((cq2.Lines[cq2.pre].Lstring.isEmpty()) && cq2.Lines[cq2.cur].Empty) | |
1888 | 1888 | s = replacesubstring(s,"\\/",""); //remove \/ in vertical mode |
1889 | 1889 | fputs(s(),cq2.LaTeX); |
1890 | 1890 | } |
@@ -1933,23 +1933,23 @@ | ||
1933 | 1933 | } |
1934 | 1934 | else { |
1935 | 1935 | if(cq2.Lines[cq2.next].envir=='^'); // do not solve anything at the end of the minipage |
1936 | - else if (*aLineStr == "" && | |
1937 | - cq2.Lines[cq2.pre].Lstring == "") | |
1936 | + else if(aLineStr->isEmpty() && | |
1937 | + cq2.Lines[cq2.pre].Lstring.isEmpty()) | |
1938 | 1938 | { |
1939 | 1939 | fprintf(cq2.LaTeX, "\\bigskip"); |
1940 | 1940 | } |
1941 | - else if (cq2.Lines[cq2.next].Empty>0) | |
1941 | + else if(cq2.Lines[cq2.next].Empty>0) | |
1942 | 1942 | { |
1943 | 1943 | cq2.Lines[cq2.next].InhibitBsBslash = true; |
1944 | 1944 | } |
1945 | - else if (!cq2.Lines[cq2.cur].InhibitBsBslash) | |
1945 | + else if(!cq2.Lines[cq2.cur].InhibitBsBslash) | |
1946 | 1946 | { |
1947 | 1947 | /* if (!cq2.just_envir_closed && (cq2.Lines[cq2.cur].envir=='L' || cq2.Lines[cq2.cur].envir=='R')) |
1948 | 1948 | fprintf(cq2.LaTeX, "\\nwln"); |
1949 | 1949 | else*/ { |
1950 | 1950 | if(cq2.Lines[cq2.cur].Empty>0) |
1951 | 1951 | { |
1952 | - if(cq2.Lines[cq2.pre].Lstring!="") | |
1952 | + if(!cq2.Lines[cq2.pre].Lstring.isEmpty()) | |
1953 | 1953 | fputc('\n',cq2.LaTeX); |
1954 | 1954 | fprintf(cq2.LaTeX, " \\bigskip"); |
1955 | 1955 | } |
@@ -1969,7 +1969,7 @@ | ||
1969 | 1969 | case 'P':if(cq2.Lines[cq2.next].attr.Opened_Depth>0) /* Attributes are opened */ |
1970 | 1970 | { |
1971 | 1971 | Close_All_Attr(cq2.Lines[cq2.next].attr,s); /* close attributes on EOL */ |
1972 | - if((cq2.Lines[cq2.pre].Lstring=="") && cq2.Lines[cq2.cur].Empty) | |
1972 | + if((cq2.Lines[cq2.pre].Lstring.isEmpty()) && cq2.Lines[cq2.cur].Empty) | |
1973 | 1973 | s = replacesubstring(s,"\\/",""); //remove \/ in vertical mode |
1974 | 1974 | fputs(s(),cq2.LaTeX); |
1975 | 1975 | } |
@@ -267,7 +267,7 @@ | ||
267 | 267 | if(ch=='/' || ch=='\\') |
268 | 268 | RelativeFigDir = copy(RelativeFigDir,0,StrLen(RelativeFigDir)-1); |
269 | 269 | |
270 | - if(wpd_filename=="") return; | |
270 | + if(wpd_filename.isEmpty()) return; | |
271 | 271 | |
272 | 272 | if((i=GetPathEnd(wpd_filename())) > 0) |
273 | 273 | { |
@@ -320,8 +320,8 @@ | ||
320 | 320 | if(length(var)>0) Noclobber=true; |
321 | 321 | |
322 | 322 | var = getenv("wp2latex"); |
323 | - if(var=="") var = getenv("WP2LATEX"); | |
324 | - if(var=="") return; | |
323 | + if(var.isEmpty()) var = getenv("WP2LATEX"); | |
324 | + if(var.isEmpty()) return; | |
325 | 325 | |
326 | 326 | oldtyp=0; |
327 | 327 | for(i=0;i<length(var);i++) |
@@ -364,7 +364,7 @@ | ||
364 | 364 | { |
365 | 365 | fGets2(F,s); |
366 | 366 | s.trim(); |
367 | - if(s=="") continue; | |
367 | + if(s.isEmpty()) continue; | |
368 | 368 | /* if(s=="[WPUserChars]") |
369 | 369 | { |
370 | 370 | Section=1; |
@@ -384,7 +384,7 @@ | ||
384 | 384 | while(isdigit(s[0])) |
385 | 385 | { |
386 | 386 | s=copy(s,1,length(s)-1); |
387 | - if(s=="") break; | |
387 | + if(s.isEmpty()) break; | |
388 | 388 | } |
389 | 389 | s=trim(s); |
390 | 390 | if(UserWPCharSet==NULL) |
@@ -1970,12 +1970,12 @@ | ||
1970 | 1970 | } |
1971 | 1971 | |
1972 | 1972 | |
1973 | - if(wpd_filename == "") | |
1973 | + if(wpd_filename.isEmpty()) | |
1974 | 1974 | { |
1975 | 1975 | wpd_filename = name; |
1976 | 1976 | continue; |
1977 | 1977 | } |
1978 | - if(latex_filename == "") | |
1978 | + if(latex_filename.isEmpty()) | |
1979 | 1979 | { |
1980 | 1980 | latex_filename = name; |
1981 | 1981 | continue; |
@@ -467,7 +467,7 @@ | ||
467 | 467 | Heading(); |
468 | 468 | printf(_("\nLog file name [%s]: "), chk(LogFile())); |
469 | 469 | StrGets(s); |
470 | - if(s != "") LogFile=s; | |
470 | + if(!s.isEmpty()) LogFile=s; | |
471 | 471 | } |
472 | 472 | |
473 | 473 |
@@ -478,16 +478,16 @@ | ||
478 | 478 | |
479 | 479 | Heading(); |
480 | 480 | |
481 | - if(latex_filename == "") | |
481 | + if(latex_filename.isEmpty()) | |
482 | 482 | { |
483 | - if(Interactive && (Verbosing>=1 || wpd_filename=="")) | |
483 | + if(Interactive && (Verbosing>=1 || wpd_filename.isEmpty())) | |
484 | 484 | { |
485 | 485 | printf(_("\nWordPerfect-filename [%s]: "), chk(wpd_filename())); |
486 | 486 | StrGets(StrName); |
487 | - if (StrName != "") wpd_filename=StrName; | |
487 | + if(!StrName.isEmpty()) wpd_filename=StrName; | |
488 | 488 | } |
489 | 489 | |
490 | - if(wpd_filename == "") | |
490 | + if(wpd_filename.isEmpty()) | |
491 | 491 | { /* No filename entered */ |
492 | 492 | RunError(0x200); |
493 | 493 | } |
@@ -506,16 +506,16 @@ | ||
506 | 506 | if(p<=0) p=length(wpd_filename); //no extension |
507 | 507 | |
508 | 508 | |
509 | - if(latex_filename == "") | |
509 | + if(latex_filename.isEmpty()) | |
510 | 510 | { |
511 | 511 | latex_filename=copy(wpd_filename,0,p) + ".tex"; |
512 | 512 | } |
513 | 513 | |
514 | - if(Interactive && (Verbosing >= 1 || latex_filename == "")) | |
514 | + if(Interactive && (Verbosing >= 1 || latex_filename.isEmpty())) | |
515 | 515 | { |
516 | 516 | printf(_("LaTeX-filename [%s]: "), chk(latex_filename())); |
517 | 517 | StrGets(StrName); |
518 | - if (StrName != "") latex_filename = StrName; | |
518 | + if(!StrName.isEmpty()) latex_filename = StrName; | |
519 | 519 | } |
520 | 520 | } |
521 | 521 |
@@ -693,7 +693,7 @@ | ||
693 | 693 | if((wpd = fopen(wpd_filename, "rb")) == NULL) |
694 | 694 | RunError(2,wpd_filename); |
695 | 695 | |
696 | - if(FORCE != "") | |
696 | + if(!FORCE.isEmpty()) | |
697 | 697 | { |
698 | 698 | cqPass1 = GetConverter(FORCE); |
699 | 699 | if(cqPass1==NULL) |
@@ -707,7 +707,7 @@ | ||
707 | 707 | { |
708 | 708 | CheckFileFormat(wpd,FilForD); |
709 | 709 | cqPass1 = GetConverter(FilForD.Converter); |
710 | - if(cqPass1==NULL && force!="") | |
710 | + if(cqPass1==NULL && !force.isEmpty()) | |
711 | 711 | { |
712 | 712 | cqPass1=GetConverter(force); |
713 | 713 | if(cqPass1==NULL) |
@@ -743,7 +743,7 @@ | ||
743 | 743 | } |
744 | 744 | |
745 | 745 | logg = NULL; |
746 | - if(log_filename != "") | |
746 | + if(!log_filename.isEmpty()) | |
747 | 747 | { |
748 | 748 | if(wpd_filename == log_filename) |
749 | 749 | { |
@@ -373,7 +373,7 @@ | ||
373 | 373 | { |
374 | 374 | string tmp; |
375 | 375 | char c; |
376 | - if(RelPath=="") return(temp_string(Path(),Path.length())); | |
376 | + if(RelPath.isEmpty()) return(temp_string(Path(),Path.length())); | |
377 | 377 | c = RelPath[0]; |
378 | 378 | if(AbsolutePath(RelPath())) |
379 | 379 | { |