diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-30 21:18:45 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-07-03 05:03:59 +0000 |
commit | c7f23c281765a75ea7840f8dd54449e20abb8fc6 (patch) | |
tree | feb4017ef6a3f8925f01676d8c314ea60935825d /sw | |
parent | 3875218079cae6f94d938b810109de0222485af6 (diff) |
SvStream: remove the error prone operator<</>>(sal_Int64)
As the recent regression after merging AOO patch adding code serializing
"long" variables has shown, this overload (which was added in
7b2a0e541567be9750dfc7d98374555967da3470) is a bad idea.
In a unxlngx build, nm finds uses of the symbols _ZN8SvStreamrsERl
and _ZN8SvStreamlsEl in these files:
- sbxvalue.cxx: this appears to be a legitimate use with sal_Int64
- dateitem.cxx: this was accidentally changed by commit
9830fd36dbdb72c79703b0c61efc027fba793c5a
- atrfrm.cxx: this was added for Table Autoformat enhancement in
7e8c0bd73ee59ff3041e55268c77203373962e51, which is after the
sal_Int64 operators were added, so the file format is now
platform dependent
Change-Id: I78352b5429b53612c4831cdb81b587b5de5180a9
(cherry picked from commit 3835dee3c777bf10693903cb0866d22fab3794ea)
Reviewed-on: https://gerrit.libreoffice.org/4685
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index cf5a03e6ffcb..06a290a10b4b 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1196,16 +1196,30 @@ bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) SvStream& SwFmtVertOrient::Store(SvStream &rStream, sal_uInt16 /*version*/) const { - rStream << nYPos << eOrient << eRelation; +#if SAL_TYPES_SIZEOFLONG == 8 + rStream.WriteInt64(nYPos); +#else + rStream << static_cast<sal_Int32>(nYPos); +#endif + rStream << eOrient << eRelation; return rStream; } SfxPoolItem* SwFmtVertOrient::Create(SvStream &rStream, sal_uInt16 /*itemVersion*/) const { - SwTwips yPos; - sal_Int16 orient; - sal_Int16 relation; - rStream >> yPos >> orient >> relation; + SwTwips yPos(0); + sal_Int16 orient(0); + sal_Int16 relation(0); + // compatibility hack for Table Auto Format: SwTwips is "long" :( + // (this means that the file format is platform dependent) +#if SAL_TYPES_SIZEOFLONG == 8 + rStream.ReadInt64(yPos); +#else + sal_Int32 n; + rStream >> n; + yPos = n; +#endif + rStream >> orient >> relation; return new SwFmtVertOrient(yPos, orient, relation); } |