[Libreoffice-commits] core.git: 2 commits - sd/source
Tor Lillqvist
tml at iki.fi
Mon Feb 18 02:00:01 PST 2013
sd/source/ui/remotecontrol/BluetoothServer.cxx | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
New commits:
commit 21bec368ad670e368d4b5cadae1c07962710f115
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Feb 18 11:59:03 2013 +0200
WaE: comparison is always true due to limited range of data type
Change-Id: Id88e1d8a29972ca9384ddc905697d7d32d94cc35
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index 8366c49..1062e1c 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -146,7 +146,7 @@ sal_Int32 OSXBluetoothWrapper::readLine( rtl::OString& aLine )
{
if (*p == '\n')
s << "\\n";
- else if (*p < ' ' || (*p >= 0x7F && *p <= 0xFF))
+ else if (*p < ' ' || *p >= 0x7F)
s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << (int) *p << std::setfill(' ') << std::setw(1) << std::dec;
else
s << *p;
commit 730cff74c04dc6ec2cfc9cf9dcec172392f50616
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Feb 18 11:57:02 2013 +0200
std::vector::data() is C++11
Change-Id: I729606a879cfd6330ce9cf3ad7723d2558c07c4a
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index b538d6d..8366c49 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -140,14 +140,17 @@ sal_Int32 OSXBluetoothWrapper::readLine( rtl::OString& aLine )
// We should have in the sal logging some standard way to
// output char buffers with non-printables escaped.
std::ostringstream s;
- for (unsigned char *p = (unsigned char *) mBuffer.data(); p != (unsigned char *) mBuffer.data() + mBuffer.size(); p++)
+ if (mBuffer.size() > 0)
{
- if (*p == '\n')
- s << "\\n";
- else if (*p < ' ' || (*p >= 0x7F && *p <= 0xFF))
- s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << (int) *p << std::setfill(' ') << std::setw(1) << std::dec;
- else
- s << *p;
+ for (unsigned char *p = (unsigned char *) &mBuffer.front(); p != (unsigned char *) &mBuffer.front() + mBuffer.size(); p++)
+ {
+ if (*p == '\n')
+ s << "\\n";
+ else if (*p < ' ' || (*p >= 0x7F && *p <= 0xFF))
+ s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << (int) *p << std::setfill(' ') << std::setw(1) << std::dec;
+ else
+ s << *p;
+ }
}
SAL_INFO( "sdremote.bluetooth", " mBuffer: \"" << s.str() << "\"" );
#endif
More information about the Libreoffice-commits
mailing list