filters

kword13utils.cpp
1#include "kword13utils.h"
2
3TQString EscapeXmlDump( const TQString& strIn )
4{
5 TQString strReturn;
6 TQChar ch;
7
8 for (uint i=0; i<strIn.length(); i++)
9 {
10 ch=strIn[i];
11 switch (ch.unicode())
12 {
13 case 38: // &
14 {
15 strReturn+="&amp;";
16 break;
17 }
18 case 60: // <
19 {
20 strReturn+="&lt;";
21 break;
22 }
23 case 62: // >
24 {
25 strReturn+="&gt;";
26 break;
27 }
28 case 34: // "
29 {
30 strReturn+="&quot;";
31 break;
32 }
33 case 39: // '
34 {
35 strReturn+="&apos;";
36 break;
37 }
38 default:
39 {
40 strReturn+=ch;
41 break;
42 }
43 }
44 }
45
46 return strReturn;
47}
48