r22084 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Tue Jun 27 17:37:35 UTC 2017
Author: jghali
Date: Tue Jun 27 17:37:35 2017
New Revision: 22084
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22084
Log:
#14884: A blank character is added when importing an html file
Modified:
branches/Version14x/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
Modified: branches/Version14x/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22084&path=/branches/Version14x/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp Tue Jun 27 17:37:35 2017
@@ -279,6 +279,9 @@
else
tmp = tmp.simplified();
+ if (tmp.isEmpty())
+ return true;
+
if (!lastCharWasSpace)
if (fcis)
tmp = " " + tmp;
@@ -343,12 +346,14 @@
if (name == "center")
{
inCenter = false;
+ lastCharWasSpace = true;
writer->append("\n");
}
else if (name == "p")
{
+ inP = false;
+ lastCharWasSpace = true;
writer->append("\n");
- inP = false;
}
else if (name == "a")
{
@@ -432,36 +437,43 @@
{
inLI = false;
addedLI = false;
+ lastCharWasSpace = true;
writer->append("\n");
}
else if (name == "h1")
{
inH1 = false;
+ lastCharWasSpace = true;
writer->append("\n", pstyleh1);
}
else if (name == "h2")
{
inH2 = false;
+ lastCharWasSpace = true;
writer->append("\n", pstyleh2);
}
else if (name == "h3")
{
inH3 = false;
+ lastCharWasSpace = true;
writer->append("\n", pstyleh3);
}
else if (name == "h4")
{
inH4 = false;
+ lastCharWasSpace = true;
writer->append("\n", pstyleh4);
}
else if (name == "h5")
{
inH5 = false;
+ lastCharWasSpace = true;
writer->append("\n", pstyleh5);
}
else if (name == "h6")
{
inH6 = false;
+ lastCharWasSpace = true;
writer->append("\n", pstyleh6);
}
else if ((name == "b") || (name == "strong"))
@@ -475,6 +487,7 @@
else if (name == "pre")
{
inPre = false;
+ lastCharWasSpace = true;
writer->append("\n");
}
else if (name == "div")
More information about the scribus-commit
mailing list