/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: templateimpl.cxx,v $ * $Revision: 1.24 $ * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_configmgr.hxx" #include #include "templateimpl.hxx" #include "treemanager.hxx" #include "node.hxx" #include "nodevisitor.hxx" #include "strdecl.hxx" #include "typeconverter.hxx" #include "localizedtreeactions.hxx" #include "treeactions.hxx" #include "apitypes.hxx" #ifndef INCLUDED_MAP #include #define INCLUDED_MAP #endif namespace configmgr { namespace configuration { //----------------------------------------------------------------------------- com::sun::star::uno::Type TemplateName::resolveSimpleTypeName(rtl::OUString const& aName) { rtl::OUString sTypeName = aName; return parseTemplateName(sTypeName); } //----------------------------------------------------------------------------- #if OSL_DEBUG_LEVEL > 0 rtl::OUString TemplateName::makeNativeTypeModuleName() { return rtl::OUString( TEMPLATE_MODULE_NATIVE_VALUE ); } //----------------------------------------------------------------------------- rtl::OUString TemplateName::makeLocalizedTypeModuleName() { return rtl::OUString( TEMPLATE_MODULE_LOCALIZED_VALUE ); } #endif //----------------------------------------------------------------------------- bool TemplateName::isSimpleTypeName() const { bool bIsSimple = (aModule.compareToAscii(TEMPLATE_MODULE_NATIVE_PREFIX, TEMPLATE_MODULE_NATIVE_PREFIX.getLength()) == 0); OSL_ENSURE(!bIsSimple || aModule == makeNativeTypeModuleName() || aModule == makeLocalizedTypeModuleName(), "ERROR: Invalid template module with native prefix found"); return bIsSimple; } //----------------------------------------------------------------------------- com::sun::star::uno::Type TemplateName::resolveToSimpleType() const { com::sun::star::uno::Type aType; if ( isSimpleTypeName() ) { aType = resolveSimpleTypeName( aName ); } else OSL_ENSURE(false, "TemplateName::resolveToSimpleType must be called only for simple type name pairs"); return aType; } //----------------------------------------------------------------------------- // class TemplateImplHelper //----------------------------------------------------------------------------- rtl::Reference