2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2009-02-20 10:24:14 +00:00
|
|
|
|
|
|
|
#ifndef _DBA_COREDATAACCESS_MODELIMPL_HXX_
|
|
|
|
#define _DBA_COREDATAACCESS_MODELIMPL_HXX_
|
|
|
|
|
|
|
|
#include "apitools.hxx"
|
|
|
|
#include "bookmarkcontainer.hxx"
|
|
|
|
#include "ContentHelper.hxx"
|
|
|
|
#include "core_resource.hxx"
|
2009-04-24 18:34:24 +00:00
|
|
|
#include "documentevents.hxx"
|
2009-02-20 10:24:14 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
|
|
|
#include <com/sun/star/beans/XPropertyAccess.hpp>
|
|
|
|
#include <com/sun/star/container/XContainerListener.hpp>
|
|
|
|
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
|
|
|
|
#include <com/sun/star/document/XEventListener.hpp>
|
|
|
|
#include <com/sun/star/document/XStorageBasedDocument.hpp>
|
|
|
|
#include <com/sun/star/embed/ElementModes.hpp>
|
|
|
|
#include <com/sun/star/embed/XStorage.hpp>
|
|
|
|
#include <com/sun/star/embed/XTransactionListener.hpp>
|
|
|
|
#include <com/sun/star/frame/XModel.hpp>
|
|
|
|
#include <com/sun/star/frame/XStorable.hpp>
|
|
|
|
#include <com/sun/star/lang/NotInitializedException.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/sdb/XBookmarksSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdb/XCompletedConnection.hpp>
|
|
|
|
#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XDataSource.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XIsolatedConnection.hpp>
|
|
|
|
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
|
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
|
|
|
#include <com/sun/star/util/XFlushable.hpp>
|
|
|
|
#include <com/sun/star/util/XModifiable.hpp>
|
|
|
|
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
|
|
|
|
#include <com/sun/star/util/XNumberFormatter.hpp>
|
|
|
|
#include <com/sun/star/util/XRefreshable.hpp>
|
|
|
|
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
|
|
|
|
#include <com/sun/star/frame/DoubleInitializationException.hpp>
|
|
|
|
|
|
|
|
#include <comphelper/broadcasthelper.hxx>
|
2010-01-29 13:54:37 +01:00
|
|
|
#include <comphelper/namedvaluecollection.hxx>
|
2009-02-20 10:24:14 +00:00
|
|
|
#include <comphelper/proparrhlp.hxx>
|
|
|
|
#include <comphelper/sharedmutex.hxx>
|
|
|
|
#include <connectivity/CommonTools.hxx>
|
|
|
|
#include <cppuhelper/propshlp.hxx>
|
|
|
|
#include <cppuhelper/weakref.hxx>
|
|
|
|
#include <sfx2/docmacromode.hxx>
|
|
|
|
#include <sfx2/docstoragemodifylistener.hxx>
|
|
|
|
#include <unotools/sharedunocomponent.hxx>
|
2010-10-16 03:13:32 -05:00
|
|
|
#include <osl/mutex.hxx>
|
2010-10-15 12:22:54 -05:00
|
|
|
#include <rtl/ref.hxx>
|
2009-02-20 10:24:14 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace comphelper
|
|
|
|
{
|
|
|
|
class NamedValueCollection;
|
|
|
|
}
|
|
|
|
|
|
|
|
//........................................................................
|
|
|
|
namespace dbaccess
|
|
|
|
{
|
|
|
|
//........................................................................
|
|
|
|
|
|
|
|
typedef ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XConnection > OWeakConnection;
|
|
|
|
typedef std::vector< OWeakConnection > OWeakConnectionArray;
|
|
|
|
|
|
|
|
struct AsciiPropertyValue
|
|
|
|
{
|
|
|
|
// note: the canonic member order would be AsciiName / DefaultValue, but
|
|
|
|
// this crashes on unxlngi6.pro, since there's a bug which somehow results in
|
|
|
|
// getDefaultDataSourceSettings returning corrupted Any instances then.
|
2009-10-16 14:16:52 +02:00
|
|
|
::com::sun::star::uno::Any DefaultValue;
|
|
|
|
const sal_Char* AsciiName;
|
|
|
|
const ::com::sun::star::uno::Type& ValueType;
|
|
|
|
|
|
|
|
AsciiPropertyValue()
|
|
|
|
:DefaultValue( )
|
|
|
|
,AsciiName( NULL )
|
|
|
|
,ValueType( ::cppu::UnoType< ::cppu::UnoVoidType >::get() )
|
|
|
|
{
|
|
|
|
}
|
2009-02-20 10:24:14 +00:00
|
|
|
|
|
|
|
AsciiPropertyValue( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Any& _rDefaultValue )
|
|
|
|
:DefaultValue( _rDefaultValue )
|
|
|
|
,AsciiName( _pAsciiName )
|
2009-10-16 14:16:52 +02:00
|
|
|
,ValueType( _rDefaultValue.getValueType() )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( ValueType.getTypeClass() != ::com::sun::star::uno::TypeClass_VOID,
|
|
|
|
"AsciiPropertyValue::AsciiPropertyValue: NULL values not allowed here, use the other CTOR for this!" );
|
|
|
|
}
|
|
|
|
AsciiPropertyValue( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Type& _rValeType )
|
|
|
|
:DefaultValue()
|
|
|
|
,AsciiName( _pAsciiName )
|
|
|
|
,ValueType( _rValeType )
|
2009-02-20 10:24:14 +00:00
|
|
|
{
|
2009-10-16 14:16:52 +02:00
|
|
|
OSL_ENSURE( ValueType.getTypeClass() != ::com::sun::star::uno::TypeClass_VOID,
|
|
|
|
"AsciiPropertyValue::AsciiPropertyValue: VOID property values not supported!" );
|
2009-02-20 10:24:14 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class ODatabaseContext;
|
|
|
|
class OSharedConnectionManager;
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
//= VosMutexFacade
|
|
|
|
//============================================================
|
|
|
|
/** a class which provides an IMutex interface to an OSL-based mutex
|
|
|
|
*/
|
2010-10-16 03:13:32 -05:00
|
|
|
class VosMutexFacade : public ::osl::SolarMutex
|
2009-02-20 10:24:14 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** beware of life time: the mutex you pass here must live as least as long
|
|
|
|
as the VosMutexFacade instance lives.
|
|
|
|
*/
|
|
|
|
VosMutexFacade( ::osl::Mutex& _rMutex );
|
|
|
|
|
|
|
|
// IMutex
|
|
|
|
virtual void SAL_CALL acquire();
|
|
|
|
virtual sal_Bool SAL_CALL tryToAcquire();
|
|
|
|
virtual void SAL_CALL release();
|
|
|
|
|
|
|
|
private:
|
|
|
|
::osl::Mutex& m_rMutex;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
//= ODatabaseModelImpl
|
|
|
|
//============================================================
|
|
|
|
typedef ::utl::SharedUNOComponent< ::com::sun::star::embed::XStorage > SharedStorage;
|
|
|
|
|
|
|
|
class ODatabaseContext;
|
|
|
|
class DocumentStorageAccess;
|
|
|
|
class OSharedConnectionManager;
|
|
|
|
class ODatabaseModelImpl :public ::rtl::IReference
|
|
|
|
,public ::sfx2::IMacroDocumentAccess
|
|
|
|
,public ::sfx2::IModifiableDocument
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum ObjectType
|
|
|
|
{
|
|
|
|
E_FORM = 0,
|
|
|
|
E_REPORT = 1,
|
|
|
|
E_QUERY = 2,
|
|
|
|
E_TABLE = 3
|
|
|
|
};
|
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2009-02-20 10:24:14 +00:00
|
|
|
private:
|
|
|
|
OModuleClient m_aModuleClient;
|
|
|
|
::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel;
|
|
|
|
::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDataSource > m_xDataSource;
|
|
|
|
|
|
|
|
DocumentStorageAccess* m_pStorageAccess;
|
|
|
|
::comphelper::SharedMutex m_aMutex;
|
|
|
|
VosMutexFacade m_aMutexFacade;
|
|
|
|
::std::vector< TContentPtr > m_aContainer; // one for each ObjectType
|
|
|
|
::sfx2::DocumentMacroMode m_aMacroMode;
|
|
|
|
sal_Int16 m_nImposedMacroExecMode;
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer > m_xBasicLibraries;
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer > m_xDialogLibraries;
|
|
|
|
|
|
|
|
SharedStorage m_xDocumentStorage;
|
|
|
|
::rtl::Reference< ::sfx2::DocumentStorageModifyListener > m_pStorageModifyListener;
|
|
|
|
ODatabaseContext* m_pDBContext;
|
2009-04-24 18:34:24 +00:00
|
|
|
DocumentEventsData m_aDocumentEvents;
|
2009-02-20 10:24:14 +00:00
|
|
|
|
2010-01-29 13:54:37 +01:00
|
|
|
::comphelper::NamedValueCollection m_aMediaDescriptor;
|
2009-02-20 10:24:14 +00:00
|
|
|
/// the URL the document was loaded from
|
|
|
|
::rtl::OUString m_sDocFileLocation;
|
|
|
|
|
|
|
|
oslInterlockedCount m_refCount;
|
|
|
|
|
|
|
|
/// do we have any object (forms/reports) which contains macros?
|
2009-04-24 18:34:24 +00:00
|
|
|
::boost::optional< EmbeddedMacros > m_aEmbeddedMacros;
|
2009-02-20 10:24:14 +00:00
|
|
|
|
|
|
|
/// true if setting the Modified flag of the document is currently locked
|
|
|
|
bool m_bModificationLock;
|
|
|
|
|
|
|
|
/// true if and only if a database document existed previously (though meanwhile disposed), and was already initialized
|
|
|
|
bool m_bDocumentInitialized;
|
|
|
|
|
|
|
|
/** the URL which the document should report as it's URL
|
|
|
|
|
|
|
|
This might differ from ->m_sDocFileLocation in case the document was loaded
|
|
|
|
as part of a crash recovery process. In this case, ->m_sDocFileLocation points to
|
|
|
|
the temporary file where the DB had been saved to, after a crash.
|
|
|
|
->m_sDocumentURL then is the URL of the document which actually had
|
|
|
|
been recovered.
|
|
|
|
*/
|
|
|
|
::rtl::OUString m_sDocumentURL;
|
|
|
|
|
|
|
|
public:
|
|
|
|
OWeakConnectionArray m_aConnections;
|
|
|
|
const ::comphelper::ComponentContext m_aContext;
|
|
|
|
|
|
|
|
public:
|
|
|
|
::com::sun::star::uno::WeakReference< ::com::sun::star::container::XNameAccess > m_xCommandDefinitions;
|
|
|
|
::com::sun::star::uno::WeakReference< ::com::sun::star::container::XNameAccess > m_xTableDefinitions;
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >
|
|
|
|
m_xNumberFormatsSupplier;
|
|
|
|
::rtl::OUString m_sConnectURL;
|
|
|
|
::rtl::OUString m_sName; // transient, our creator has to tell us the title
|
|
|
|
::rtl::OUString m_sUser;
|
|
|
|
::rtl::OUString m_aPassword; // transient !
|
|
|
|
::rtl::OUString m_sFailedPassword;
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>
|
|
|
|
m_aLayoutInformation;
|
|
|
|
sal_Int32 m_nLoginTimeout;
|
|
|
|
sal_Bool m_bReadOnly : 1;
|
|
|
|
sal_Bool m_bPasswordRequired : 1;
|
|
|
|
sal_Bool m_bSuppressVersionColumns : 1;
|
|
|
|
sal_Bool m_bModified : 1;
|
|
|
|
sal_Bool m_bDocumentReadOnly : 1;
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyAccess >
|
|
|
|
m_xSettings;
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aTableFilter;
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aTableTypeFilter;
|
|
|
|
OSharedConnectionManager* m_pSharedConnectionManager;
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >
|
|
|
|
m_xSharedConnectionManager;
|
|
|
|
sal_uInt16 m_nControllerLockCount;
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
/** determines whether the database document has an embedded data storage
|
|
|
|
*/
|
|
|
|
inline bool isEmbeddedDatabase() const { return ( m_sConnectURL.compareToAscii( "sdbc:embedded:", 14 ) == 0 ); }
|
|
|
|
|
|
|
|
/** stores the embedded storage ("database")
|
|
|
|
|
|
|
|
@param _bPreventRootCommits
|
|
|
|
Normally, committing the embedded storage results in also commiting the root storage
|
|
|
|
- this is an automatism for data safety reasons.
|
|
|
|
If you pass <TRUE/> here, committing the root storage is prevented for this particular
|
|
|
|
call.
|
|
|
|
@return <TRUE/> if the storage could be commited, otherwise <FALSE/>
|
|
|
|
*/
|
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test
2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test
2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ...
2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in
2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs)
2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing
2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing
2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript
2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test
2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test
2009-11-03 14:25:44 +0000 fs r277324 : #i10000#
2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs
2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ...
2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM)
2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion
2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense
2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE
2009-10-21 07:08:35 +0000 fs r277075 : spare useless call
2009-10-20 21:26:31 +0000 fs r277072 : #i10000#
2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62)
2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch
2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks.
2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk)
2009-10-15 12:52:39 +0000 fs r276939 : #i10000#
2009-10-15 12:44:26 +0000 fs r276938 : #i10000#
2009-10-15 12:00:33 +0000 fs r276936 : #i10000#
2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg
2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const
2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#:
introduce an option to the layout manager to preserve, if possible, the size of the content window
when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing.
(the option is incompatible with in-place editing, anyway)
This is because such embedded objects couple the (content) window size to the VisAreaSize, in that
both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize,
and restores it upon next open. This, however, leads to different content window sizes when the
window is closed with another toolbar set than used during opening.
This patch here prevents those different content window sizes. Also, now the content window size
doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content
window size stays the same, and the container window size is adjusted.
2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows
2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable)
2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows
2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service
2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist
2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified
2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command
2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 12:59:17 +0000 fs r276754 : #i87693#
2009-10-07 11:19:22 +0000 fs r276752 : #i10000#
2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller)
2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion
2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release:
when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing
the ref count, again. This ensures that our adapter cannot create references to the dying object anymore.
(A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous
release/dispose/destroy pattern, namely WeakComponentImplHelperBase)
2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying
2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool)
2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked
2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails
2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet
revealed some inconsistencies, in whether the objects are cached by their URL, or by their
registration name. This has been changed to caching by registration name.
2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case
2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed
2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable
(timing-dependent) results/failures. Instead, every test sets up a new odb file.
Also, did some re-factoring, improved the cleanup code, and caught a few more errors.
2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now
2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose
2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now
2009-10-06 12:49:22 +0000 fs r276707 : typo
2009-10-06 12:49:03 +0000 fs r276706 : typo
2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class
2009-10-06 12:48:02 +0000 fs r276704 : typo
2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably
2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence
2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope
2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create
2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope
2009-10-05 09:46:17 +0000 fs r276671 : #i10000#
2009-10-05 08:43:58 +0000 fs r276664 : #i105505#
release: dispose the (base classes) weak connection point before disposing ourself,
and in particular before temporarily incrementing our ref count, again.
This way, we prevent that a separate thread re-surrects us (using the weak connection
point's queryAdapted) while we're in the process of destruction
2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release)
2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead
2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics
2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants
2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign
2009-10-04 19:53:30 +0000 fs r276657 : #105560#
remove unused code
thanks to cmc@openoffice.org for submitting the patch
2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc)
2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60)
2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ...
2009-10-02 10:52:24 +0000 fs r276634 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes
2009-10-01 09:12:20 +0000 fs r276582 : #i105505#
2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion
2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods
2009-09-30 06:35:59 +0000 fs r276538 : #i10000#
2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113#
2009-09-29 10:27:10 +0000 fs r276520 : #i105367#
2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles
2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc
2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE...
2009-09-28 20:53:36 +0000 fs r276503 : #i104117#
cleaned up the mess with help IDs in module extensions.
Formerly, extensions used to use help IDs which were declared in module svx, and vice versa.
Also, help ID ranges were not respected.
2009-09-28 11:25:36 +0000 fs r276489 : typo
2009-09-28 11:25:10 +0000 fs r276488 : #i105235#
2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar
2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-16 11:11:43 +0000 fs r276195 : #i105082#
consolidated the sub storage handling, by delegating more functionality into
the DocumentStorageAccess class. As a result, there won't be that many unnecessary
commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages
and DocumentStorageAccess::m_aExposedStorages) have been consolidated.
This is not really part of the fix of issue 105082, but it helped reducing the
calls to the storage/package implementation.
2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures)
2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved
2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error
2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS
2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models
2009-09-14 10:33:02 +0000 fs r276106 : removed dead file
2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor
2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text
2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
|
|
|
bool commitEmbeddedStorage( bool _bPreventRootCommits = false );
|
2009-02-20 10:24:14 +00:00
|
|
|
|
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test
2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test
2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ...
2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in
2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs)
2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing
2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing
2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript
2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test
2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test
2009-11-03 14:25:44 +0000 fs r277324 : #i10000#
2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs
2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ...
2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM)
2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion
2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense
2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE
2009-10-21 07:08:35 +0000 fs r277075 : spare useless call
2009-10-20 21:26:31 +0000 fs r277072 : #i10000#
2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62)
2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch
2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks.
2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk)
2009-10-15 12:52:39 +0000 fs r276939 : #i10000#
2009-10-15 12:44:26 +0000 fs r276938 : #i10000#
2009-10-15 12:00:33 +0000 fs r276936 : #i10000#
2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg
2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const
2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#:
introduce an option to the layout manager to preserve, if possible, the size of the content window
when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing.
(the option is incompatible with in-place editing, anyway)
This is because such embedded objects couple the (content) window size to the VisAreaSize, in that
both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize,
and restores it upon next open. This, however, leads to different content window sizes when the
window is closed with another toolbar set than used during opening.
This patch here prevents those different content window sizes. Also, now the content window size
doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content
window size stays the same, and the container window size is adjusted.
2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows
2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable)
2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows
2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service
2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist
2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified
2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command
2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 12:59:17 +0000 fs r276754 : #i87693#
2009-10-07 11:19:22 +0000 fs r276752 : #i10000#
2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller)
2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion
2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release:
when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing
the ref count, again. This ensures that our adapter cannot create references to the dying object anymore.
(A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous
release/dispose/destroy pattern, namely WeakComponentImplHelperBase)
2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying
2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool)
2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked
2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails
2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet
revealed some inconsistencies, in whether the objects are cached by their URL, or by their
registration name. This has been changed to caching by registration name.
2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case
2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed
2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable
(timing-dependent) results/failures. Instead, every test sets up a new odb file.
Also, did some re-factoring, improved the cleanup code, and caught a few more errors.
2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now
2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose
2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now
2009-10-06 12:49:22 +0000 fs r276707 : typo
2009-10-06 12:49:03 +0000 fs r276706 : typo
2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class
2009-10-06 12:48:02 +0000 fs r276704 : typo
2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably
2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence
2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope
2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create
2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope
2009-10-05 09:46:17 +0000 fs r276671 : #i10000#
2009-10-05 08:43:58 +0000 fs r276664 : #i105505#
release: dispose the (base classes) weak connection point before disposing ourself,
and in particular before temporarily incrementing our ref count, again.
This way, we prevent that a separate thread re-surrects us (using the weak connection
point's queryAdapted) while we're in the process of destruction
2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release)
2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead
2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics
2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants
2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign
2009-10-04 19:53:30 +0000 fs r276657 : #105560#
remove unused code
thanks to cmc@openoffice.org for submitting the patch
2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc)
2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60)
2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ...
2009-10-02 10:52:24 +0000 fs r276634 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes
2009-10-01 09:12:20 +0000 fs r276582 : #i105505#
2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion
2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods
2009-09-30 06:35:59 +0000 fs r276538 : #i10000#
2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113#
2009-09-29 10:27:10 +0000 fs r276520 : #i105367#
2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles
2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc
2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE...
2009-09-28 20:53:36 +0000 fs r276503 : #i104117#
cleaned up the mess with help IDs in module extensions.
Formerly, extensions used to use help IDs which were declared in module svx, and vice versa.
Also, help ID ranges were not respected.
2009-09-28 11:25:36 +0000 fs r276489 : typo
2009-09-28 11:25:10 +0000 fs r276488 : #i105235#
2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar
2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-16 11:11:43 +0000 fs r276195 : #i105082#
consolidated the sub storage handling, by delegating more functionality into
the DocumentStorageAccess class. As a result, there won't be that many unnecessary
commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages
and DocumentStorageAccess::m_aExposedStorages) have been consolidated.
This is not really part of the fix of issue 105082, but it helped reducing the
calls to the storage/package implementation.
2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures)
2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved
2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error
2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS
2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models
2009-09-14 10:33:02 +0000 fs r276106 : removed dead file
2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor
2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text
2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
|
|
|
/// commits all sub storages
|
2009-02-20 10:24:14 +00:00
|
|
|
void commitStorages()
|
|
|
|
SAL_THROW(( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ));
|
|
|
|
|
|
|
|
ODatabaseModelImpl(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
|
|
|
|
ODatabaseContext& _pDBContext
|
|
|
|
);
|
|
|
|
virtual ~ODatabaseModelImpl();
|
|
|
|
|
|
|
|
ODatabaseModelImpl(
|
|
|
|
const ::rtl::OUString& _rRegistrationName,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
|
|
|
|
ODatabaseContext& _rDBContext
|
|
|
|
);
|
|
|
|
|
|
|
|
// XEventListener
|
|
|
|
void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
void setModified( sal_Bool bModified );
|
|
|
|
|
|
|
|
void dispose();
|
|
|
|
|
|
|
|
inline ::rtl::OUString getURL() const { return m_sDocumentURL; }
|
|
|
|
inline ::rtl::OUString getDocFileLocation() const { return m_sDocFileLocation; }
|
|
|
|
|
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test
2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test
2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ...
2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in
2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs)
2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing
2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing
2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript
2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test
2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test
2009-11-03 14:25:44 +0000 fs r277324 : #i10000#
2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs
2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ...
2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM)
2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion
2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense
2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE
2009-10-21 07:08:35 +0000 fs r277075 : spare useless call
2009-10-20 21:26:31 +0000 fs r277072 : #i10000#
2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62)
2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch
2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks.
2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk)
2009-10-15 12:52:39 +0000 fs r276939 : #i10000#
2009-10-15 12:44:26 +0000 fs r276938 : #i10000#
2009-10-15 12:00:33 +0000 fs r276936 : #i10000#
2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg
2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const
2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#:
introduce an option to the layout manager to preserve, if possible, the size of the content window
when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing.
(the option is incompatible with in-place editing, anyway)
This is because such embedded objects couple the (content) window size to the VisAreaSize, in that
both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize,
and restores it upon next open. This, however, leads to different content window sizes when the
window is closed with another toolbar set than used during opening.
This patch here prevents those different content window sizes. Also, now the content window size
doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content
window size stays the same, and the container window size is adjusted.
2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows
2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable)
2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows
2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service
2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist
2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified
2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command
2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 12:59:17 +0000 fs r276754 : #i87693#
2009-10-07 11:19:22 +0000 fs r276752 : #i10000#
2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller)
2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion
2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release:
when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing
the ref count, again. This ensures that our adapter cannot create references to the dying object anymore.
(A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous
release/dispose/destroy pattern, namely WeakComponentImplHelperBase)
2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying
2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool)
2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked
2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails
2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet
revealed some inconsistencies, in whether the objects are cached by their URL, or by their
registration name. This has been changed to caching by registration name.
2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case
2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed
2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable
(timing-dependent) results/failures. Instead, every test sets up a new odb file.
Also, did some re-factoring, improved the cleanup code, and caught a few more errors.
2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now
2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose
2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now
2009-10-06 12:49:22 +0000 fs r276707 : typo
2009-10-06 12:49:03 +0000 fs r276706 : typo
2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class
2009-10-06 12:48:02 +0000 fs r276704 : typo
2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably
2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence
2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope
2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create
2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope
2009-10-05 09:46:17 +0000 fs r276671 : #i10000#
2009-10-05 08:43:58 +0000 fs r276664 : #i105505#
release: dispose the (base classes) weak connection point before disposing ourself,
and in particular before temporarily incrementing our ref count, again.
This way, we prevent that a separate thread re-surrects us (using the weak connection
point's queryAdapted) while we're in the process of destruction
2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release)
2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead
2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics
2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants
2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign
2009-10-04 19:53:30 +0000 fs r276657 : #105560#
remove unused code
thanks to cmc@openoffice.org for submitting the patch
2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc)
2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60)
2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ...
2009-10-02 10:52:24 +0000 fs r276634 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes
2009-10-01 09:12:20 +0000 fs r276582 : #i105505#
2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion
2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods
2009-09-30 06:35:59 +0000 fs r276538 : #i10000#
2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113#
2009-09-29 10:27:10 +0000 fs r276520 : #i105367#
2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles
2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc
2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE...
2009-09-28 20:53:36 +0000 fs r276503 : #i104117#
cleaned up the mess with help IDs in module extensions.
Formerly, extensions used to use help IDs which were declared in module svx, and vice versa.
Also, help ID ranges were not respected.
2009-09-28 11:25:36 +0000 fs r276489 : typo
2009-09-28 11:25:10 +0000 fs r276488 : #i105235#
2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar
2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-16 11:11:43 +0000 fs r276195 : #i105082#
consolidated the sub storage handling, by delegating more functionality into
the DocumentStorageAccess class. As a result, there won't be that many unnecessary
commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages
and DocumentStorageAccess::m_aExposedStorages) have been consolidated.
This is not really part of the fix of issue 105082, but it helped reducing the
calls to the storage/package implementation.
2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures)
2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved
2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error
2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS
2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models
2009-09-14 10:33:02 +0000 fs r276106 : removed dead file
2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor
2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text
2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
|
|
|
|
getStorage(
|
|
|
|
const ObjectType _eType, const sal_Int32 _nDesiredMode = ::com::sun::star::embed::ElementModes::READWRITE );
|
|
|
|
|
2009-02-20 10:24:14 +00:00
|
|
|
// helper
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >&
|
|
|
|
getNumberFormatsSupplier();
|
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
DocumentEventsData&
|
|
|
|
getDocumentEvents() { return m_aDocumentEvents; }
|
|
|
|
|
2010-01-29 13:54:37 +01:00
|
|
|
const ::comphelper::NamedValueCollection&
|
|
|
|
getMediaDescriptor() const { return m_aMediaDescriptor; }
|
2009-02-20 10:24:14 +00:00
|
|
|
|
2010-02-15 16:05:58 +01:00
|
|
|
void setResource(
|
2009-02-20 10:24:14 +00:00
|
|
|
const ::rtl::OUString& _rURL,
|
2010-02-15 16:05:58 +01:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs
|
|
|
|
);
|
|
|
|
void setDocFileLocation(
|
|
|
|
const ::rtl::OUString& i_rLoadedFrom
|
|
|
|
);
|
2009-02-20 10:24:14 +00:00
|
|
|
|
2010-01-29 13:54:37 +01:00
|
|
|
static ::comphelper::NamedValueCollection
|
2009-02-20 10:24:14 +00:00
|
|
|
stripLoadArguments( const ::comphelper::NamedValueCollection& _rArguments );
|
|
|
|
|
|
|
|
// other stuff
|
|
|
|
void flushTables();
|
|
|
|
|
|
|
|
// disposes all elements in m_aStorages, and clears it
|
|
|
|
void disposeStorages() SAL_THROW(());
|
|
|
|
|
|
|
|
/// creates a ->com::sun::star::embed::StorageFactory
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
|
|
|
|
createStorageFactory() const;
|
|
|
|
|
|
|
|
/// commits our storage
|
|
|
|
void commitRootStorage();
|
|
|
|
|
|
|
|
/// commits a given storage if it's not readonly, ignoring (but asserting) all errors
|
|
|
|
static bool commitStorageIfWriteable_ignoreErrors(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
|
|
|
|
)
|
|
|
|
SAL_THROW(());
|
|
|
|
|
|
|
|
void clearConnections();
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getOrCreateRootStorage();
|
|
|
|
inline ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getRootStorage() const { return m_xDocumentStorage.getTyped(); }
|
|
|
|
inline void resetRootStroage() { impl_switchToStorage_throw( NULL ); }
|
|
|
|
|
|
|
|
/** returns the data source. If it doesn't exist it will be created
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> getOrCreateDataSource();
|
|
|
|
|
|
|
|
/** returns the model, if there already exists one
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getModel_noCreate() const;
|
|
|
|
|
|
|
|
/** returns a new ->ODatabaseDocument
|
|
|
|
|
|
|
|
@param _bInitializeIfNecessary
|
|
|
|
calls XLoadable::initNew on the newly created model, if necessary
|
|
|
|
|
|
|
|
@precond
|
|
|
|
No ->ODatabaseDocument exists so far
|
|
|
|
|
|
|
|
@seealso
|
|
|
|
getModel_noCreate
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > createNewModel_deliverOwnership( bool _bInitialize );
|
|
|
|
|
|
|
|
struct ResetModelAccess { friend class ODatabaseDocument; private: ResetModelAccess() { } };
|
|
|
|
|
|
|
|
/** resets the model to NULL
|
|
|
|
|
|
|
|
Only to be called when the model is being disposed
|
|
|
|
*/
|
|
|
|
void modelIsDisposing( const bool _wasInitialized, ResetModelAccess );
|
|
|
|
|
|
|
|
bool hadInitializedDocument() const { return m_bDocumentInitialized; }
|
|
|
|
|
|
|
|
DocumentStorageAccess*
|
|
|
|
getDocumentStorageAccess();
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentSubStorageSupplier >
|
|
|
|
getDocumentSubStorageSupplier();
|
|
|
|
|
|
|
|
inline const ::comphelper::SharedMutex& getSharedMutex() const { return m_aMutex; }
|
|
|
|
|
|
|
|
/** @see osl_incrementInterlockedCount.
|
|
|
|
*/
|
|
|
|
virtual oslInterlockedCount SAL_CALL acquire();
|
|
|
|
|
|
|
|
/** @see osl_decrementInterlockedCount.
|
|
|
|
*/
|
|
|
|
virtual oslInterlockedCount SAL_CALL release();
|
|
|
|
|
|
|
|
/// returns a all known data source settings, including their default values
|
|
|
|
static const AsciiPropertyValue* getDefaultDataSourceSettings();
|
|
|
|
|
|
|
|
/** retrieves the requested container of objects (forms/reports/tables/queries)
|
|
|
|
*/
|
|
|
|
TContentPtr& getObjectContainer( const ObjectType _eType );
|
|
|
|
|
|
|
|
/** returns the name of the storage which is used to stored objects of the given type, if applicable
|
|
|
|
*/
|
|
|
|
static ::rtl::OUString
|
|
|
|
getObjectContainerStorageName( const ObjectType _eType );
|
|
|
|
|
|
|
|
/** revokes the data source registration at the database context
|
|
|
|
*/
|
|
|
|
void revokeDataSource() const;
|
|
|
|
|
|
|
|
/** determines whether a given object storage contains macros
|
|
|
|
*/
|
|
|
|
static bool objectHasMacros(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxContainerStorage,
|
|
|
|
const ::rtl::OUString& _rPersistentName
|
|
|
|
);
|
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
/** determines which kind of embedded macros are present in the document
|
2009-02-20 10:24:14 +00:00
|
|
|
*/
|
2009-04-24 18:34:24 +00:00
|
|
|
EmbeddedMacros determineEmbeddedMacros();
|
2009-02-20 10:24:14 +00:00
|
|
|
|
|
|
|
/** checks our document's macro execution mode, using the interaction handler as supplied with our
|
|
|
|
load arguments
|
|
|
|
*/
|
|
|
|
bool checkMacrosOnLoading();
|
|
|
|
|
|
|
|
/** adjusts our document's macro execution mode, without using any UI, assuming the user
|
|
|
|
would reject execution of macros, if she would have been asked.
|
|
|
|
|
|
|
|
If checkMacrosOnLoading has been called before (and thus the macro execution mode
|
|
|
|
is already adjusted), then the current execution mode is simply returned.
|
|
|
|
|
|
|
|
@return
|
|
|
|
whether or not macro execution is allowed
|
|
|
|
*/
|
|
|
|
bool adjustMacroMode_AutoReject();
|
|
|
|
|
|
|
|
/** resets our macro execute mode, so next time the checkMacrosOnLoading is called, it will
|
|
|
|
behave as if it has never been called before
|
|
|
|
*/
|
|
|
|
void resetMacroExecutionMode();
|
|
|
|
|
|
|
|
/** ensures that ->m_xBasicLibraries resp. m_xDialogLibraries exists
|
|
|
|
|
|
|
|
@return
|
|
|
|
the requested library container. Is never <NULL/>.
|
|
|
|
|
|
|
|
@throws RuntimeException
|
|
|
|
if something does wrong, which indicates a server error in the installation
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >
|
|
|
|
getLibraryContainer( bool _bScript );
|
|
|
|
|
|
|
|
/** lets our library containers store themself into the given root storage
|
|
|
|
*/
|
|
|
|
void storeLibraryContainersTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxToRootStorage );
|
|
|
|
|
|
|
|
/** rebases the document to the given storage
|
|
|
|
|
|
|
|
No actual committing, copying, saving, whatsoever happens. The storage is just remembered as the documents
|
|
|
|
new storage, nothing more.
|
|
|
|
|
|
|
|
@throws ::com::sun::star::lang::IllegalArgumentException
|
|
|
|
if the given storage is <NULL/>
|
|
|
|
@throws ::com::sun::star::lang::RuntimeException
|
|
|
|
if any of the invoked operations does so
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
|
|
|
|
switchToStorage(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxNewRootStorage
|
|
|
|
);
|
|
|
|
|
|
|
|
/** returns the macro mode imposed by an external instance, which passed it to attachResource
|
|
|
|
*/
|
|
|
|
sal_Int16 getImposedMacroExecMode() const
|
|
|
|
{
|
|
|
|
return m_nImposedMacroExecMode;
|
|
|
|
}
|
|
|
|
void setImposedMacroExecMode( const sal_Int16 _nMacroMode )
|
|
|
|
{
|
|
|
|
m_nImposedMacroExecMode = _nMacroMode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
// IMacroDocumentAccess overridables
|
|
|
|
virtual sal_Int16 getCurrentMacroExecMode() const;
|
|
|
|
virtual sal_Bool setCurrentMacroExecMode( sal_uInt16 );
|
|
|
|
virtual ::rtl::OUString getDocumentLocation() const;
|
2009-09-17 13:53:54 +00:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getZipStorageToSign();
|
2009-02-20 10:24:14 +00:00
|
|
|
virtual sal_Bool documentStorageHasMacros() const;
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const;
|
2009-09-17 13:53:54 +00:00
|
|
|
virtual sal_Int16 getScriptingSignatureState();
|
|
|
|
virtual sal_Bool hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor );
|
2009-02-20 10:24:14 +00:00
|
|
|
virtual void showBrokenSignatureWarning( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction ) const;
|
|
|
|
|
|
|
|
// IModifiableDocument
|
|
|
|
virtual void storageIsModified();
|
|
|
|
|
|
|
|
// don't use directly, use the ModifyLock class instead
|
|
|
|
void lockModify() { m_bModificationLock = true; }
|
|
|
|
void unlockModify() { m_bModificationLock = false; }
|
|
|
|
bool isModifyLocked() const { return m_bModificationLock; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void impl_construct_nothrow();
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
|
|
|
|
impl_switchToStorage_throw( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxNewRootStorage );
|
2010-02-15 16:05:58 +01:00
|
|
|
|
|
|
|
/** switches to the given document URL, which denotes the logical URL of the document, not necessariy the
|
|
|
|
URL where the doc was loaded/recovered from
|
|
|
|
*/
|
|
|
|
void impl_switchToLogicalURL(
|
|
|
|
const ::rtl::OUString& i_rDocumentURL
|
|
|
|
);
|
|
|
|
|
2009-02-20 10:24:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** a small base class for UNO components whose functionality depends on a ODatabaseModelImpl
|
|
|
|
*/
|
|
|
|
class ModelDependentComponent
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
::rtl::Reference< ODatabaseModelImpl > m_pImpl;
|
|
|
|
mutable ::comphelper::SharedMutex m_aMutex;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
ModelDependentComponent( const ::rtl::Reference< ODatabaseModelImpl >& _model );
|
|
|
|
virtual ~ModelDependentComponent();
|
|
|
|
|
|
|
|
/** returns the component itself
|
|
|
|
*/
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getThis() const = 0;
|
|
|
|
|
|
|
|
inline ::osl::Mutex& getMutex() const
|
|
|
|
{
|
|
|
|
return m_aMutex;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
struct GuardAccess { friend class ModelMethodGuard; private: GuardAccess() { } };
|
|
|
|
|
|
|
|
/** returns the mutex used for thread safety
|
|
|
|
|
|
|
|
@throws ::com::sun::star::lang::DisposedException
|
|
|
|
if m_pImpl is <NULL/>. Usually, you will set this member in your derived
|
|
|
|
component's <code>dispose</code> method to <NULL/>.
|
|
|
|
*/
|
|
|
|
inline ::osl::Mutex& getMutex( GuardAccess ) const
|
|
|
|
{
|
|
|
|
return getMutex();
|
|
|
|
}
|
2011-01-06 20:29:25 +01:00
|
|
|
inline ::rtl::Reference< ODatabaseModelImpl > getImpl( GuardAccess ) const
|
2009-02-20 10:24:14 +00:00
|
|
|
{
|
|
|
|
return m_pImpl;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// checks whether the component is already disposed, throws a DisposedException if so
|
|
|
|
inline void checkDisposed() const
|
|
|
|
{
|
|
|
|
if ( !m_pImpl.is() )
|
2013-01-19 13:36:05 -02:00
|
|
|
throw ::com::sun::star::lang::DisposedException( "Component is already disposed.", getThis() );
|
2009-02-20 10:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void lockModify()
|
|
|
|
{
|
|
|
|
m_pImpl->lockModify();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void unlockModify()
|
|
|
|
{
|
|
|
|
m_pImpl->unlockModify();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class ModifyLock
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ModifyLock( ModelDependentComponent& _component )
|
|
|
|
:m_rComponent( _component )
|
|
|
|
{
|
|
|
|
m_rComponent.lockModify();
|
|
|
|
}
|
|
|
|
|
|
|
|
~ModifyLock()
|
|
|
|
{
|
|
|
|
m_rComponent.unlockModify();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
ModelDependentComponent& m_rComponent;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** a guard for public methods of objects dependent on a ODatabaseModelImpl instance
|
|
|
|
|
|
|
|
Just put this guard onto the stack at the beginning of your method. Don't bother yourself
|
|
|
|
with a MutexGuard, checks for being disposed, and the like.
|
|
|
|
*/
|
|
|
|
class ModelMethodGuard : public ::osl::ResettableMutexGuard
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
typedef ::osl::ResettableMutexGuard BaseMutexGuard;
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** constructs the guard
|
|
|
|
|
|
|
|
@param _component
|
|
|
|
the component whose functionality depends on a ODatabaseModelImpl instance
|
|
|
|
|
|
|
|
@throws ::com::sun::star::lang::DisposedException
|
|
|
|
If the given component is already disposed
|
|
|
|
*/
|
|
|
|
ModelMethodGuard( const ModelDependentComponent& _component )
|
|
|
|
:BaseMutexGuard( _component.getMutex( ModelDependentComponent::GuardAccess() ) )
|
|
|
|
{
|
|
|
|
_component.checkDisposed();
|
|
|
|
}
|
|
|
|
|
|
|
|
~ModelMethodGuard()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//........................................................................
|
|
|
|
} // namespace dbaccess
|
|
|
|
//........................................................................
|
|
|
|
|
|
|
|
#endif // _DBA_COREDATAACCESS_DATALINK_HXX_
|
|
|
|
|
2010-10-27 12:33:13 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|