[Libreoffice-commits] core.git: drawinglayer/source
Chris Sherlock
chris.sherlock79 at gmail.com
Sun Oct 1 19:11:41 UTC 2017
drawinglayer/source/tools/emfphelperdata.cxx | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
New commits:
commit d64dd40552bdcfe4fd2ab0d10f0c72796e579487
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Mon Oct 2 02:16:57 2017 +1100
drawinglayer: should be warning, not info SAL_LOG messages
We should warn if EMF+ record < 12 bytes. Similarly, if the
record size is less than 12 bytes, that's evidence of a
corrupted EMF+ record, same with if the length or datasize
is too long. Thus we should warn at this point.
Also - if an if statement is not part of another if/else block
then best to have a newline separating them so they don't
look like they are part of that block.
Change-Id: I914c754fe7437d6d4b6f2e4aec2d28475eaf5d70
Reviewed-on: https://gerrit.libreoffice.org/43004
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 419cd778f7be..2962193b9e5f 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -741,9 +741,7 @@ namespace emfplushelper
sal_uInt64 length = rMS.GetSize();
if (length < 12)
- {
- SAL_INFO("cppcanvas.emf", "length is less than required header size");
- }
+ SAL_WARN("cppcanvas.emf", "length is less than required header size");
// 12 is minimal valid EMF+ record size; remaining bytes are padding
while (length >= 12)
@@ -757,17 +755,12 @@ namespace emfplushelper
next = rMS.Tell() + (size - 12);
if (size < 12)
- {
- SAL_INFO("cppcanvas.emf", "Size field is less than 12 bytes");
- }
+ SAL_WARN("cppcanvas.emf", "Size field is less than 12 bytes");
else if (size > length)
- {
- SAL_INFO("cppcanvas.emf", "Size field is greater than bytes left");
- }
+ SAL_WARN("cppcanvas.emf", "Size field is greater than bytes left");
+
if (dataSize > (size - 12))
- {
- SAL_INFO("cppcanvas.emf", "DataSize field is greater than Size-12");
- }
+ SAL_WARN("cppcanvas.emf", "DataSize field is greater than Size-12");
SAL_INFO("cppcanvas.emf", "EMF+ record size: " << size << " type: " << emfTypeToName(type) << " flags: " << flags << " data size: " << dataSize);
More information about the Libreoffice-commits
mailing list