diff options
author | Matthias Huetsch [mhu] <matthias.huetsch@sun.com> | 2010-06-16 17:09:09 +0200 |
---|---|---|
committer | Matthias Huetsch [mhu] <matthias.huetsch@sun.com> | 2010-06-16 17:09:09 +0200 |
commit | 14cad1ab1a571527196b7be799b46c1aa5ac7e20 (patch) | |
tree | 57e059aa981c697ac9befa985208b5eee8335268 /tools | |
parent | 5d2f6cb97629e2d3d876f31403ea2e022b22a2b9 (diff) | |
parent | 1184876fc2d6662101facfc1db7464a0d01e2428 (diff) |
Update from master repository (DEV300_m82).
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/diagnose_ex.h | 18 | ||||
-rw-r--r-- | tools/inc/tools/gen.hxx | 15 | ||||
-rw-r--r-- | tools/inc/tools/preextstl.h | 15 | ||||
-rw-r--r-- | tools/inc/tools/solar.h | 24 | ||||
-rw-r--r-- | tools/inc/tools/svborder.hxx | 8 | ||||
-rw-r--r-- | tools/source/stream/strmunx.cxx | 4 |
6 files changed, 56 insertions, 28 deletions
diff --git a/tools/inc/tools/diagnose_ex.h b/tools/inc/tools/diagnose_ex.h index fac739b32583..6833fd6632ce 100644 --- a/tools/inc/tools/diagnose_ex.h +++ b/tools/inc/tools/diagnose_ex.h @@ -141,6 +141,24 @@ return; \ } +/** asserts a given condition (in debug mode), and continues the most-inner + loop if the condition is not met +*/ +#define ENSURE_OR_CONTINUE( c, m ) \ + if ( !(c) ) \ + { \ + OSL_ENSURE( false, m ); \ + continue; \ + } +/** asserts a given condition (in debug mode), and continues the most-inner + loop if the condition is not met +*/ +#define ENSURE_OR_BREAK( c, m ) \ + if ( !(c) ) \ + { \ + OSL_ENSURE( false, m ); \ + break; \ + } #endif // TOOLS_DIAGNOSE_EX_H diff --git a/tools/inc/tools/gen.hxx b/tools/inc/tools/gen.hxx index 85da22126b77..308cc02165ce 100644 --- a/tools/inc/tools/gen.hxx +++ b/tools/inc/tools/gen.hxx @@ -420,6 +420,7 @@ public: Point Center() const; void Move( long nHorzMove, long nVertMove ); + inline void Transpose(); inline void SetPos( const Point& rPoint ); void SetSize( const Size& rSize ); inline Size GetSize() const; @@ -578,6 +579,20 @@ inline void Rectangle::Move( long nHorzMove, long nVertMove ) nBottom += nVertMove; } +void Rectangle::Transpose() +{ + if ( !IsEmpty() ) + { + long swap( nLeft ); + nLeft = nTop; + nTop = swap; + + swap = nRight; + nRight = nBottom; + nBottom = swap; + } +} + inline void Rectangle::SetPos( const Point& rPoint ) { if ( nRight != RECT_EMPTY ) diff --git a/tools/inc/tools/preextstl.h b/tools/inc/tools/preextstl.h index 4d0418d01c57..27aed38686f0 100644 --- a/tools/inc/tools/preextstl.h +++ b/tools/inc/tools/preextstl.h @@ -24,8 +24,11 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - +//1. Force inclusion of a std:: using header to ensure the stlport define +//of std as "stlport" +#include <algorithm> #if defined(ADAPT_EXT_STL) +//2. Force inclusion of stlport headers to get their stlport:: definitions # include <ostream> # include <istream> # include <fstream> @@ -33,12 +36,14 @@ # include <vector> # include <list> # include <map> -# include <algorithm> +//3. Now force inclusion of native headers to get their std:: definitions # if defined(std) # define std_was_redefined_as_stlport std # undef std # define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf -# pragma GCC visibility push(default) +# if defined(_GNUC__) +# pragma GCC visibility push(default) +# endif # include _STLP_NATIVE_HEADER(exception_defines.h) # include _STLP_NATIVE_HEADER(limits) # include _STLP_NATIVE_HEADER(memory) @@ -56,7 +61,9 @@ # include _STLP_NATIVE_HEADER(vector) # include _STLP_NATIVE_HEADER(list) # include _STLP_NATIVE_HEADER(map) -# pragma GCC visibility pop +# if defined(_GNUC__) +# pragma GCC visibility pop +# endif # endif #endif //ext_std resolves to the std that external c++ libs, e.g. Graphite were built diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h index 2ae0fa5f2f32..096d34d05b9e 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -122,23 +122,13 @@ typedef BYTE SVBT64[8]; #ifdef __cplusplus inline BYTE SVBT8ToByte ( const SVBT8 p ) { return p[0]; } -#if defined OSL_LITENDIAN && SAL_TYPES_ALIGNMENT2 == 1 -inline USHORT SVBT16ToShort( const SVBT16 p ) { return *(USHORT*)p; } -#else inline USHORT SVBT16ToShort( const SVBT16 p ) { return (USHORT)p[0] + ((USHORT)p[1] << 8); } -#endif -#if defined OSL_LITENDIAN && SAL_TYPES_ALIGNMENT4 == 1 -inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return *(sal_uInt32*)p; } -#else inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return (sal_uInt32)p[0] + ((sal_uInt32)p[1] << 8) + ((sal_uInt32)p[2] << 16) + ((sal_uInt32)p[3] << 24); } -#endif -#if defined OSL_LITENDIAN && SAL_TYPES_ALIGNMENT8 == 1 -inline double SVBT64ToDouble( const SVBT64 p ) { return *(double*)p; } -#elif defined OSL_LITENDIAN +#if defined OSL_LITENDIAN inline double SVBT64ToDouble( const SVBT64 p ) { double n; ((BYTE*)&n)[0] = p[0]; ((BYTE*)&n)[1] = p[1]; @@ -163,23 +153,13 @@ inline double SVBT64ToDouble( const SVBT64 p ) { double n; #endif inline void ByteToSVBT8 ( BYTE n, SVBT8 p ) { p[0] = n; } -#if defined OSL_LITENDIAN && SAL_TYPES_ALIGNMENT2 == 1 -inline void ShortToSVBT16( USHORT n, SVBT16 p ) { *(USHORT*)p = n; } -#else inline void ShortToSVBT16( USHORT n, SVBT16 p ) { p[0] = (BYTE) n; p[1] = (BYTE)(n >> 8); } -#endif -#if defined OSL_LITENDIAN && SAL_TYPES_ALIGNMENT4 == 1 -inline void UInt32ToSVBT32 ( sal_uInt32 n, SVBT32 p ) { *(sal_uInt32*)p = n; } -#else inline void UInt32ToSVBT32 ( sal_uInt32 n, SVBT32 p ) { p[0] = (BYTE) n; p[1] = (BYTE)(n >> 8); p[2] = (BYTE)(n >> 16); p[3] = (BYTE)(n >> 24); } -#endif -#if defined OSL_LITENDIAN && SAL_TYPES_ALIGNMENT8 == 1 -inline void DoubleToSVBT64( double n, SVBT64 p ) { *(double*)p = n; } -#elif defined OSL_LITENDIAN +#if defined OSL_LITENDIAN inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((BYTE*)&n)[0]; p[1] = ((BYTE*)&n)[1]; p[2] = ((BYTE*)&n)[2]; diff --git a/tools/inc/tools/svborder.hxx b/tools/inc/tools/svborder.hxx index 9523a71a060f..a0509bcc89be 100644 --- a/tools/inc/tools/svborder.hxx +++ b/tools/inc/tools/svborder.hxx @@ -49,6 +49,14 @@ public: } BOOL operator != ( const SvBorder & rObj ) const { return !(*this == rObj); } + SvBorder & operator = ( const SvBorder & rBorder ) + { + Left() = rBorder.Left(); + Top() = rBorder.Top(); + Right() = rBorder.Right(); + Bottom() = rBorder.Bottom(); + return *this; + } SvBorder & operator += ( const SvBorder & rBorder ) { Left() += rBorder.Left(); diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 9e4f501d1823..88ccb2113e0d 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -209,7 +209,7 @@ static sal_uInt32 GetSvError( int nErrno ) { 0, SVSTREAM_OK }, { EACCES, SVSTREAM_ACCESS_DENIED }, { EBADF, SVSTREAM_INVALID_HANDLE }, -#if defined( RS6000 ) || defined( ALPHA ) || defined( HP9000 ) || defined( NETBSD ) || defined(FREEBSD) || defined(MACOSX) +#if defined( RS6000 ) || defined( ALPHA ) || defined( HP9000 ) || defined( NETBSD ) || defined(FREEBSD) || defined(MACOSX) || defined(__FreeBSD_kernel__) { EDEADLK, SVSTREAM_LOCKING_VIOLATION }, #else { EDEADLOCK, SVSTREAM_LOCKING_VIOLATION }, @@ -223,7 +223,7 @@ static sal_uInt32 GetSvError( int nErrno ) { EAGAIN, SVSTREAM_LOCKING_VIOLATION }, { EISDIR, SVSTREAM_PATH_NOT_FOUND }, { ELOOP, SVSTREAM_PATH_NOT_FOUND }, -#if ! defined( RS6000 ) && ! defined( ALPHA ) && ! defined( NETBSD ) && ! defined (FREEBSD) && ! defined (MACOSX) +#if ! defined( RS6000 ) && ! defined( ALPHA ) && ! defined( NETBSD ) && ! defined (FREEBSD) && ! defined (MACOSX) && ! defined(__FreeBSD_kernel__) { EMULTIHOP, SVSTREAM_PATH_NOT_FOUND }, { ENOLINK, SVSTREAM_PATH_NOT_FOUND }, #endif |