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 /editeng/source/items | |
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 'editeng/source/items')
-rw-r--r-- | editeng/source/items/legacyitem.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/editeng/source/items/legacyitem.cxx b/editeng/source/items/legacyitem.cxx index bb9a7cf03b47..509c7a68b6aa 100644 --- a/editeng/source/items/legacyitem.cxx +++ b/editeng/source/items/legacyitem.cxx @@ -24,6 +24,7 @@ #include <comphelper/fileformat.h> #include <vcl/graph.hxx> #include <vcl/GraphicObject.hxx> +#include <vcl/TypeSerializer.hxx> #include <osl/diagnose.h> #include <tools/urlobj.hxx> #include <editeng/fontitem.hxx> @@ -493,7 +494,7 @@ namespace legacy sal_Int8 nStyle; rStrm.ReadCharAsBool( bTrans ); - tools::GenericTypeSerializer aSerializer(rStrm); + TypeSerializer aSerializer(rStrm); aSerializer.readColor(aTempColor); aSerializer.readColor(aTempFillColor); rStrm.ReadSChar( nStyle ); @@ -555,8 +556,7 @@ namespace legacy if ( nDoLoad & LOAD_GRAPHIC ) { Graphic aGraphic; - - ReadGraphic( rStrm, aGraphic ); + aSerializer.readGraphic(aGraphic); rItem.SetGraphicObject(GraphicObject(aGraphic)); if( SVSTREAM_FILEFORMAT_ERROR == rStrm.GetError() ) @@ -592,7 +592,7 @@ namespace legacy SvStream& Store(const SvxBrushItem& rItem, SvStream& rStrm, sal_uInt16) { rStrm.WriteBool( false ); - tools::GenericTypeSerializer aSerializer(rStrm); + TypeSerializer aSerializer(rStrm); aSerializer.writeColor(rItem.GetColor()); aSerializer.writeColor(rItem.GetColor()); rStrm.WriteSChar( rItem.GetColor().IsTransparent() ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID @@ -609,7 +609,9 @@ namespace legacy rStrm.WriteUInt16( nDoLoad ); if (nullptr != pGraphicObject && rItem.GetGraphicLink().isEmpty()) - WriteGraphic(rStrm, pGraphicObject->GetGraphic()); + { + aSerializer.writeGraphic(pGraphicObject->GetGraphic()); + } if ( !rItem.GetGraphicLink().isEmpty() ) { OSL_FAIL("No BaseURL!"); |