summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-12-10 15:20:39 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-12-10 17:08:06 +0100
commitd88d113c7de2681a0e88c276adc363c8f5a4ea8e (patch)
tree738ab7af2d8f6405bff6c354079c4b18b3a4bccb
parent1d21ecc90cc14cc40ebee5de2f45fb6a8cb35c77 (diff)
Simplify SvStream::WriteDouble
Change-Id: I0ece791b5571d3839c936e104016f53cc3b6d5e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160537 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--include/tools/stream.hxx2
-rw-r--r--tools/source/stream/stream.cxx14
2 files changed, 4 insertions, 12 deletions
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index d3e741bbd016..a6349c0be066 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -259,7 +259,7 @@ public:
SvStream& WriteChar( char nChar );
SvStream& WriteUChar( unsigned char nChar );
SvStream& WriteFloat( float nFloat );
- SvStream& WriteDouble( const double& rDouble );
+ SvStream& WriteDouble( double nDouble );
template <typename N>
SvStream& WriteNumberAsString( N n ) { return WriteOString(OString::number(n)); }
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index f5ddabac548d..b948c12847c6 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1029,21 +1029,13 @@ SvStream& SvStream::WriteFloat( float v )
return *this;
}
-SvStream& SvStream::WriteDouble ( const double& r )
+SvStream& SvStream::WriteDouble ( double v )
{
#if defined UNX
if (m_isSwap)
- {
- double nHelp = r;
- SwapDouble(nHelp);
- writeNumberWithoutSwap(nHelp);
- return *this;
- }
- else
+ SwapDouble(v);
#endif
- {
- writeNumberWithoutSwap(r);
- }
+ writeNumberWithoutSwap(v);
return *this;
}