Kaydet (Commit) f60eaab7 authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno

Related: tdf#99312, add specialized interaction handler

Needed to manage https certificates and authentication whenever
needed.

Change-Id: If20b85a9b349b203a8c46d453afa823629d114cb
Reviewed-on: https://gerrit.libreoffice.org/27927Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>
üst 0bab74d6
......@@ -35,6 +35,7 @@ $(eval $(call gb_CppunitTest_use_components,filter_eps_test,\
i18npool/util/i18npool \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
uui/util/uui \
))
$(eval $(call gb_CppunitTest_use_configuration,filter_eps_test))
......
......@@ -48,6 +48,7 @@ $(eval $(call gb_CppunitTest_use_components,sax_xmlimport,\
sax/source/expatwrap/expwrap \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
uui/util/uui \
))
$(eval $(call gb_CppunitTest_use_configuration,sax_xmlimport))
......
......@@ -20,12 +20,14 @@
#include <rtl/ustring.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
#include <com/sun/star/io/XActiveDataStreamer.hpp>
#include <comphelper/simplefileaccessinteraction.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/streamwrap.hxx>
#include <ucblockbytes.hxx>
......@@ -140,7 +142,14 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo
SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode )
{
return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), true /* bEnsureFileExists */ );
// related tdf#99312
// create a specialized interaction handler to manages Web certificates and Web credentials when needed
Reference< XInteractionHandler > xIH(
css::task::InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), nullptr ) );
Reference < XInteractionHandler > xIHScoped( static_cast< XInteractionHandler *> (
new comphelper::SimpleFileAccessInteraction( xIH ) ) );
return lcl_CreateStream( rFileName, eOpenMode, xIHScoped, true /* bEnsureFileExists */ );
}
SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
......@@ -152,7 +161,13 @@ SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode e
SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
bool bFileExists )
{
return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), !bFileExists );
// related tdf#99312
// create a specialized interaction handler to manages Web certificates and Web credentials when needed
Reference< XInteractionHandler > xIH(
css::task::InteractionHandler::createWithParent( comphelper::getProcessComponentContext(), nullptr ) );
Reference < XInteractionHandler > xIHScoped( static_cast< XInteractionHandler *> (
new comphelper::SimpleFileAccessInteraction( xIH ) ) );
return lcl_CreateStream( rFileName, eOpenMode, xIHScoped,!bFileExists );
}
SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream )
......
......@@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_use_components,vcl_filters_test,\
i18npool/util/i18npool \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
uui/util/uui \
))
$(eval $(call gb_CppunitTest_use_configuration,vcl_filters_test))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment