summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-06-18 13:09:52 +0200
committerThomas Lange [tl] <tl@openoffice.org>2010-06-18 13:09:52 +0200
commita3c52e955ec05284db925b9d7453d42cb958890c (patch)
tree763e34104542a7d45312d8f1c770ed5f06b197de /tools
parent8b11b2af1e090a3f8df4596eaa2522936f07c399 (diff)
parent7f0993d43019a0ccb7f89c11fc23704c063b902f (diff)
cws tl79: merge with DEV300_m83
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/diagnose_ex.h29
-rw-r--r--tools/inc/tools/gen.hxx15
-rw-r--r--tools/inc/tools/preextstl.h15
-rw-r--r--tools/inc/tools/solar.h24
-rw-r--r--tools/inc/tools/svborder.hxx8
-rw-r--r--tools/source/stream/strmunx.cxx4
6 files changed, 67 insertions, 28 deletions
diff --git a/tools/inc/tools/diagnose_ex.h b/tools/inc/tools/diagnose_ex.h
index fac739b32583..b244d11dc305 100644
--- a/tools/inc/tools/diagnose_ex.h
+++ b/tools/inc/tools/diagnose_ex.h
@@ -130,6 +130,17 @@
#define ENSURE_OR_RETURN_FALSE(c, m) \
ENSURE_OR_RETURN(c, m, false)
+/** This macro asserts the given condition (in debug mode), and
+ returns afterwards, without return value "void".
+ */
+#define ENSURE_OR_RETURN_VOID( c, m ) \
+ if( !(c) ) \
+ { \
+ OSL_ENSURE( c, m ); \
+ return; \
+ }
+
+
/** This macro asserts the given condition (in debug mode), and
returns afterwards, without return value "void".
@@ -141,6 +152,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