Update ooo320-m1
[ooovba.git] / extensions / source / propctrlr / pcrcommon.cxx
bloba3f2d26739453481194a7e35068c3f273ea3a6ae
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pcrcommon.cxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_extensions.hxx"
33 #include "pcrcommon.hxx"
34 #ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_
35 #include "modulepcr.hxx"
36 #endif
37 #ifndef EXTENSIONS_PROPRESID_HRC
38 #include "propresid.hrc"
39 #endif
41 /** === begin UNO includes === **/
42 #include <com/sun/star/util/MeasureUnit.hpp>
43 /** === end UNO includes === **/
44 #include <rtl/ustrbuf.hxx>
46 //............................................................................
47 namespace pcr
49 //............................................................................
51 using namespace ::com::sun::star::util;
53 //========================================================================
54 //= HelpIdUrl
55 //========================================================================
56 //------------------------------------------------------------------------
57 SmartId HelpIdUrl::getHelpId( const ::rtl::OUString& _rHelpURL )
59 SmartId aSmartHelpId( _rHelpURL );
60 if ( 0 == _rHelpURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "HID:" ) ) )
61 aSmartHelpId = SmartId( _rHelpURL.copy( sizeof( "HID:" ) - 1 ).toInt32() );
62 return aSmartHelpId;
65 //------------------------------------------------------------------------
66 ::rtl::OUString HelpIdUrl::getHelpURL( sal_uInt32 _nHelpId )
68 ::rtl::OUStringBuffer aBuffer;
69 aBuffer.appendAscii( "HID:" );
70 aBuffer.append( (sal_Int32)_nHelpId );
71 return aBuffer.makeStringAndClear();
73 //............................................................................
74 } // namespace pcr
75 //............................................................................