diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-04-27 11:18:42 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-04-27 06:48:18 +0200 |
commit | cae53cf14d59bc2fa6317c9493197804928d6e5e (patch) | |
tree | 4420d17bf2c9f1aa001c98c5c140ebd7ed04c30e /sd/source | |
parent | 55e28737e973b40f72d398c9bb7a4a41307eb562 (diff) |
Decouple reading/writing of Color into GenericTypeSerializer
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 <quikee@gmail.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/filter/html/pubdlg.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 3cbc42135894..cdf1d10f00bd 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -30,6 +30,7 @@ #include <svtools/colrdlg.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> +#include <tools/GenericTypeSerializer.hxx> #include <sdiocmpt.hxx> #include <sfx2/docfile.hxx> #include <pres.hxx> @@ -233,6 +234,7 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) SdIOCompat aIO(rIn, StreamMode::READ); sal_uInt16 nTemp16; + tools::GenericTypeSerializer aSerializer(rIn); rDesign.m_aDesignName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); @@ -257,11 +259,11 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) rIn.ReadCharAsBool( rDesign.m_bCreated ); // not used rIn.ReadInt16( rDesign.m_nButtonThema ); rIn.ReadCharAsBool( rDesign.m_bUserAttr ); - ReadColor( rIn, rDesign.m_aBackColor ); - ReadColor( rIn, rDesign.m_aTextColor ); - ReadColor( rIn, rDesign.m_aLinkColor ); - ReadColor( rIn, rDesign.m_aVLinkColor ); - ReadColor( rIn, rDesign.m_aALinkColor ); + aSerializer.readColor(rDesign.m_aBackColor); + aSerializer.readColor(rDesign.m_aTextColor); + aSerializer.readColor(rDesign.m_aLinkColor); + aSerializer.readColor(rDesign.m_aVLinkColor); + aSerializer.readColor(rDesign.m_aALinkColor); rIn.ReadCharAsBool( rDesign.m_bUseAttribs ); rIn.ReadCharAsBool( rDesign.m_bUseColor ); @@ -287,6 +289,8 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes // The last parameter is the versionnumber of the code SdIOCompat aIO(rOut, StreamMode::WRITE, 0); + tools::GenericTypeSerializer aSerializer(rOut); + // Name write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8); @@ -310,11 +314,11 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes rOut.WriteBool( rDesign.m_bCreated ); // not used rOut.WriteInt16( rDesign.m_nButtonThema ); rOut.WriteBool( rDesign.m_bUserAttr ); - WriteColor( rOut, rDesign.m_aBackColor ); - WriteColor( rOut, rDesign.m_aTextColor ); - WriteColor( rOut, rDesign.m_aLinkColor ); - WriteColor( rOut, rDesign.m_aVLinkColor ); - WriteColor( rOut, rDesign.m_aALinkColor ); + aSerializer.writeColor(rDesign.m_aBackColor); + aSerializer.writeColor(rDesign.m_aTextColor); + aSerializer.writeColor(rDesign.m_aLinkColor); + aSerializer.writeColor(rDesign.m_aVLinkColor); + aSerializer.writeColor(rDesign.m_aALinkColor); rOut.WriteBool( rDesign.m_bUseAttribs ); rOut.WriteBool( rDesign.m_bUseColor ); |