uui/source/iahndl.cxx | 89 -------------------------------------------------- uui/source/iahndl.hxx | 7 --- 2 files changed, 96 deletions(-)
New commits: commit e45cfa739128a878d55214216ff14d7807a63bc2 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Dec 13 12:06:11 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Wed Dec 13 17:48:25 2023 +0100 uui: remove use of org.openoffice.ucb.InteractionHandler/InteractionHandlers Since the configuration schema was removed in commit c48e810f1a856d392b2ffce6b343082406644ab8 this can now fail with: com.sun.star.uno.RuntimeException message: "cannot find /org.openoffice.ucb.InteractionHandler/InteractionHandlers at /home/ms/lo/master/configmgr/source/rootaccess.cxx:214" Just remove the code, there has been a better replacement since commit af66a011a47f673a9a0ee2c6a0b27e23b11b6ebf in 2010. Change-Id: I80582f77dfb1f301fa7fe4ccd2d5931e1c8771ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160678 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 85c820bd3f1c..2a029de54296 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -264,17 +264,6 @@ UUIInteractionHelper::isInformationalErrorMessageRequest( return xAbort.is(); } -bool -UUIInteractionHelper::tryOtherInteractionHandler( - uno::Reference< task::XInteractionRequest > const & rRequest) -{ - InteractionHandlerDataList dataList; - getInteractionHandlerList(dataList); - - return std::any_of(dataList.cbegin(), dataList.cend(), - [&](const InteractionHandlerData& rData) { return handleCustomRequest( rRequest, rData.ServiceName ); }); -} - namespace { @@ -838,10 +827,6 @@ UUIInteractionHelper::handleRequest_impl( // typed InteractionHandlers (ooo.Interactions) if ( handleTypedHandlerImplementations( rRequest ) ) return true; - - // legacy configuration (ooo.ucb.InteractionHandlers) - if (tryOtherInteractionHandler( rRequest )) - return true; } // Not handled. @@ -858,80 +843,6 @@ UUIInteractionHelper::handleRequest_impl( return false; } -void -UUIInteractionHelper::getInteractionHandlerList( - InteractionHandlerDataList &rdataList) -{ - try - { - uno::Reference< lang::XMultiServiceFactory > xConfigProv = - configuration::theDefaultProvider::get( m_xContext ); - - uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( - { - {"nodepath", uno::Any(OUString("/org.openoffice.ucb.InteractionHandler/InteractionHandlers"))} - })); - - uno::Reference< uno::XInterface > xInterface( - xConfigProv->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess" , aArguments ) ); - - if ( !xInterface.is() ) - throw uno::RuntimeException("unable to instantiate config access"); - - uno::Reference< container::XNameAccess > xNameAccess( - xInterface, uno::UNO_QUERY_THROW ); - const uno::Sequence< OUString > aElems = xNameAccess->getElementNames(); - - if ( aElems.hasElements() ) - { - uno::Reference< container::XHierarchicalNameAccess > - xHierNameAccess( xInterface, uno::UNO_QUERY_THROW ); - - // Iterate over children. - for ( const auto& rElem : aElems ) - { - try - { - InteractionHandlerData aInfo; - - // Obtain service name. - OUString aKeyBuffer = "['" + rElem + "']/ServiceName"; - - OUString aValue; - if ( !( xHierNameAccess->getByHierarchicalName( - aKeyBuffer ) >>= aValue ) ) - { - OSL_FAIL( "GetInteractionHandlerList - " - "Error getting item value!" ); - continue; - } - - aInfo.ServiceName = aValue; - - // Append info to list. - rdataList.push_back( aInfo ); - } - catch ( container::NoSuchElementException& ) - { - // getByHierarchicalName - - OSL_FAIL( "GetInteractionHandlerList - " - "caught NoSuchElementException!" ); - } - } - } - } - catch ( uno::RuntimeException const & ) - { - throw; - } - catch ( uno::Exception const & ) - { - TOOLS_WARN_EXCEPTION( "uui", "GetInteractionHandlerList" ); - } -} - const uno::Reference< awt::XWindow>& UUIInteractionHelper::getParentXWindow() const { diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 284fb685a902..a37f15e9a7b2 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -127,13 +127,6 @@ private: css::uno::Reference< css::task::XInteractionRequest > const & rRequest ); - bool - tryOtherInteractionHandler( - css::uno::Reference< css::task::XInteractionRequest > const & rRequest); - - void - getInteractionHandlerList(InteractionHandlerDataList &rdataList); - static bool isInformationalErrorMessageRequest( css::uno::Sequence<