Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <com/sun/star/ucb/Command.hpp>
30 : : #include <com/sun/star/ucb/XCommandEnvironment.hpp>
31 : : #include <com/sun/star/ucb/XCommandProcessor.hpp>
32 : :
33 : : #include "resultsetforroot.hxx"
34 : : #include "databases.hxx"
35 : :
36 : : using namespace chelp;
37 : : using namespace com::sun::star;
38 : : using namespace com::sun::star::ucb;
39 : :
40 : :
41 : :
42 : 12 : ResultSetForRoot::ResultSetForRoot( const uno::Reference< lang::XMultiServiceFactory >& xMSF,
43 : : const uno::Reference< XContentProvider >& xProvider,
44 : : sal_Int32 nOpenMode,
45 : : const uno::Sequence< beans::Property >& seq,
46 : : const uno::Sequence< NumberedSortingInfo >& seqSort,
47 : : URLParameter& aURLParameter,
48 : : Databases* pDatabases )
49 : : : ResultSetBase( xMSF,xProvider,nOpenMode,seq,seqSort ),
50 : : m_aURLParameter( aURLParameter ),
51 : 12 : m_pDatabases( pDatabases )
52 : : {
53 [ + - ][ + - ]: 12 : m_aPath = m_pDatabases->getModuleList( m_aURLParameter.get_language() );
[ + - ]
54 [ + - ]: 12 : m_aItems.resize( m_aPath.size() );
55 [ + - ]: 12 : m_aIdents.resize( m_aPath.size() );
56 : :
57 : 12 : Command aCommand;
58 : 12 : aCommand.Name = rtl::OUString( "getPropertyValues" );
59 [ + - ]: 12 : aCommand.Argument <<= m_sProperty;
60 : :
61 [ - + ]: 12 : for( sal_uInt32 i = 0; i < m_aPath.size(); ++i )
62 : : {
63 : 0 : m_aPath[i] =
64 : : rtl::OUString( "vnd.sun.star.help://" ) +
65 : 0 : m_aPath[i] +
66 : : rtl::OUString( "?Language=" ) +
67 : : m_aURLParameter.get_language() +
68 : : rtl::OUString( "&System=" ) +
69 [ # # ]: 0 : m_aURLParameter.get_system();
70 : :
71 : 0 : m_nRow = sal_Int32( i );
72 : :
73 [ # # ]: 0 : uno::Reference< XContent > content = queryContent();
74 [ # # ]: 0 : if( content.is() )
75 : : {
76 [ # # ]: 0 : uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
77 [ # # ][ # # ]: 0 : cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( 0 ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
[ # # ][ # # ]
78 : : }
79 : 0 : m_nRow = 0xffffffff;
80 : 12 : }
81 : 12 : }
82 : :
83 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|