xref: /aoo42x/main/oox/inc/oox/export/utils.hxx (revision e3508121)
1*e3508121SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*e3508121SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e3508121SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e3508121SAndrew Rist  * distributed with this work for additional information
6*e3508121SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e3508121SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e3508121SAndrew Rist  * "License"); you may not use this file except in compliance
9*e3508121SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e3508121SAndrew Rist  *
11*e3508121SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e3508121SAndrew Rist  *
13*e3508121SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e3508121SAndrew Rist  * software distributed under the License is distributed on an
15*e3508121SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e3508121SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e3508121SAndrew Rist  * specific language governing permissions and limitations
18*e3508121SAndrew Rist  * under the License.
19*e3508121SAndrew Rist  *
20*e3508121SAndrew Rist  *************************************************************/
21*e3508121SAndrew Rist 
22*e3508121SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _OOX_EXPORT_UTILS_HXX_
25cdf0e10cSrcweir #define _OOX_EXPORT_UTILS_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #define S(x) String( RTL_CONSTASCII_USTRINGPARAM( x ) )
28cdf0e10cSrcweir #define US(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ))
29cdf0e10cSrcweir #define I32S(x) OString::valueOf( (sal_Int32) x ).getStr()
30cdf0e10cSrcweir #define I64S(x) OString::valueOf( (sal_Int64) x ).getStr()
31cdf0e10cSrcweir #define H32S(x) OString::valueOf( (sal_Int32) x, 16 ).getStr()
32cdf0e10cSrcweir #define H64S(x) OString::valueOf( (sal_Int64) x, 16 ).getStr()
33cdf0e10cSrcweir #define IS(x) OString::valueOf( x ).getStr()
34cdf0e10cSrcweir #define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
35cdf0e10cSrcweir #define ST(x) ByteString( x, RTL_TEXTENCODING_UTF8 ).GetBuffer()
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #ifndef DBG
38cdf0e10cSrcweir #  if OSL_DEBUG_LEVEL > 0
39cdf0e10cSrcweir #    define DBG(x) x
40cdf0e10cSrcweir #  else
41cdf0e10cSrcweir #    define DBG(x)
42cdf0e10cSrcweir #  endif
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir 
45cdf0e10cSrcweir // ---------------------------------------------------------------------------------------------
46cdf0e10cSrcweir 
PPTtoEMU(INT32 nPPT)47cdf0e10cSrcweir static inline sal_Int64 PPTtoEMU( INT32 nPPT )
48cdf0e10cSrcweir {
49cdf0e10cSrcweir     return (sal_Int64)( (double)nPPT * 1587.5 );
50cdf0e10cSrcweir }
51cdf0e10cSrcweir 
52cdf0e10cSrcweir // ---------------------------------------------------------------------------------------------
53cdf0e10cSrcweir 
MM100toEMU(INT32 nMM100)54cdf0e10cSrcweir static inline sal_Int64 MM100toEMU( INT32 nMM100 )
55cdf0e10cSrcweir {
56cdf0e10cSrcweir     return (sal_Int64)nMM100 * 360;
57cdf0e10cSrcweir }
58cdf0e10cSrcweir 
59cdf0e10cSrcweir // ---------------------------------------------------------------------------------------------
60cdf0e10cSrcweir 
TwipsToEMU(sal_Int32 nTwips)61cdf0e10cSrcweir static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
62cdf0e10cSrcweir {
63cdf0e10cSrcweir     return sal_Int64( nTwips ) * 635;
64cdf0e10cSrcweir }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir #endif
67