From a1570b6052ae9c9349282027c9007b071589bce6 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 28 Aug 2020 16:05:56 +0200 Subject: Make the OUString ConstCharArrayDetector::TypeUtf16 overloads are actually used 0c8fa58a2d73702770687ed15b98822d09f96ac3 "Support ConstCharArrayDetector also for UTF-16 arrays" had introduced those LIBO_INTERNAL_ONLY ctor and operator == overloads, but they never got called because the existing 'sal_Unicode const *' overloads always won. (The other function overloads introduced with 0c8fa58a2d73702770687ed15b98822d09f96ac3 should be unproblematic, as they do not have any 'sal_Unicode const *' overload counterparts.) Also fix the resulting loplugin:elidestringvar and loplugin:stringconstant fallout. For one, those plugins look at the actual ctor overloads being used, so had missed those cases that accidentally had used an unexpected overload. And for another, the heuristic the plugins used to detect the ConstCharArrayDetector overloads turned out to be too simplistic now and would have started to cause false positives. Change-Id: I4426890979fb832d53f391c7e1b62bc1ad501a65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101582 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/qa/cppunit/pdfexport/pdfexport.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 607d89f8b630..96dce4aff82a 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -1194,12 +1194,12 @@ void PdfExportTest::testTdf115117_2a() int nChars = FPDFText_CountChars(pPdfTextPage); CPPUNIT_ASSERT_EQUAL(13, nChars); - OUString aExpectedText = u"\u0627\u0644 \u0628\u0627\u0644 \u0648\u0642\u0641 \u0627\u0644"; std::vector aChars(nChars); for (int i = 0; i < nChars; i++) aChars[i] = FPDFText_GetUnicode(pPdfTextPage, i); OUString aActualText(aChars.data(), aChars.size()); - CPPUNIT_ASSERT_EQUAL(aExpectedText, aActualText); + CPPUNIT_ASSERT_EQUAL( + OUString(u"\u0627\u0644 \u0628\u0627\u0644 \u0648\u0642\u0641 \u0627\u0644"), aActualText); FPDFText_ClosePage(pPdfTextPage); #endif -- cgit