diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-12-24 09:22:35 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-12-30 08:25:11 +0100 |
commit | 3482f5903079f680686a067974a24d135f44ebaf (patch) | |
tree | 1f5558da88189fa63c4a32fab34e514cf59b3c03 /sw/qa | |
parent | 4d3806c945b695488e2c5a9c83ed44ab8842511d (diff) |
vcl: remove {Read,Write}ImpGraphic and ImplExportNative from Graphic
ReadImpGraphic and WriteImpGraphic have been reimplemented in the
TypeSerializer some time ago, but the code has not yet been moved
to use that class. This commits does that and changes all the code
using those 2 methods and removes them. With this implemented in
the TypeSerializer, it is easier to handle
In addition it also removes ImplExportNative (and the method on
the Graphic interface). This was really used only in one method,
and it could be implemented in the mthod itself.
Change-Id: I0982429d1c1d5ed7ef07627d87ed9a08df43f040
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108256
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 5 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 5 |
3 files changed, 11 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index e39d475d8718..3d185a72afb9 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -64,6 +64,8 @@ #include <comphelper/propertysequence.hxx> #include <osl/time.h> #include <comphelper/processfactory.hxx> +#include <vcl/TypeSerializer.hxx> + class Test : public SwModelTestBase { @@ -1554,7 +1556,8 @@ DECLARE_OOXMLIMPORT_TEST(testTdf100072, "tdf100072.docx") // Read it back and dump it as an XML file. Graphic aGraphic; - ReadGraphic(aStream, aGraphic); + TypeSerializer aSerializer(aStream); + aSerializer.readGraphic(aGraphic); const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, rMetaFile); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index c5aeeae93efb..9f5967b5d2ff 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -48,6 +48,7 @@ #include <AnnotationWin.hxx> #include <com/sun/star/text/XDefaultNumberingProvider.hpp> #include <com/sun/star/awt/FontUnderline.hpp> +#include <vcl/TypeSerializer.hxx> #include <svx/svdpage.hxx> #include <svx/svdview.hxx> @@ -2154,7 +2155,8 @@ void SwUiWriterTest::testFdo87448() // Read it back and dump it as an XML file. Graphic aGraphic; - ReadGraphic(aStream, aGraphic); + TypeSerializer aSerializer(aStream); + aSerializer.readGraphic(aGraphic); const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, rMetaFile); diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index a3a2a06a03a6..7177c8fa7576 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -10,6 +10,7 @@ #include <swmodeltestbase.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <vcl/scheduler.hxx> +#include <vcl/TypeSerializer.hxx> #include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <IDocumentDrawModelAccess.hxx> #include <com/sun/star/text/TextContentAnchorType.hpp> @@ -2084,7 +2085,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477) // Read it back and check the color of the first pixel. Graphic aGraphic; - ReadGraphic(aStream, aGraphic); + TypeSerializer aSerializer(aStream); + aSerializer.readGraphic(aGraphic); + BitmapEx aBitmap = aGraphic.GetBitmapEx(); CPPUNIT_ASSERT_EQUAL(Color(0, 102, 204), aBitmap.GetPixelColor(0, 0)); } |