diff options
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/api/XGraphicTest.cxx | 8 | ||||
-rw-r--r-- | vcl/qa/cppunit/BitmapFilterTest.cxx | 19 | ||||
-rw-r--r-- | vcl/qa/cppunit/GraphicFormatDetectorTest.cxx | 40 | ||||
-rw-r--r-- | vcl/qa/cppunit/GraphicNativeMetadataTest.cxx | 18 | ||||
-rw-r--r-- | vcl/qa/cppunit/GraphicTest.cxx | 2 | ||||
-rw-r--r-- | vcl/qa/cppunit/PDFiumLibraryTest.cxx | 18 | ||||
-rw-r--r-- | vcl/qa/cppunit/VectorGraphicSearchTest.cxx | 16 | ||||
-rw-r--r-- | vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 14 | ||||
-rw-r--r-- | vcl/qa/cppunit/blocklistparsertest.cxx | 6 | ||||
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-test.cxx | 18 | ||||
-rw-r--r-- | vcl/qa/cppunit/jpeg/JpegReaderTest.cxx | 14 | ||||
-rw-r--r-- | vcl/qa/cppunit/jpeg/JpegWriterTest.cxx | 10 | ||||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 39 | ||||
-rw-r--r-- | vcl/qa/cppunit/png/PngFilterTest.cxx | 6 | ||||
-rw-r--r-- | vcl/qa/cppunit/svm/svmtest.cxx | 91 | ||||
-rw-r--r-- | vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx | 17 | ||||
-rw-r--r-- | vcl/qa/unit/vcl-dialogs-test.cxx | 2 |
17 files changed, 193 insertions, 145 deletions
diff --git a/vcl/qa/api/XGraphicTest.cxx b/vcl/qa/api/XGraphicTest.cxx index 3694e52ce38f..2dfe4f132346 100644 --- a/vcl/qa/api/XGraphicTest.cxx +++ b/vcl/qa/api/XGraphicTest.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include <test/bootstrapfixture.hxx> #include <com/sun/star/graphic/XGraphic.hpp> @@ -32,7 +36,7 @@ public: { } - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(gaDataUrl) + sFileName; } @@ -113,7 +117,7 @@ void XGraphicTest::testGraphicDescriptor() void XGraphicTest::testGraphicProvider() { - OUString aGraphicURL = getFullUrl("TestGraphic.png"); + OUString aGraphicURL = getFullUrl(u"TestGraphic.png"); { // Load lazy uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); diff --git a/vcl/qa/cppunit/BitmapFilterTest.cxx b/vcl/qa/cppunit/BitmapFilterTest.cxx index 4a697150c4e5..09831169e656 100644 --- a/vcl/qa/cppunit/BitmapFilterTest.cxx +++ b/vcl/qa/cppunit/BitmapFilterTest.cxx @@ -20,6 +20,7 @@ #include <BitmapSymmetryCheck.hxx> #include <chrono> +#include <string_view> namespace { @@ -47,12 +48,12 @@ public: CPPUNIT_TEST_SUITE_END(); private: - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { - return m_directories.getURLFromSrc("vcl/qa/cppunit/data/") + sFileName; + return m_directories.getURLFromSrc(u"vcl/qa/cppunit/data/") + sFileName; } - BitmapEx loadBitmap(const OUString& sFileName) + BitmapEx loadBitmap(std::u16string_view sFileName) { Graphic aGraphic; const OUString aURL(getFullUrl(sFileName)); @@ -136,11 +137,13 @@ void BitmapFilterTest::testBlurCorrectness() void BitmapFilterTest::testBasicMorphology() { - const BitmapEx aOrigBitmap = loadBitmap("testBasicMorphology.png"); - const BitmapEx aRefBitmapDilated1 = loadBitmap("testBasicMorphologyDilated1.png"); - const BitmapEx aRefBitmapDilated1Eroded1 = loadBitmap("testBasicMorphologyDilated1Eroded1.png"); - const BitmapEx aRefBitmapDilated2 = loadBitmap("testBasicMorphologyDilated2.png"); - const BitmapEx aRefBitmapDilated2Eroded1 = loadBitmap("testBasicMorphologyDilated2Eroded1.png"); + const BitmapEx aOrigBitmap = loadBitmap(u"testBasicMorphology.png"); + const BitmapEx aRefBitmapDilated1 = loadBitmap(u"testBasicMorphologyDilated1.png"); + const BitmapEx aRefBitmapDilated1Eroded1 + = loadBitmap(u"testBasicMorphologyDilated1Eroded1.png"); + const BitmapEx aRefBitmapDilated2 = loadBitmap(u"testBasicMorphologyDilated2.png"); + const BitmapEx aRefBitmapDilated2Eroded1 + = loadBitmap(u"testBasicMorphologyDilated2Eroded1.png"); BitmapEx aTransformBitmap = aOrigBitmap; BitmapFilter::Filter(aTransformBitmap, BitmapDilateFilter(1)); diff --git a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx index 1ce516bf52b3..f4f4698b28a9 100644 --- a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx +++ b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include <cppunit/TestAssert.h> #include <cppunit/extensions/HelperMacros.h> #include <unotest/bootstrapfixturebase.hxx> @@ -22,9 +26,9 @@ namespace { class GraphicFormatDetectorTest : public test::BootstrapFixtureBase { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { - return m_directories.getURLFromSrc("/vcl/qa/cppunit/data/") + sFileName; + return m_directories.getURLFromSrc(u"/vcl/qa/cppunit/data/") + sFileName; } void testDetectMET(); @@ -70,7 +74,7 @@ class GraphicFormatDetectorTest : public test::BootstrapFixtureBase void GraphicFormatDetectorTest::testDetectMET() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.met"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.met"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "MET"); CPPUNIT_ASSERT(aDetector.detect()); @@ -85,7 +89,7 @@ void GraphicFormatDetectorTest::testDetectMET() void GraphicFormatDetectorTest::testDetectBMP() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.bmp"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.bmp"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "BMP"); CPPUNIT_ASSERT(aDetector.detect()); @@ -100,7 +104,7 @@ void GraphicFormatDetectorTest::testDetectBMP() void GraphicFormatDetectorTest::testDetectWMF() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.wmf"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.wmf"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "WMF"); CPPUNIT_ASSERT(aDetector.detect()); @@ -115,7 +119,7 @@ void GraphicFormatDetectorTest::testDetectWMF() void GraphicFormatDetectorTest::testDetectPCX() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.pcx"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.pcx"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "PCX"); CPPUNIT_ASSERT(aDetector.detect()); @@ -130,7 +134,7 @@ void GraphicFormatDetectorTest::testDetectPCX() void GraphicFormatDetectorTest::testDetectJPG() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.jpg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.jpg"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "JPG"); CPPUNIT_ASSERT(aDetector.detect()); @@ -145,7 +149,7 @@ void GraphicFormatDetectorTest::testDetectJPG() void GraphicFormatDetectorTest::testDetectPNG() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.png"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.png"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "PNG"); CPPUNIT_ASSERT(aDetector.detect()); @@ -160,7 +164,7 @@ void GraphicFormatDetectorTest::testDetectPNG() void GraphicFormatDetectorTest::testDetectGIF() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.gif"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.gif"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "GIF"); CPPUNIT_ASSERT(aDetector.detect()); @@ -175,7 +179,7 @@ void GraphicFormatDetectorTest::testDetectGIF() void GraphicFormatDetectorTest::testDetectPSD() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.psd"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.psd"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "PSD"); CPPUNIT_ASSERT(aDetector.detect()); @@ -190,7 +194,7 @@ void GraphicFormatDetectorTest::testDetectPSD() void GraphicFormatDetectorTest::testDetectTGA() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.tga"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.tga"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "TGA"); CPPUNIT_ASSERT(aDetector.detect()); @@ -205,7 +209,7 @@ void GraphicFormatDetectorTest::testDetectTGA() void GraphicFormatDetectorTest::testDetectTIF() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.tif"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.tif"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "TIF"); CPPUNIT_ASSERT(aDetector.detect()); @@ -220,7 +224,7 @@ void GraphicFormatDetectorTest::testDetectTIF() void GraphicFormatDetectorTest::testDetectXBM() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.xbm"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.xbm"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "XBM"); CPPUNIT_ASSERT(aDetector.detect()); @@ -235,7 +239,7 @@ void GraphicFormatDetectorTest::testDetectXBM() void GraphicFormatDetectorTest::testDetectXPM() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.xpm"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.xpm"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "XPM"); CPPUNIT_ASSERT(aDetector.detect()); @@ -250,7 +254,7 @@ void GraphicFormatDetectorTest::testDetectXPM() void GraphicFormatDetectorTest::testDetectSVG() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.svg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.svg"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "SVG"); CPPUNIT_ASSERT(aDetector.detect()); @@ -265,7 +269,7 @@ void GraphicFormatDetectorTest::testDetectSVG() void GraphicFormatDetectorTest::testDetectSVGZ() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.svgz"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.svgz"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "SVG"); CPPUNIT_ASSERT(aDetector.detect()); @@ -280,7 +284,7 @@ void GraphicFormatDetectorTest::testDetectSVGZ() void GraphicFormatDetectorTest::testDetectPDF() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.pdf"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.pdf"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "PDF"); CPPUNIT_ASSERT(aDetector.detect()); @@ -295,7 +299,7 @@ void GraphicFormatDetectorTest::testDetectPDF() void GraphicFormatDetectorTest::testDetectEPS() { - SvFileStream aFileStream(getFullUrl("TypeDetectionExample.eps"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.eps"), StreamMode::READ); vcl::GraphicFormatDetector aDetector(aFileStream, "EPS"); CPPUNIT_ASSERT(aDetector.detect()); diff --git a/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx b/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx index 42683a1a3f06..49bf55fa9f4d 100644 --- a/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx +++ b/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include <cppunit/TestAssert.h> #include <cppunit/extensions/HelperMacros.h> #include <unotest/bootstrapfixturebase.hxx> @@ -21,9 +25,9 @@ namespace { class GraphicNativeMetadataTest : public test::BootstrapFixtureBase { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { - return m_directories.getURLFromSrc("/vcl/qa/cppunit/data/") + sFileName; + return m_directories.getURLFromSrc(u"/vcl/qa/cppunit/data/") + sFileName; } void testReadFromGraphic(); @@ -37,7 +41,7 @@ class GraphicNativeMetadataTest : public test::BootstrapFixtureBase void GraphicNativeMetadataTest::testReadFromGraphic() { - SvFileStream aFileStream(getFullUrl("Exif1_180.jpg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"Exif1_180.jpg"), StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); // don't load the graphic, but try to get the metadata @@ -66,28 +70,28 @@ void GraphicNativeMetadataTest::testExifRotationJpeg() { { // No rotation in metadata - SvFileStream aFileStream(getFullUrl("Exif1.jpg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"Exif1.jpg"), StreamMode::READ); GraphicNativeMetadata aMetadata; aMetadata.read(aFileStream); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), aMetadata.getRotation().get()); } { // Rotation 90 degree clock-wise = 270 degree counter-clock-wise - SvFileStream aFileStream(getFullUrl("Exif1_090CW.jpg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"Exif1_090CW.jpg"), StreamMode::READ); GraphicNativeMetadata aMetadata; aMetadata.read(aFileStream); CPPUNIT_ASSERT_EQUAL(sal_Int16(2700), aMetadata.getRotation().get()); } { // Rotation 180 degree - SvFileStream aFileStream(getFullUrl("Exif1_180.jpg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"Exif1_180.jpg"), StreamMode::READ); GraphicNativeMetadata aMetadata; aMetadata.read(aFileStream); CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), aMetadata.getRotation().get()); } { // Rotation 270 degree clock-wise = 90 degree counter-clock-wise - SvFileStream aFileStream(getFullUrl("Exif1_270CW.jpg"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"Exif1_270CW.jpg"), StreamMode::READ); GraphicNativeMetadata aMetadata; aMetadata.read(aFileStream); CPPUNIT_ASSERT_EQUAL(sal_Int16(900), aMetadata.getRotation().get()); diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index 538995ff5dd2..b1f6b77ef5c2 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -338,7 +338,7 @@ void GraphicTest::testWMFRoundtrip() { // Load a WMF file. test::Directories aDirectories; - OUString aURL = aDirectories.getURLFromSrc("vcl/qa/cppunit/data/roundtrip.wmf"); + OUString aURL = aDirectories.getURLFromSrc(u"vcl/qa/cppunit/data/roundtrip.wmf"); SvFileStream aStream(aURL, StreamMode::READ); sal_uInt64 nExpectedSize = aStream.TellEnd(); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); diff --git a/vcl/qa/cppunit/PDFiumLibraryTest.cxx b/vcl/qa/cppunit/PDFiumLibraryTest.cxx index 577f73ed1130..88bbf9978da2 100644 --- a/vcl/qa/cppunit/PDFiumLibraryTest.cxx +++ b/vcl/qa/cppunit/PDFiumLibraryTest.cxx @@ -11,6 +11,8 @@ #if HAVE_FEATURE_PDFIUM +#include <string_view> + #include <cppunit/TestAssert.h> #include <cppunit/extensions/HelperMacros.h> @@ -28,9 +30,9 @@ class PDFiumLibraryTest : public test::BootstrapFixtureBase { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { - return m_directories.getURLFromSrc("/vcl/qa/cppunit/data/") + sFileName; + return m_directories.getURLFromSrc(u"/vcl/qa/cppunit/data/") + sFileName; } void testDocument(); @@ -54,7 +56,7 @@ class PDFiumLibraryTest : public test::BootstrapFixtureBase void PDFiumLibraryTest::testDocument() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -82,7 +84,7 @@ void PDFiumLibraryTest::testDocument() void PDFiumLibraryTest::testPages() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -108,7 +110,7 @@ void PDFiumLibraryTest::testPages() void PDFiumLibraryTest::testPageObjects() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -158,7 +160,7 @@ void PDFiumLibraryTest::testPageObjects() void PDFiumLibraryTest::testAnnotationsMadeInEvince() { - OUString aURL = getFullUrl("PangramWithAnnotations.pdf"); + OUString aURL = getFullUrl(u"PangramWithAnnotations.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -215,7 +217,7 @@ void PDFiumLibraryTest::testAnnotationsMadeInEvince() void PDFiumLibraryTest::testAnnotationsMadeInAcrobat() { - OUString aURL = getFullUrl("PangramAcrobatAnnotations.pdf"); + OUString aURL = getFullUrl(u"PangramAcrobatAnnotations.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -293,7 +295,7 @@ void PDFiumLibraryTest::testAnnotationsMadeInAcrobat() void PDFiumLibraryTest::testAnnotationsDifferentTypes() { - OUString aURL = getFullUrl("PangramWithMultipleTypeOfAnnotations.pdf"); + OUString aURL = getFullUrl(u"PangramWithMultipleTypeOfAnnotations.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx index 0659e4e62dcf..e539c5a81636 100644 --- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx +++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx @@ -11,6 +11,8 @@ #if HAVE_FEATURE_PDFIUM +#include <string_view> + #include <cppunit/TestAssert.h> #include <cppunit/extensions/HelperMacros.h> @@ -24,9 +26,9 @@ class VectorGraphicSearchTest : public test::BootstrapFixtureBase { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { - return m_directories.getURLFromSrc("/vcl/qa/cppunit/data/") + sFileName; + return m_directories.getURLFromSrc(u"/vcl/qa/cppunit/data/") + sFileName; } void test(); @@ -46,7 +48,7 @@ class VectorGraphicSearchTest : public test::BootstrapFixtureBase void VectorGraphicSearchTest::test() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -97,7 +99,7 @@ void VectorGraphicSearchTest::test() // between search matches. void VectorGraphicSearchTest::testNextPrevious() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -173,7 +175,7 @@ void VectorGraphicSearchTest::testNextPrevious() void VectorGraphicSearchTest::testSearchStringChange() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -204,7 +206,7 @@ void VectorGraphicSearchTest::testSearchStringChange() void VectorGraphicSearchTest::testSearchMatchWholeWord() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); @@ -243,7 +245,7 @@ void VectorGraphicSearchTest::testSearchMatchWholeWord() void VectorGraphicSearchTest::testSearchMatchCase() { - OUString aURL = getFullUrl("Pangram.pdf"); + OUString aURL = getFullUrl(u"Pangram.pdf"); SvFileStream aStream(aURL, StreamMode::READ); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx index 10e6f82fc219..201d10e56fd3 100644 --- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx +++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include <test/bootstrapfixture.hxx> #include <vcl/virdev.hxx> @@ -25,7 +29,7 @@ constexpr OUStringLiteral gaDataUrl = u"/vcl/qa/cppunit/bitmaprender/data/"; class BitmapRenderTest : public test::BootstrapFixture { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(gaDataUrl) + sFileName; } @@ -62,7 +66,7 @@ void BitmapRenderTest::testTdf104141() // Load animated GIF and draw it on green background GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic; - const OUString aURL(getFullUrl("tdf104141.gif")); + const OUString aURL(getFullUrl(u"tdf104141.gif")); SvFileStream aFileStream(aURL, StreamMode::READ); ErrCode bResult = rFilter.ImportGraphic(aGraphic, aURL, aFileStream); CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult); @@ -85,7 +89,7 @@ void BitmapRenderTest::testTdf113918() GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic; - const OUString aURL(getFullUrl("tdf113918.png")); + const OUString aURL(getFullUrl(u"tdf113918.png")); SvFileStream aFileStream(aURL, StreamMode::READ); ErrCode bResult = rFilter.ImportGraphic(aGraphic, aURL, aFileStream); CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult); @@ -128,7 +132,7 @@ void BitmapRenderTest::testDrawAlphaBitmapEx() CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(1, 1))); CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(2, 2))); - SvFileStream aFileStream(getFullUrl("ImageRGBA.png"), StreamMode::READ); + SvFileStream aFileStream(getFullUrl(u"ImageRGBA.png"), StreamMode::READ); vcl::PngImageReader aPngReader(aFileStream); BitmapEx aBitmapEx; @@ -238,7 +242,7 @@ void BitmapRenderTest::testTdf116888() // didn't properly release mpUserBuffer after ReadTexture() failure. GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); Graphic aGraphic; - const OUString aURL(getFullUrl("tdf116888.gif")); + const OUString aURL(getFullUrl(u"tdf116888.gif")); SvFileStream aFileStream(aURL, StreamMode::READ); ErrCode bResult = rFilter.ImportGraphic(aGraphic, aURL, aFileStream); CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult); diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx index 0c221ba776a8..689e8d9c9e24 100644 --- a/vcl/qa/cppunit/blocklistparsertest.cxx +++ b/vcl/qa/cppunit/blocklistparsertest.cxx @@ -40,7 +40,7 @@ void BlocklistParserTest::testParse() { std::vector<DriverInfo> aDriveInfos; - Parser aBlocklistParser(m_directories.getURLFromSrc("vcl/qa/cppunit/") + "test_blocklist_parse.xml", + Parser aBlocklistParser(m_directories.getURLFromSrc(u"vcl/qa/cppunit/") + "test_blocklist_parse.xml", aDriveInfos, VersionType::OpenGL); aBlocklistParser.parse(); @@ -98,7 +98,7 @@ void BlocklistParserTest::testEvaluate() { std::vector<DriverInfo> aDriveInfos; - Parser aBlocklistParser(m_directories.getURLFromSrc("vcl/qa/cppunit/") + "test_blocklist_evaluate.xml", + Parser aBlocklistParser(m_directories.getURLFromSrc(u"vcl/qa/cppunit/") + "test_blocklist_evaluate.xml", aDriveInfos, VersionType::OpenGL); aBlocklistParser.parse(); @@ -150,7 +150,7 @@ void BlocklistParserTest::testVulkan() { std::vector<DriverInfo> aDriveInfos; - Parser aBlocklistParser(m_directories.getURLFromSrc("vcl/qa/cppunit/") + "test_blocklist_vulkan.xml", + Parser aBlocklistParser(m_directories.getURLFromSrc(u"vcl/qa/cppunit/") + "test_blocklist_vulkan.xml", aDriveInfos, VersionType::Vulkan); aBlocklistParser.parse(); diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index fe7485e3944a..5a4443f1075a 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -150,31 +150,31 @@ void VclFiltersTest::testCVEs() { #ifndef DISABLE_CVE_TESTS testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/wmf/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/wmf/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/emf/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/emf/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/png/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/png/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/jpg/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/jpg/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/gif/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/gif/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/bmp/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/bmp/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/xbm/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/xbm/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/xpm/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/xpm/")); testDir(OUString(), - m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/svm/")); + m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/svm/")); #endif } diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index 2ed23db8dbeb..0900c02d4bb5 100644 --- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx @@ -8,6 +8,10 @@ * */ +#include <sal/config.h> + +#include <string_view> + #include <unotest/bootstrapfixturebase.hxx> #include <vcl/graphicfilter.hxx> #include <bitmap/BitmapWriteAccess.hxx> @@ -17,7 +21,7 @@ constexpr OUStringLiteral gaDataUrl(u"/vcl/qa/cppunit/jpeg/data/"); class JpegReaderTest : public test::BootstrapFixtureBase { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(gaDataUrl) + sFileName; } @@ -112,7 +116,7 @@ Graphic JpegReaderTest::loadJPG(const OUString& aURL) void JpegReaderTest::testReadRGB() { - Graphic aGraphic = loadJPG(getFullUrl("JPEGTestRGB.jpeg")); + Graphic aGraphic = loadJPG(getFullUrl(u"JPEGTestRGB.jpeg")); Bitmap aBitmap = aGraphic.GetBitmapEx().GetBitmap(); Size aSize = aBitmap.GetSizePixel(); CPPUNIT_ASSERT_EQUAL(tools::Long(12), aSize.Width()); @@ -129,7 +133,7 @@ void JpegReaderTest::testReadRGB() void JpegReaderTest::testReadGray() { - Graphic aGraphic = loadJPG(getFullUrl("JPEGTestGray.jpeg")); + Graphic aGraphic = loadJPG(getFullUrl(u"JPEGTestGray.jpeg")); Bitmap aBitmap = aGraphic.GetBitmapEx().GetBitmap(); Size aSize = aBitmap.GetSizePixel(); CPPUNIT_ASSERT_EQUAL(tools::Long(12), aSize.Width()); @@ -149,7 +153,7 @@ void JpegReaderTest::testReadGray() void JpegReaderTest::testReadCMYK() { - Graphic aGraphic = loadJPG(getFullUrl("JPEGTestCMYK.jpeg")); + Graphic aGraphic = loadJPG(getFullUrl(u"JPEGTestCMYK.jpeg")); Bitmap aBitmap = aGraphic.GetBitmapEx().GetBitmap(); Size aSize = aBitmap.GetSizePixel(); CPPUNIT_ASSERT_EQUAL(tools::Long(12), aSize.Width()); @@ -166,7 +170,7 @@ void JpegReaderTest::testReadCMYK() void JpegReaderTest::testTdf138950() { - Graphic aGraphic = loadJPG(getFullUrl("tdf138950.jpeg")); + Graphic aGraphic = loadJPG(getFullUrl(u"tdf138950.jpeg")); Bitmap aBitmap = aGraphic.GetBitmapEx().GetBitmap(); Size aSize = aBitmap.GetSizePixel(); CPPUNIT_ASSERT_EQUAL(tools::Long(720), aSize.Width()); diff --git a/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx b/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx index 234b2ea14514..b2144fe3b47e 100644 --- a/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx @@ -8,6 +8,10 @@ * */ +#include <sal/config.h> + +#include <string_view> + #include <unotest/bootstrapfixturebase.hxx> #include <vcl/graphicfilter.hxx> #include <vcl/BitmapReadAccess.hxx> @@ -17,7 +21,7 @@ constexpr OUStringLiteral gaDataUrl(u"/vcl/qa/cppunit/jpeg/data/"); class JpegWriterTest : public test::BootstrapFixtureBase { - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(gaDataUrl) + sFileName; } @@ -66,7 +70,7 @@ BitmapEx JpegWriterTest::roundtripJPG(const BitmapEx& bitmap) void JpegWriterTest::testWrite8BitGrayscale() { - Bitmap bitmap = roundtripJPG(getFullUrl("8BitGrayscale.jpg")).GetBitmap(); + Bitmap bitmap = roundtripJPG(getFullUrl(u"8BitGrayscale.jpg")).GetBitmap(); Bitmap::ScopedReadAccess access(bitmap); const ScanlineFormat format = access->GetScanlineFormat(); // Check that it's still 8bit grayscale. @@ -82,7 +86,7 @@ void JpegWriterTest::testWrite8BitGrayscale() void JpegWriterTest::testWrite8BitNonGrayscale() { - Bitmap bitmap = roundtripJPG(getFullUrl("8BitNonGrayscale.gif")).GetBitmap(); + Bitmap bitmap = roundtripJPG(getFullUrl(u"8BitNonGrayscale.gif")).GetBitmap(); Bitmap::ScopedReadAccess access(bitmap); const ScanlineFormat format = access->GetScanlineFormat(); // Check that it's still 8bit grayscale. diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 255a82553dfb..0236a6e73e5d 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -10,6 +10,7 @@ #include <sal/config.h> #include <memory> +#include <string_view> #include <type_traits> #include <config_features.h> @@ -72,8 +73,8 @@ public: PdfExportTest(); virtual void setUp() override; virtual void tearDown() override; - void saveAsPDF(const OUString& rFile); - void load(const OUString& rFile, vcl::filter::PDFDocument& rDocument); + void saveAsPDF(std::u16string_view rFile); + void load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument); }; PdfExportTest::PdfExportTest() { maTempFile.EnableKillingFile(); } @@ -117,7 +118,7 @@ void PdfExportTest::tearDown() OUStringLiteral const DATA_DIRECTORY = u"/vcl/qa/cppunit/pdfexport/data/"; -void PdfExportTest::saveAsPDF(const OUString& rFile) +void PdfExportTest::saveAsPDF(std::u16string_view rFile) { // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + rFile; @@ -130,7 +131,7 @@ void PdfExportTest::saveAsPDF(const OUString& rFile) xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); } -void PdfExportTest::load(const OUString& rFile, vcl::filter::PDFDocument& rDocument) +void PdfExportTest::load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument) { saveAsPDF(rFile); @@ -184,7 +185,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106059) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106693) { vcl::filter::PDFDocument aDocument; - load("tdf106693.odt", aDocument); + load(u"tdf106693.odt", aDocument); // Assert that the XObject in the page resources dictionary is a form XObject. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -328,7 +329,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107868) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105093) { vcl::filter::PDFDocument aDocument; - load("tdf105093.odp", aDocument); + load(u"tdf105093.odp", aDocument); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -602,7 +603,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testSofthyphenPos) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107013) { vcl::filter::PDFDocument aDocument; - load("tdf107013.odt", aDocument); + load(u"tdf107013.odt", aDocument); // Get access to the only image on the only page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -622,7 +623,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107013) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107018) { vcl::filter::PDFDocument aDocument; - load("tdf107018.odt", aDocument); + load(u"tdf107018.odt", aDocument); // Get access to the only image on the only page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -677,7 +678,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107018) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107089) { vcl::filter::PDFDocument aDocument; - load("tdf107089.odt", aDocument); + load(u"tdf107089.odt", aDocument); // Get access to the only image on the only page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -724,7 +725,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107089) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf99680) { vcl::filter::PDFDocument aDocument; - load("tdf99680.odt", aDocument); + load(u"tdf99680.odt", aDocument); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -765,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf99680) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf99680_2) { vcl::filter::PDFDocument aDocument; - load("tdf99680-2.odt", aDocument); + load(u"tdf99680-2.odt", aDocument); // For each document page std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -901,7 +902,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf108963) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf118244_radioButtonGroup) { vcl::filter::PDFDocument aDocument; - load("tdf118244_radioButtonGroup.odt", aDocument); + load(u"tdf118244_radioButtonGroup.odt", aDocument); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); @@ -943,7 +944,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115117_1) { #if HAVE_MORE_FONTS vcl::filter::PDFDocument aDocument; - load("tdf115117-1.odt", aDocument); + load(u"tdf115117-1.odt", aDocument); vcl::filter::PDFObjectElement* pToUnicode = nullptr; @@ -1010,7 +1011,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115117_2) // See the comments in testTdf115117_1() for explanation. vcl::filter::PDFDocument aDocument; - load("tdf115117-2.odt", aDocument); + load(u"tdf115117-2.odt", aDocument); vcl::filter::PDFObjectElement* pToUnicode = nullptr; @@ -1152,7 +1153,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_1) #if HAVE_MORE_FONTS // This requires Amiri font, if it is missing the test will fail. vcl::filter::PDFDocument aDocument; - load("tdf66597-1.odt", aDocument); + load(u"tdf66597-1.odt", aDocument); { // Get access to ToUnicode of the first font @@ -1249,7 +1250,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_2) { #if HAVE_MORE_FONTS vcl::filter::PDFDocument aDocument; - load("tdf66597-2.odt", aDocument); + load(u"tdf66597-2.odt", aDocument); { // Get access to ToUnicode of the first font @@ -1352,7 +1353,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_3) { #if HAVE_MORE_FONTS vcl::filter::PDFDocument aDocument; - load("tdf66597-3.odt", aDocument); + load(u"tdf66597-3.odt", aDocument); { // Get access to ToUnicode of the first font @@ -1620,7 +1621,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf113143) CPPUNIT_TEST_FIXTURE(PdfExportTest, testForcePoint71) { // I just care it doesn't crash - saveAsPDF("forcepoint71.key"); + saveAsPDF(u"forcepoint71.key"); } CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115262) @@ -1719,7 +1720,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115967) CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf121615) { vcl::filter::PDFDocument aDocument; - load("tdf121615.odt", aDocument); + load(u"tdf121615.odt", aDocument); // The document has one page. std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); diff --git a/vcl/qa/cppunit/png/PngFilterTest.cxx b/vcl/qa/cppunit/png/PngFilterTest.cxx index d0d356f23702..42a25652134f 100644 --- a/vcl/qa/cppunit/png/PngFilterTest.cxx +++ b/vcl/qa/cppunit/png/PngFilterTest.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <test/bootstrapfixture.hxx> #include <tools/stream.hxx> #include <vcl/filter/PngImageReader.hxx> @@ -29,7 +33,7 @@ class PngFilterTest : public test::BootstrapFixture { OUString maDataUrl; - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(maDataUrl) + sFileName; } diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 4460811ca306..f8a4c0a96734 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -8,6 +8,10 @@ * */ +#include <sal/config.h> + +#include <string_view> + #include <test/bootstrapfixture.hxx> #include <test/xmltesttools.hxx> #include <vcl/gdimtf.hxx> @@ -28,7 +32,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools { OUString maDataUrl; - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(maDataUrl) + sFileName; } @@ -37,11 +41,12 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools // write GDI Metafile to a file in data directory // only use this for new tests to create the svm file - void writeToFile(GDIMetaFile& rMetaFile, OUString const & rName); + void writeToFile(GDIMetaFile& rMetaFile, std::u16string_view rName); - GDIMetaFile writeAndReadStream(GDIMetaFile& rMetaFile, OUString const & rName = OUString()); + GDIMetaFile writeAndReadStream( + GDIMetaFile& rMetaFile, std::u16string_view rName = std::u16string_view()); - GDIMetaFile readFile(const OUString& sName); + GDIMetaFile readFile(std::u16string_view sName); xmlDocUniquePtr dumpMeta(const GDIMetaFile& rMetaFile); @@ -298,17 +303,17 @@ static void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) aFileStream.Close(); } -void SvmTest::writeToFile(GDIMetaFile& rMetaFile, OUString const & rName) +void SvmTest::writeToFile(GDIMetaFile& rMetaFile, std::u16string_view rName) { - if (rName.isEmpty()) + if (rName.empty()) return; OUString sFilePath = getFullUrl(rName); writeMetaFile(rMetaFile, sFilePath); } -GDIMetaFile SvmTest::writeAndReadStream(GDIMetaFile& rMetaFile, OUString const & rName) +GDIMetaFile SvmTest::writeAndReadStream(GDIMetaFile& rMetaFile, std::u16string_view rName) { - if (!rName.isEmpty()) + if (!rName.empty()) writeToFile(rMetaFile, rName); SvMemoryStream aStream; @@ -320,7 +325,7 @@ GDIMetaFile SvmTest::writeAndReadStream(GDIMetaFile& rMetaFile, OUString const & return aResultMetafile; } -GDIMetaFile SvmTest::readFile(const OUString& sName) +GDIMetaFile SvmTest::readFile(std::u16string_view sName) { OUString sFilePath = getFullUrl(sName); return readMetafile(sFilePath); @@ -386,7 +391,7 @@ void SvmTest::testPixel() pVirtualDev->DrawPixel(Point(1, 8), COL_BLUE); checkPixel(writeAndReadStream(aGDIMetaFile)); - checkPixel(readFile("pixel.svm")); + checkPixel(readFile(u"pixel.svm")); } void SvmTest::checkPoint(const GDIMetaFile& rMetaFile) @@ -407,7 +412,7 @@ void SvmTest::testPoint() pVirtualDev->DrawPixel(Point(4, 4)); checkPoint(writeAndReadStream(aGDIMetaFile)); - checkPoint(readFile("point.svm")); + checkPoint(readFile(u"point.svm")); } void SvmTest::checkLine(const GDIMetaFile& rMetaFile) @@ -459,7 +464,7 @@ void SvmTest::testLine() pVirtualDev->DrawLine(Point(1, 8), Point(8, 1), aLineInfo); checkLine(writeAndReadStream(aGDIMetaFile)); - checkLine(readFile("line.svm")); + checkLine(readFile(u"line.svm")); } void SvmTest::checkRect(const GDIMetaFile& rMetaFile) @@ -488,7 +493,7 @@ void SvmTest::testRect() pVirtualDev->DrawRect(tools::Rectangle(Point(1, 2), Size(4, 4))); checkRect(writeAndReadStream(aGDIMetaFile)); - checkRect(readFile("rect.svm")); + checkRect(readFile(u"rect.svm")); } void SvmTest::checkRoundRect(const GDIMetaFile& rMetaFile) @@ -517,7 +522,7 @@ void SvmTest::testRoundRect() pVirtualDev->DrawRect(tools::Rectangle(Point(1, 2), Size(4, 4)), 1, 2); checkRoundRect(writeAndReadStream(aGDIMetaFile)); - checkRoundRect(readFile("roundrect.svm")); + checkRoundRect(readFile(u"roundrect.svm")); } void SvmTest::checkEllipse(const GDIMetaFile& rMetaFile) @@ -545,7 +550,7 @@ void SvmTest::testEllipse() pVirtualDev->DrawEllipse(tools::Rectangle(Point(1, 2), Size(4, 4))); checkEllipse(writeAndReadStream(aGDIMetaFile)); - checkEllipse(readFile("ellipse.svm")); + checkEllipse(readFile(u"ellipse.svm")); } void SvmTest::checkArc(const GDIMetaFile& rMetaFile) @@ -576,7 +581,7 @@ void SvmTest::testArc() pVirtualDev->DrawArc(tools::Rectangle(Point(1, 2), Size(4, 4)), Point(10, 11), Point(12, 13)); checkArc(writeAndReadStream(aGDIMetaFile)); - checkArc(readFile("arc.svm")); + checkArc(readFile(u"arc.svm")); } void SvmTest::checkPie(const GDIMetaFile& rMetaFile) @@ -607,7 +612,7 @@ void SvmTest::testPie() pVirtualDev->DrawPie(tools::Rectangle(Point(11, 12), Size(4, 4)), Point(20, 21), Point(22, 23)); checkPie(writeAndReadStream(aGDIMetaFile)); - checkPie(readFile("pie.svm")); + checkPie(readFile(u"pie.svm")); } void SvmTest::checkChord(const GDIMetaFile& rMetaFile) @@ -638,7 +643,7 @@ void SvmTest::testChord() pVirtualDev->DrawChord(tools::Rectangle(Point(21, 22), Size(4, 4)), Point(30, 31), Point(32, 33)); checkChord(writeAndReadStream(aGDIMetaFile)); - checkChord(readFile("chord.svm")); + checkChord(readFile(u"chord.svm")); } void SvmTest::checkPolyLine(const GDIMetaFile& rMetaFile) @@ -706,7 +711,7 @@ void SvmTest::testPolyLine() pVirtualDev->DrawPolyLine(aPolygonWithControl, aLineInfo); checkPolyLine(writeAndReadStream(aGDIMetaFile)); - checkPolyLine(readFile("polyline.svm")); + checkPolyLine(readFile(u"polyline.svm")); } void SvmTest::checkPolygon(const GDIMetaFile& rMetaFile) @@ -750,7 +755,7 @@ void SvmTest::testPolygon() pVirtualDev->DrawPolygon(aPolygonWithControl); checkPolygon(writeAndReadStream(aGDIMetaFile)); - checkPolygon(readFile("polygon.svm")); + checkPolygon(readFile(u"polygon.svm")); } void SvmTest::checkPolyPolygon(const GDIMetaFile& rMetaFile) @@ -796,7 +801,7 @@ void SvmTest::testPolyPolygon() pVirtualDev->DrawPolyPolygon(aPolyPolygon); checkPolyPolygon(writeAndReadStream(aGDIMetaFile)); - checkPolyPolygon(readFile("polypolygon.svm")); + checkPolyPolygon(readFile(u"polypolygon.svm")); } void SvmTest::checkText(const GDIMetaFile& rMetaFile) @@ -819,7 +824,7 @@ void SvmTest::testText() pVirtualDev->DrawText(Point(4,6), "xABC", 1, 2); checkText(writeAndReadStream(aGDIMetaFile)); - checkText(readFile("text.svm")); + checkText(readFile(u"text.svm")); } void SvmTest::checkTextArray(const GDIMetaFile& rMetaFile) @@ -842,7 +847,7 @@ void SvmTest::testTextArray() pVirtualDev->DrawTextArray(Point(4,6), "123456", aDX, 1, 4); checkTextArray(writeAndReadStream(aGDIMetaFile)); - checkTextArray(readFile("textarray.svm")); + checkTextArray(readFile(u"textarray.svm")); } void SvmTest::checkstretchText(const GDIMetaFile& rMetaFile) @@ -864,7 +869,7 @@ void SvmTest::teststretchText() pVirtualDev->DrawStretchText(Point(4,6), 10, "123456", 1, 4); checkstretchText(writeAndReadStream(aGDIMetaFile)); - checkstretchText(readFile("strecthtext.svm")); + checkstretchText(readFile(u"strecthtext.svm")); } void SvmTest::checkTextRect(const GDIMetaFile& rMetaFile) @@ -886,7 +891,7 @@ void SvmTest::testTextRect() pVirtualDev->DrawText(tools::Rectangle(Point(0,0), Size(5,5)), "123456", DrawTextFlags::Center); checkTextRect(writeAndReadStream(aGDIMetaFile)); - checkTextRect(readFile("textrectangle.svm")); + checkTextRect(readFile(u"textrectangle.svm")); } void SvmTest::checkTextLine(const GDIMetaFile& rMetaFile) @@ -907,7 +912,7 @@ void SvmTest::testTextLine() pVirtualDev->DrawTextLine(Point(4,6), 10, STRIKEOUT_SINGLE, LINESTYLE_SINGLE, LINESTYLE_SINGLE); checkTextLine(writeAndReadStream(aGDIMetaFile)); - checkTextLine(readFile("textline.svm")); + checkTextLine(readFile(u"textline.svm")); } void SvmTest::checkBitmaps(const GDIMetaFile& rMetaFile) @@ -959,7 +964,7 @@ void SvmTest::testBitmaps() checkRendering(pVirtualDev, aReloadedGDIMetaFile); } { - GDIMetaFile aFileGDIMetaFile = readFile("bitmaps.svm"); + GDIMetaFile aFileGDIMetaFile = readFile(u"bitmaps.svm"); checkBitmaps(aFileGDIMetaFile); checkRendering(pVirtualDev, aFileGDIMetaFile); } @@ -1118,7 +1123,7 @@ void SvmTest::testBitmapExs() checkRendering(pVirtualDev, aReloadedGDIMetaFile); } { - GDIMetaFile aFileGDIMetaFile = readFile("bitmapexs.svm"); + GDIMetaFile aFileGDIMetaFile = readFile(u"bitmapexs.svm"); checkBitmapExs(aFileGDIMetaFile); checkRendering(pVirtualDev, aFileGDIMetaFile); } @@ -1173,7 +1178,7 @@ void SvmTest::testMasks() pVirtualDev->DrawMask(Point(1, 2), Size(3, 4), Point(2, 1), Size(4, 3), aBitmap3, COL_LIGHTRED, MetaActionType::MASKSCALEPART); checkMasks(writeAndReadStream(aGDIMetaFile)); - checkMasks(readFile("masks.svm")); + checkMasks(readFile(u"masks.svm")); } void SvmTest::checkGradient(const GDIMetaFile& rMetaFile) @@ -1246,7 +1251,7 @@ void SvmTest::testGradient() pVirtualDev->DrawGradient(aRectangle2, aGradient2); checkGradient(writeAndReadStream(aGDIMetaFile)); - checkGradient(readFile("gradient.svm")); + checkGradient(readFile(u"gradient.svm")); } void SvmTest::testGradientEx() @@ -1293,7 +1298,7 @@ void SvmTest::testHatch() pVirtualDev->DrawHatch(aPolyPolygon, aHatch); checkHatch(writeAndReadStream(aGDIMetaFile)); - checkHatch(readFile("hatch.svm")); + checkHatch(readFile(u"hatch.svm")); } void SvmTest::checkWallpaper(const GDIMetaFile& rMetaFile) @@ -1328,7 +1333,7 @@ void SvmTest::testWallpaper() pVirtualDev->DrawWallpaper(tools::Rectangle(Point(1, 1), Size(3, 3)), aWallpaper); checkWallpaper(writeAndReadStream(aGDIMetaFile)); - checkWallpaper(readFile("wallpaper.svm")); + checkWallpaper(readFile(u"wallpaper.svm")); } void SvmTest::checkClipRegion(const GDIMetaFile& rMetaFile) @@ -1358,7 +1363,7 @@ void SvmTest::testClipRegion() pVirtualDev->SetClipRegion(aRegion); checkClipRegion(writeAndReadStream(aGDIMetaFile)); - checkClipRegion(readFile("clipregion.svm")); + checkClipRegion(readFile(u"clipregion.svm")); } void SvmTest::testIntersectRectClipRegion() @@ -1388,7 +1393,7 @@ void SvmTest::testLineColor() pVirtualDev->Pop(); checkLineColor(writeAndReadStream(aGDIMetaFile)); - checkLineColor(readFile("linecolor.svm")); + checkLineColor(readFile(u"linecolor.svm")); } void SvmTest::checkFillColor(const GDIMetaFile& rMetaFile) @@ -1411,7 +1416,7 @@ void SvmTest::testFillColor() pVirtualDev->Pop(); checkFillColor(writeAndReadStream(aGDIMetaFile)); - checkFillColor(readFile("fillcolor.svm")); + checkFillColor(readFile(u"fillcolor.svm")); } void SvmTest::checkTextColor(const GDIMetaFile& rMetaFile) @@ -1432,7 +1437,7 @@ void SvmTest::testTextColor() pVirtualDev->SetTextColor(Color(0x123456)); checkTextColor(writeAndReadStream(aGDIMetaFile)); - checkTextColor(readFile("textcolor.svm")); + checkTextColor(readFile(u"textcolor.svm")); } void SvmTest::checkTextFillColor(const GDIMetaFile& rMetaFile) @@ -1453,7 +1458,7 @@ void SvmTest::testTextFillColor() pVirtualDev->SetTextFillColor(Color(0x234567)); checkTextFillColor(writeAndReadStream(aGDIMetaFile)); - checkTextFillColor(readFile("textfillecolor.svm")); + checkTextFillColor(readFile(u"textfillecolor.svm")); } void SvmTest::checkTextLineColor(const GDIMetaFile& rMetaFile) @@ -1474,7 +1479,7 @@ void SvmTest::testTextLineColor() pVirtualDev->SetTextLineColor(Color(0x345678)); checkTextLineColor(writeAndReadStream(aGDIMetaFile)); - checkTextLineColor(readFile("textlinecolor.svm")); + checkTextLineColor(readFile(u"textlinecolor.svm")); } void SvmTest::checkOverLineColor(const GDIMetaFile& rMetaFile) @@ -1497,7 +1502,7 @@ void SvmTest::testOverLineColor() pVirtualDev->Pop(); checkOverLineColor(writeAndReadStream(aGDIMetaFile)); - checkOverLineColor(readFile("overlinecolor.svm")); + checkOverLineColor(readFile(u"overlinecolor.svm")); } void SvmTest::checkTextAlign(const GDIMetaFile& rMetaFile) @@ -1518,7 +1523,7 @@ void SvmTest::testTextAlign() pVirtualDev->SetTextAlign(TextAlign::ALIGN_BOTTOM); checkTextAlign(writeAndReadStream(aGDIMetaFile)); - checkTextAlign(readFile("textalign.svm")); + checkTextAlign(readFile(u"textalign.svm")); } void SvmTest::testMapMode() @@ -1561,7 +1566,7 @@ void SvmTest::testPushPop() pVirtualDev->DrawLine(Point(1,1), Point(8,8)); checkPushPop(writeAndReadStream(aGDIMetaFile)); - checkPushPop(readFile("pushpop.svm")); + checkPushPop(readFile(u"pushpop.svm")); } void SvmTest::checkRasterOp(const GDIMetaFile& rMetaFile) @@ -1582,7 +1587,7 @@ void SvmTest::testRasterOp() pVirtualDev->SetRasterOp(RasterOp::Xor); checkRasterOp(writeAndReadStream(aGDIMetaFile)); - checkRasterOp(readFile("rasterop.svm")); + checkRasterOp(readFile(u"rasterop.svm")); } void SvmTest::checkTransparent(const GDIMetaFile& rMetaFile) @@ -1622,7 +1627,7 @@ void SvmTest::testTransparent() CPPUNIT_ASSERT(aGDIMetaFile.HasTransparentActions()); checkTransparent(writeAndReadStream(aGDIMetaFile)); - checkTransparent(readFile("transparent.svm")); + checkTransparent(readFile(u"transparent.svm")); } void SvmTest::testFloatTransparent() diff --git a/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx b/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx index ac5accc5c940..480ff411012f 100644 --- a/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx +++ b/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include <cppunit/TestAssert.h> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/plugin/TestPlugIn.h> @@ -21,7 +25,7 @@ constexpr OUStringLiteral gaDataUrl(u"/vcl/qa/cppunit/widgetdraw/data/"); class WidgetDefinitionReaderTest : public test::BootstrapFixtureBase { private: - OUString getFullUrl(const OUString& sFileName) + OUString getFullUrl(std::u16string_view sFileName) { return m_directories.getURLFromSrc(gaDataUrl) + sFileName; } @@ -40,21 +44,24 @@ void WidgetDefinitionReaderTest::testReadSettings() { { vcl::WidgetDefinition aDefinition; - vcl::WidgetDefinitionReader aReader(getFullUrl("definitionSettings1.xml"), getFullUrl("")); + vcl::WidgetDefinitionReader aReader(getFullUrl(u"definitionSettings1.xml"), + getFullUrl(u"")); CPPUNIT_ASSERT(aReader.read(aDefinition)); CPPUNIT_ASSERT_EQUAL(OString(""), aDefinition.mpSettings->msCenteredTabs); } { vcl::WidgetDefinition aDefinition; - vcl::WidgetDefinitionReader aReader(getFullUrl("definitionSettings2.xml"), getFullUrl("")); + vcl::WidgetDefinitionReader aReader(getFullUrl(u"definitionSettings2.xml"), + getFullUrl(u"")); CPPUNIT_ASSERT(aReader.read(aDefinition)); CPPUNIT_ASSERT_EQUAL(OString("true"), aDefinition.mpSettings->msCenteredTabs); } { vcl::WidgetDefinition aDefinition; - vcl::WidgetDefinitionReader aReader(getFullUrl("definitionSettings3.xml"), getFullUrl("")); + vcl::WidgetDefinitionReader aReader(getFullUrl(u"definitionSettings3.xml"), + getFullUrl(u"")); CPPUNIT_ASSERT(aReader.read(aDefinition)); CPPUNIT_ASSERT_EQUAL(OString("true"), aDefinition.mpSettings->msNoActiveTabTextRaise); CPPUNIT_ASSERT_EQUAL(OString("false"), aDefinition.mpSettings->msCenteredTabs); @@ -73,7 +80,7 @@ void WidgetDefinitionReaderTest::testRead() { vcl::WidgetDefinition aDefinition; - vcl::WidgetDefinitionReader aReader(getFullUrl("definition1.xml"), getFullUrl("")); + vcl::WidgetDefinitionReader aReader(getFullUrl(u"definition1.xml"), getFullUrl(u"")); CPPUNIT_ASSERT(aReader.read(aDefinition)); CPPUNIT_ASSERT_EQUAL(OUString("123456"), aDefinition.mpStyle->maFaceColor.AsRGBHexString()); diff --git a/vcl/qa/unit/vcl-dialogs-test.cxx b/vcl/qa/unit/vcl-dialogs-test.cxx index bca3437099f2..4f5016da2971 100644 --- a/vcl/qa/unit/vcl-dialogs-test.cxx +++ b/vcl/qa/unit/vcl-dialogs-test.cxx @@ -48,7 +48,7 @@ VclPtr<VclAbstractDialog> VclDialogsTest::createDialogByID(sal_uInt32 /*nID*/) { void VclDialogsTest::openAnyDialog() { /// process input file containing the UXMLDescriptions of the dialogs to dump - processDialogBatchFile("vcl/qa/unit/data/vcl-dialogs-test.txt"); + processDialogBatchFile(u"vcl/qa/unit/data/vcl-dialogs-test.txt"); } CPPUNIT_TEST_SUITE_REGISTRATION(VclDialogsTest); |