summaryrefslogtreecommitdiff
path: root/library
authoreilers <eilers>2002-12-09 15:32:16 (UTC)
committer eilers <eilers>2002-12-09 15:32:16 (UTC)
commit9aa2442f6ea4e0d58fa7888995ebad04b3692049 (patch) (side-by-side diff)
treef0a4340cf9178868e5c8d05df69a3d0d0fa12756 /library
parentb0a600bf9dd32b908d79c2cf1f12b8088dc2590d (diff)
downloadopie-9aa2442f6ea4e0d58fa7888995ebad04b3692049.zip
opie-9aa2442f6ea4e0d58fa7888995ebad04b3692049.tar.gz
opie-9aa2442f6ea4e0d58fa7888995ebad04b3692049.tar.bz2
Temorarely bug workaround ( #490 ) until trolltech publishing a bugfix !
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vobject.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp
index 2f22c20..2c5b577 100644
--- a/library/backend/vobject.cpp
+++ b/library/backend/vobject.cpp
@@ -1008,110 +1008,136 @@ static int writeBase64(OFile *fp, unsigned char *s, long len)
static const char *replaceChar(unsigned char c)
{
if (c == '\n') {
return "=0A=\n";
} else if (
(c >= 'A' && c <= 'Z')
||
(c >= 'a' && c <= 'z')
||
(c >= '0' && c <= '9')
||
(c >= '\'' && c <= ')')
||
(c >= '+' && c <= '-')
||
(c == '/')
||
(c == '?')
||
(c == ' '))
{
return 0;
}
+#warning "Bug-Workaround must be fixed !"
+ // IF THIS FUNCTION RETURNES TRUE, THE DATA IS EXPORTED
+ // AS QUOTED PRINTABLE.
+ // BUT THE PARSER IS UNABLE TO IMPORT THIS, THEREFORE
+ // I DECIDED TO DISABLE IT UNTIL TROLLTECH FIXES THIS BUG
+ // SEE ALSO includesUnprintable(VObject *o)
+ // (se)
+
+ return 0;
+
+#if 0
static char trans[4];
trans[0] = '=';
trans[3] = '\0';
int rem = c % 16;
int div = c / 16;
if (div < 10)
trans[1] = '0' + div;
else
trans[1] = 'A' + (div - 10);
if (rem < 10)
trans[2] = '0' + rem;
else
trans[2] = 'A' + (rem - 10);
return trans;
+#endif
}
static void writeQPString(OFile *fp, const char *s)
{
/*
only A-Z, 0-9 and
"'" (ASCII code 39)
"(" (ASCII code 40)
")" (ASCII code 41)
"+" (ASCII code 43)
"," (ASCII code 44)
"-" (ASCII code 45)
"/" (ASCII code 47)
"?" (ASCII code 63)
should remain un-encoded.
'=' needs to be encoded as it is the escape character.
';' needs to be as it is a field separator.
*/
const char *p = s;
while (*p) {
const char *rep = replaceChar(*p);
if (rep)
appendsOFile(fp, rep);
else
appendcOFile(fp, *p);
p++;
}
}
static bool includesUnprintable(VObject *o)
{
+
+#if 0
+
+ // IF THIS FUNCTION RETURNES TRUE, THE DATA IS EXPORTED
+ // AS QUOTED PRINTABLE.
+ // BUT THE PARSER IS UNABLE TO IMPORT THIS, THEREFORE
+ // I DECIDED TO DISABLE IT UNTIL TROLLTECH FIXES THIS BUG
+ // SEE ALSO *replaceChar(unsigned char c)
+ // (se)
+
if (o) {
if (VALUE_TYPE(o) == VCVT_STRINGZ) {
const char *p = STRINGZ_VALUE_OF(o);
if (p) {
while (*p) {
if (replaceChar(*p))
return TRUE;
p++;
}
}
}
}
+
+#endif
+#warning "Bug-Workaround must be fixed !"
+
return FALSE;
}
static void writeVObject_(OFile *fp, VObject *o);
static void writeValue(OFile *fp, VObject *o, unsigned long size)
{
if (o == 0) return;
switch (VALUE_TYPE(o)) {
case VCVT_STRINGZ: {
writeQPString(fp, STRINGZ_VALUE_OF(o));
break;
}
case VCVT_UINT: {
char buf[16];
sprintf(buf,"%u", INTEGER_VALUE_OF(o));
appendsOFile(fp,buf);
break;
}
case VCVT_ULONG: {
char buf[16];
sprintf(buf,"%lu", LONG_VALUE_OF(o));
appendsOFile(fp,buf);
break;