From kde-bugs-dist Mon Apr 30 21:39:36 2007 From: tstaerk Date: Mon, 30 Apr 2007 21:39:36 +0000 To: kde-bugs-dist Subject: [Bug 74601] kword doesn't recognize PRE-tags in HTML Message-Id: <20070430213936.6636.qmail () ktown ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-bugs-dist&m=117796918701487 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. http://bugs.kde.org/show_bug.cgi?id=74601 dev staerk de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Additional Comments From dev staerk de 2007-04-30 23:39 ------- 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();