8076325
Index: ucbhelper/source/client/content.cxx
8076325
===================================================================
8076325
--- ucbhelper/source/client/content.cxx	(revision 270567)
8076325
+++ ucbhelper/source/client/content.cxx	(working copy)
8076325
@@ -39,6 +39,7 @@
8076325
 #include <cppuhelper/weak.hxx>
8076325
 
8076325
 #include <cppuhelper/implbase1.hxx>
8076325
+#include <com/sun/star/beans/PropertyValue.hpp>
8076325
 #include <com/sun/star/ucb/ContentCreationError.hpp>
8076325
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
8076325
 #include <com/sun/star/ucb/XCommandInfo.hpp>
8076325
@@ -48,6 +49,8 @@
8076325
 #include <com/sun/star/ucb/ContentAction.hpp>
8076325
 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
8076325
 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
8076325
+#include <com/sun/star/ucb/IOErrorCode.hpp>
8076325
+#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
8076325
 #include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp>
8076325
 #include <com/sun/star/ucb/NameClash.hpp>
8076325
 #include <com/sun/star/ucb/OpenMode.hpp>
8076325
@@ -65,6 +68,8 @@
8076325
 #include <com/sun/star/sdbc/XRow.hpp>
8076325
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
8076325
 #include <com/sun/star/beans/UnknownPropertyException.hpp>
8076325
+#include <com/sun/star/task/XInteractionRequest.hpp>
8076325
+
8076325
 #include <ucbhelper/macros.hxx>
8076325
 #include <ucbhelper/content.hxx>
8076325
 #include <ucbhelper/contentbroker.hxx>
8076325
@@ -72,6 +77,10 @@
8076325
 #include <ucbhelper/activedatastreamer.hxx>
8076325
 #include <ucbhelper/interactionrequest.hxx>
8076325
 #include <ucbhelper/cancelcommandexecution.hxx>
8076325
+#include <ucbhelper/fileidentifierconverter.hxx>
8076325
+#include <ucbhelper/simpleinteractionrequest.hxx>
8076325
+
8076325
+#include <memory>
8076325
 
8076325
 using namespace com::sun::star::container;
8076325
 using namespace com::sun::star::beans;
8076325
@@ -375,6 +384,54 @@
8076325
     return Reference< XContent >();
8076325
 }
8076325
 
8076325
+namespace
8076325
+{
8076325
+
8076325
+void
8076325
+lcl_displayMessage(
8076325
+        const Reference<XCommandEnvironment>& rEnvironment,
8076325
+        const rtl::OUString& rUri)
8076325
+{
8076325
+    // Create exception
8076325
+    const Reference<XContentProviderManager> xCPM(
8076325
+            getContentBroker(true)->getContentProviderManagerInterface());
8076325
+    const PropertyValue aUriProperty(
8076325
+            rtl::OUString::createFromAscii("Uri"),
8076325
+            -1,
8076325
+            makeAny(getSystemPathFromFileURL(xCPM, rUri)),
8076325
+            PropertyState_DIRECT_VALUE)
8076325
+        ;
8076325
+    Sequence<Any> lArguments(1);
8076325
+    lArguments[0] <<= aUriProperty;
8076325
+    const InteractiveAugmentedIOException xError(
8076325
+            rtl::OUString(),
8076325
+            0,
8076325
+            InteractionClassification_ERROR,
8076325
+            IOErrorCode_NO_FILE,
8076325
+            lArguments)
8076325
+        ;
8076325
+
8076325
+    // Create interaction request
8076325
+    std::auto_ptr<ucbhelper::SimpleInteractionRequest> aRequest(
8076325
+            new ucbhelper::SimpleInteractionRequest(makeAny(xError), CONTINUATION_APPROVE));
8076325
+    {
8076325
+        Reference<XInteractionContinuation> xContinuation(
8076325
+                new ::ucbhelper::InteractionApprove(aRequest.get()));
8076325
+        Sequence<Reference<XInteractionContinuation> > lContinuations(1);
8076325
+        lContinuations[0].set(xContinuation);
8076325
+        aRequest->setContinuations(lContinuations);
8076325
+    }
8076325
+
8076325
+    Reference<XInteractionHandler> xInteraction(rEnvironment->getInteractionHandler());
8076325
+    if (xInteraction.is())
8076325
+    {
8076325
+        Reference<XInteractionRequest> xRequest(aRequest.release());
8076325
+        xInteraction->handle(xRequest);
8076325
+    }
8076325
+}
8076325
+    
8076325
+}
8076325
+
8076325
 //=========================================================================
