summaryrefslogtreecommitdiffstats
path: root/lib/kformula/scripts
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kformula/scripts
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kformula/scripts')
-rwxr-xr-xlib/kformula/scripts/bycodes.py18
-rwxr-xr-xlib/kformula/scripts/bynames.py10
-rwxr-xr-xlib/kformula/scripts/oper-dict.py8
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/kformula/scripts/bycodes.py b/lib/kformula/scripts/bycodes.py
index 16d71959..f5da0ae0 100755
--- a/lib/kformula/scripts/bycodes.py
+++ b/lib/kformula/scripts/bycodes.py
@@ -23,35 +23,35 @@ import string
import qt
def decode( fd, font, line ):
- begin = string.find( line, '"' )
- end = string.find( line, '"', begin + 1)
- unicode = line[begin + 2:end] # Remove 'U' from string aswell
+ begin = string.tqfind( line, '"' )
+ end = string.tqfind( line, '"', begin + 1)
+ tqunicode = line[begin + 2:end] # Remove 'U' from string aswell
char_list = []
- separation = string.find( unicode, '-' )
+ separation = string.tqfind( tqunicode, '-' )
if separation != -1:
- second = unicode
+ second = tqunicode
while separation != -1:
first = second[0:separation]
second = second[separation + 2:]
char_list.append( string.atoi( first, 16 ) )
- separation = string.find( second, '-' )
+ separation = string.tqfind( second, '-' )
if separation == -1:
char_list.append( string.atoi( second, 16 ) )
else:
- char_list.append( string.atoi ( unicode, 16 ) )
+ char_list.append( string.atoi ( tqunicode, 16 ) )
fm = qt.QFontMetrics( qt.QFont( font ) )
in_font = True
for c in char_list:
if not fm.inFont( qt.QChar( c ) ):
in_font = False
- fd.write( unicode + ' ' + str( in_font ) + '\n')
+ fd.write( tqunicode + ' ' + str( in_font ) + '\n')
def parse( file, font ):
fd = open( file )
fd2 = open( 'mathml.list', 'w' )
line = fd.readline()
while line != "":
- if string.find( line, 'name' ) != -1:
+ if string.tqfind( line, 'name' ) != -1:
decode( fd2, font, line )
line = fd.readline()
diff --git a/lib/kformula/scripts/bynames.py b/lib/kformula/scripts/bynames.py
index afb9ece5..50fac994 100755
--- a/lib/kformula/scripts/bynames.py
+++ b/lib/kformula/scripts/bynames.py
@@ -66,7 +66,7 @@ struct entityMap {
return qstrcmp( name, right ) < 0;
}
const char* name;
- const uint unicode;
+ const uint tqunicode;
};
extern const entityMap entities[];
@@ -109,14 +109,14 @@ def name_cmp( a, b ):
def parse( fr, fw ):
line = fr.readline()
- while line != "" and string.find( line, '<pre>' ) == -1:
+ while line != "" and string.tqfind( line, '<pre>' ) == -1:
line = fr.readline()
- pos = string.find( line, '<pre>' ) ### Ad-hoc detection
+ pos = string.tqfind( line, '<pre>' ) ### Ad-hoc detection
if pos == -1:
return
line = line[pos + len('<pre>'):].strip() ### Ad-hoc detection
entries = []
- while line != "" and string.find( line, ',' ) != -1:
+ while line != "" and string.tqfind( line, ',' ) != -1:
fields = line.split(',')
name = fields[0].strip()
number = fields[1].strip()
@@ -124,7 +124,7 @@ def parse( fr, fw ):
# TODO: Support multicharacter entities, should also be supported by
# application. The best solution would probably to map to a single
# character provided by the font in the private area of Unicode
- if string.find( number, '-' ) == -1:
+ if string.tqfind( number, '-' ) == -1:
entries.append( [name, '0x' + number[1:]] )
line = fr.readline().strip()
diff --git a/lib/kformula/scripts/oper-dict.py b/lib/kformula/scripts/oper-dict.py
index 49191ef6..a91a7971 100755
--- a/lib/kformula/scripts/oper-dict.py
+++ b/lib/kformula/scripts/oper-dict.py
@@ -190,12 +190,12 @@ def parse( fr, fw, entities ):
attr_list[10]: '"false"'
}
fields = line.split()
- name = string.replace( fields[0], '&amp;', '&' )
+ name = string.tqreplace( fields[0], '&amp;', '&' )
fields.pop(0) # Remove name
entities_found = True
while True:
- begin = string.find( name, '&' )
- end = string.find( name, ';' )
+ begin = string.tqfind( name, '&' )
+ end = string.tqfind( name, ';' )
if begin == -1 or end == -1:
break
###
@@ -204,7 +204,7 @@ def parse( fr, fw, entities ):
# character provided by the font in the private area of Unicode
entity_name = name[begin + 1:end]
if entities.has_key( entity_name ) :
- name = name.replace( '&' + entity_name + ';', unichr(entities[entity_name]));
+ name = name.tqreplace( '&' + entity_name + ';', unichr(entities[entity_name]));
else:
entities_found = False
break