25#include <com/sun/star/sdbc/XResultSet.hpp>
26#include <com/sun/star/sdbc/XRow.hpp>
27#include <com/sun/star/task/InteractionHandler.hpp>
28#include <com/sun/star/ucb/CommandAbortedException.hpp>
29#include <com/sun/star/ucb/XContentAccess.hpp>
30#include <com/sun/star/ucb/XDynamicResultSet.hpp>
31#include <com/sun/star/io/XInputStream.hpp>
49 vector<OUString> aList;
53 uno::Reference< sdbc::XResultSet > xResultSet;
54 uno::Reference< ucb::XDynamicResultSet > xDynResultSet;
59 if ( xDynResultSet.is() )
60 xResultSet = xDynResultSet->getStaticResultSet();
62 catch(
const uno::Exception& )
68 if ( xResultSet.is() )
70 uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY );
71 uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
75 while ( xResultSet->next() )
77 OUString aTitle( xRow->getString(1) );
78 OUString aType( xRow->getString(2) );
79 OUString aRow = aTitle +
83 xContentAccess->queryContentIdentifierString();
84 aList.push_back( aRow );
87 catch(
const uno::Exception& )
93 catch(
const uno::Exception& )
107 uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
108 uno::Reference< task::XInteractionHandler > xInteractionHandler(
109 task::InteractionHandler::createWithParent(xContext,
nullptr), uno::UNO_QUERY_THROW );
112 uno::Reference< sdbc::XResultSet > xResultSet;
116 uno::Reference< ucb::XDynamicResultSet > xDynResultSet = aCnt.
createDynamicCursor( {
"Title",
"IsFolder" } );
117 if ( xDynResultSet.is() )
118 xResultSet = xDynResultSet->getStaticResultSet();
120 catch(
const ucb::CommandAbortedException& )
123 catch(
const uno::Exception& )
127 if ( xResultSet.is() )
129 uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY );
130 uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
134 while ( xResultSet->next() )
136 OUString aTitle( xRow->getString(1) );
137 bool bFolder = xRow->getBoolean(2);
138 OUString aRow = aTitle +
"\t" +
139 xContentAccess->queryContentIdentifierString() +
"\t" +
140 (bFolder ? std::u16string_view(
u"1") : std::u16string_view(
u"0"));
144 catch(
const ucb::CommandAbortedException& )
147 catch(
const uno::Exception& )
152 catch(
const uno::Exception& )
165 uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
166 uno::Reference< task::XInteractionHandler > xInteractionHandler(
167 task::InteractionHandler::createWithParent(xContext,
nullptr), uno::UNO_QUERY_THROW );
172 uno::Sequence< sal_Int8 > lData;
173 sal_Int32 nRead =
xStream->readBytes( lData, 1024 );
176 std::string_view sOldString(
reinterpret_cast<char const *
>(lData.getConstArray()), nRead );
177 OUString sString = OStringToOUString( sOldString, RTL_TEXTENCODING_UTF8 );
178 aRet.append( sString );
180 nRead =
xStream->readBytes( lData, 1024 );
183 catch(
const uno::Exception& )
187 return aRet.makeStringAndClear();
197 uno::Reference< ucb::XCommandEnvironment >(),
201 SAL_WARN(
"sfx.bastyp",
"Property 'IsErrorDocument' is missing" );
204 catch(
const uno::Exception& )
222 catch(
const uno::Exception& )
PropertiesInfo aProperties
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
INetProtocol GetProtocol() const
static OUString GetActiveHelpString(const OUString &rURL)
static sal_Int64 GetSize(std::u16string_view rContent)
static std::vector< OUString > GetResultSet(const OUString &rURL)
static std::vector< OUString > GetHelpTreeViewContents(const OUString &rURL)
static bool IsHelpErrorDocument(std::u16string_view rURL)
css::uno::Any getPropertyValue(const OUString &rPropertyName)
css::uno::Reference< css::io::XInputStream > openStream()
css::uno::Reference< css::ucb::XDynamicResultSet > createDynamicCursor(const css::uno::Sequence< OUString > &rPropertyNames, ResultSetInclude eMode=INCLUDE_FOLDERS_AND_DOCUMENTS)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define SAL_WARN(area, stream)
Reference< XComponentContext > getProcessComponentContext()