8076325
 //=========================================================================
8076325
 //
8076325
@@ -1186,7 +1243,10 @@
8076325
     throw( CommandAbortedException, RuntimeException, Exception )
8076325
 {
8076325
     if ( !isDocument() )
8076325
+    {
8076325
+        lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
8076325
         return Reference< XInputStream >();
8076325
+    }
8076325
 
8076325
     Reference< XActiveDataSink > xSink = new ActiveDataSink;
8076325
 
8076325
@@ -1211,7 +1271,10 @@
8076325
     throw( CommandAbortedException, RuntimeException, Exception )
8076325
 {
8076325
     if ( !isDocument() )
8076325
+    {
8076325
+        lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
8076325
         return Reference< XInputStream >();
8076325
+    }
8076325
 
8076325
     Reference< XActiveDataSink > xSink = new ActiveDataSink;
8076325
 
8076325
@@ -1236,7 +1299,10 @@
8076325
     throw( CommandAbortedException, RuntimeException, Exception )
8076325
 {
8076325
     if ( !isDocument() )
8076325
+    {
8076325
+        lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
8076325
         return Reference< XStream >();
8076325
+    }
8076325
 
8076325
     Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer;
8076325
 
8076325
@@ -1261,7 +1327,10 @@
8076325
     throw( CommandAbortedException, RuntimeException, Exception )
8076325
 {
8076325
     if ( !isDocument() )
8076325
+    {
8076325
+        lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
8076325
         return Reference< XStream >();
8076325
+    }
8076325
 
8076325
     Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer;
8076325
 
8076325
@@ -1286,7 +1355,10 @@
8076325
     throw( CommandAbortedException, RuntimeException, Exception )
8076325
 {
8076325
     if ( !isDocument() )
8076325
+    {
8076325
+        lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
8076325
         return sal_False;
8076325
+    }
8076325
 
8076325
     OpenCommandArgument2 aArg;
8076325
     aArg.Mode       = OpenMode::DOCUMENT;
8076325
@@ -1309,7 +1381,10 @@
8076325
     throw( CommandAbortedException, RuntimeException, Exception )
8076325
 {
8076325
     if ( !isDocument() )
8076325
+    {
8076325
+        lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
8076325
         return sal_False;
8076325
+    }
8076325
 
8076325
     OpenCommandArgument2 aArg;
8076325
     aArg.Mode       = OpenMode::DOCUMENT;
8076325
Index: comphelper/source/misc/mediadescriptor.cxx
8076325
===================================================================
8076325
--- comphelper/source/misc/stillreadwriteinteraction.cxx	2010-07-06 15:32:02.000000000 +0100
8076325
+++ comphelper/source/misc/stillreadwriteinteraction.cxx	2010-07-06 15:32:31.000000000 +0100
8076325
@@ -103,6 +103,7 @@
8076325
 			bAbort = (
8076325
 				(exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED     )
8076325
 				|| (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION )
8076325
+				|| (exIO.Code == css::ucb::IOErrorCode_NO_FILE )
8076325
 				|| (exIO.Code == css::ucb::IOErrorCode_NOT_EXISTING )
8076325
 #ifdef MACOSX
8076325
 				// this is a workaround for MAC, on this platform if the file is locked