Index: ucbhelper/source/client/content.cxx =================================================================== --- ucbhelper/source/client/content.cxx (revision 270567) +++ ucbhelper/source/client/content.cxx (working copy) @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -48,6 +49,8 @@ #include #include #include +#include +#include #include #include #include @@ -65,6 +68,8 @@ #include #include #include +#include + #include #include #include @@ -72,6 +77,10 @@ #include #include #include +#include +#include + +#include using namespace com::sun::star::container; using namespace com::sun::star::beans; @@ -375,6 +384,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); + } +} + +} + //========================================================================= //========================================================================= // @@ -1186,7 +1243,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XInputStream >(); + } Reference< XActiveDataSink > xSink = new ActiveDataSink; @@ -1211,7 +1271,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XInputStream >(); + } Reference< XActiveDataSink > xSink = new ActiveDataSink; @@ -1236,7 +1299,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XStream >(); + } Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer; @@ -1261,7 +1327,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return Reference< XStream >(); + } Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer; @@ -1286,7 +1355,10 @@ throw( CommandAbortedException, RuntimeException, Exception ) { if ( !isDocument() ) + { + lcl_displayMessage(m_xImpl->getEnvironment(), getURL()); return sal_False; + } OpenCommandArgument2 aArg; aArg.Mode = OpenMode::DOCUMENT; @@ -1309,7 +1381,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/stillreadwriteinteraction.cxx 2010-07-06 15:32:02.000000000 +0100 +++ comphelper/source/misc/stillreadwriteinteraction.cxx 2010-07-06 15:32:31.000000000 +0100 @@ -103,6 +103,7 @@ bAbort = ( (exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED ) || (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION ) + || (exIO.Code == css::ucb::IOErrorCode_NO_FILE ) || (exIO.Code == css::ucb::IOErrorCode_NOT_EXISTING ) #ifdef MACOSX // this is a workaround for MAC, on this platform if the file is locked