Index: ucbhelper/source/client/content.cxx =================================================================== --- ucbhelper/source/client/content.cxx (revision 270567) +++ ucbhelper/source/client/content.cxx (working copy) @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -51,6 +52,8 @@ #include #include #include +#include +#include #include #include #include @@ -68,6 +71,8 @@ #include #include #include +#include + #include #include #include @@ -77,7 +82,11 @@ #include #endif #include +#include +#include +#include + using namespace com::sun::star::container; using namespace com::sun::star::beans; using namespace com::sun::star::io; @@ -377,6 +386,54 @@ return Reference< XContent >(); } +namespace +{ + +void +lcl_displayMessage( + const Reference& rEnvironment, + const rtl::OUString& rUri) +{ + // Create exception + const Reference xCPM( + getContentBroker(true)->getContentProviderManagerInterface()); + const PropertyValue aUriProperty( + rtl::OUString::createFromAscii("Uri"), + -1, + makeAny(getSystemPathFromFileURL(xCPM, rUri)), + PropertyState_DIRECT_VALUE) + ; + Sequence lArguments(1); + lArguments[0] <<= aUriProperty; + const InteractiveAugmentedIOException xError( + rtl::OUString(), + 0, + InteractionClassification_ERROR, + IOErrorCode_NO_FILE, + lArguments) + ; + + // Create interaction request + std::auto_ptr aRequest( + new ucbhelper::SimpleInteractionRequest(makeAny(xError), CONTINUATION_APPROVE)); + { + Reference xContinuation( + new ::ucbhelper::InteractionApprove(aRequest.get())); + Sequence > lContinuations(1); + lContinuations[0].set(xContinuation); + aRequest->setContinuations(lContinuations); + } + + Reference xInteraction(rEnvironment->getInteractionHandler()); + if (xInteraction.is()) + { + Reference xRequest(aRequest.release()); + xInteraction->handle(xRequest); + } +} + +} + //========================================================================= //========================================================================= // @@ -1188,7 +1245,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XInputStream >(); + } Reference< XActiveDataSink > xSink = new ActiveDataSink; @@ -1213,7 +1273,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XInputStream >(); + } Reference< XActiveDataSink > xSink = new ActiveDataSink; @@ -1238,7 +1301,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XStream >(); + } Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer; @@ -1263,7 +1329,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XStream >(); + } Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer; @@ -1288,7 +1357,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return sal_False; + } OpenCommandArgument2 aArg; aArg.Mode = OpenMode::DOCUMENT; @@ -1311,7 +1383,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return sal_False; + } OpenCommandArgument2 aArg; aArg.Mode = OpenMode::DOCUMENT; Index: comphelper/source/misc/mediadescriptor.cxx =================================================================== --- comphelper/source/misc/mediadescriptor.cxx (revision 270567) +++ comphelper/source/misc/mediadescriptor.cxx (working copy) @@ -727,7 +727,8 @@ xRequest->getRequest() >>= exIO; bAbort = ( (exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED ) || - (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION ) + (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION ) || + (exIO.Code == css::ucb::IOErrorCode_NO_FILE) ); } break;