summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-21 19:13:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-23 08:16:18 +0200
commitd254f8a926d7d3ec4565d01f7a41ad3d9d7c9e87 (patch)
tree6f33b99f7344c3861972760428fb974073130d8d /svtools
parent7c08c1af7116346f2dc0b669e231d82f4230a8c7 (diff)
loplugin:singlevalfields improve unaryoperator
when we see a unaryoperator, unless it's one of a small set, we can know (mostly) that the field will not be written. there is still a small risk of false+ with code taking references via conditional expressions. Change-Id: I96fa808067576a50e5eaf425338e225b4e0bdd4e Reviewed-on: https://gerrit.libreoffice.org/53263 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svhtml/HtmlWriter.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx
index 631a56e3e1f1..7414b40b15b5 100644
--- a/svtools/source/svhtml/HtmlWriter.cxx
+++ b/svtools/source/svhtml/HtmlWriter.cxx
@@ -14,7 +14,6 @@
HtmlWriter::HtmlWriter(SvStream& rStream, const OString& rNamespace) :
mrStream(rStream),
mbElementOpen(false),
- mbContentWritten(false),
mbCharactersWritten(false),
mbPrettyPrint(true)
{
@@ -38,9 +37,8 @@ void HtmlWriter::start(const OString& aElement)
if (mbElementOpen)
{
mrStream.WriteChar('>');
- if (!mbContentWritten && mbPrettyPrint)
+ if (mbPrettyPrint)
mrStream.WriteChar('\n');
- mbContentWritten = false;
}
maElementStack.push_back(aElement);
@@ -92,7 +90,7 @@ void HtmlWriter::end()
}
else
{
- if (!mbContentWritten && mbPrettyPrint)
+ if (mbPrettyPrint)
{
for(size_t i = 0; i < maElementStack.size() - 1; i++)
{
@@ -107,7 +105,6 @@ void HtmlWriter::end()
}
maElementStack.pop_back();
mbElementOpen = false;
- mbContentWritten = false;
mbCharactersWritten = false;
}