1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _CONVERT_HXX 28 #define _CONVERT_HXX 29 30 /* 31 #define _SWAPSHORT(x) ((((x) & 0xFF00)>>8) | (((x) & 0x00FF)<<8)) 32 #define _SWAPLONG(x) ((((x) & 0xFF000000)>>24) | (((x) & 0x00FF0000)>>8) | \ 33 (((x) & 0x0000FF00)<<8) | (((x) & 0x000000FF)<<24)) 34 */ 35 class Convert 36 { 37 public: 38 static void Swap( long & nValue ) 39 { nValue = SWAPLONG( nValue ); } 40 static void Swap( ULONG & nValue ) 41 { nValue = SWAPLONG( nValue ); } 42 static void Swap( short & nValue ) 43 { nValue = SWAPSHORT( nValue ); } 44 static void Swap( USHORT & nValue ) 45 { nValue = SWAPSHORT( nValue ); } 46 static void Swap( Point & aPtr ) 47 { Swap( aPtr.X() ); Swap( aPtr.Y() ); } 48 static void Swap( Size & aSize ) 49 { Swap( aSize.Width() ); Swap( aSize.Height() ); } 50 static void Swap( Rectangle & rRect ) 51 { Swap( rRect.Top() ); Swap( rRect.Bottom() ); 52 Swap( rRect.Left() ); Swap( rRect.Right() ); } 53 /* 54 static USHORT AnsiFloatSize() const { return 6; } 55 static float AnsiToFloat( void * pAnsiFloat ) 56 { return 0; } 57 static USHORT AnsiDoubleSize() const { return 12; } 58 static double AnsiToDouble( void * pAnsiDouble ) 59 { return 0; } 60 */ 61 }; 62 63 #endif // _CONVERT_HXX 64