[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/koffice/1.6/koffice/filters/kword/html/import
From: Thorsten Staerk <dev () staerk ! de>
Date: 2007-04-30 21:39:31
Message-ID: 1177969171.172062.23822.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 659834 by tstaerk:
enable pre-tags for html import
BUGS:74601
M +12 -5 kwdwriter.cpp
A test/pretext.htm
--- branches/koffice/1.6/koffice/filters/kword/html/import/kwdwriter.cpp #659833:659834
@@ -428,12 +428,16 @@
if (temp.isNull()) { kdDebug(30503) << "no text" << endl; return; }
QString oldtext=currentText.data();
int oldLength=oldtext.length();
- if (keep_formatting) {
- if (oldLength) {
+ if (keep_formatting)
+ {
+ if (oldLength)
+ {
++oldLength;
oldtext.append('\n');
}
- } else {
+ }
+ else
+ {
if (oldLength)
++oldLength; // add new trailing space char
text=text.simplifyWhiteSpace(); // drop all unprintable chars
@@ -441,9 +445,12 @@
QString newtext;
if (keep_formatting)
newtext=oldtext + text;
- else {
+ else
+ {
newtext=oldtext + " " + text;
- newtext=newtext.simplifyWhiteSpace(); // strip possible new space at beginning.
+ // strip possible newline at beginning.
+ while (newtext.left(1)=="\n" || newtext.left(1)==" ") newtext=newtext.right(newtext.length()-1);
+
}
currentText.setData(newtext);
int newLength=text.length();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic