merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / source / propctrlr / pcrcommon.cxx
blob9e09d4977697a88bbe4130e2d7d696362ec044d8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_extensions.hxx"
30 #include "pcrcommon.hxx"
31 #ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_
32 #include "modulepcr.hxx"
33 #endif
34 #ifndef EXTENSIONS_PROPRESID_HRC
35 #include "propresid.hrc"
36 #endif
38 /** === begin UNO includes === **/
39 #include <com/sun/star/util/MeasureUnit.hpp>
40 /** === end UNO includes === **/
41 #include <rtl/ustrbuf.hxx>
43 //............................................................................
44 namespace pcr
46 //............................................................................
48 using namespace ::com::sun::star::util;
50 //========================================================================
51 //= HelpIdUrl
52 //========================================================================
53 //------------------------------------------------------------------------
54 SmartId HelpIdUrl::getHelpId( const ::rtl::OUString& _rHelpURL )
56 SmartId aSmartHelpId( _rHelpURL );
57 if ( 0 == _rHelpURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "HID:" ) ) )
58 aSmartHelpId = SmartId( _rHelpURL.copy( sizeof( "HID:" ) - 1 ).toInt32() );
59 return aSmartHelpId;
62 //------------------------------------------------------------------------
63 ::rtl::OUString HelpIdUrl::getHelpURL( sal_uInt32 _nHelpId )
65 ::rtl::OUStringBuffer aBuffer;
66 aBuffer.appendAscii( "HID:" );
67 aBuffer.append( (sal_Int32)_nHelpId );
68 return aBuffer.makeStringAndClear();
70 //............................................................................
71 } // namespace pcr
72 //............................................................................