bump product version to 5.0.4.1
[LibreOffice.git] / xmlhelp / source / cxxhelp / provider / resultsetforroot.cxx
blobc269d579da864b009840f702aa22c0096e3c6270
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/ucb/Command.hpp>
21 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
22 #include <com/sun/star/ucb/XCommandProcessor.hpp>
24 #include "resultsetforroot.hxx"
25 #include "databases.hxx"
27 using namespace chelp;
28 using namespace com::sun::star;
29 using namespace com::sun::star::ucb;
33 ResultSetForRoot::ResultSetForRoot( const uno::Reference< uno::XComponentContext >& rxContext,
34 const uno::Reference< XContentProvider >& xProvider,
35 sal_Int32 nOpenMode,
36 const uno::Sequence< beans::Property >& seq,
37 const uno::Sequence< NumberedSortingInfo >& seqSort,
38 URLParameter& aURLParameter,
39 Databases* pDatabases )
40 : ResultSetBase( rxContext, xProvider,nOpenMode,seq,seqSort ),
41 m_aURLParameter( aURLParameter ),
42 m_pDatabases( pDatabases )
44 m_aPath = m_pDatabases->getModuleList( m_aURLParameter.get_language() );
45 m_aItems.resize( m_aPath.size() );
46 m_aIdents.resize( m_aPath.size() );
48 Command aCommand;
49 aCommand.Name = "getPropertyValues";
50 aCommand.Argument <<= m_sProperty;
52 for( sal_uInt32 i = 0; i < m_aPath.size(); ++i )
54 m_aPath[i] =
55 "vnd.sun.star.help://" +
56 m_aPath[i] +
57 "?Language=" +
58 m_aURLParameter.get_language() +
59 "&System=" +
60 m_aURLParameter.get_system();
62 m_nRow = sal_Int32( i );
64 uno::Reference< XContent > content = queryContent();
65 if( content.is() )
67 uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
68 cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( 0 ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
70 m_nRow = 0xffffffff;
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */