[Libreoffice-commits] core.git: cppcanvas/source
Chris Sherlock
chris.sherlock79 at gmail.com
Sun May 14 21:34:24 UTC 2017
cppcanvas/source/mtfrenderer/emfpfont.cxx | 2 +-
cppcanvas/source/mtfrenderer/emfplus.cxx | 2 +-
cppcanvas/source/mtfrenderer/emfpstringformat.cxx | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 8c0be54a7da6262dffe04357121814dd22b5d7fe
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sun May 14 22:22:21 2017 +1000
tdf#43157: convert cppcanvas module away from OSL_ASSERT
2nd attempt, this time I've decided makes more sense to just produce
a warning.
Change-Id: Iaf373a2d38e8f47266b00ea869de38a584788d45
Reviewed-on: https://gerrit.libreoffice.org/37598
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
diff --git a/cppcanvas/source/mtfrenderer/emfpfont.cxx b/cppcanvas/source/mtfrenderer/emfpfont.cxx
index 2df7981e6ab6..71ce93cdf4d1 100755
--- a/cppcanvas/source/mtfrenderer/emfpfont.cxx
+++ b/cppcanvas/source/mtfrenderer/emfpfont.cxx
@@ -51,7 +51,7 @@ namespace cppcanvas
s.ReadUInt32(header).ReadFloat(emSize).ReadUInt32(sizeUnit).ReadInt32(fontFlags).ReadUInt32(reserved).ReadUInt32(length);
- OSL_ASSERT((header >> 12) == 0xdbc01);
+ SAL_WARN_IF((header >> 12) != 0xdbc01, "cppcanvas.emf", "Invalid header - not 0xdbc01");
SAL_INFO("cppcanvas.emf", "EMF+\tfont\nEMF+\theader: 0x" << std::hex << (header >> 12) << " version: 0x" << (header & 0x1fff) << " size: " << std::dec << emSize << " unit: 0x" << std::hex << sizeUnit << std::dec);
SAL_INFO("cppcanvas.emf", "EMF+\tflags: 0x" << std::hex << fontFlags << " reserved: 0x" << reserved << " length: 0x" << std::hex << length << std::dec);
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index aea0aef58a95..8cfd1127540e 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -450,7 +450,7 @@ namespace cppcanvas
int length = aStartColor.getLength ();
uno::Sequence< double > aColor (length);
- OSL_ASSERT (length == aEndColor.getLength());
+ SAL_WARN_IF(length != aEndColor.getLength(), "cppcanvas.emf", "length != aEndColor.getLength()");
for (int i = 0; i < brush->blendPoints; i++) {
aStops[i] = brush->blendPositions [i];
diff --git a/cppcanvas/source/mtfrenderer/emfpstringformat.cxx b/cppcanvas/source/mtfrenderer/emfpstringformat.cxx
index 01bbb4aae874..a677be4c11c5 100755
--- a/cppcanvas/source/mtfrenderer/emfpstringformat.cxx
+++ b/cppcanvas/source/mtfrenderer/emfpstringformat.cxx
@@ -52,7 +52,7 @@ namespace cppcanvas
s.ReadFloat(firstTabOffset).ReadInt32(hotkeyPrefix).ReadFloat(leadingMargin).ReadFloat(trailingMargin).ReadFloat(tracking);
s.ReadInt32(trimming).ReadInt32(tabStopCount).ReadInt32(rangeCount);
- OSL_ASSERT((header >> 12) == 0xdbc01);
+ SAL_WARN_IF((header >> 12) != 0xdbc01, "cppcanvas.emf", "Invalid header - not 0xdbc01");
SAL_INFO("cppcanvas.emf", "EMF+\t string format\nEMF+\theader: 0x" << std::hex << (header >> 12) << " version: 0x" << (header & 0x1fff) << " StringFormatFlags: " << std::dec << stringFormatFlags << " Language: " << language);
SAL_INFO("cppcanvas.emf", "EMF+\t StringAlignment: " << stringAlignment << " LineAlign: " << lineAlign << " DigitSubstitution: " << digitSubstitution << " DigitLanguage: " << digitLanguage);
More information about the Libreoffice-commits
mailing list