author | zautrix <zautrix> | 2005-03-10 14:36:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-10 14:36:13 (UTC) |
commit | 34f5a1b758adb98c466ae8e45c9d980d62dfc544 (patch) (side-by-side diff) | |
tree | 1ba10eac4df592da4b284bae029a864e40314d18 /libkcal | |
parent | b96161e4dd7fc19eea87257c2455b85420dad35a (diff) | |
download | kdepimpi-34f5a1b758adb98c466ae8e45c9d980d62dfc544.zip kdepimpi-34f5a1b758adb98c466ae8e45c9d980d62dfc544.tar.gz kdepimpi-34f5a1b758adb98c466ae8e45c9d980d62dfc544.tar.bz2 |
htmal tag fix
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 35 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.h | 1 |
2 files changed, 26 insertions, 10 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 1751ae3..57a9ede 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -53,3 +53,3 @@ void KIncidenceFormatter::setEvent(Event *event) if ( mode == 0 ) { - addTag("h3",event->summary()); + addTag("h3",deTag(event->summary())); } @@ -64,5 +64,5 @@ void KIncidenceFormatter::setEvent(Event *event) if ( mode == 1 ) { - addTag("h2",i18n( "Local: " ) +event->summary()); + addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { - addTag("h2",i18n( "Remote: " ) +event->summary()); + addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } @@ -80,3 +80,3 @@ void KIncidenceFormatter::setEvent(Event *event) addTag("b",i18n("Location: ")); - mText.append(event->location()+"<br>"); + mText.append(deTag(event->location())+"<br>"); } @@ -146,3 +146,3 @@ void KIncidenceFormatter::setEvent(Event *event) addTag("p",i18n("<b>Details: </b>")); - addTag("p",event->description()); + addTag("p",deTag(event->description())); } @@ -172,3 +172,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) if (mode == 0 ) - addTag("h3",event->summary()); + addTag("h3",deTag(event->summary())); else { @@ -181,5 +181,5 @@ void KIncidenceFormatter::setTodo(Todo *event ) if ( mode == 1 ) { - addTag("h2",i18n( "Local: " ) +event->summary()); + addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { - addTag("h2",i18n( "Remote: " ) +event->summary()); + addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } @@ -206,3 +206,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("b",i18n("Location: ")); - mText.append(event->location()+"<br>"); + mText.append(deTag(event->location())+"<br>"); } @@ -231,3 +231,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("p",i18n("<b>Details: </b>")); - addTag("p",event->description()); + addTag("p",deTag(event->description())); } @@ -378 +378,16 @@ void KIncidenceFormatter::formatReadOnly(Incidence *event) } +QString KIncidenceFormatter::deTag(QString text) +{ +#if QT_VERSION >= 0x030000 + text.replace( '<' , "<" ); + text.replace( '>' , ">" ); +#else + if ( text.find ('<') > 0 ) { + text.replace( QRegExp("<") , "<" ); + } + if ( text.find ('>') > 0 ) { + text.replace( QRegExp(">") , ">" ); + } +#endif + return text; +} diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h index 068e6d2..b5603e0 100644 --- a/libkcal/kincidenceformatter.h +++ b/libkcal/kincidenceformatter.h @@ -34,2 +34,3 @@ class KIncidenceFormatter : public QObject private: + QString deTag(QString text); bool mSyncMode; |