Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-05-08 10:10:01+0000
Modified:
   dba/dbaccess/source/ext/macromigration/macromigrationwizard.cxx

Log:
 don't accept documents which are read-only

File Changes:

Directory: /dba/dbaccess/source/ext/macromigration/
===================================================

File [changed]: macromigrationwizard.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ext/macromigration/macromigrationwizard.cxx?r1=1.3.2.1&r2=1.3.2.2
Delta lines:  +12 -1
--------------------
--- macromigrationwizard.cxx    2008-04-30 09:23:55+0000        1.3.2.1
+++ macromigrationwizard.cxx    2008-05-08 10:09:59+0000        1.3.2.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: macromigrationwizard.cxx,v $
- * $Revision: 1.3.2.1 $
+ * $Revision: 1.3.2.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -37,6 +37,7 @@
 /** === begin UNO includes === **/
 #include <com/sun/star/ucb/AlreadyInitializedException.hpp>
 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
 /** === end UNO includes === **/
 
 #include <comphelper/componentcontext.hxx>
@@ -64,6 +65,7 @@
     using ::com::sun::star::ucb::AlreadyInitializedException;
     using ::com::sun::star::sdb::XOfficeDatabaseDocument;
     using ::com::sun::star::lang::IllegalArgumentException;
+    using ::com::sun::star::frame::XStorable;
        /** === end UNO using === **/
 
        //====================================================================
@@ -223,6 +225,15 @@
                 1
             );
 
+        Reference< XStorable > xDocStor( m_xDocument, UNO_QUERY_THROW );
+        if ( xDocStor->isReadonly() )
+            throw IllegalArgumentException(
+                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Not applicable 
to read-only documents." ) ),
+                    // TODO: resource
+                *this,
+                1
+            );
+
         m_bInitialized = true;
     }
 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to