Hello community,
here is the log from the commit of package OpenOffice_org-base for openSUSE:Factory
checked in at Wed Apr 29 01:24:58 CEST 2009.
--------
--- OpenOffice_org-base/OpenOffice_org-base.changes 2009-04-17 17:44:01.000000000 +0200
+++ OpenOffice_org-base/OpenOffice_org-base.changes 2009-04-24 13:54:45.000000000 +0200
@@ -1,0 +2,8 @@
+Fri Apr 24 13:48:09 CEST 2009 - pmladek(a)suse.cz
+
+- updated to the milestone ooo310-m10
+- updated ooo-build to version 3.0.99.6 (3.1-beta6)
+- updated extra localization sources: be-BY, bg, cs, da, el, et, fi, ga, km,
+ lt, mk, sk, sl
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
ooo310-m9-base.tar.bz2
New:
----
ooo310-m10-base.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ OpenOffice_org-base.spec ++++++
--- /var/tmp/diff_new_pack.X25610/_old 2009-04-29 01:24:13.000000000 +0200
+++ /var/tmp/diff_new_pack.X25610/_new 2009-04-29 01:24:13.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package OpenOffice_org-base (Version 3.0.99.5)
+# spec file for package OpenOffice_org-base (Version 3.0.99.6)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,9 +19,9 @@
Name: OpenOffice_org-base
-Version: 3.0.99.5
+Version: 3.0.99.6
Release: 1
-%define ooo_build_version 3.0.99.5
+%define ooo_build_version 3.0.99.6
%define piece base
#!BuildIgnore: OpenOffice_org
BuildRequires: ImageMagick ant ant-apache-regexp bison boost-devel ccache cups-devel curl-devel db-devel flac-devel flex gnome-vfs2-devel gperf gtk2-devel icu java-devel kdelibs3-devel krb5 libexif mono-devel neon-devel openldap2-devel pam-devel perl-Archive-Zip perl-Compress-Zlib python-devel recode unixODBC-devel unzip update-desktop-files xml-commons-apis xorg-x11 zip
@@ -30,7 +30,7 @@
BuildRequires: OpenOffice_org-libs-core-devel = %version
%define ooo_prefix %_libdir
%define ooo_home ooo3
-%define ooo_build_tag ooo310-m9
+%define ooo_build_tag ooo310-m10
License: LGPL v3 only
Group: Productivity/Office/Suite
AutoReqProv: on
@@ -130,6 +130,11 @@
%ooo_prefix/%ooo_home/solver/noarch
%changelog
+* Fri Apr 24 2009 pmladek(a)suse.cz
+- updated to the milestone ooo310-m10
+- updated ooo-build to version 3.0.99.6 (3.1-beta6)
+- updated extra localization sources: be-BY, bg, cs, da, el, et, fi, ga, km,
+ lt, mk, sk, sl
* Fri Apr 17 2009 pmladek(a)suse.cz
- updated ooo-build to version 3.0.99.5 (3.1-beta5)
* Wed Apr 08 2009 pmladek(a)suse.cz
++++++ ooo310-m9-base.tar.bz2 -> ooo310-m10-base.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/qa/complex/dbaccess/DatabaseDocument.java new/ooo310-m10-base/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
--- old/ooo310-m9-base/dbaccess/qa/complex/dbaccess/DatabaseDocument.java 2009-04-02 12:41:34.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/qa/complex/dbaccess/DatabaseDocument.java 2009-04-15 09:09:22.000000000 +0200
@@ -334,7 +334,6 @@
new UnoMethodDescriptor( XStorable.class, "store" ),
new UnoMethodDescriptor( XFormDocumentsSupplier.class, "getFormDocuments" ),
new UnoMethodDescriptor( XReportDocumentsSupplier.class, "getReportDocuments" ),
- new UnoMethodDescriptor( XScriptInvocationContext.class, "getScriptContainer" ),
new UnoMethodDescriptor( XScriptProviderSupplier.class, "getScriptProvider" ),
new UnoMethodDescriptor( XEventsSupplier.class, "getEvents" ),
new UnoMethodDescriptor( XTitle.class, "getTitle" ),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/databasedocument.cxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/databasedocument.cxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/databasedocument.cxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/databasedocument.cxx 2009-04-15 09:09:22.000000000 +0200
@@ -35,7 +35,6 @@
#include "databasedocument.hxx"
#include "dbastrings.hrc"
#include "module_dba.hxx"
-#include "documentevents.hxx"
#include "documenteventexecutor.hxx"
#include "databasecontext.hxx"
#include "documentcontainer.hxx"
@@ -165,12 +164,13 @@
,m_aModifyListeners( getMutex() )
,m_aCloseListener( getMutex() )
,m_aStorageListeners( getMutex() )
- ,m_pEventContainer( new DocumentEvents( *this, getMutex() ) )
+ ,m_pEventContainer( new DocumentEvents( *this, getMutex(), _pImpl->getDocumentEvents() ) )
,m_pEventExecutor( NULL ) // initialized below, ref-count-protected
,m_aEventNotifier( *this, getMutex() )
,m_aViewMonitor( m_aEventNotifier )
,m_eInitState( NotInitialized )
,m_bClosing( false )
+ ,m_bAllowDocumentScripting( false )
{
DBG_CTOR(ODatabaseDocument,NULL);
@@ -189,7 +189,10 @@
// then consider ourself initialized, too.
// #i94840#
if ( m_pImpl->hadInitializedDocument() )
+ {
impl_setInitialized();
+ m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::eSubDocumentMacros );
+ }
}
//--------------------------------------------------------------------------
@@ -210,7 +213,7 @@
// strip XEmbeddedScripts and XScriptInvocationContext if we have any form/report
// which already contains macros. In this case, the database document itself is not
// allowed to contain macros, too.
- if ( impl_shouldDisallowScripting_nolck_nothrow()
+ if ( !m_bAllowDocumentScripting
&& ( _rType.equals( XEmbeddedScripts::static_type() )
|| _rType.equals( XScriptInvocationContext::static_type() )
)
@@ -244,7 +247,7 @@
// strip XEmbeddedScripts and XScriptInvocationContext if we have any form/report
// which already contains macros. In this case, the database document itself is not
// allowed to contain macros, too.
- if ( impl_shouldDisallowScripting_nolck_nothrow() )
+ if ( !m_bAllowDocumentScripting )
{
Sequence< Type > aStrippedTypes( aTypes.getLength() );
Type* pStripTo( aStrippedTypes.getArray() );
@@ -291,34 +294,67 @@
}
// -----------------------------------------------------------------------------
-bool ODatabaseDocument::impl_shouldDisallowScripting_nolck_nothrow() const
-{
- ::osl::MutexGuard aGuard( getMutex() );
- if ( m_pImpl.is() && m_pImpl->hasAnyObjectWithMacros() )
- return true;
- return false;
-}
-
-// -----------------------------------------------------------------------------
// local functions
// -----------------------------------------------------------------------------
namespace
{
// -----------------------------------------------------------------------------
+ Reference< XStatusIndicator > lcl_extractStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments )
+ {
+ Reference< XStatusIndicator > xStatusIndicator;
+ return _rArguments.getOrDefault( "StatusIndicator", xStatusIndicator );
+ }
+
+ // -----------------------------------------------------------------------------
+ static void lcl_triggerStatusIndicator_throw( const ::comphelper::NamedValueCollection& _rArguments, DocumentGuard& _rGuard, const bool _bStart )
+ {
+ Reference< XStatusIndicator > xStatusIndicator( lcl_extractStatusIndicator( _rArguments ) );
+ if ( !xStatusIndicator.is() )
+ return;
+
+ _rGuard.clear();
+ try
+ {
+ if ( _bStart )
+ xStatusIndicator->start( ::rtl::OUString(), (sal_Int32)1000000 );
+ else
+ xStatusIndicator->end();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ _rGuard.reset();
+ // note that |reset| can throw a DisposedException
+ }
+
+ // -----------------------------------------------------------------------------
+ static void lcl_extractStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments, Sequence< Any >& _rCallArgs )
+ {
+ Reference< XStatusIndicator > xStatusIndicator( lcl_extractStatusIndicator( _rArguments ) );
+ if ( !xStatusIndicator.is() )
+ return;
+
+ sal_Int32 nLength = _rCallArgs.getLength();
+ _rCallArgs.realloc( nLength + 1 );
+ _rCallArgs[ nLength ] <<= xStatusIndicator;
+ }
+
+ // -----------------------------------------------------------------------------
static void lcl_extractAndStartStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments, Reference< XStatusIndicator >& _rxStatusIndicator,
Sequence< Any >& _rCallArgs )
{
+ _rxStatusIndicator = lcl_extractStatusIndicator( _rArguments );
+ if ( !_rxStatusIndicator.is() )
+ return;
+
try
{
- _rxStatusIndicator = _rArguments.getOrDefault( "StatusIndicator", _rxStatusIndicator );
- if ( _rxStatusIndicator.is() )
- {
- _rxStatusIndicator->start( ::rtl::OUString(), (sal_Int32)1000000 );
+ _rxStatusIndicator->start( ::rtl::OUString(), (sal_Int32)1000000 );
- sal_Int32 nLength = _rCallArgs.getLength();
- _rCallArgs.realloc( nLength + 1 );
- _rCallArgs[ nLength ] <<= _rxStatusIndicator;
- }
+ sal_Int32 nLength = _rCallArgs.getLength();
+ _rCallArgs.realloc( nLength + 1 );
+ _rCallArgs[ nLength ] <<= _rxStatusIndicator;
}
catch( const Exception& )
{
@@ -326,6 +362,7 @@
}
}
+ // -----------------------------------------------------------------------------
static Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const Sequence< PropertyValue >& _rDescriptor, const ::rtl::OUString _rURL )
{
::comphelper::NamedValueCollection aMediaDescriptor( _rDescriptor );
@@ -373,7 +410,8 @@
}
// -----------------------------------------------------------------------------
-void ODatabaseDocument::impl_import_throw( const ::comphelper::NamedValueCollection& _rResource )
+void ODatabaseDocument::impl_import_nolck_throw( const ::comphelper::ComponentContext _rContext, const Reference< XInterface >& _rxTargetComponent,
+ const ::comphelper::NamedValueCollection& _rResource )
{
Sequence< Any > aFilterArgs;
Reference< XStatusIndicator > xStatusIndicator;
@@ -395,10 +433,10 @@
aFilterArgs[nCount] <<= xInfoSet;
Reference< XImporter > xImporter(
- m_pImpl->m_aContext.createComponentWithArguments( "com.sun.star.comp.sdb.DBFilter", aFilterArgs ),
- UNO_QUERY_THROW );
+ _rContext.createComponentWithArguments( "com.sun.star.comp.sdb.DBFilter", aFilterArgs ),
+ UNO_QUERY_THROW );
- Reference< XComponent > xComponent( *this, UNO_QUERY_THROW );
+ Reference< XComponent > xComponent( _rxTargetComponent, UNO_QUERY_THROW );
xImporter->setTargetDocument( xComponent );
Reference< XFilter > xFilter( xImporter, UNO_QUERY_THROW );
@@ -423,11 +461,14 @@
m_pImpl->m_aContext.getLegacyServiceFactory() ) );
// store therein
- impl_storeToStorage_throw( xTempStor, Sequence< PropertyValue >() );
+ impl_storeToStorage_throw( xTempStor, Sequence< PropertyValue >(), aGuard );
// let the impl know we're now based on this storage
m_pImpl->switchToStorage( xTempStor );
+ // for the newly created document, allow document-wide scripting
+ m_bAllowDocumentScripting = true;
+
impl_setInitialized();
m_aEventNotifier.notifyDocumentEventAsync( "OnTitleChanged" );
@@ -466,7 +507,9 @@
impl_setInitializing();
try
{
- impl_import_throw( aResource );
+ aGuard.clear();
+ impl_import_nolck_throw( m_pImpl->m_aContext, *this, aResource );
+ aGuard.reset();
}
catch( const Exception& )
{
@@ -474,7 +517,7 @@
throw;
}
// tell our view monitor that the document has been loaded - this way it will fire the proper
- // even (OnLoad instead of OnCreate) later on
+ // event (OnLoad instead of OnCreate) later on
m_aViewMonitor.onLoadedDocument();
// note that we do *not* call impl_setInitialized() here: The initialization is only complete
@@ -507,6 +550,12 @@
{ // this means we've just been loaded, and this is the attachResource call which follows
// the load call.
impl_setInitialized();
+
+ // determine whether the document as a whole, or sub documents, have macros. Especially the latter
+ // controls the availability of our XEmbeddedScripts and XScriptInvocationContext interfaces, and we
+ // should know this before anybody actually uses the object.
+ m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::eSubDocumentMacros );
+
m_aEventNotifier.notifyDocumentEvent( "OnLoadFinished" );
}
@@ -728,7 +777,7 @@
// store to current storage
Reference< XStorage > xCurrentStorage( m_pImpl->getOrCreateRootStorage(), UNO_QUERY_THROW );
Sequence< PropertyValue > aMediaDescriptor( lcl_appendFileNameToDescriptor( _rArguments, _rURL ) );
- impl_storeToStorage_throw( xCurrentStorage, aMediaDescriptor );
+ impl_storeToStorage_throw( xCurrentStorage, aMediaDescriptor, _rGuard );
// success - tell our impl
m_pImpl->attachResource( _rURL, aMediaDescriptor );
@@ -807,6 +856,10 @@
impl_reset_nothrow();
throw;
}
+
+ if ( bImplicitInitialization )
+ m_bAllowDocumentScripting = true;
+
aGuard.clear();
// <- SYNCHRONIZED
@@ -815,7 +868,8 @@
}
// -----------------------------------------------------------------------------
-void ODatabaseDocument::impl_storeToStorage_throw( const Reference< XStorage >& _rxTargetStorage, const Sequence< PropertyValue >& _rMediaDescriptor ) const
+void ODatabaseDocument::impl_storeToStorage_throw( const Reference< XStorage >& _rxTargetStorage, const Sequence< PropertyValue >& _rMediaDescriptor,
+ DocumentGuard& _rDocGuard ) const
{
if ( !_rxTargetStorage.is() )
throw IllegalArgumentException( ::rtl::OUString(), *const_cast< ODatabaseDocument* >( this ), 1 );
@@ -838,11 +892,13 @@
}
// write into target storage
- ::comphelper::NamedValueCollection aWriteArgs( _rMediaDescriptor );
- writeStorage( _rxTargetStorage, aWriteArgs );
+ ::comphelper::NamedValueCollection aWriteArgs( _rMediaDescriptor );
+ lcl_triggerStatusIndicator_throw( aWriteArgs, _rDocGuard, true );
+ impl_writeStorage_throw( _rxTargetStorage, aWriteArgs );
+ lcl_triggerStatusIndicator_throw( aWriteArgs, _rDocGuard, false );
// commit target storage
- OSL_VERIFY( m_pImpl->commitStorageIfWriteable( _rxTargetStorage ) );
+ OSL_VERIFY( ODatabaseModelImpl::commitStorageIfWriteable( _rxTargetStorage ) );
}
catch( const IOException& ) { throw; }
catch( const RuntimeException& ) { throw; }
@@ -873,7 +929,7 @@
Sequence< PropertyValue > aMediaDescriptor( lcl_appendFileNameToDescriptor( _rArguments, _rURL ) );
// store to this storage
- impl_storeToStorage_throw( xTargetStorage, aMediaDescriptor );
+ impl_storeToStorage_throw( xTargetStorage, aMediaDescriptor, aGuard );
}
catch( const Exception& )
{
@@ -944,28 +1000,24 @@
// ::com::sun::star::document::XEventBroadcaster
void SAL_CALL ODatabaseDocument::addEventListener(const uno::Reference< document::XEventListener >& _Listener ) throw (uno::RuntimeException)
{
- DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
m_aEventNotifier.addLegacyEventListener( _Listener );
}
// -----------------------------------------------------------------------------
void SAL_CALL ODatabaseDocument::removeEventListener( const uno::Reference< document::XEventListener >& _Listener ) throw (uno::RuntimeException)
{
- DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
m_aEventNotifier.removeLegacyEventListener( _Listener );
}
// -----------------------------------------------------------------------------
void SAL_CALL ODatabaseDocument::addDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) throw (RuntimeException)
{
- DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
m_aEventNotifier.addDocumentEventListener( _Listener );
}
// -----------------------------------------------------------------------------
void SAL_CALL ODatabaseDocument::removeDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) throw (RuntimeException)
{
- DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
m_aEventNotifier.removeDocumentEventListener( _Listener );
}
@@ -1232,12 +1284,11 @@
}
// -----------------------------------------------------------------------------
-void ODatabaseDocument::writeStorage( const Reference< XStorage >& _rxTargetStorage, const ::comphelper::NamedValueCollection& _rMediaDescriptor ) const
+void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _rxTargetStorage, const ::comphelper::NamedValueCollection& _rMediaDescriptor ) const
{
// extract status indicator
Sequence< Any > aDelegatorArguments;
- Reference< XStatusIndicator > xStatusIndicator;
- lcl_extractAndStartStatusIndicator( _rMediaDescriptor, xStatusIndicator, aDelegatorArguments );
+ lcl_extractStatusIndicator( _rMediaDescriptor, aDelegatorArguments );
/** property map for export info set */
comphelper::PropertyMapEntry aExportInfoMap[] =
@@ -1275,9 +1326,6 @@
aDelegatorArguments, aMediaDescriptor, _rxTargetStorage );
m_pImpl->storeLibraryContainersTo( _rxTargetStorage );
-
- if ( xStatusIndicator.is() )
- xStatusIndicator->end();
}
// -----------------------------------------------------------------------------
@@ -1497,8 +1545,7 @@
void SAL_CALL ODatabaseDocument::storeToStorage( const Reference< XStorage >& _rxStorage, const Sequence< PropertyValue >& _rMediaDescriptor ) throw (IllegalArgumentException, IOException, Exception, RuntimeException)
{
DocumentGuard aGuard( *this );
-
- impl_storeToStorage_throw( _rxStorage, _rMediaDescriptor );
+ impl_storeToStorage_throw( _rxStorage, _rMediaDescriptor, aGuard );
}
// -----------------------------------------------------------------------------
@@ -1573,7 +1620,7 @@
m_pImpl->m_aContext.getSingleton( "com.sun.star.script.provider.theMasterScriptProviderFactory" ), UNO_QUERY_THROW );
Any aScriptProviderContext;
- if ( !impl_shouldDisallowScripting_nolck_nothrow() )
+ if ( m_bAllowDocumentScripting )
aScriptProviderContext <<= Reference< XModel >( this );
xScriptProvider.set( xFactory->createScriptProvider( aScriptProviderContext ), UNO_SET_THROW );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/databasedocument.hxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/databasedocument.hxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/databasedocument.hxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/databasedocument.hxx 2009-04-15 09:09:22.000000000 +0200
@@ -206,6 +206,7 @@
*/
InitState m_eInitState;
bool m_bClosing;
+ bool m_bAllowDocumentScripting;
enum StoreType { SAVE, SAVE_AS };
/** stores the document to the given URL, rebases it to the respective new storage, if necessary, resets
@@ -267,7 +268,7 @@
@param _xStorageToSaveTo
The storage which should be used for saving
*/
- void writeStorage(
+ void impl_writeStorage_throw(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxTargetStorage,
const ::comphelper::NamedValueCollection& _rMediaDescriptor
) const;
@@ -534,7 +535,12 @@
/** imports the document from the given resource.
*/
- void impl_import_throw( const ::comphelper::NamedValueCollection& _rResource );
+ static void
+ impl_import_nolck_throw(
+ const ::comphelper::ComponentContext _rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxTargetComponent,
+ const ::comphelper::NamedValueCollection& _rResource
+ );
/** creates a storage for the given URL, truncating it if a file with this name already exists
@@ -570,6 +576,14 @@
Note that the document is actually not rebased to this storage, it just stores a copy of itself
to the given target storage.
+ @param _rxTargetStorage
+ denotes the storage to store the document into
+ @param _rMediaDescriptor
+ contains additional parameters for storing the document
+ @param _rDocGuard
+ a guard which holds the (only) lock to the document, and which will be temporarily
+ released where necessary (e.g. for notifications, or calling into other components)
+
@throws ::com::sun::star::uno::IllegalArgumentException
if the given storage is <NULL/>.
@@ -582,21 +596,15 @@
*/
void impl_storeToStorage_throw(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxTargetStorage,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rMediaDescriptor
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rMediaDescriptor,
+ DocumentGuard& _rDocGuard
) const;
-
- /// determines whether we should disable the scripting related interfaces
- bool impl_shouldDisallowScripting_nolck_nothrow() const;
-
- /** checks whether we need to implicitly initialize the document
-
- */
};
/** an extended version of the ModelMethodGuard, which also cares for the initialization state
of the document
*/
-class DocumentGuard : public ModelMethodGuard
+class DocumentGuard : private ModelMethodGuard
{
public:
enum MethodType
@@ -629,12 +637,13 @@
*/
DocumentGuard( const ODatabaseDocument& _document, MethodType _eType = DefaultMethod )
:ModelMethodGuard( _document )
+ ,m_document( _document )
{
switch ( _eType )
{
- case InitMethod: _document.checkNotInitialized(); break;
- case DefaultMethod: _document.checkInitialized(); break;
- case MethodUsedDuringInit: _document.checkNotUninitilized(); break;
+ case InitMethod: m_document.checkNotInitialized(); break;
+ case DefaultMethod: m_document.checkInitialized(); break;
+ case MethodUsedDuringInit: m_document.checkNotUninitilized(); break;
case MethodWithoutInit: break;
}
}
@@ -642,6 +651,20 @@
~DocumentGuard()
{
}
+
+ void clear()
+ {
+ ModelMethodGuard::clear();
+ }
+ void reset()
+ {
+ ModelMethodGuard::reset();
+ m_document.checkDisposed();
+ }
+
+private:
+
+ const ODatabaseDocument& m_document;
};
//........................................................................
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/documentdefinition.cxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/documentdefinition.cxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/documentdefinition.cxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/documentdefinition.cxx 2009-04-15 09:09:22.000000000 +0200
@@ -948,9 +948,9 @@
// So, in such a case, and with 2. above, we would silently execute those macros,
// regardless of the global security settings - which would be a security issue, of
// course.
- if ( !m_pImpl->m_pDataSource->hasAnyObjectWithMacros() )
+ if ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eNoMacros )
{
- // this is case 2. from above (not *exactly*, but sufficiently)
+ // this is case 2. from above
// So, pass a USE_CONFIG to the to-be-loaded document. This means that
// the user will be prompted with a security message upon opening this
// sub document, in case the settings require this, *and* the document
@@ -1555,7 +1555,8 @@
// -----------------------------------------------------------------------------
sal_Bool ODocumentDefinition::objectSupportsEmbeddedScripts() const
{
- bool bAllowDocumentMacros = !m_pImpl->m_pDataSource || m_pImpl->m_pDataSource->hasAnyObjectWithMacros();
+ bool bAllowDocumentMacros = !m_pImpl->m_pDataSource
+ || ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eSubDocumentMacros );
// if *any* of the objects of the database document already has macros, we continue to allow it
// to have them, until the user did a migration.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/documentevents.cxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/documentevents.cxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/documentevents.cxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/documentevents.cxx 2009-04-15 09:09:22.000000000 +0200
@@ -38,7 +38,6 @@
#include <comphelper/namedvaluecollection.hxx>
-#include <map>
#include <algorithm>
#include <functional>
@@ -68,17 +67,16 @@
//====================================================================
//= DocumentEvents_Data
//====================================================================
- typedef ::std::map< ::rtl::OUString, Sequence< PropertyValue > > NamedEventDescriptors;
-
struct DocumentEvents_Data : public ::boost::noncopyable
{
::cppu::OWeakObject& rParent;
::osl::Mutex& rMutex;
- NamedEventDescriptors aEventDescs;
+ DocumentEventsData& rEventsData;
- DocumentEvents_Data( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex )
+ DocumentEvents_Data( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, DocumentEventsData& _rEventsData )
:rParent( _rParent )
,rMutex( _rMutex )
+ ,rEventsData( _rEventsData )
{
}
};
@@ -132,14 +130,16 @@
//= DocumentEvents
//====================================================================
//--------------------------------------------------------------------
- DocumentEvents::DocumentEvents( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex )
- :m_pData( new DocumentEvents_Data( _rParent, _rMutex ) )
+ DocumentEvents::DocumentEvents( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, DocumentEventsData& _rEventsData )
+ :m_pData( new DocumentEvents_Data( _rParent, _rMutex, _rEventsData ) )
{
const DocumentEventData* pEventData = lcl_getDocumentEventData();
while ( pEventData->pAsciiEventName )
{
- m_pData->aEventDescs[ ::rtl::OUString::createFromAscii( pEventData->pAsciiEventName ) ] =
- Sequence< PropertyValue >();
+ ::rtl::OUString sEventName = ::rtl::OUString::createFromAscii( pEventData->pAsciiEventName );
+ DocumentEventsData::iterator existingPos = m_pData->rEventsData.find( sEventName );
+ if ( existingPos == m_pData->rEventsData.end() )
+ m_pData->rEventsData[ sEventName ] = Sequence< PropertyValue >();
++pEventData;
}
}
@@ -181,8 +181,8 @@
{
::osl::MutexGuard aGuard( m_pData->rMutex );
- NamedEventDescriptors::iterator elementPos = m_pData->aEventDescs.find( _Name );
- if ( elementPos == m_pData->aEventDescs.end() )
+ DocumentEventsData::iterator elementPos = m_pData->rEventsData.find( _Name );
+ if ( elementPos == m_pData->rEventsData.end() )
throw NoSuchElementException( _Name, *this );
Sequence< PropertyValue > aEventDescriptor;
@@ -215,8 +215,8 @@
{
::osl::MutexGuard aGuard( m_pData->rMutex );
- NamedEventDescriptors::const_iterator elementPos = m_pData->aEventDescs.find( _Name );
- if ( elementPos == m_pData->aEventDescs.end() )
+ DocumentEventsData::const_iterator elementPos = m_pData->rEventsData.find( _Name );
+ if ( elementPos == m_pData->rEventsData.end() )
throw NoSuchElementException( _Name, *this );
Any aReturn;
@@ -231,12 +231,12 @@
{
::osl::MutexGuard aGuard( m_pData->rMutex );
- Sequence< ::rtl::OUString > aNames( m_pData->aEventDescs.size() );
+ Sequence< ::rtl::OUString > aNames( m_pData->rEventsData.size() );
::std::transform(
- m_pData->aEventDescs.begin(),
- m_pData->aEventDescs.end(),
+ m_pData->rEventsData.begin(),
+ m_pData->rEventsData.end(),
aNames.getArray(),
- ::std::select1st< NamedEventDescriptors::value_type >()
+ ::std::select1st< DocumentEventsData::value_type >()
);
return aNames;
}
@@ -246,7 +246,7 @@
{
::osl::MutexGuard aGuard( m_pData->rMutex );
- return m_pData->aEventDescs.find( _Name ) != m_pData->aEventDescs.end();
+ return m_pData->rEventsData.find( _Name ) != m_pData->rEventsData.end();
}
//--------------------------------------------------------------------
@@ -259,7 +259,7 @@
::sal_Bool SAL_CALL DocumentEvents::hasElements( ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_pData->rMutex );
- return !m_pData->aEventDescs.empty();
+ return !m_pData->rEventsData.empty();
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/documentevents.hxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/documentevents.hxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/documentevents.hxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/documentevents.hxx 2009-04-15 09:09:22.000000000 +0200
@@ -32,11 +32,13 @@
/** === begin UNO includes === **/
#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
/** === end UNO includes === **/
#include <cppuhelper/implbase1.hxx>
#include <memory>
+#include <map>
#include <boost/noncopyable.hpp>
//........................................................................
@@ -44,6 +46,9 @@
{
//........................................................................
+ typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >
+ DocumentEventsData;
+
//====================================================================
//= DocumentEvents
//====================================================================
@@ -52,12 +57,11 @@
typedef ::cppu::WeakImplHelper1 < ::com::sun::star::container::XNameReplace
> DocumentEvents_Base;
- class DocumentEvents
- :public DocumentEvents_Base
- ,public ::boost::noncopyable
+ class DocumentEvents :public DocumentEvents_Base
+ ,public ::boost::noncopyable
{
public:
- DocumentEvents( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex );
+ DocumentEvents( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, DocumentEventsData& _rEventsData );
~DocumentEvents();
static bool needsSynchronousNotification( const ::rtl::OUString& _rEventName );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/ModelImpl.cxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/ModelImpl.cxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/ModelImpl.cxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/ModelImpl.cxx 2009-04-15 09:09:22.000000000 +0200
@@ -323,7 +323,7 @@
,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
,m_pDBContext( &_rDBContext )
,m_refCount(0)
- ,m_bHasAnyObjectWithMacros( false )
+ ,m_aEmbeddedMacros()
,m_bModificationLock( false )
,m_bDocumentInitialized( false )
,m_aContext( _rxFactory )
@@ -362,7 +362,7 @@
,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
,m_pDBContext( &_rDBContext )
,m_refCount(0)
- ,m_bHasAnyObjectWithMacros( false )
+ ,m_aEmbeddedMacros()
,m_bModificationLock( false )
,m_bDocumentInitialized( false )
,m_aContext( _rxFactory )
@@ -1386,24 +1386,33 @@
}
// -----------------------------------------------------------------------------
-sal_Bool ODatabaseModelImpl::documentStorageHasMacros() const
+ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros()
{
- // does our root storage contain macros?
- if ( ::sfx2::DocumentMacroMode::storageHasMacros( const_cast< ODatabaseModelImpl* >( this )->getOrCreateRootStorage() ) )
- {
- return true;
- }
-
- // do we have forms or reports with macros?
- if ( lcl_hasObjectsWithMacros_nothrow( const_cast< ODatabaseModelImpl& >( *this ), E_FORM )
- || lcl_hasObjectsWithMacros_nothrow( const_cast< ODatabaseModelImpl& >( *this ), E_REPORT )
- )
+ if ( !m_aEmbeddedMacros )
{
- const_cast< ODatabaseModelImpl* >( this )->m_bHasAnyObjectWithMacros = true;
- return true;
+ if ( ::sfx2::DocumentMacroMode::storageHasMacros( const_cast< ODatabaseModelImpl* >( this )->getOrCreateRootStorage() ) )
+ {
+ m_aEmbeddedMacros.reset( eDocumentWideMacros );
+ }
+ else if ( lcl_hasObjectsWithMacros_nothrow( const_cast< ODatabaseModelImpl& >( *this ), E_FORM )
+ || lcl_hasObjectsWithMacros_nothrow( const_cast< ODatabaseModelImpl& >( *this ), E_REPORT )
+ )
+ {
+ m_aEmbeddedMacros.reset( eSubDocumentMacros );
+ }
+ else
+ {
+ m_aEmbeddedMacros.reset( eNoMacros );
+ }
}
+ return *m_aEmbeddedMacros;
+}
- return false;
+// -----------------------------------------------------------------------------
+sal_Bool ODatabaseModelImpl::documentStorageHasMacros() const
+{
+ const_cast< ODatabaseModelImpl* >( this )->determineEmbeddedMacros();
+ return ( *m_aEmbeddedMacros != eNoMacros );
}
// -----------------------------------------------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ooo310-m9-base/dbaccess/source/core/dataaccess/ModelImpl.hxx new/ooo310-m10-base/dbaccess/source/core/dataaccess/ModelImpl.hxx
--- old/ooo310-m9-base/dbaccess/source/core/dataaccess/ModelImpl.hxx 2009-04-02 12:41:20.000000000 +0200
+++ new/ooo310-m10-base/dbaccess/source/core/dataaccess/ModelImpl.hxx 2009-04-15 09:09:22.000000000 +0200
@@ -35,6 +35,7 @@
#include "bookmarkcontainer.hxx"
#include "ContentHelper.hxx"
#include "core_resource.hxx"
+#include "documentevents.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -162,6 +163,16 @@
E_TABLE = 3
};
+ enum EmbeddedMacros
+ {
+ // the database document (storage) itself contains macros
+ eDocumentWideMacros,
+ // there are sub document( storage)s containing macros
+ eSubDocumentMacros,
+ // there are no known macro( storage)s
+ eNoMacros
+ };
+
private:
OModuleClient m_aModuleClient;
::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel;
@@ -181,6 +192,7 @@
SharedStorage m_xDocumentStorage;
::rtl::Reference< ::sfx2::DocumentStorageModifyListener > m_pStorageModifyListener;
ODatabaseContext* m_pDBContext;
+ DocumentEventsData m_aDocumentEvents;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aArgs;
/// the URL the document was loaded from
@@ -189,7 +201,7 @@
oslInterlockedCount m_refCount;
/// do we have any object (forms/reports) which contains macros?
- bool m_bHasAnyObjectWithMacros;
+ ::boost::optional< EmbeddedMacros > m_aEmbeddedMacros;
/// true if setting the Modified flag of the document is currently locked
bool m_bModificationLock;
@@ -289,6 +301,9 @@
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >&
getNumberFormatsSupplier();
+ DocumentEventsData&
+ getDocumentEvents() { return m_aDocumentEvents; }
+
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&
getResource() const { return m_aArgs; }
@@ -408,12 +423,9 @@
const ::rtl::OUString& _rPersistentName
);
- /** determines whether the database document has any object (form/report) which contains macros
-
- In such a case, *all* objects in the document keep the macro capability, and the database document
- itself does *not* allow embedding macros.
+ /** determines which kind of embedded macros are present in the document
*/
- bool hasAnyObjectWithMacros() const { return m_bHasAnyObjectWithMacros; }
+ EmbeddedMacros determineEmbeddedMacros();
/** checks our document's macro execution mode, using the interaction handler as supplied with our
load arguments
++++++ ooo-sdf-base.tar.bz2 ++++++
++++ 45692 lines of diff (skipped)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org