nss: upgrade to release 3.73
[LibreOffice.git] / xmlhelp / source / cxxhelp / provider / resultsetforroot.cxx
blobb2b7e29a2dbed304ca71d08d98586f2602039627
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;
32 ResultSetForRoot::ResultSetForRoot( const uno::Reference< uno::XComponentContext >& rxContext,
33 const uno::Reference< XContentProvider >& xProvider,
34 const uno::Sequence< beans::Property >& seq,
35 URLParameter const & aURLParameter,
36 Databases* pDatabases )
37 : ResultSetBase( rxContext, xProvider,seq )
39 m_aPath = pDatabases->getModuleList( aURLParameter.get_language() );
40 m_aItems.resize( m_aPath.size() );
41 m_aIdents.resize( m_aPath.size() );
43 Command aCommand;
44 aCommand.Name = "getPropertyValues";
45 aCommand.Argument <<= m_sProperty;
47 for( size_t i = 0; i < m_aPath.size(); ++i )
49 m_aPath[i] =
50 "vnd.sun.star.help://" +
51 m_aPath[i] +
52 "?Language=" +
53 aURLParameter.get_language() +
54 "&System=" +
55 aURLParameter.get_system();
57 m_nRow = sal_Int32( i );
59 uno::Reference< XContent > content = queryContent();
60 if( content.is() )
62 uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
63 cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( nullptr ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
65 m_nRow = 0xffffffff;
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */