merge the formfield patch from ooo-build
[ooovba.git] / xmlhelp / source / cxxhelp / provider / resultsetforroot.cxx
blob12b1712f18de27dc904f9e89fe78a04631a3a2ff
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: resultsetforroot.cxx,v $
10 * $Revision: 1.8 $
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_xmlhelp.hxx"
33 #include <com/sun/star/ucb/Command.hpp>
34 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
35 #include <com/sun/star/ucb/XCommandProcessor.hpp>
37 #include "resultsetforroot.hxx"
38 #include "databases.hxx"
40 using namespace chelp;
41 using namespace com::sun::star;
42 using namespace com::sun::star::ucb;
46 ResultSetForRoot::ResultSetForRoot( const uno::Reference< lang::XMultiServiceFactory >& xMSF,
47 const uno::Reference< XContentProvider >& xProvider,
48 sal_Int32 nOpenMode,
49 const uno::Sequence< beans::Property >& seq,
50 const uno::Sequence< NumberedSortingInfo >& seqSort,
51 URLParameter& aURLParameter,
52 Databases* pDatabases )
53 : ResultSetBase( xMSF,xProvider,nOpenMode,seq,seqSort ),
54 m_aURLParameter( aURLParameter ),
55 m_pDatabases( pDatabases )
57 m_aPath = m_pDatabases->getModuleList( m_aURLParameter.get_language() );
58 m_aItems.resize( m_aPath.size() );
59 m_aIdents.resize( m_aPath.size() );
61 Command aCommand;
62 aCommand.Name = rtl::OUString::createFromAscii( "getPropertyValues" );
63 aCommand.Argument <<= m_sProperty;
65 for( sal_uInt32 i = 0; i < m_aPath.size(); ++i )
67 m_aPath[i] =
68 rtl::OUString::createFromAscii( "vnd.sun.star.help://" ) +
69 m_aPath[i] +
70 rtl::OUString::createFromAscii( "?Language=" ) +
71 m_aURLParameter.get_language() +
72 rtl::OUString::createFromAscii( "&System=" ) +
73 m_aURLParameter.get_system();
75 m_nRow = sal_Int32( i );
77 uno::Reference< XContent > content = queryContent();
78 if( content.is() )
80 uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
81 cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( 0 ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
83 m_nRow = 0xffffffff;