1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SFX_SFXTYPES_HXX
20 #define _SFX_SFXTYPES_HXX
22 #include <tools/debug.hxx>
23 #include <tools/rc.hxx>
24 #include <tools/rcid.h>
25 #include <tools/resid.hxx>
26 #include <vcl/svapp.hxx>
27 #include <vcl/wrkwin.hxx>
29 #include <osl/mutex.hxx>
32 #define DELETEZ(pPtr) ( delete pPtr, pPtr = 0 )
37 #define DELETEX(pPtr) ( delete pPtr, (void*&) pPtr = (void*) 0xFFFFFFFF )
39 #define DELETEX(pPtr) delete pPtr
43 //------------------------------------------------------------------------
45 // Macro for the Call-Profiler under WinNT
46 // with S_CAP a measurement can be started, and stopped with E_CAP
47 #if defined( WNT ) && defined( PROFILE )
55 #define S_CAP() StartCAP();
56 #define E_CAP() StopCAP(); DumpCAP();
60 _Capper() { S_CAP(); }
61 ~_Capper() { E_CAP(); }
64 #define CAP _Capper _aCap_
76 #define DBG(statement) statement
78 #define DBG_OUTF(x) DbgOutf x
81 #define DBG(statement)
86 //------------------------------------------------------------------------
88 #if defined(DBG_UTIL) && defined(WNT)
92 static unsigned nLevel
;
95 SfxStack( const char *pName
)
98 DbgOutf( "STACK: enter %3d %s", nLevel
, pName
);
102 DbgOutf( "STACK: leave %3d", nLevel
);
107 #define SFX_STACK(s) SfxStack aSfxStack_( #s )
112 //------------------------------------------------------------------------
114 struct StringList_Impl
: private Resource
119 StringList_Impl( const ResId
& rErrIdP
, sal_uInt16 nId
)
120 : Resource( rErrIdP
),aResId(nId
, *rErrIdP
.GetResMgr()){}
121 ~StringList_Impl() { FreeResource(); }
123 String
GetString(){ return aResId
.toString(); }
124 operator sal_Bool(){return IsAvailableRes(aResId
.SetRT(RSC_STRING
));}
128 #endif // #ifndef _SFX_SFXTYPES_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */