summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-17 07:47:09 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-09-17 08:53:52 +0200
commitd3e1d30ac7099584552ebf9c96dd21fdf7b1d9c9 (patch)
tree7fcdff4b36e54ce8fb8a167fc1c64793c62da0ab /filter
parente92fc5ec08563f3fdd0941008a2c97cef302afa0 (diff)
Some test-code simplifications, using starts/endsWith rest parameter
Change-Id: I3376ddc30e8ddc0e2dfc052ab47fe086108e015a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122221 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/qa/unit/svg.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx
index 4c37dac61548..e1b54fb2a294 100644
--- a/filter/qa/unit/svg.cxx
+++ b/filter/qa/unit/svg.cxx
@@ -117,11 +117,10 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentLine)
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
OUString aStyle = getXPath(
pXmlDoc, "//svg:g[@class='com.sun.star.drawing.LineShape']/svg:g/svg:g", "style");
- OUString aPrefix("opacity: ");
// Without the accompanying fix in place, this test would have failed, as the style was
// "mask:url(#mask1)", not "opacity: <value>".
- CPPUNIT_ASSERT(aStyle.startsWith(aPrefix));
- int nPercent = std::round(aStyle.copy(aPrefix.getLength()).toDouble() * 100);
+ CPPUNIT_ASSERT(aStyle.startsWith("opacity: ", &aStyle));
+ int nPercent = std::round(aStyle.toDouble() * 100);
// Make sure that the line is still 30% opaque, rather than completely invisible.
CPPUNIT_ASSERT_EQUAL(30, nPercent);
}