From cae53cf14d59bc2fa6317c9493197804928d6e5e Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 27 Apr 2019 11:18:42 +0900 Subject: Decouple reading/writing of Color into GenericTypeSerializer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds GenericTypeSerializer, which is now responsible of serializing the Color into a stream (other types will follow), but only for the older version of the binary format. The new version we just write the sal_UInt32 mValue directly. This is a start of decoupling the serialization of generic types in tools and vcl module from the actual type, so we can in the future replace those with basegfx variant. Change-Id: I92738e7c178cac5cbca882dcbe45c80cc8269466 Reviewed-on: https://gerrit.libreoffice.org/71404 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- tools/qa/cppunit/test_color.cxx | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'tools/qa') diff --git a/tools/qa/cppunit/test_color.cxx b/tools/qa/cppunit/test_color.cxx index 8ecf03572295..011fbcbdfa65 100644 --- a/tools/qa/cppunit/test_color.cxx +++ b/tools/qa/cppunit/test_color.cxx @@ -23,7 +23,6 @@ class Test: public CppUnit::TestFixture public: void testVariables(); void test_asRGBColor(); - void test_readAndWriteStream(); void test_ApplyTintOrShade(); void testGetColorError(); void testInvert(); @@ -32,7 +31,6 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testVariables); CPPUNIT_TEST(test_asRGBColor); - CPPUNIT_TEST(test_readAndWriteStream); CPPUNIT_TEST(test_ApplyTintOrShade); CPPUNIT_TEST(testGetColorError); CPPUNIT_TEST(testInvert); @@ -107,22 +105,6 @@ void Test::test_asRGBColor() CPPUNIT_ASSERT_EQUAL(OUString("ffffff"), aColor.AsRGBHexString()); } -void Test::test_readAndWriteStream() -{ - SvMemoryStream aStream; - Color aReadColor; - - WriteColor(aStream, Color(0x12, 0x34, 0x56)); - - aStream.Seek(STREAM_SEEK_TO_BEGIN); - - ReadColor(aStream, aReadColor); - - CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x12), aReadColor.GetRed()); - CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x34), aReadColor.GetGreen()); - CPPUNIT_ASSERT_EQUAL(sal_uInt8(0x56), aReadColor.GetBlue()); -} - OUString createTintShade(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB, OUString const & sReference, sal_Int16 nTintShade) { Color aColor(nR, nG, nB); -- cgit