2004-08-02 14:09:11 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* $RCSfile: databasedocument.cxx,v $
|
2008-10-16 06:57:26 +00:00
|
|
|
* $Revision: 1.40.6.21 $
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
2008-04-10 11:44:35 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-08-02 14:09:11 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2006-09-17 05:39:27 +00:00
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_dbaccess.hxx"
|
2008-01-30 07:33:34 +00:00
|
|
|
|
CWS-TOOLING: integrate CWS dba32g
2009-09-09 07:53:55 +0200 oj r275964 : replace strlen with rtl_str_getLength
2009-09-07 20:59:10 +0200 fs r275913 : disable the CopyTableWizard test until issue 104869 is fixed
2009-09-07 12:17:31 +0200 oj r275885 : #i104810# remove de as lang
2009-09-05 22:26:21 +0200 fs r275857 : protect StateChanged against re-entrance
2009-09-05 22:25:52 +0200 fs r275856 : don't attempt to classify the parent of a form as control
2009-09-05 22:25:29 +0200 fs r275855 : protect against re-entrance
2009-09-05 00:11:40 +0200 fs r275835 : #i10000#
2009-09-04 23:25:50 +0200 fs r275834 : #i10000#
2009-09-04 23:23:47 +0200 fs r275833 : #i10000#
2009-09-04 21:49:37 +0200 fs r275830 : #i10000# correct wrong conflict resolution
2009-09-04 20:59:51 +0200 fs r275829 : CWS-TOOLING: rebase CWS dba32g to trunk@275801 (milestone: DEV300:m57)
2009-09-04 11:08:32 +0200 oj r275791 : #i104780# new version 1.2.0
2009-09-03 22:29:21 +0200 fs r275775 : OSL_TRACE doesn't need \n anymore
2009-09-03 08:33:21 +0200 fs r275743 : CWS-TOOLING: rebase CWS dba32g to trunk@275331 (milestone: DEV300:m56)
2009-09-02 13:48:12 +0200 fs r275708 : removed useless include
2009-09-02 13:45:43 +0200 fs r275707 : more since tags, which are used across offapi/udkapi
2009-09-02 13:23:04 +0200 fs r275705 : should *not* have the dtor, copy ctor, and assignment operator compiler-generated, else we run into trouble as soon as the compiler creates different versions of our singleton member's static data in different libraries
2009-09-02 12:32:45 +0200 fs r275704 : AutoIncrementIsPrimaryKey is a driver setting, not a data source setting
2009-09-02 11:42:49 +0200 fs r275701 : URL meta data are meta data which are valid for all connections of this type, not per-data-source properties. Settings them as data source properties is a hack.
2009-09-02 08:43:34 +0200 fs r275696 : 3.x.x is not a valid 'since' tag
2009-09-01 16:05:24 +0200 fs r275665 : #i104686# don't treat controls bound to read-only columns as required
2009-09-01 13:10:22 +0200 fs r275657 : #i104574# use PageUp/Down to scroll through the complete page
2009-09-01 07:04:48 +0200 oj r275641 : #i104104# correct line ends
2009-08-31 15:52:34 +0200 fs r275612 : #i104410#
2009-08-31 12:29:05 +0200 fs r275596 : #i104364#
2009-08-31 12:28:56 +0200 fs r275595 : #i104364#
2009-08-31 11:43:09 +0200 fs r275593 : #i104649# JavaDriverClassPath is also a known JDBC-bridge setting
2009-08-31 11:41:37 +0200 fs r275592 : #i104649#
2009-08-28 21:48:27 +0200 fs r275552 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:48:17 +0200 fs r275551 : #i96862# do not show the 'Create a new database' option when a) no embedded/dBase driver is installed or b) the configuration requests to hide the option
2009-08-28 21:47:19 +0200 fs r275550 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:46:41 +0200 fs r275549 : #i96862# renamed and extended the configuration data which controls availability of certain DBA-related UI
2009-08-28 15:10:19 +0200 fs r275535 : #i96862# if no embedded driver is installed, use dBase for creating new DBs. If no dBase driver is installed, too, do not offer the 'Create new database' option
2009-08-28 14:03:04 +0200 fs r275532 : #i104454# allow multiple fields to display the same column
2009-08-28 13:14:00 +0200 fs r275528 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:09:57 +0200 fs r275527 : properly chech the MySQL type buttons (else next/back in the wizard leads to state with two buttons checked)
2009-08-28 13:09:17 +0200 fs r275526 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:07:18 +0200 fs r275525 : BooleanComparisonMode is a property, or a feature - but not a driver meta data
2009-08-28 11:00:31 +0200 fs r275521 : #i104580#
2009-08-28 10:40:05 +0200 fs r275519 : #i104577# correct assertion: If the template node type is ANY, then any value type is allowed
2009-08-28 10:09:30 +0200 fs r275518 : #i104575# implement Named Pipe UI
2009-08-28 10:09:07 +0200 fs r275517 : pass the trigger-event to IWindowOperator::operateOn / work with VclWindowEvents, not VclSimpleEvents
2009-08-27 14:27:36 +0200 fs r275484 : ImplPosTabPage: respect mbEmptyViewMargin for WINDOWALIGN_LEFT
2009-08-27 13:43:56 +0200 fs r275480 : merging latest changes from CWS dba32f herein
2009-08-27 13:23:07 +0200 fs r275475 : #i103882#
2009-08-27 11:56:55 +0200 fs r275466 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 11:55:34 +0200 fs r275465 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 10:14:11 +0200 fs r275459 : preparations for supporting a 'NamedPipe' parameter for the MySQL Connector/OOo
2009-08-27 10:13:21 +0200 fs r275458 : preparations for supporting a 'NamedPipe' setting for the MySQL Connector/OOo
2009-08-27 10:11:14 +0200 fs r275456 : outsourced the MySQLNative settings into a dedicated class, to not duplicate all the code in two tab page implementations
2009-08-26 14:18:13 +0200 fs r275422 : #i10000#
2009-08-26 13:26:36 +0200 fs r275419 : ignore output paths
2009-08-26 13:23:38 +0200 fs r275417 : support the LocalSocket property for the MySQL native driver
2009-08-26 13:17:05 +0200 fs r275416 : some re-factoring, to outsource the tab page for setting up the MySQLNative connection, into a dedicated class (needed later)
2009-08-26 13:15:15 +0200 fs r275415 : support a NoThousandSep property for NumericFormatters - I'm tired of correcting this at runtime, instead of controlling it in the resource
2009-08-26 11:45:08 +0200 fs r275410 : oops, 'flat' shouldn't have got lost
2009-08-26 09:38:57 +0200 fs r275398 : #i102631# when saving the document fails, ensure that the interaction handler really can handle/display the error
2009-08-26 09:37:05 +0200 fs r275397 : #i102631# don't let non-IO/RuntimeExceptions escape from DatabaseDocument::store*, wrap them into an IOException
2009-08-26 09:35:39 +0200 fs r275395 : let the default interaction handler implement XInteractionHandler2
2009-08-25 13:51:34 +0200 fs r275352 : #i102631# createTempFile: pass URL through FileHelper.getOOoCompatibleFileURL
2009-08-25 13:49:23 +0200 fs r275351 : #i102631# createTempFileURL: immediately delete the file implicitly created by createTempFile, we really only need the URL
2009-08-24 14:49:07 +0200 fs r275318 : #i10000#
2009-08-24 14:36:03 +0200 fs r275315 : properly terminate message with 0 character
2009-08-24 14:35:45 +0200 fs r275314 : trace method concepts in non-pro, if special flag is enabled
2009-08-24 14:24:17 +0200 fs r275312 : #i98973# filter some more events for grid control columns
2009-08-24 14:15:23 +0200 fs r275311 : #i98973# implement XComboBox for combo box cells
2009-08-24 13:39:24 +0200 fs r275308 : #i98973# do not display the 'actionPerformed' event for grid combo box columns
2009-08-24 12:52:03 +0200 fs r275303 : #i98973# implement XCheckBox and XButton for check box cells
2009-08-24 11:56:05 +0200 oj r275300 : #i104447# wrong default for orientation
2009-08-24 10:51:21 +0200 fs r275296 : in the script selector dialog, interpret a double click onto a function as OK
2009-08-24 10:50:56 +0200 fs r275295 : localize some to-be-displayed names, consolidate some code regarding form/control naming
2009-08-21 14:28:05 +0200 fs r275255 : #i98973# implement KeyListeners
2009-08-21 14:27:20 +0200 fs r275254 : #i98973# move the conversion VCL[Mouse|Key]Event->Awt[Mouse|Key]Event from vclxwindow.cxx to VCLUnoHelper
2009-08-21 14:08:50 +0200 fs r275248 : #i98973# implement Mouse- and MouseMotion-broadcasting
2009-08-21 13:31:08 +0200 fs r275244 : #i98973# implement text and change listeners at text cells
2009-08-21 12:47:38 +0200 fs r275234 : #i104399# some refactoring:
If the MySQL Connector/OOo is installed, it registers for the sdbc:mysqlc: protocol (now known as DST_MYSQL_NATIVE_DIRECT).
However, we do not want to display this in the UI, instead we display "MySQL" only, which collects DST_MYSQL_ODBC, DST_MYSQL_JDBC, and DST_MYSQL_NATIVE.
2009-08-21 12:45:18 +0200 fs r275232 : #i104399# also register for the sdbc:mysql:mysqlc protocol, decide at runtime (depending on the availability of sdbc:mysqlc:), whether it is really accepted. This prevents that the C/OOo extension needs to register *our* implementation name for the sdbc:mysql:mysqlc: protocol, which would be somewhat weird
2009-08-20 16:18:48 +0200 fs r275190 : merging the latest changes from CWS dba32f (which this CWS was created from)
2009-08-19 20:19:59 +0200 fs r275160 : add some spacing between the radios
2009-08-19 14:50:15 +0200 fs r275150 : #i98973# slightly refactoring the grid cell implementations, to prepare for proper events being fired. Implement focus events for the moment, more to come.
2009-08-19 10:53:38 +0200 fs r275142 : #i99936# initialize newly created models
2009-08-18 23:03:48 +0200 fs r275132 : merging latest changes from CWS dba32f
2009-08-18 15:14:08 +0200 fs r275110 : #i102819# SetColumnPos: SCROLL_CLIP is deadly here
2009-09-14 11:18:01 +00:00
|
|
|
#include "core_resource.hxx"
|
|
|
|
#include "core_resource.hrc"
|
2004-08-02 14:09:11 +00:00
|
|
|
#include "datasource.hxx"
|
2005-03-10 15:33:50 +00:00
|
|
|
#include "databasedocument.hxx"
|
2004-08-02 14:09:11 +00:00
|
|
|
#include "dbastrings.hrc"
|
2008-01-30 07:33:34 +00:00
|
|
|
#include "module_dba.hxx"
|
2008-10-16 06:57:26 +00:00
|
|
|
#include "documenteventexecutor.hxx"
|
|
|
|
#include "databasecontext.hxx"
|
|
|
|
#include "documentcontainer.hxx"
|
2008-01-30 07:33:34 +00:00
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
#include <comphelper/documentconstants.hxx>
|
|
|
|
#include <comphelper/namedvaluecollection.hxx>
|
|
|
|
#include <comphelper/enumhelper.hxx>
|
|
|
|
#include <comphelper/numberedcollection.hxx>
|
2008-10-01 12:28:29 +00:00
|
|
|
#include <comphelper/genericpropertyset.hxx>
|
|
|
|
#include <comphelper/property.hxx>
|
|
|
|
#include <svtools/saveopt.hxx>
|
|
|
|
|
2008-12-01 12:31:27 +00:00
|
|
|
#include <framework/titlehelper.hxx>
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
/** === begin UNO includes === **/
|
|
|
|
#include <com/sun/star/document/XExporter.hpp>
|
|
|
|
#include <com/sun/star/document/XFilter.hpp>
|
|
|
|
#include <com/sun/star/document/XImporter.hpp>
|
|
|
|
#include <com/sun/star/embed/EntryInitModes.hpp>
|
|
|
|
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
2004-08-02 14:09:11 +00:00
|
|
|
#include <com/sun/star/embed/XTransactedObject.hpp>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
|
2004-08-02 14:09:11 +00:00
|
|
|
#include <com/sun/star/io/XActiveDataSource.hpp>
|
|
|
|
#include <com/sun/star/io/XSeekable.hpp>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
|
|
|
|
#include <com/sun/star/task/ErrorCodeIOException.hpp>
|
2004-08-02 14:09:11 +00:00
|
|
|
#include <com/sun/star/task/XStatusIndicator.hpp>
|
|
|
|
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
|
2005-03-01 18:13:53 +00:00
|
|
|
#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
|
2004-08-02 14:09:11 +00:00
|
|
|
#include <com/sun/star/view/XSelectionSupplier.hpp>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
|
|
|
/** === end UNO includes === **/
|
|
|
|
|
|
|
|
#include <comphelper/documentconstants.hxx>
|
2008-11-19 17:43:08 +00:00
|
|
|
#include <comphelper/interaction.hxx>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <comphelper/enumhelper.hxx>
|
|
|
|
#include <comphelper/mediadescriptor.hxx>
|
|
|
|
#include <comphelper/namedvaluecollection.hxx>
|
|
|
|
#include <comphelper/numberedcollection.hxx>
|
|
|
|
#include <comphelper/storagehelper.hxx>
|
2006-03-29 11:33:47 +00:00
|
|
|
#include <cppuhelper/exc_hlp.hxx>
|
2008-10-16 06:57:26 +00:00
|
|
|
#include <framework/titlehelper.hxx>
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#include <tools/diagnose_ex.h>
|
|
|
|
#include <tools/errcode.hxx>
|
|
|
|
#include <tools/urlobj.hxx>
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2005-12-21 12:34:54 +00:00
|
|
|
#include <boost/bind.hpp>
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include <functional>
|
2008-12-16 13:30:53 +00:00
|
|
|
#include <list>
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
#define MAP_LEN(x) x, sizeof(x) - 1
|
|
|
|
|
2008-11-19 17:43:08 +00:00
|
|
|
#define MAP_LEN(x) x, sizeof(x) - 1
|
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::frame;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::document;
|
|
|
|
using namespace ::com::sun::star::io;
|
|
|
|
using namespace ::com::sun::star::util;
|
|
|
|
using namespace ::com::sun::star::embed;
|
|
|
|
using namespace ::com::sun::star::task;
|
|
|
|
using namespace ::com::sun::star::view;
|
2005-03-10 15:33:50 +00:00
|
|
|
using namespace ::com::sun::star::sdbc;
|
2004-08-02 14:09:11 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::xml::sax;
|
2008-03-06 16:58:17 +00:00
|
|
|
using namespace ::com::sun::star::script;
|
|
|
|
using namespace ::com::sun::star::script::provider;
|
|
|
|
using namespace ::com::sun::star::ui;
|
2004-08-02 14:09:11 +00:00
|
|
|
using namespace ::cppu;
|
|
|
|
using namespace ::osl;
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-06-06 13:02:08 +00:00
|
|
|
using ::com::sun::star::awt::XWindow;
|
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
//........................................................................
|
|
|
|
namespace dbaccess
|
|
|
|
{
|
|
|
|
//........................................................................
|
2005-03-10 15:33:50 +00:00
|
|
|
|
|
|
|
//============================================================
|
2008-10-16 06:57:26 +00:00
|
|
|
//= ViewMonitor
|
|
|
|
//============================================================
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
bool ViewMonitor::onControllerConnected( const Reference< XController >& _rxController )
|
|
|
|
{
|
|
|
|
bool bFirstControllerEver = ( m_bEverHadController == false );
|
|
|
|
m_bEverHadController = true;
|
|
|
|
|
|
|
|
m_xLastConnectedController = _rxController;
|
|
|
|
m_bLastIsFirstEverController = bFirstControllerEver;
|
|
|
|
|
|
|
|
return bFirstControllerEver;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void ViewMonitor::onSetCurrentController( const Reference< XController >& _rxController )
|
|
|
|
{
|
|
|
|
// we interpret this as "loading the document (including UI) is finished",
|
|
|
|
// if and only if this is the controller which was last connected, and it was the
|
|
|
|
// first controller ever connected
|
|
|
|
bool bLoadFinished = ( _rxController == m_xLastConnectedController ) && m_bLastIsFirstEverController;
|
|
|
|
|
|
|
|
// notify the respective events
|
|
|
|
if ( bLoadFinished )
|
|
|
|
m_rEventNotifier.notifyDocumentEventAsync( m_bIsNewDocument ? "OnNew" : "OnLoad" );
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
//= ODatabaseDocument
|
2005-03-10 15:33:50 +00:00
|
|
|
//============================================================
|
|
|
|
DBG_NAME(ODatabaseDocument)
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument()
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-01-30 07:33:34 +00:00
|
|
|
static ::dba::OAutoRegistration< ODatabaseDocument > aAutoRegistration;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2005-03-10 15:33:50 +00:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl )
|
2005-12-21 12:34:54 +00:00
|
|
|
:ModelDependentComponent( _pImpl )
|
|
|
|
,ODatabaseDocument_OfficeDocument( getMutex() )
|
|
|
|
,m_aModifyListeners( getMutex() )
|
|
|
|
,m_aCloseListener( getMutex() )
|
2008-03-06 16:58:17 +00:00
|
|
|
,m_aStorageListeners( getMutex() )
|
2009-04-24 18:34:24 +00:00
|
|
|
,m_pEventContainer( new DocumentEvents( *this, getMutex(), _pImpl->getDocumentEvents() ) )
|
2008-10-16 06:57:26 +00:00
|
|
|
,m_pEventExecutor( NULL ) // initialized below, ref-count-protected
|
|
|
|
,m_aEventNotifier( *this, getMutex() )
|
|
|
|
,m_aViewMonitor( m_aEventNotifier )
|
|
|
|
,m_eInitState( NotInitialized )
|
|
|
|
,m_bClosing( false )
|
2009-04-24 18:34:24 +00:00
|
|
|
,m_bAllowDocumentScripting( false )
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2005-03-10 15:33:50 +00:00
|
|
|
DBG_CTOR(ODatabaseDocument,NULL);
|
2005-07-08 09:36:11 +00:00
|
|
|
|
2006-02-07 09:18:42 +00:00
|
|
|
osl_incrementInterlockedCount( &m_refCount );
|
|
|
|
{
|
|
|
|
impl_reparent_nothrow( m_xForms );
|
|
|
|
impl_reparent_nothrow( m_xReports );
|
|
|
|
impl_reparent_nothrow( m_pImpl->m_xTableDefinitions );
|
|
|
|
impl_reparent_nothrow( m_pImpl->m_xCommandDefinitions );
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
m_pEventExecutor = new DocumentEventExecutor( m_pImpl->m_aContext, this );
|
2006-02-07 09:18:42 +00:00
|
|
|
}
|
|
|
|
osl_decrementInterlockedCount( &m_refCount );
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
// if there previously was a document instance for the same Impl which was already initialized,
|
|
|
|
// then consider ourself initialized, too.
|
|
|
|
// #i94840#
|
|
|
|
if ( m_pImpl->hadInitializedDocument() )
|
2009-04-24 18:34:24 +00:00
|
|
|
{
|
CWS-TOOLING: integrate CWS dba32h
2009-10-12 12:21:44 +0200 msc r276827 : remove warning for issue 102712 because the issue is fixed
2009-10-05 07:14:20 +0200 oj r276658 : #105585# add missing dependency for OOO_UI
2009-10-02 12:50:19 +0200 fs r276632 : #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 12:46:12 +0200 fs r276631 : #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 13:09:07 +0200 fs r276596 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 12:35:56 +0200 fs r276589 : #i105509# don't rely on default form component names, use indexes
2009-10-01 11:19:18 +0200 fs r276584 : copying the fix for #i105082# into this CWS
2009-10-01 11:13:22 +0200 fs r276583 : improved logs
2009-10-01 11:10:44 +0200 fs r276581 : #i105505#
2009-10-01 08:07:57 +0200 fs r276575 : manual merge of trunk, to allow cwslocalize to run
2009-09-30 22:48:30 +0200 fs r276574 : removed that strange ONLOAD definition
2009-09-30 12:58:18 +0200 fs r276553 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 12:56:45 +0200 fs r276552 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 11:47:45 +0200 fs r276549 : #i105235#
2009-09-29 12:27:40 +0200 fs r276521 : #i105367#
2009-09-28 12:08:17 +0200 oj r276485 : #i105371# export version in manifest.xml as well
2009-09-28 12:07:02 +0200 oj r276484 : #i105371# export version in manifest.xml as well
2009-09-28 09:48:01 +0200 oj r276481 : #i105366# init drivers when not empty
2009-09-25 14:31:27 +0200 fs r276466 : CWS-TOOLING: rebase CWS dba32h to trunk@276429 (milestone: DEV300:m60)
2009-09-24 13:52:54 +0200 fs r276422 : #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 11:42:03 +0200 fs r276413 : #i105234# proper zoom handling for the nav bar
2009-09-24 11:41:40 +0200 fs r276412 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-23 12:21:22 +0200 oj r276377 : remove dos lineends
2009-09-23 11:44:52 +0200 oj r276376 : #i105216# load config on demand
2009-09-23 11:44:19 +0200 oj r276375 : #i105216# load config on demand
2009-09-23 11:43:35 +0200 oj r276374 : #i105216# load config on demand
2009-09-21 09:13:03 +0200 oj r276307 : #i105158# use Thread support
2009-09-18 13:06:50 +0200 fs r276277 : #i105147#
2009-09-18 11:48:23 +0200 oj r276271 : #i105158# new method for thread safety
2009-09-18 10:42:56 +0200 fs r276266 : CWS-TOOLING: rebase CWS dba32h to trunk@276192 (milestone: DEV300:m59)
2009-09-18 08:30:03 +0200 oj r276263 : #i105016# load correct ldap so
2009-09-17 13:42:31 +0200 oj r276240 : change count of check boxes
2009-09-17 13:32:59 +0200 oj r276239 : revert false to true for currency
2009-09-17 09:14:46 +0200 oj r276220 : #i104901# add patch for every issue
2009-09-17 09:10:29 +0200 oj r276219 : #i104901# add patch for every issue
2009-09-11 13:47:49 +0200 oj r276060 : #i104901# fix for indentity
2009-09-11 12:14:14 +0200 fs r276056 : #i104594# allow to render controls without an SdrPageView
2009-09-11 11:49:31 +0200 fs r276055 : CWS-TOOLING: rebase CWS dba32h to trunk@276043 (milestone: DEV300:m58)
2009-09-10 08:41:40 +0200 oj r276021 : #i104911# export variable-set not for repeating sections
2009-10-14 18:48:09 +00:00
|
|
|
// Note we set our init-state to "Initializing", not "Initialized". We're created from inside the ModelImpl,
|
|
|
|
// which is expected to call attachResource in case there was a previous incarnation of the document,
|
|
|
|
// so we can properly finish our initialization then.
|
|
|
|
impl_setInitializing();
|
|
|
|
|
|
|
|
if ( m_pImpl->getURL().getLength() )
|
|
|
|
{
|
|
|
|
// if the previous incarnation of the DatabaseDocument already had an URL, then creating this incarnation
|
|
|
|
// here is effectively loading the document.
|
|
|
|
m_aViewMonitor.onLoadedDocument();
|
|
|
|
}
|
2009-04-24 18:34:24 +00:00
|
|
|
}
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2005-03-10 15:33:50 +00:00
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
ODatabaseDocument::~ODatabaseDocument()
|
2004-12-03 13:34:06 +00:00
|
|
|
{
|
2005-03-10 15:33:50 +00:00
|
|
|
DBG_DTOR(ODatabaseDocument,NULL);
|
|
|
|
if ( !ODatabaseDocument_OfficeDocument::rBHelper.bInDispose && !ODatabaseDocument_OfficeDocument::rBHelper.bDisposed )
|
2004-12-03 13:34:06 +00:00
|
|
|
{
|
2005-03-10 15:33:50 +00:00
|
|
|
acquire();
|
|
|
|
dispose();
|
2004-12-03 13:34:06 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
delete m_pEventContainer, m_pEventContainer = NULL;
|
2004-12-03 13:34:06 +00:00
|
|
|
}
|
2008-06-06 13:02:08 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) throw (RuntimeException)
|
2008-04-04 13:32:17 +00:00
|
|
|
{
|
2008-04-08 11:46:07 +00:00
|
|
|
// 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.
|
2009-04-24 18:34:24 +00:00
|
|
|
if ( !m_bAllowDocumentScripting
|
2008-04-08 11:46:07 +00:00
|
|
|
&& ( _rType.equals( XEmbeddedScripts::static_type() )
|
|
|
|
|| _rType.equals( XScriptInvocationContext::static_type() )
|
|
|
|
)
|
|
|
|
)
|
|
|
|
return Any();
|
|
|
|
|
2008-04-04 13:32:17 +00:00
|
|
|
Any aReturn = ODatabaseDocument_OfficeDocument::queryInterface(_rType);
|
|
|
|
if (!aReturn.hasValue())
|
|
|
|
aReturn = ODatabaseDocument_Title::queryInterface(_rType);
|
|
|
|
return aReturn;
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::acquire( ) throw ()
|
|
|
|
{
|
|
|
|
ODatabaseDocument_OfficeDocument::acquire();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::release( ) throw ()
|
|
|
|
{
|
|
|
|
ODatabaseDocument_OfficeDocument::release();
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( ) throw (RuntimeException)
|
|
|
|
{
|
2008-04-08 11:46:07 +00:00
|
|
|
Sequence< Type > aTypes = ::comphelper::concatSequences(
|
2008-04-04 13:32:17 +00:00
|
|
|
ODatabaseDocument_OfficeDocument::getTypes(),
|
|
|
|
ODatabaseDocument_Title::getTypes()
|
|
|
|
);
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// 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.
|
2009-04-24 18:34:24 +00:00
|
|
|
if ( !m_bAllowDocumentScripting )
|
2005-03-30 10:55:24 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
Sequence< Type > aStrippedTypes( aTypes.getLength() );
|
|
|
|
Type* pStripTo( aStrippedTypes.getArray() );
|
|
|
|
|
|
|
|
// strip XEmbeddedScripts, and immediately re-assign to aTypes
|
|
|
|
aTypes = Sequence< Type >(
|
|
|
|
pStripTo,
|
|
|
|
::std::remove_copy_if(
|
|
|
|
aTypes.getConstArray(),
|
|
|
|
aTypes.getConstArray() + aTypes.getLength(),
|
|
|
|
pStripTo,
|
|
|
|
::std::bind2nd( ::std::equal_to< Type >(), XEmbeddedScripts::static_type() )
|
|
|
|
) - pStripTo
|
|
|
|
);
|
|
|
|
|
|
|
|
// strip XScriptInvocationContext, and immediately re-assign to aTypes
|
|
|
|
aTypes = Sequence< Type >(
|
|
|
|
pStripTo,
|
|
|
|
::std::remove_copy_if(
|
|
|
|
aTypes.getConstArray(),
|
|
|
|
aTypes.getConstArray() + aTypes.getLength(),
|
|
|
|
pStripTo,
|
|
|
|
::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() )
|
|
|
|
) - pStripTo
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return aTypes;
|
|
|
|
}
|
2008-04-08 11:46:07 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Sequence< sal_Int8 > SAL_CALL ODatabaseDocument::getImplementationId( ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
static ::cppu::OImplementationId * pId = 0;
|
|
|
|
if (! pId)
|
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
|
|
|
if (! pId)
|
|
|
|
{
|
|
|
|
static ::cppu::OImplementationId aId;
|
|
|
|
pId = &aId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pId->getImplementationId();
|
|
|
|
}
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// local functions
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
namespace
|
|
|
|
{
|
2009-04-24 18:34:24 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
static void lcl_extractAndStartStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments, Reference< XStatusIndicator >& _rxStatusIndicator,
|
|
|
|
Sequence< Any >& _rCallArgs )
|
|
|
|
{
|
2009-04-24 18:34:24 +00:00
|
|
|
_rxStatusIndicator = lcl_extractStatusIndicator( _rArguments );
|
|
|
|
if ( !_rxStatusIndicator.is() )
|
|
|
|
return;
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
try
|
2005-03-30 10:55:24 +00:00
|
|
|
{
|
2009-04-24 18:34:24 +00:00
|
|
|
_rxStatusIndicator->start( ::rtl::OUString(), (sal_Int32)1000000 );
|
2005-03-30 10:55:24 +00:00
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
sal_Int32 nLength = _rCallArgs.getLength();
|
|
|
|
_rCallArgs.realloc( nLength + 1 );
|
|
|
|
_rCallArgs[ nLength ] <<= _rxStatusIndicator;
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2005-03-30 10:55:24 +00:00
|
|
|
}
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
static Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const Sequence< PropertyValue >& _rDescriptor, const ::rtl::OUString _rURL )
|
2005-03-30 10:55:24 +00:00
|
|
|
{
|
2008-06-06 13:02:08 +00:00
|
|
|
::comphelper::NamedValueCollection aMediaDescriptor( _rDescriptor );
|
2008-03-06 16:58:17 +00:00
|
|
|
if ( _rURL.getLength() )
|
|
|
|
{
|
2008-06-06 13:02:08 +00:00
|
|
|
aMediaDescriptor.put( "FileName", _rURL );
|
|
|
|
aMediaDescriptor.put( "URL", _rURL );
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
2008-06-06 13:02:08 +00:00
|
|
|
return aMediaDescriptor.getPropertyValues();
|
2005-03-30 10:55:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODatabaseDocument::impl_setInitialized()
|
|
|
|
{
|
|
|
|
m_eInitState = Initialized;
|
|
|
|
|
|
|
|
// start event notifications
|
|
|
|
m_aEventNotifier.onDocumentInitialized();
|
|
|
|
}
|
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
void ODatabaseDocument::impl_reset_nothrow()
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2004-11-17 13:43:36 +00:00
|
|
|
try
|
|
|
|
{
|
2005-03-10 15:33:50 +00:00
|
|
|
m_pImpl->clearConnections();
|
|
|
|
m_pImpl->disposeStorages();
|
2008-03-06 16:58:17 +00:00
|
|
|
m_pImpl->resetRootStroage();
|
2004-12-03 13:34:06 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
clearObjectContainer( m_xForms );
|
|
|
|
clearObjectContainer( m_xReports );
|
|
|
|
clearObjectContainer( m_pImpl->m_xTableDefinitions );
|
|
|
|
clearObjectContainer( m_pImpl->m_xCommandDefinitions );
|
2004-11-17 13:43:36 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
m_eInitState = NotInitialized;
|
|
|
|
|
2007-07-24 11:04:32 +00:00
|
|
|
m_pImpl->reset();
|
2004-11-17 13:43:36 +00:00
|
|
|
}
|
|
|
|
catch(const Exception&)
|
|
|
|
{
|
2007-11-21 14:37:45 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2004-11-17 13:43:36 +00:00
|
|
|
}
|
2005-03-10 15:33:50 +00:00
|
|
|
m_pImpl->m_bDocumentReadOnly = sal_False;
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
2004-11-17 13:43:36 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2009-04-24 18:34:24 +00:00
|
|
|
void ODatabaseDocument::impl_import_nolck_throw( const ::comphelper::ComponentContext _rContext, const Reference< XInterface >& _rxTargetComponent,
|
|
|
|
const ::comphelper::NamedValueCollection& _rResource )
|
2008-03-06 16:58:17 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
Sequence< Any > aFilterArgs;
|
|
|
|
Reference< XStatusIndicator > xStatusIndicator;
|
|
|
|
lcl_extractAndStartStatusIndicator( _rResource, xStatusIndicator, aFilterArgs );
|
2004-11-17 13:43:36 +00:00
|
|
|
|
2008-11-19 17:43:08 +00:00
|
|
|
/** property map for import info set */
|
|
|
|
comphelper::PropertyMapEntry aExportInfoMap[] =
|
2008-12-01 12:31:27 +00:00
|
|
|
{
|
2008-11-19 17:43:08 +00:00
|
|
|
{ MAP_LEN( "BaseURI"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 },
|
|
|
|
{ MAP_LEN( "StreamName"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 },
|
2008-12-01 12:31:27 +00:00
|
|
|
{ NULL, 0, 0, NULL, 0, 0 }
|
|
|
|
};
|
|
|
|
uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
|
2008-11-19 17:43:08 +00:00
|
|
|
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(_rResource.getOrDefault("URL",::rtl::OUString())));
|
|
|
|
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml"))));
|
|
|
|
|
|
|
|
const sal_Int32 nCount = aFilterArgs.getLength();
|
|
|
|
aFilterArgs.realloc(nCount + 1);
|
|
|
|
aFilterArgs[nCount] <<= xInfoSet;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
Reference< XImporter > xImporter(
|
2009-04-24 18:34:24 +00:00
|
|
|
_rContext.createComponentWithArguments( "com.sun.star.comp.sdb.DBFilter", aFilterArgs ),
|
|
|
|
UNO_QUERY_THROW );
|
2004-11-17 13:43:36 +00:00
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
Reference< XComponent > xComponent( _rxTargetComponent, UNO_QUERY_THROW );
|
2008-10-16 06:57:26 +00:00
|
|
|
xImporter->setTargetDocument( xComponent );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
Reference< XFilter > xFilter( xImporter, UNO_QUERY_THROW );
|
|
|
|
xFilter->filter( ODatabaseModelImpl::stripLoadArguments( _rResource ) );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( xStatusIndicator.is() )
|
|
|
|
xStatusIndicator->end();
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-10-16 06:57:26 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::initNew( ) throw (DoubleInitializationException, IOException, Exception, RuntimeException)
|
2008-03-06 16:58:17 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// SYNCHRONIZED ->
|
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::InitMethod );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
impl_reset_nothrow();
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
impl_setInitializing();
|
|
|
|
|
|
|
|
// create a temporary storage
|
|
|
|
Reference< XStorage > xTempStor( ::comphelper::OStorageHelper::GetTemporaryStorage(
|
|
|
|
m_pImpl->m_aContext.getLegacyServiceFactory() ) );
|
|
|
|
|
|
|
|
// store therein
|
2009-04-24 18:34:24 +00:00
|
|
|
impl_storeToStorage_throw( xTempStor, Sequence< PropertyValue >(), aGuard );
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
// let the impl know we're now based on this storage
|
|
|
|
m_pImpl->switchToStorage( xTempStor );
|
|
|
|
|
2009-04-24 18:34:24 +00:00
|
|
|
// for the newly created document, allow document-wide scripting
|
|
|
|
m_bAllowDocumentScripting = true;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
impl_setInitialized();
|
|
|
|
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnTitleChanged" );
|
|
|
|
|
|
|
|
impl_setModified_nothrow( sal_False, aGuard );
|
|
|
|
// <- SYNCHRONIZED
|
|
|
|
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnCreate" );
|
|
|
|
|
|
|
|
impl_notifyStorageChange_nolck_nothrow( xTempStor );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::load( const Sequence< PropertyValue >& _Arguments ) throw (DoubleInitializationException, IOException, Exception, RuntimeException)
|
|
|
|
{
|
|
|
|
// SYNCHRONIZED ->
|
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::InitMethod );
|
|
|
|
|
|
|
|
impl_reset_nothrow();
|
|
|
|
|
|
|
|
::comphelper::NamedValueCollection aResource( _Arguments );
|
2008-12-01 12:31:27 +00:00
|
|
|
if ( aResource.has( "FileName" ) && !aResource.has( "URL" ) )
|
|
|
|
// FileName is the compatibility name for URL, so we might have clients passing
|
|
|
|
// a FileName only. However, some of our code works with the URL only, so ensure
|
|
|
|
// we have one.
|
|
|
|
aResource.put( "URL", aResource.get( "FileName" ) );
|
|
|
|
if ( aResource.has( "URL" ) && !aResource.has( "FileName" ) )
|
|
|
|
// similar ... just in case there is legacy code which expects a FileName only
|
|
|
|
aResource.put( "FileName", aResource.get( "URL" ) );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-05-05 14:50:07 +00:00
|
|
|
// now that somebody (perhaps) told us an macro execution mode, remember it as
|
|
|
|
// ImposedMacroExecMode
|
|
|
|
m_pImpl->setImposedMacroExecMode(
|
2008-06-06 13:02:08 +00:00
|
|
|
aResource.getOrDefault( "MacroExecutionMode", m_pImpl->getImposedMacroExecMode() ) );
|
2008-05-05 14:50:07 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
impl_setInitializing();
|
|
|
|
try
|
|
|
|
{
|
2009-04-24 18:34:24 +00:00
|
|
|
aGuard.clear();
|
|
|
|
impl_import_nolck_throw( m_pImpl->m_aContext, *this, aResource );
|
|
|
|
aGuard.reset();
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
impl_reset_nothrow();
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
// tell our view monitor that the document has been loaded - this way it will fire the proper
|
2009-04-24 18:34:24 +00:00
|
|
|
// event (OnLoad instead of OnCreate) later on
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aViewMonitor.onLoadedDocument();
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// note that we do *not* call impl_setInitialized() here: The initialization is only complete
|
|
|
|
// when the XModel::attachResource has been called, not sooner.
|
|
|
|
|
|
|
|
impl_setModified_nothrow( sal_False, aGuard );
|
|
|
|
// <- SYNCHRONIZED
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// XModel
|
|
|
|
sal_Bool SAL_CALL ODatabaseDocument::attachResource( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
|
|
|
|
|
|
|
|
if ( ( _rURL == getURL() )
|
|
|
|
&& ( _rArguments.getLength() == 1 )
|
|
|
|
&& ( _rArguments[0].Name.compareToAscii( "BreakMacroSignature" ) == 0 )
|
|
|
|
)
|
2005-03-10 15:33:50 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// this is a BAD hack of the Basic importer code ... there should be a dedicated API for this,
|
|
|
|
// not this bad mis-using of existing interfaces
|
2008-03-06 16:58:17 +00:00
|
|
|
return sal_False;
|
2008-10-16 06:57:26 +00:00
|
|
|
// (we do not support macro signatures, so we can ignore this call)
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pImpl->attachResource( _rURL, _rArguments );
|
|
|
|
|
|
|
|
if ( impl_isInitializing() )
|
|
|
|
{ // this means we've just been loaded, and this is the attachResource call which follows
|
|
|
|
// the load call.
|
|
|
|
impl_setInitialized();
|
2009-04-24 18:34:24 +00:00
|
|
|
|
|
|
|
// 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 );
|
|
|
|
|
CWS-TOOLING: integrate CWS dba32h
2009-10-12 12:21:44 +0200 msc r276827 : remove warning for issue 102712 because the issue is fixed
2009-10-05 07:14:20 +0200 oj r276658 : #105585# add missing dependency for OOO_UI
2009-10-02 12:50:19 +0200 fs r276632 : #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 12:46:12 +0200 fs r276631 : #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 13:09:07 +0200 fs r276596 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 12:35:56 +0200 fs r276589 : #i105509# don't rely on default form component names, use indexes
2009-10-01 11:19:18 +0200 fs r276584 : copying the fix for #i105082# into this CWS
2009-10-01 11:13:22 +0200 fs r276583 : improved logs
2009-10-01 11:10:44 +0200 fs r276581 : #i105505#
2009-10-01 08:07:57 +0200 fs r276575 : manual merge of trunk, to allow cwslocalize to run
2009-09-30 22:48:30 +0200 fs r276574 : removed that strange ONLOAD definition
2009-09-30 12:58:18 +0200 fs r276553 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 12:56:45 +0200 fs r276552 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 11:47:45 +0200 fs r276549 : #i105235#
2009-09-29 12:27:40 +0200 fs r276521 : #i105367#
2009-09-28 12:08:17 +0200 oj r276485 : #i105371# export version in manifest.xml as well
2009-09-28 12:07:02 +0200 oj r276484 : #i105371# export version in manifest.xml as well
2009-09-28 09:48:01 +0200 oj r276481 : #i105366# init drivers when not empty
2009-09-25 14:31:27 +0200 fs r276466 : CWS-TOOLING: rebase CWS dba32h to trunk@276429 (milestone: DEV300:m60)
2009-09-24 13:52:54 +0200 fs r276422 : #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 11:42:03 +0200 fs r276413 : #i105234# proper zoom handling for the nav bar
2009-09-24 11:41:40 +0200 fs r276412 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-23 12:21:22 +0200 oj r276377 : remove dos lineends
2009-09-23 11:44:52 +0200 oj r276376 : #i105216# load config on demand
2009-09-23 11:44:19 +0200 oj r276375 : #i105216# load config on demand
2009-09-23 11:43:35 +0200 oj r276374 : #i105216# load config on demand
2009-09-21 09:13:03 +0200 oj r276307 : #i105158# use Thread support
2009-09-18 13:06:50 +0200 fs r276277 : #i105147#
2009-09-18 11:48:23 +0200 oj r276271 : #i105158# new method for thread safety
2009-09-18 10:42:56 +0200 fs r276266 : CWS-TOOLING: rebase CWS dba32h to trunk@276192 (milestone: DEV300:m59)
2009-09-18 08:30:03 +0200 oj r276263 : #i105016# load correct ldap so
2009-09-17 13:42:31 +0200 oj r276240 : change count of check boxes
2009-09-17 13:32:59 +0200 oj r276239 : revert false to true for currency
2009-09-17 09:14:46 +0200 oj r276220 : #i104901# add patch for every issue
2009-09-17 09:10:29 +0200 oj r276219 : #i104901# add patch for every issue
2009-09-11 13:47:49 +0200 oj r276060 : #i104901# fix for indentity
2009-09-11 12:14:14 +0200 fs r276056 : #i104594# allow to render controls without an SdrPageView
2009-09-11 11:49:31 +0200 fs r276055 : CWS-TOOLING: rebase CWS dba32h to trunk@276043 (milestone: DEV300:m58)
2009-09-10 08:41:40 +0200 oj r276021 : #i104911# export variable-set not for repeating sections
2009-10-14 18:48:09 +00:00
|
|
|
aGuard.clear();
|
|
|
|
// <- SYNCHRONIZED
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnLoadFinished" );
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
::rtl::OUString SAL_CALL ODatabaseDocument::getURL( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
2008-03-06 16:58:17 +00:00
|
|
|
return m_pImpl->getURL();
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getArgs( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
|
|
|
return m_pImpl->getResource();
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::connectController( const Reference< XController >& _xController ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2007-11-21 14:37:45 +00:00
|
|
|
|
2007-07-24 11:04:32 +00:00
|
|
|
m_aControllers.push_back( _xController );
|
2007-11-21 14:37:45 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnViewCreated", Reference< XController2 >( _xController, UNO_QUERY ) );
|
|
|
|
|
|
|
|
bool bFirstControllerEver = m_aViewMonitor.onControllerConnected( _xController );
|
|
|
|
if ( !bFirstControllerEver )
|
2008-03-06 16:58:17 +00:00
|
|
|
return;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// check/adjust our macro mode.
|
2008-03-06 16:58:17 +00:00
|
|
|
m_pImpl->checkMacrosOnLoading();
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::disconnectController( const Reference< XController >& _xController ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
bool bNotifyViewClosed = false;
|
|
|
|
bool bLastControllerGone = false;
|
|
|
|
bool bIsClosing = false;
|
|
|
|
|
|
|
|
// SYNCHRONIZED ->
|
|
|
|
{
|
|
|
|
DocumentGuard aGuard( *this );
|
|
|
|
|
|
|
|
Controllers::iterator pos = ::std::find( m_aControllers.begin(), m_aControllers.end(), _xController );
|
|
|
|
OSL_ENSURE( pos != m_aControllers.end(), "ODatabaseDocument::disconnectController: don't know this controller!" );
|
|
|
|
if ( pos != m_aControllers.end() )
|
|
|
|
{
|
|
|
|
m_aControllers.erase( pos );
|
|
|
|
bNotifyViewClosed = true;
|
|
|
|
}
|
2005-03-30 10:55:24 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( m_xCurrentController == _xController )
|
|
|
|
m_xCurrentController = NULL;
|
2006-12-01 16:29:18 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
bLastControllerGone = m_aControllers.empty();
|
|
|
|
bIsClosing = m_bClosing;
|
|
|
|
}
|
|
|
|
// <- SYNCHRONIZED
|
2006-03-29 11:33:47 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( bNotifyViewClosed )
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnViewClosed", Reference< XController2 >( _xController, UNO_QUERY ) );
|
2007-11-21 14:37:45 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( bLastControllerGone && !bIsClosing )
|
|
|
|
{
|
2006-03-29 11:33:47 +00:00
|
|
|
// if this was the last view, close the document as a whole
|
|
|
|
// #i51157# / 2006-03-16 / frank.schoenheit@sun.com
|
|
|
|
try
|
|
|
|
{
|
|
|
|
close( sal_True );
|
|
|
|
}
|
|
|
|
catch( const CloseVetoException& )
|
|
|
|
{
|
|
|
|
// okay, somebody vetoed and took ownership
|
|
|
|
}
|
|
|
|
}
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::lockControllers( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-30 10:55:24 +00:00
|
|
|
|
2005-03-10 15:33:50 +00:00
|
|
|
++m_pImpl->m_nControllerLockCount;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::unlockControllers( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
|
|
|
--m_pImpl->m_nControllerLockCount;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseDocument::hasControllersLocked( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
|
|
|
return m_pImpl->m_nControllerLockCount != 0;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Reference< XController > SAL_CALL ODatabaseDocument::getCurrentController() throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2007-07-24 11:04:32 +00:00
|
|
|
return m_xCurrentController.is() ? m_xCurrentController : ( m_aControllers.empty() ? Reference< XController >() : *m_aControllers.begin() );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::setCurrentController( const Reference< XController >& _xController ) throw (NoSuchElementException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2007-07-24 11:04:32 +00:00
|
|
|
m_xCurrentController = _xController;
|
2008-10-16 06:57:26 +00:00
|
|
|
|
|
|
|
m_aViewMonitor.onSetCurrentController( _xController );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Reference< XInterface > SAL_CALL ODatabaseDocument::getCurrentSelection( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
|
|
|
Reference< XInterface > xRet;
|
|
|
|
Reference< XSelectionSupplier > xDocView( getCurrentController(), UNO_QUERY );
|
|
|
|
if ( xDocView.is() )
|
|
|
|
xRet.set(xDocView->getSelection(),UNO_QUERY);
|
|
|
|
|
|
|
|
return xRet;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// XStorable
|
2005-03-10 15:33:50 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseDocument::hasLocation( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
return getLocation().getLength() > 0;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
::rtl::OUString SAL_CALL ODatabaseDocument::getLocation( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
|
|
|
return m_pImpl->getURL();
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseDocument::isReadonly( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
2005-03-10 15:33:50 +00:00
|
|
|
return m_pImpl->m_bDocumentReadOnly;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::store( ) throw (IOException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( m_pImpl->getDocFileLocation() == m_pImpl->getURL() )
|
2008-03-06 16:58:17 +00:00
|
|
|
if ( m_pImpl->m_bDocumentReadOnly )
|
|
|
|
throw IOException();
|
2005-02-02 13:01:30 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
impl_storeAs_throw( m_pImpl->getURL(), m_pImpl->getResource(), SAVE, aGuard );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
void ODatabaseDocument::impl_storeAs_throw( const ::rtl::OUString& _rURL, const Sequence< PropertyValue>& _rArguments,
|
CWS-TOOLING: integrate CWS dba32g
2009-09-09 07:53:55 +0200 oj r275964 : replace strlen with rtl_str_getLength
2009-09-07 20:59:10 +0200 fs r275913 : disable the CopyTableWizard test until issue 104869 is fixed
2009-09-07 12:17:31 +0200 oj r275885 : #i104810# remove de as lang
2009-09-05 22:26:21 +0200 fs r275857 : protect StateChanged against re-entrance
2009-09-05 22:25:52 +0200 fs r275856 : don't attempt to classify the parent of a form as control
2009-09-05 22:25:29 +0200 fs r275855 : protect against re-entrance
2009-09-05 00:11:40 +0200 fs r275835 : #i10000#
2009-09-04 23:25:50 +0200 fs r275834 : #i10000#
2009-09-04 23:23:47 +0200 fs r275833 : #i10000#
2009-09-04 21:49:37 +0200 fs r275830 : #i10000# correct wrong conflict resolution
2009-09-04 20:59:51 +0200 fs r275829 : CWS-TOOLING: rebase CWS dba32g to trunk@275801 (milestone: DEV300:m57)
2009-09-04 11:08:32 +0200 oj r275791 : #i104780# new version 1.2.0
2009-09-03 22:29:21 +0200 fs r275775 : OSL_TRACE doesn't need \n anymore
2009-09-03 08:33:21 +0200 fs r275743 : CWS-TOOLING: rebase CWS dba32g to trunk@275331 (milestone: DEV300:m56)
2009-09-02 13:48:12 +0200 fs r275708 : removed useless include
2009-09-02 13:45:43 +0200 fs r275707 : more since tags, which are used across offapi/udkapi
2009-09-02 13:23:04 +0200 fs r275705 : should *not* have the dtor, copy ctor, and assignment operator compiler-generated, else we run into trouble as soon as the compiler creates different versions of our singleton member's static data in different libraries
2009-09-02 12:32:45 +0200 fs r275704 : AutoIncrementIsPrimaryKey is a driver setting, not a data source setting
2009-09-02 11:42:49 +0200 fs r275701 : URL meta data are meta data which are valid for all connections of this type, not per-data-source properties. Settings them as data source properties is a hack.
2009-09-02 08:43:34 +0200 fs r275696 : 3.x.x is not a valid 'since' tag
2009-09-01 16:05:24 +0200 fs r275665 : #i104686# don't treat controls bound to read-only columns as required
2009-09-01 13:10:22 +0200 fs r275657 : #i104574# use PageUp/Down to scroll through the complete page
2009-09-01 07:04:48 +0200 oj r275641 : #i104104# correct line ends
2009-08-31 15:52:34 +0200 fs r275612 : #i104410#
2009-08-31 12:29:05 +0200 fs r275596 : #i104364#
2009-08-31 12:28:56 +0200 fs r275595 : #i104364#
2009-08-31 11:43:09 +0200 fs r275593 : #i104649# JavaDriverClassPath is also a known JDBC-bridge setting
2009-08-31 11:41:37 +0200 fs r275592 : #i104649#
2009-08-28 21:48:27 +0200 fs r275552 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:48:17 +0200 fs r275551 : #i96862# do not show the 'Create a new database' option when a) no embedded/dBase driver is installed or b) the configuration requests to hide the option
2009-08-28 21:47:19 +0200 fs r275550 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:46:41 +0200 fs r275549 : #i96862# renamed and extended the configuration data which controls availability of certain DBA-related UI
2009-08-28 15:10:19 +0200 fs r275535 : #i96862# if no embedded driver is installed, use dBase for creating new DBs. If no dBase driver is installed, too, do not offer the 'Create new database' option
2009-08-28 14:03:04 +0200 fs r275532 : #i104454# allow multiple fields to display the same column
2009-08-28 13:14:00 +0200 fs r275528 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:09:57 +0200 fs r275527 : properly chech the MySQL type buttons (else next/back in the wizard leads to state with two buttons checked)
2009-08-28 13:09:17 +0200 fs r275526 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:07:18 +0200 fs r275525 : BooleanComparisonMode is a property, or a feature - but not a driver meta data
2009-08-28 11:00:31 +0200 fs r275521 : #i104580#
2009-08-28 10:40:05 +0200 fs r275519 : #i104577# correct assertion: If the template node type is ANY, then any value type is allowed
2009-08-28 10:09:30 +0200 fs r275518 : #i104575# implement Named Pipe UI
2009-08-28 10:09:07 +0200 fs r275517 : pass the trigger-event to IWindowOperator::operateOn / work with VclWindowEvents, not VclSimpleEvents
2009-08-27 14:27:36 +0200 fs r275484 : ImplPosTabPage: respect mbEmptyViewMargin for WINDOWALIGN_LEFT
2009-08-27 13:43:56 +0200 fs r275480 : merging latest changes from CWS dba32f herein
2009-08-27 13:23:07 +0200 fs r275475 : #i103882#
2009-08-27 11:56:55 +0200 fs r275466 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 11:55:34 +0200 fs r275465 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 10:14:11 +0200 fs r275459 : preparations for supporting a 'NamedPipe' parameter for the MySQL Connector/OOo
2009-08-27 10:13:21 +0200 fs r275458 : preparations for supporting a 'NamedPipe' setting for the MySQL Connector/OOo
2009-08-27 10:11:14 +0200 fs r275456 : outsourced the MySQLNative settings into a dedicated class, to not duplicate all the code in two tab page implementations
2009-08-26 14:18:13 +0200 fs r275422 : #i10000#
2009-08-26 13:26:36 +0200 fs r275419 : ignore output paths
2009-08-26 13:23:38 +0200 fs r275417 : support the LocalSocket property for the MySQL native driver
2009-08-26 13:17:05 +0200 fs r275416 : some re-factoring, to outsource the tab page for setting up the MySQLNative connection, into a dedicated class (needed later)
2009-08-26 13:15:15 +0200 fs r275415 : support a NoThousandSep property for NumericFormatters - I'm tired of correcting this at runtime, instead of controlling it in the resource
2009-08-26 11:45:08 +0200 fs r275410 : oops, 'flat' shouldn't have got lost
2009-08-26 09:38:57 +0200 fs r275398 : #i102631# when saving the document fails, ensure that the interaction handler really can handle/display the error
2009-08-26 09:37:05 +0200 fs r275397 : #i102631# don't let non-IO/RuntimeExceptions escape from DatabaseDocument::store*, wrap them into an IOException
2009-08-26 09:35:39 +0200 fs r275395 : let the default interaction handler implement XInteractionHandler2
2009-08-25 13:51:34 +0200 fs r275352 : #i102631# createTempFile: pass URL through FileHelper.getOOoCompatibleFileURL
2009-08-25 13:49:23 +0200 fs r275351 : #i102631# createTempFileURL: immediately delete the file implicitly created by createTempFile, we really only need the URL
2009-08-24 14:49:07 +0200 fs r275318 : #i10000#
2009-08-24 14:36:03 +0200 fs r275315 : properly terminate message with 0 character
2009-08-24 14:35:45 +0200 fs r275314 : trace method concepts in non-pro, if special flag is enabled
2009-08-24 14:24:17 +0200 fs r275312 : #i98973# filter some more events for grid control columns
2009-08-24 14:15:23 +0200 fs r275311 : #i98973# implement XComboBox for combo box cells
2009-08-24 13:39:24 +0200 fs r275308 : #i98973# do not display the 'actionPerformed' event for grid combo box columns
2009-08-24 12:52:03 +0200 fs r275303 : #i98973# implement XCheckBox and XButton for check box cells
2009-08-24 11:56:05 +0200 oj r275300 : #i104447# wrong default for orientation
2009-08-24 10:51:21 +0200 fs r275296 : in the script selector dialog, interpret a double click onto a function as OK
2009-08-24 10:50:56 +0200 fs r275295 : localize some to-be-displayed names, consolidate some code regarding form/control naming
2009-08-21 14:28:05 +0200 fs r275255 : #i98973# implement KeyListeners
2009-08-21 14:27:20 +0200 fs r275254 : #i98973# move the conversion VCL[Mouse|Key]Event->Awt[Mouse|Key]Event from vclxwindow.cxx to VCLUnoHelper
2009-08-21 14:08:50 +0200 fs r275248 : #i98973# implement Mouse- and MouseMotion-broadcasting
2009-08-21 13:31:08 +0200 fs r275244 : #i98973# implement text and change listeners at text cells
2009-08-21 12:47:38 +0200 fs r275234 : #i104399# some refactoring:
If the MySQL Connector/OOo is installed, it registers for the sdbc:mysqlc: protocol (now known as DST_MYSQL_NATIVE_DIRECT).
However, we do not want to display this in the UI, instead we display "MySQL" only, which collects DST_MYSQL_ODBC, DST_MYSQL_JDBC, and DST_MYSQL_NATIVE.
2009-08-21 12:45:18 +0200 fs r275232 : #i104399# also register for the sdbc:mysql:mysqlc protocol, decide at runtime (depending on the availability of sdbc:mysqlc:), whether it is really accepted. This prevents that the C/OOo extension needs to register *our* implementation name for the sdbc:mysql:mysqlc: protocol, which would be somewhat weird
2009-08-20 16:18:48 +0200 fs r275190 : merging the latest changes from CWS dba32f (which this CWS was created from)
2009-08-19 20:19:59 +0200 fs r275160 : add some spacing between the radios
2009-08-19 14:50:15 +0200 fs r275150 : #i98973# slightly refactoring the grid cell implementations, to prepare for proper events being fired. Implement focus events for the moment, more to come.
2009-08-19 10:53:38 +0200 fs r275142 : #i99936# initialize newly created models
2009-08-18 23:03:48 +0200 fs r275132 : merging latest changes from CWS dba32f
2009-08-18 15:14:08 +0200 fs r275110 : #i102819# SetColumnPos: SCROLL_CLIP is deadly here
2009-09-14 11:18:01 +00:00
|
|
|
const StoreType _eType, DocumentGuard& _rGuard ) throw ( IOException, RuntimeException )
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
OSL_PRECOND( ( _eType == SAVE ) || ( _eType == SAVE_AS ),
|
|
|
|
"ODatabaseDocument::impl_storeAs_throw: you introduced a new type which cannot be handled here!" );
|
|
|
|
|
|
|
|
// if we're in the process of initializing the document (which effectively means it is an implicit
|
|
|
|
// initialization triggered in storeAsURL), the we do not notify events, since to an observer, the SaveAs
|
|
|
|
// should not be noticable
|
|
|
|
bool bIsInitializationProcess = impl_isInitializing();
|
|
|
|
|
|
|
|
if ( !bIsInitializationProcess )
|
|
|
|
{
|
|
|
|
_rGuard.clear();
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( _eType == SAVE ? "OnSave" : "OnSaveAs", NULL, makeAny( _rURL ) );
|
|
|
|
_rGuard.reset();
|
|
|
|
}
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XStorage > xNewRootStorage;
|
|
|
|
// will be non-NULL if our storage changed
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
try
|
2006-01-03 15:14:40 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
ModifyLock aLock( *this );
|
|
|
|
// ignore all changes of our "modified" state during storing
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
sal_Bool bLocationChanged = ( _rURL != m_pImpl->getDocFileLocation() );
|
|
|
|
if ( bLocationChanged )
|
|
|
|
{
|
|
|
|
// create storage for target URL
|
|
|
|
Reference< XStorage > xTargetStorage( impl_createStorageFor_throw( _rURL ) );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( m_pImpl->isEmbeddedDatabase() )
|
|
|
|
m_pImpl->clearConnections();
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// commit everything
|
|
|
|
m_pImpl->commitEmbeddedStorage();
|
|
|
|
m_pImpl->commitStorages();
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// copy own storage to target storage
|
|
|
|
Reference< XStorage > xCurrentStorage( m_pImpl->getRootStorage() );
|
|
|
|
if ( xCurrentStorage.is() )
|
|
|
|
xCurrentStorage->copyToStorage( xTargetStorage );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
m_pImpl->disposeStorages();
|
2005-03-30 10:55:24 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
xNewRootStorage = m_pImpl->switchToStorage( xTargetStorage );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
m_pImpl->m_bDocumentReadOnly = sal_False;
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// store to current storage
|
|
|
|
Reference< XStorage > xCurrentStorage( m_pImpl->getOrCreateRootStorage(), UNO_QUERY_THROW );
|
|
|
|
Sequence< PropertyValue > aMediaDescriptor( lcl_appendFileNameToDescriptor( _rArguments, _rURL ) );
|
2009-04-24 18:34:24 +00:00
|
|
|
impl_storeToStorage_throw( xCurrentStorage, aMediaDescriptor, _rGuard );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// success - tell our impl
|
|
|
|
m_pImpl->attachResource( _rURL, aMediaDescriptor );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// if we are in an initialization process, then this is finished, now that we stored the document
|
|
|
|
if ( bIsInitializationProcess )
|
|
|
|
impl_setInitialized();
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
CWS-TOOLING: integrate CWS dba32g
2009-09-09 07:53:55 +0200 oj r275964 : replace strlen with rtl_str_getLength
2009-09-07 20:59:10 +0200 fs r275913 : disable the CopyTableWizard test until issue 104869 is fixed
2009-09-07 12:17:31 +0200 oj r275885 : #i104810# remove de as lang
2009-09-05 22:26:21 +0200 fs r275857 : protect StateChanged against re-entrance
2009-09-05 22:25:52 +0200 fs r275856 : don't attempt to classify the parent of a form as control
2009-09-05 22:25:29 +0200 fs r275855 : protect against re-entrance
2009-09-05 00:11:40 +0200 fs r275835 : #i10000#
2009-09-04 23:25:50 +0200 fs r275834 : #i10000#
2009-09-04 23:23:47 +0200 fs r275833 : #i10000#
2009-09-04 21:49:37 +0200 fs r275830 : #i10000# correct wrong conflict resolution
2009-09-04 20:59:51 +0200 fs r275829 : CWS-TOOLING: rebase CWS dba32g to trunk@275801 (milestone: DEV300:m57)
2009-09-04 11:08:32 +0200 oj r275791 : #i104780# new version 1.2.0
2009-09-03 22:29:21 +0200 fs r275775 : OSL_TRACE doesn't need \n anymore
2009-09-03 08:33:21 +0200 fs r275743 : CWS-TOOLING: rebase CWS dba32g to trunk@275331 (milestone: DEV300:m56)
2009-09-02 13:48:12 +0200 fs r275708 : removed useless include
2009-09-02 13:45:43 +0200 fs r275707 : more since tags, which are used across offapi/udkapi
2009-09-02 13:23:04 +0200 fs r275705 : should *not* have the dtor, copy ctor, and assignment operator compiler-generated, else we run into trouble as soon as the compiler creates different versions of our singleton member's static data in different libraries
2009-09-02 12:32:45 +0200 fs r275704 : AutoIncrementIsPrimaryKey is a driver setting, not a data source setting
2009-09-02 11:42:49 +0200 fs r275701 : URL meta data are meta data which are valid for all connections of this type, not per-data-source properties. Settings them as data source properties is a hack.
2009-09-02 08:43:34 +0200 fs r275696 : 3.x.x is not a valid 'since' tag
2009-09-01 16:05:24 +0200 fs r275665 : #i104686# don't treat controls bound to read-only columns as required
2009-09-01 13:10:22 +0200 fs r275657 : #i104574# use PageUp/Down to scroll through the complete page
2009-09-01 07:04:48 +0200 oj r275641 : #i104104# correct line ends
2009-08-31 15:52:34 +0200 fs r275612 : #i104410#
2009-08-31 12:29:05 +0200 fs r275596 : #i104364#
2009-08-31 12:28:56 +0200 fs r275595 : #i104364#
2009-08-31 11:43:09 +0200 fs r275593 : #i104649# JavaDriverClassPath is also a known JDBC-bridge setting
2009-08-31 11:41:37 +0200 fs r275592 : #i104649#
2009-08-28 21:48:27 +0200 fs r275552 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:48:17 +0200 fs r275551 : #i96862# do not show the 'Create a new database' option when a) no embedded/dBase driver is installed or b) the configuration requests to hide the option
2009-08-28 21:47:19 +0200 fs r275550 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:46:41 +0200 fs r275549 : #i96862# renamed and extended the configuration data which controls availability of certain DBA-related UI
2009-08-28 15:10:19 +0200 fs r275535 : #i96862# if no embedded driver is installed, use dBase for creating new DBs. If no dBase driver is installed, too, do not offer the 'Create new database' option
2009-08-28 14:03:04 +0200 fs r275532 : #i104454# allow multiple fields to display the same column
2009-08-28 13:14:00 +0200 fs r275528 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:09:57 +0200 fs r275527 : properly chech the MySQL type buttons (else next/back in the wizard leads to state with two buttons checked)
2009-08-28 13:09:17 +0200 fs r275526 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:07:18 +0200 fs r275525 : BooleanComparisonMode is a property, or a feature - but not a driver meta data
2009-08-28 11:00:31 +0200 fs r275521 : #i104580#
2009-08-28 10:40:05 +0200 fs r275519 : #i104577# correct assertion: If the template node type is ANY, then any value type is allowed
2009-08-28 10:09:30 +0200 fs r275518 : #i104575# implement Named Pipe UI
2009-08-28 10:09:07 +0200 fs r275517 : pass the trigger-event to IWindowOperator::operateOn / work with VclWindowEvents, not VclSimpleEvents
2009-08-27 14:27:36 +0200 fs r275484 : ImplPosTabPage: respect mbEmptyViewMargin for WINDOWALIGN_LEFT
2009-08-27 13:43:56 +0200 fs r275480 : merging latest changes from CWS dba32f herein
2009-08-27 13:23:07 +0200 fs r275475 : #i103882#
2009-08-27 11:56:55 +0200 fs r275466 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 11:55:34 +0200 fs r275465 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 10:14:11 +0200 fs r275459 : preparations for supporting a 'NamedPipe' parameter for the MySQL Connector/OOo
2009-08-27 10:13:21 +0200 fs r275458 : preparations for supporting a 'NamedPipe' setting for the MySQL Connector/OOo
2009-08-27 10:11:14 +0200 fs r275456 : outsourced the MySQLNative settings into a dedicated class, to not duplicate all the code in two tab page implementations
2009-08-26 14:18:13 +0200 fs r275422 : #i10000#
2009-08-26 13:26:36 +0200 fs r275419 : ignore output paths
2009-08-26 13:23:38 +0200 fs r275417 : support the LocalSocket property for the MySQL native driver
2009-08-26 13:17:05 +0200 fs r275416 : some re-factoring, to outsource the tab page for setting up the MySQLNative connection, into a dedicated class (needed later)
2009-08-26 13:15:15 +0200 fs r275415 : support a NoThousandSep property for NumericFormatters - I'm tired of correcting this at runtime, instead of controlling it in the resource
2009-08-26 11:45:08 +0200 fs r275410 : oops, 'flat' shouldn't have got lost
2009-08-26 09:38:57 +0200 fs r275398 : #i102631# when saving the document fails, ensure that the interaction handler really can handle/display the error
2009-08-26 09:37:05 +0200 fs r275397 : #i102631# don't let non-IO/RuntimeExceptions escape from DatabaseDocument::store*, wrap them into an IOException
2009-08-26 09:35:39 +0200 fs r275395 : let the default interaction handler implement XInteractionHandler2
2009-08-25 13:51:34 +0200 fs r275352 : #i102631# createTempFile: pass URL through FileHelper.getOOoCompatibleFileURL
2009-08-25 13:49:23 +0200 fs r275351 : #i102631# createTempFileURL: immediately delete the file implicitly created by createTempFile, we really only need the URL
2009-08-24 14:49:07 +0200 fs r275318 : #i10000#
2009-08-24 14:36:03 +0200 fs r275315 : properly terminate message with 0 character
2009-08-24 14:35:45 +0200 fs r275314 : trace method concepts in non-pro, if special flag is enabled
2009-08-24 14:24:17 +0200 fs r275312 : #i98973# filter some more events for grid control columns
2009-08-24 14:15:23 +0200 fs r275311 : #i98973# implement XComboBox for combo box cells
2009-08-24 13:39:24 +0200 fs r275308 : #i98973# do not display the 'actionPerformed' event for grid combo box columns
2009-08-24 12:52:03 +0200 fs r275303 : #i98973# implement XCheckBox and XButton for check box cells
2009-08-24 11:56:05 +0200 oj r275300 : #i104447# wrong default for orientation
2009-08-24 10:51:21 +0200 fs r275296 : in the script selector dialog, interpret a double click onto a function as OK
2009-08-24 10:50:56 +0200 fs r275295 : localize some to-be-displayed names, consolidate some code regarding form/control naming
2009-08-21 14:28:05 +0200 fs r275255 : #i98973# implement KeyListeners
2009-08-21 14:27:20 +0200 fs r275254 : #i98973# move the conversion VCL[Mouse|Key]Event->Awt[Mouse|Key]Event from vclxwindow.cxx to VCLUnoHelper
2009-08-21 14:08:50 +0200 fs r275248 : #i98973# implement Mouse- and MouseMotion-broadcasting
2009-08-21 13:31:08 +0200 fs r275244 : #i98973# implement text and change listeners at text cells
2009-08-21 12:47:38 +0200 fs r275234 : #i104399# some refactoring:
If the MySQL Connector/OOo is installed, it registers for the sdbc:mysqlc: protocol (now known as DST_MYSQL_NATIVE_DIRECT).
However, we do not want to display this in the UI, instead we display "MySQL" only, which collects DST_MYSQL_ODBC, DST_MYSQL_JDBC, and DST_MYSQL_NATIVE.
2009-08-21 12:45:18 +0200 fs r275232 : #i104399# also register for the sdbc:mysql:mysqlc protocol, decide at runtime (depending on the availability of sdbc:mysqlc:), whether it is really accepted. This prevents that the C/OOo extension needs to register *our* implementation name for the sdbc:mysql:mysqlc: protocol, which would be somewhat weird
2009-08-20 16:18:48 +0200 fs r275190 : merging the latest changes from CWS dba32f (which this CWS was created from)
2009-08-19 20:19:59 +0200 fs r275160 : add some spacing between the radios
2009-08-19 14:50:15 +0200 fs r275150 : #i98973# slightly refactoring the grid cell implementations, to prepare for proper events being fired. Implement focus events for the moment, more to come.
2009-08-19 10:53:38 +0200 fs r275142 : #i99936# initialize newly created models
2009-08-18 23:03:48 +0200 fs r275132 : merging latest changes from CWS dba32f
2009-08-18 15:14:08 +0200 fs r275110 : #i102819# SetColumnPos: SCROLL_CLIP is deadly here
2009-09-14 11:18:01 +00:00
|
|
|
Any aError = ::cppu::getCaughtException();
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// notify the failure
|
|
|
|
if ( !bIsInitializationProcess )
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", NULL, makeAny( _rURL ) );
|
CWS-TOOLING: integrate CWS dba32g
2009-09-09 07:53:55 +0200 oj r275964 : replace strlen with rtl_str_getLength
2009-09-07 20:59:10 +0200 fs r275913 : disable the CopyTableWizard test until issue 104869 is fixed
2009-09-07 12:17:31 +0200 oj r275885 : #i104810# remove de as lang
2009-09-05 22:26:21 +0200 fs r275857 : protect StateChanged against re-entrance
2009-09-05 22:25:52 +0200 fs r275856 : don't attempt to classify the parent of a form as control
2009-09-05 22:25:29 +0200 fs r275855 : protect against re-entrance
2009-09-05 00:11:40 +0200 fs r275835 : #i10000#
2009-09-04 23:25:50 +0200 fs r275834 : #i10000#
2009-09-04 23:23:47 +0200 fs r275833 : #i10000#
2009-09-04 21:49:37 +0200 fs r275830 : #i10000# correct wrong conflict resolution
2009-09-04 20:59:51 +0200 fs r275829 : CWS-TOOLING: rebase CWS dba32g to trunk@275801 (milestone: DEV300:m57)
2009-09-04 11:08:32 +0200 oj r275791 : #i104780# new version 1.2.0
2009-09-03 22:29:21 +0200 fs r275775 : OSL_TRACE doesn't need \n anymore
2009-09-03 08:33:21 +0200 fs r275743 : CWS-TOOLING: rebase CWS dba32g to trunk@275331 (milestone: DEV300:m56)
2009-09-02 13:48:12 +0200 fs r275708 : removed useless include
2009-09-02 13:45:43 +0200 fs r275707 : more since tags, which are used across offapi/udkapi
2009-09-02 13:23:04 +0200 fs r275705 : should *not* have the dtor, copy ctor, and assignment operator compiler-generated, else we run into trouble as soon as the compiler creates different versions of our singleton member's static data in different libraries
2009-09-02 12:32:45 +0200 fs r275704 : AutoIncrementIsPrimaryKey is a driver setting, not a data source setting
2009-09-02 11:42:49 +0200 fs r275701 : URL meta data are meta data which are valid for all connections of this type, not per-data-source properties. Settings them as data source properties is a hack.
2009-09-02 08:43:34 +0200 fs r275696 : 3.x.x is not a valid 'since' tag
2009-09-01 16:05:24 +0200 fs r275665 : #i104686# don't treat controls bound to read-only columns as required
2009-09-01 13:10:22 +0200 fs r275657 : #i104574# use PageUp/Down to scroll through the complete page
2009-09-01 07:04:48 +0200 oj r275641 : #i104104# correct line ends
2009-08-31 15:52:34 +0200 fs r275612 : #i104410#
2009-08-31 12:29:05 +0200 fs r275596 : #i104364#
2009-08-31 12:28:56 +0200 fs r275595 : #i104364#
2009-08-31 11:43:09 +0200 fs r275593 : #i104649# JavaDriverClassPath is also a known JDBC-bridge setting
2009-08-31 11:41:37 +0200 fs r275592 : #i104649#
2009-08-28 21:48:27 +0200 fs r275552 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:48:17 +0200 fs r275551 : #i96862# do not show the 'Create a new database' option when a) no embedded/dBase driver is installed or b) the configuration requests to hide the option
2009-08-28 21:47:19 +0200 fs r275550 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:46:41 +0200 fs r275549 : #i96862# renamed and extended the configuration data which controls availability of certain DBA-related UI
2009-08-28 15:10:19 +0200 fs r275535 : #i96862# if no embedded driver is installed, use dBase for creating new DBs. If no dBase driver is installed, too, do not offer the 'Create new database' option
2009-08-28 14:03:04 +0200 fs r275532 : #i104454# allow multiple fields to display the same column
2009-08-28 13:14:00 +0200 fs r275528 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:09:57 +0200 fs r275527 : properly chech the MySQL type buttons (else next/back in the wizard leads to state with two buttons checked)
2009-08-28 13:09:17 +0200 fs r275526 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:07:18 +0200 fs r275525 : BooleanComparisonMode is a property, or a feature - but not a driver meta data
2009-08-28 11:00:31 +0200 fs r275521 : #i104580#
2009-08-28 10:40:05 +0200 fs r275519 : #i104577# correct assertion: If the template node type is ANY, then any value type is allowed
2009-08-28 10:09:30 +0200 fs r275518 : #i104575# implement Named Pipe UI
2009-08-28 10:09:07 +0200 fs r275517 : pass the trigger-event to IWindowOperator::operateOn / work with VclWindowEvents, not VclSimpleEvents
2009-08-27 14:27:36 +0200 fs r275484 : ImplPosTabPage: respect mbEmptyViewMargin for WINDOWALIGN_LEFT
2009-08-27 13:43:56 +0200 fs r275480 : merging latest changes from CWS dba32f herein
2009-08-27 13:23:07 +0200 fs r275475 : #i103882#
2009-08-27 11:56:55 +0200 fs r275466 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 11:55:34 +0200 fs r275465 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 10:14:11 +0200 fs r275459 : preparations for supporting a 'NamedPipe' parameter for the MySQL Connector/OOo
2009-08-27 10:13:21 +0200 fs r275458 : preparations for supporting a 'NamedPipe' setting for the MySQL Connector/OOo
2009-08-27 10:11:14 +0200 fs r275456 : outsourced the MySQLNative settings into a dedicated class, to not duplicate all the code in two tab page implementations
2009-08-26 14:18:13 +0200 fs r275422 : #i10000#
2009-08-26 13:26:36 +0200 fs r275419 : ignore output paths
2009-08-26 13:23:38 +0200 fs r275417 : support the LocalSocket property for the MySQL native driver
2009-08-26 13:17:05 +0200 fs r275416 : some re-factoring, to outsource the tab page for setting up the MySQLNative connection, into a dedicated class (needed later)
2009-08-26 13:15:15 +0200 fs r275415 : support a NoThousandSep property for NumericFormatters - I'm tired of correcting this at runtime, instead of controlling it in the resource
2009-08-26 11:45:08 +0200 fs r275410 : oops, 'flat' shouldn't have got lost
2009-08-26 09:38:57 +0200 fs r275398 : #i102631# when saving the document fails, ensure that the interaction handler really can handle/display the error
2009-08-26 09:37:05 +0200 fs r275397 : #i102631# don't let non-IO/RuntimeExceptions escape from DatabaseDocument::store*, wrap them into an IOException
2009-08-26 09:35:39 +0200 fs r275395 : let the default interaction handler implement XInteractionHandler2
2009-08-25 13:51:34 +0200 fs r275352 : #i102631# createTempFile: pass URL through FileHelper.getOOoCompatibleFileURL
2009-08-25 13:49:23 +0200 fs r275351 : #i102631# createTempFileURL: immediately delete the file implicitly created by createTempFile, we really only need the URL
2009-08-24 14:49:07 +0200 fs r275318 : #i10000#
2009-08-24 14:36:03 +0200 fs r275315 : properly terminate message with 0 character
2009-08-24 14:35:45 +0200 fs r275314 : trace method concepts in non-pro, if special flag is enabled
2009-08-24 14:24:17 +0200 fs r275312 : #i98973# filter some more events for grid control columns
2009-08-24 14:15:23 +0200 fs r275311 : #i98973# implement XComboBox for combo box cells
2009-08-24 13:39:24 +0200 fs r275308 : #i98973# do not display the 'actionPerformed' event for grid combo box columns
2009-08-24 12:52:03 +0200 fs r275303 : #i98973# implement XCheckBox and XButton for check box cells
2009-08-24 11:56:05 +0200 oj r275300 : #i104447# wrong default for orientation
2009-08-24 10:51:21 +0200 fs r275296 : in the script selector dialog, interpret a double click onto a function as OK
2009-08-24 10:50:56 +0200 fs r275295 : localize some to-be-displayed names, consolidate some code regarding form/control naming
2009-08-21 14:28:05 +0200 fs r275255 : #i98973# implement KeyListeners
2009-08-21 14:27:20 +0200 fs r275254 : #i98973# move the conversion VCL[Mouse|Key]Event->Awt[Mouse|Key]Event from vclxwindow.cxx to VCLUnoHelper
2009-08-21 14:08:50 +0200 fs r275248 : #i98973# implement Mouse- and MouseMotion-broadcasting
2009-08-21 13:31:08 +0200 fs r275244 : #i98973# implement text and change listeners at text cells
2009-08-21 12:47:38 +0200 fs r275234 : #i104399# some refactoring:
If the MySQL Connector/OOo is installed, it registers for the sdbc:mysqlc: protocol (now known as DST_MYSQL_NATIVE_DIRECT).
However, we do not want to display this in the UI, instead we display "MySQL" only, which collects DST_MYSQL_ODBC, DST_MYSQL_JDBC, and DST_MYSQL_NATIVE.
2009-08-21 12:45:18 +0200 fs r275232 : #i104399# also register for the sdbc:mysql:mysqlc protocol, decide at runtime (depending on the availability of sdbc:mysqlc:), whether it is really accepted. This prevents that the C/OOo extension needs to register *our* implementation name for the sdbc:mysql:mysqlc: protocol, which would be somewhat weird
2009-08-20 16:18:48 +0200 fs r275190 : merging the latest changes from CWS dba32f (which this CWS was created from)
2009-08-19 20:19:59 +0200 fs r275160 : add some spacing between the radios
2009-08-19 14:50:15 +0200 fs r275150 : #i98973# slightly refactoring the grid cell implementations, to prepare for proper events being fired. Implement focus events for the moment, more to come.
2009-08-19 10:53:38 +0200 fs r275142 : #i99936# initialize newly created models
2009-08-18 23:03:48 +0200 fs r275132 : merging latest changes from CWS dba32f
2009-08-18 15:14:08 +0200 fs r275110 : #i102819# SetColumnPos: SCROLL_CLIP is deadly here
2009-09-14 11:18:01 +00:00
|
|
|
|
|
|
|
if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() )
|
|
|
|
|| aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() )
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// allowed to leave
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
|
|
|
|
Exception aExcept;
|
|
|
|
aError >>= aExcept;
|
|
|
|
|
|
|
|
::rtl::OUString sErrorMessage = ResourceManager::loadString(
|
|
|
|
RID_STR_ERROR_WHILE_SAVING,
|
|
|
|
"$except$", aError.getValueTypeName(),
|
|
|
|
"$message$", aExcept.Message
|
|
|
|
);
|
|
|
|
throw IOException( sErrorMessage, *this );
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// notify the document event
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( !bIsInitializationProcess )
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveDone" : "OnSaveAsDone", NULL, makeAny( _rURL ) );
|
|
|
|
|
|
|
|
// reset our "modified" flag, and clear the guard
|
|
|
|
impl_setModified_nothrow( sal_False, _rGuard );
|
|
|
|
// <- SYNCHRONIZED
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// notify storage listeners
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( xNewRootStorage.is() )
|
|
|
|
impl_notifyStorageChange_nolck_nothrow( xNewRootStorage );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-06-06 13:02:08 +00:00
|
|
|
Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const ::rtl::OUString& _rURL ) const
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
Sequence<Any> aParam(2);
|
|
|
|
aParam[0] <<= _rURL;
|
|
|
|
aParam[1] <<= ElementModes::READWRITE | ElementModes::TRUNCATE;
|
|
|
|
|
2008-06-06 13:02:08 +00:00
|
|
|
Reference< XSingleServiceFactory > xStorageFactory( m_pImpl->createStorageFactory(), UNO_SET_THROW );
|
|
|
|
return Reference< XStorage >( xStorageFactory->createInstanceWithArguments( aParam ), UNO_QUERY_THROW );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2005-12-21 12:34:54 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::storeAsURL( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (IOException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// SYNCHRONIZED ->
|
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
|
|
|
|
|
|
|
// Normally, a document initialization is done via XLoadable::load or XLoadable::initNew. For convenience
|
|
|
|
// reasons, and to not break existing API clients, it's allowed to call storeAsURL without having initialized
|
|
|
|
// the document, in which case the initialization will be done implicitly.
|
|
|
|
bool bImplicitInitialization = !impl_isInitialized();
|
|
|
|
// implicit initialization while another initialization is just running is not possible
|
|
|
|
if ( bImplicitInitialization && impl_isInitializing() )
|
|
|
|
throw DoubleInitializationException();
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( bImplicitInitialization )
|
|
|
|
impl_setInitializing();
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
impl_storeAs_throw( _rURL, _rArguments, SAVE_AS, aGuard );
|
|
|
|
// <- SYNCHRONIZED
|
|
|
|
|
|
|
|
// impl_storeAs_throw cleared the lock on our mutex, but the below lines need this lock
|
|
|
|
// SYNCHRONIZED ->
|
|
|
|
aGuard.reset();
|
|
|
|
|
|
|
|
// our title might have changed, potentially at least
|
|
|
|
// Sadly, we cannot check this: Calling getTitle here and now would not deliver
|
|
|
|
// an up-to-date result, as the call is delegated to our TitleHelper instance, which itself
|
|
|
|
// updates its title only if it gets the OnSaveAsDone event (which was sent asynchronously
|
|
|
|
// by impl_storeAs_throw). So, we simply notify always, and also asynchronously
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnTitleChanged" );
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
impl_reset_nothrow();
|
|
|
|
throw;
|
|
|
|
}
|
2009-04-24 18:34:24 +00:00
|
|
|
|
|
|
|
if ( bImplicitInitialization )
|
|
|
|
m_bAllowDocumentScripting = true;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
aGuard.clear();
|
|
|
|
// <- SYNCHRONIZED
|
|
|
|
|
|
|
|
if ( bImplicitInitialization )
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnCreate" );
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2009-04-24 18:34:24 +00:00
|
|
|
void ODatabaseDocument::impl_storeToStorage_throw( const Reference< XStorage >& _rxTargetStorage, const Sequence< PropertyValue >& _rMediaDescriptor,
|
|
|
|
DocumentGuard& _rDocGuard ) const
|
2008-03-06 16:58:17 +00:00
|
|
|
{
|
|
|
|
if ( !_rxTargetStorage.is() )
|
|
|
|
throw IllegalArgumentException( ::rtl::OUString(), *const_cast< ODatabaseDocument* >( this ), 1 );
|
|
|
|
|
|
|
|
if ( !m_pImpl.is() )
|
|
|
|
throw DisposedException( ::rtl::OUString(), *const_cast< ODatabaseDocument* >( this ) );
|
2005-03-30 10:55:24 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
// commit everything
|
|
|
|
m_pImpl->commitEmbeddedStorage();
|
|
|
|
m_pImpl->commitStorages();
|
|
|
|
|
|
|
|
// copy own storage to target storage
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( impl_isInitialized() )
|
|
|
|
{
|
|
|
|
Reference< XStorage > xCurrentStorage( m_pImpl->getOrCreateRootStorage(), UNO_QUERY_THROW );
|
|
|
|
if ( xCurrentStorage != _rxTargetStorage )
|
|
|
|
xCurrentStorage->copyToStorage( _rxTargetStorage );
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// write into target storage
|
2008-03-11 08:43:41 +00:00
|
|
|
::comphelper::NamedValueCollection aWriteArgs( _rMediaDescriptor );
|
2009-04-24 18:34:24 +00:00
|
|
|
lcl_triggerStatusIndicator_throw( aWriteArgs, _rDocGuard, true );
|
|
|
|
impl_writeStorage_throw( _rxTargetStorage, aWriteArgs );
|
|
|
|
lcl_triggerStatusIndicator_throw( aWriteArgs, _rDocGuard, false );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// commit target storage
|
2009-04-24 18:34:24 +00:00
|
|
|
OSL_VERIFY( ODatabaseModelImpl::commitStorageIfWriteable( _rxTargetStorage ) );
|
2005-03-30 10:55:24 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
catch( const IOException& ) { throw; }
|
|
|
|
catch( const RuntimeException& ) { throw; }
|
|
|
|
catch ( const Exception& e )
|
2005-03-30 10:55:24 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
throw IOException( e.Message, *const_cast< ODatabaseDocument* >( this ) );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::storeToURL( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (IOException, RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
ModifyLock aLock( *this );
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
{
|
|
|
|
aGuard.clear();
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnSaveTo", NULL, makeAny( _rURL ) );
|
|
|
|
aGuard.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
// create storage for target URL
|
|
|
|
Reference< XStorage > xTargetStorage( impl_createStorageFor_throw( _rURL ) );
|
|
|
|
|
|
|
|
// extend media descriptor with URL
|
|
|
|
Sequence< PropertyValue > aMediaDescriptor( lcl_appendFileNameToDescriptor( _rArguments, _rURL ) );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// store to this storage
|
2009-04-24 18:34:24 +00:00
|
|
|
impl_storeToStorage_throw( xTargetStorage, aMediaDescriptor, aGuard );
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
CWS-TOOLING: integrate CWS dba32g
2009-09-09 07:53:55 +0200 oj r275964 : replace strlen with rtl_str_getLength
2009-09-07 20:59:10 +0200 fs r275913 : disable the CopyTableWizard test until issue 104869 is fixed
2009-09-07 12:17:31 +0200 oj r275885 : #i104810# remove de as lang
2009-09-05 22:26:21 +0200 fs r275857 : protect StateChanged against re-entrance
2009-09-05 22:25:52 +0200 fs r275856 : don't attempt to classify the parent of a form as control
2009-09-05 22:25:29 +0200 fs r275855 : protect against re-entrance
2009-09-05 00:11:40 +0200 fs r275835 : #i10000#
2009-09-04 23:25:50 +0200 fs r275834 : #i10000#
2009-09-04 23:23:47 +0200 fs r275833 : #i10000#
2009-09-04 21:49:37 +0200 fs r275830 : #i10000# correct wrong conflict resolution
2009-09-04 20:59:51 +0200 fs r275829 : CWS-TOOLING: rebase CWS dba32g to trunk@275801 (milestone: DEV300:m57)
2009-09-04 11:08:32 +0200 oj r275791 : #i104780# new version 1.2.0
2009-09-03 22:29:21 +0200 fs r275775 : OSL_TRACE doesn't need \n anymore
2009-09-03 08:33:21 +0200 fs r275743 : CWS-TOOLING: rebase CWS dba32g to trunk@275331 (milestone: DEV300:m56)
2009-09-02 13:48:12 +0200 fs r275708 : removed useless include
2009-09-02 13:45:43 +0200 fs r275707 : more since tags, which are used across offapi/udkapi
2009-09-02 13:23:04 +0200 fs r275705 : should *not* have the dtor, copy ctor, and assignment operator compiler-generated, else we run into trouble as soon as the compiler creates different versions of our singleton member's static data in different libraries
2009-09-02 12:32:45 +0200 fs r275704 : AutoIncrementIsPrimaryKey is a driver setting, not a data source setting
2009-09-02 11:42:49 +0200 fs r275701 : URL meta data are meta data which are valid for all connections of this type, not per-data-source properties. Settings them as data source properties is a hack.
2009-09-02 08:43:34 +0200 fs r275696 : 3.x.x is not a valid 'since' tag
2009-09-01 16:05:24 +0200 fs r275665 : #i104686# don't treat controls bound to read-only columns as required
2009-09-01 13:10:22 +0200 fs r275657 : #i104574# use PageUp/Down to scroll through the complete page
2009-09-01 07:04:48 +0200 oj r275641 : #i104104# correct line ends
2009-08-31 15:52:34 +0200 fs r275612 : #i104410#
2009-08-31 12:29:05 +0200 fs r275596 : #i104364#
2009-08-31 12:28:56 +0200 fs r275595 : #i104364#
2009-08-31 11:43:09 +0200 fs r275593 : #i104649# JavaDriverClassPath is also a known JDBC-bridge setting
2009-08-31 11:41:37 +0200 fs r275592 : #i104649#
2009-08-28 21:48:27 +0200 fs r275552 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:48:17 +0200 fs r275551 : #i96862# do not show the 'Create a new database' option when a) no embedded/dBase driver is installed or b) the configuration requests to hide the option
2009-08-28 21:47:19 +0200 fs r275550 : during #i96862#: renamed the configuration data which controls availability of certain DBA-related UI
2009-08-28 21:46:41 +0200 fs r275549 : #i96862# renamed and extended the configuration data which controls availability of certain DBA-related UI
2009-08-28 15:10:19 +0200 fs r275535 : #i96862# if no embedded driver is installed, use dBase for creating new DBs. If no dBase driver is installed, too, do not offer the 'Create new database' option
2009-08-28 14:03:04 +0200 fs r275532 : #i104454# allow multiple fields to display the same column
2009-08-28 13:14:00 +0200 fs r275528 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:09:57 +0200 fs r275527 : properly chech the MySQL type buttons (else next/back in the wizard leads to state with two buttons checked)
2009-08-28 13:09:17 +0200 fs r275526 : #i104584# driver meta data do not belong into a data source's settings
2009-08-28 13:07:18 +0200 fs r275525 : BooleanComparisonMode is a property, or a feature - but not a driver meta data
2009-08-28 11:00:31 +0200 fs r275521 : #i104580#
2009-08-28 10:40:05 +0200 fs r275519 : #i104577# correct assertion: If the template node type is ANY, then any value type is allowed
2009-08-28 10:09:30 +0200 fs r275518 : #i104575# implement Named Pipe UI
2009-08-28 10:09:07 +0200 fs r275517 : pass the trigger-event to IWindowOperator::operateOn / work with VclWindowEvents, not VclSimpleEvents
2009-08-27 14:27:36 +0200 fs r275484 : ImplPosTabPage: respect mbEmptyViewMargin for WINDOWALIGN_LEFT
2009-08-27 13:43:56 +0200 fs r275480 : merging latest changes from CWS dba32f herein
2009-08-27 13:23:07 +0200 fs r275475 : #i103882#
2009-08-27 11:56:55 +0200 fs r275466 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 11:55:34 +0200 fs r275465 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 10:14:11 +0200 fs r275459 : preparations for supporting a 'NamedPipe' parameter for the MySQL Connector/OOo
2009-08-27 10:13:21 +0200 fs r275458 : preparations for supporting a 'NamedPipe' setting for the MySQL Connector/OOo
2009-08-27 10:11:14 +0200 fs r275456 : outsourced the MySQLNative settings into a dedicated class, to not duplicate all the code in two tab page implementations
2009-08-26 14:18:13 +0200 fs r275422 : #i10000#
2009-08-26 13:26:36 +0200 fs r275419 : ignore output paths
2009-08-26 13:23:38 +0200 fs r275417 : support the LocalSocket property for the MySQL native driver
2009-08-26 13:17:05 +0200 fs r275416 : some re-factoring, to outsource the tab page for setting up the MySQLNative connection, into a dedicated class (needed later)
2009-08-26 13:15:15 +0200 fs r275415 : support a NoThousandSep property for NumericFormatters - I'm tired of correcting this at runtime, instead of controlling it in the resource
2009-08-26 11:45:08 +0200 fs r275410 : oops, 'flat' shouldn't have got lost
2009-08-26 09:38:57 +0200 fs r275398 : #i102631# when saving the document fails, ensure that the interaction handler really can handle/display the error
2009-08-26 09:37:05 +0200 fs r275397 : #i102631# don't let non-IO/RuntimeExceptions escape from DatabaseDocument::store*, wrap them into an IOException
2009-08-26 09:35:39 +0200 fs r275395 : let the default interaction handler implement XInteractionHandler2
2009-08-25 13:51:34 +0200 fs r275352 : #i102631# createTempFile: pass URL through FileHelper.getOOoCompatibleFileURL
2009-08-25 13:49:23 +0200 fs r275351 : #i102631# createTempFileURL: immediately delete the file implicitly created by createTempFile, we really only need the URL
2009-08-24 14:49:07 +0200 fs r275318 : #i10000#
2009-08-24 14:36:03 +0200 fs r275315 : properly terminate message with 0 character
2009-08-24 14:35:45 +0200 fs r275314 : trace method concepts in non-pro, if special flag is enabled
2009-08-24 14:24:17 +0200 fs r275312 : #i98973# filter some more events for grid control columns
2009-08-24 14:15:23 +0200 fs r275311 : #i98973# implement XComboBox for combo box cells
2009-08-24 13:39:24 +0200 fs r275308 : #i98973# do not display the 'actionPerformed' event for grid combo box columns
2009-08-24 12:52:03 +0200 fs r275303 : #i98973# implement XCheckBox and XButton for check box cells
2009-08-24 11:56:05 +0200 oj r275300 : #i104447# wrong default for orientation
2009-08-24 10:51:21 +0200 fs r275296 : in the script selector dialog, interpret a double click onto a function as OK
2009-08-24 10:50:56 +0200 fs r275295 : localize some to-be-displayed names, consolidate some code regarding form/control naming
2009-08-21 14:28:05 +0200 fs r275255 : #i98973# implement KeyListeners
2009-08-21 14:27:20 +0200 fs r275254 : #i98973# move the conversion VCL[Mouse|Key]Event->Awt[Mouse|Key]Event from vclxwindow.cxx to VCLUnoHelper
2009-08-21 14:08:50 +0200 fs r275248 : #i98973# implement Mouse- and MouseMotion-broadcasting
2009-08-21 13:31:08 +0200 fs r275244 : #i98973# implement text and change listeners at text cells
2009-08-21 12:47:38 +0200 fs r275234 : #i104399# some refactoring:
If the MySQL Connector/OOo is installed, it registers for the sdbc:mysqlc: protocol (now known as DST_MYSQL_NATIVE_DIRECT).
However, we do not want to display this in the UI, instead we display "MySQL" only, which collects DST_MYSQL_ODBC, DST_MYSQL_JDBC, and DST_MYSQL_NATIVE.
2009-08-21 12:45:18 +0200 fs r275232 : #i104399# also register for the sdbc:mysql:mysqlc protocol, decide at runtime (depending on the availability of sdbc:mysqlc:), whether it is really accepted. This prevents that the C/OOo extension needs to register *our* implementation name for the sdbc:mysql:mysqlc: protocol, which would be somewhat weird
2009-08-20 16:18:48 +0200 fs r275190 : merging the latest changes from CWS dba32f (which this CWS was created from)
2009-08-19 20:19:59 +0200 fs r275160 : add some spacing between the radios
2009-08-19 14:50:15 +0200 fs r275150 : #i98973# slightly refactoring the grid cell implementations, to prepare for proper events being fired. Implement focus events for the moment, more to come.
2009-08-19 10:53:38 +0200 fs r275142 : #i99936# initialize newly created models
2009-08-18 23:03:48 +0200 fs r275132 : merging latest changes from CWS dba32f
2009-08-18 15:14:08 +0200 fs r275110 : #i102819# SetColumnPos: SCROLL_CLIP is deadly here
2009-09-14 11:18:01 +00:00
|
|
|
Any aError = ::cppu::getCaughtException();
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToFailed", NULL, aError );
|
|
|
|
|
|
|
|
if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() )
|
|
|
|
|| aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() )
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// allowed to leave
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
|
|
|
|
Exception aExcept;
|
|
|
|
aError >>= aExcept;
|
|
|
|
|
|
|
|
::rtl::OUString sErrorMessage = ResourceManager::loadString(
|
|
|
|
RID_STR_ERROR_WHILE_SAVING,
|
|
|
|
"$except$", aError.getValueTypeName(),
|
|
|
|
"$message$", aExcept.Message
|
|
|
|
);
|
|
|
|
throw IOException( sErrorMessage, *this );
|
2008-10-16 06:57:26 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToDone", NULL, makeAny( _rURL ) );
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// XModifyBroadcaster
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::addModifyListener( const Reference< XModifyListener >& _xListener ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2004-08-02 14:09:11 +00:00
|
|
|
m_aModifyListeners.addInterface(_xListener);
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::removeModifyListener( const Reference< XModifyListener >& _xListener ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2004-08-02 14:09:11 +00:00
|
|
|
m_aModifyListeners.removeInterface(_xListener);
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// XModifiable
|
2005-03-10 15:33:50 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseDocument::isModified( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
|
|
|
return m_pImpl->m_bModified;
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::setModified( sal_Bool _bModified ) throw (PropertyVetoException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
|
|
|
if ( impl_isInitialized() )
|
|
|
|
impl_setModified_nothrow( _bModified, aGuard );
|
|
|
|
// it's allowed to call setModified without the document being initialized already. In this case,
|
|
|
|
// we simply ignore the call - when the initialization is finished, the respective code will set
|
|
|
|
// a proper "modified" flag
|
2007-09-26 13:39:51 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2007-09-26 13:39:51 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-10-16 06:57:26 +00:00
|
|
|
void ODatabaseDocument::impl_setModified_nothrow( sal_Bool _bModified, DocumentGuard& _rGuard )
|
2007-09-26 13:39:51 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// SYNCHRONIZED ->
|
|
|
|
bool bModifiedChanged = ( m_pImpl->m_bModified != _bModified ) && ( !m_pImpl->isModifyLocked() );
|
2005-12-21 12:34:54 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( bModifiedChanged )
|
|
|
|
{
|
|
|
|
m_pImpl->m_bModified = _bModified;
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnModifyChanged" );
|
|
|
|
}
|
2007-09-26 13:39:51 +00:00
|
|
|
_rGuard.clear();
|
2008-10-16 06:57:26 +00:00
|
|
|
// <- SYNCHRONIZED
|
2005-12-21 12:34:54 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( bModifiedChanged )
|
|
|
|
{
|
|
|
|
lang::EventObject aEvent( *this );
|
|
|
|
m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent );
|
|
|
|
}
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2005-12-21 12:34:54 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:32:17 +00:00
|
|
|
// ::com::sun::star::document::XEventBroadcaster
|
2008-10-16 06:57:26 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::addEventListener(const uno::Reference< document::XEventListener >& _Listener ) throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
m_aEventNotifier.addLegacyEventListener( _Listener );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::removeEventListener( const uno::Reference< document::XEventListener >& _Listener ) throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
m_aEventNotifier.removeLegacyEventListener( _Listener );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::addDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) throw (RuntimeException)
|
2005-03-04 08:44:36 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aEventNotifier.addDocumentEventListener( _Listener );
|
2005-03-04 08:44:36 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2005-03-04 08:44:36 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-10-16 06:57:26 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::removeDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) throw (RuntimeException)
|
2005-03-04 08:44:36 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aEventNotifier.removeDocumentEventListener( _Listener );
|
2005-03-04 08:44:36 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2005-03-04 08:44:36 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-10-16 06:57:26 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::notifyDocumentEvent( const ::rtl::OUString& _EventName, const Reference< XController2 >& _ViewController, const Any& _Supplement ) throw (IllegalArgumentException, NoSupportException, RuntimeException)
|
2005-03-04 08:44:36 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( !_EventName.getLength() )
|
|
|
|
throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
|
|
|
|
|
|
|
|
// SYNCHRONIZED ->
|
|
|
|
DocumentGuard aGuard( *this );
|
|
|
|
|
|
|
|
if ( !DocumentEvents::needsSynchronousNotification( _EventName ) )
|
|
|
|
{
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( _EventName, _ViewController, _Supplement );
|
|
|
|
return;
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
aGuard.clear();
|
2008-10-16 06:57:26 +00:00
|
|
|
// <- SYNCHRONIZED
|
|
|
|
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( _EventName, _ViewController, _Supplement );
|
2005-03-04 08:44:36 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2005-03-04 08:44:36 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getPrinter( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2006-06-20 01:44:17 +00:00
|
|
|
DBG_ERROR( "ODatabaseDocument::getPrinter: not supported!" );
|
2004-08-02 14:09:11 +00:00
|
|
|
return Sequence< PropertyValue >();
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 01:44:17 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::setPrinter( const Sequence< PropertyValue >& /*aPrinter*/ ) throw (IllegalArgumentException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2006-06-20 01:44:17 +00:00
|
|
|
DBG_ERROR( "ODatabaseDocument::setPrinter: not supported!" );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 01:44:17 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::print( const Sequence< PropertyValue >& /*xOptions*/ ) throw (IllegalArgumentException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2006-06-20 01:44:17 +00:00
|
|
|
DBG_ERROR( "ODatabaseDocument::print: not supported!" );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-02-07 09:18:42 +00:00
|
|
|
void ODatabaseDocument::impl_reparent_nothrow( const WeakReference< XNameAccess >& _rxContainer )
|
|
|
|
{
|
|
|
|
Reference< XChild > xChild( _rxContainer.get(), UNO_QUERY );
|
|
|
|
if ( xChild.is() )
|
|
|
|
xChild->setParent( *this );
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2006-04-19 12:18:41 +00:00
|
|
|
void ODatabaseDocument::clearObjectContainer( WeakReference< XNameAccess >& _rxContainer)
|
2006-02-07 09:18:42 +00:00
|
|
|
{
|
|
|
|
Reference< XNameAccess > xContainer = _rxContainer;
|
|
|
|
::comphelper::disposeComponent( xContainer );
|
|
|
|
|
2006-04-19 12:18:41 +00:00
|
|
|
Reference< XChild > xChild( _rxContainer.get(),UNO_QUERY );
|
|
|
|
if ( xChild.is() )
|
|
|
|
xChild->setParent( NULL );
|
|
|
|
_rxContainer = Reference< XNameAccess >();
|
2006-02-07 09:18:42 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType _eType )
|
|
|
|
{
|
|
|
|
if ( ( _eType != ODatabaseModelImpl::E_FORM ) && ( _eType != ODatabaseModelImpl::E_REPORT ) )
|
|
|
|
throw IllegalArgumentException();
|
|
|
|
|
|
|
|
bool bFormsContainer = _eType == ODatabaseModelImpl::E_FORM;
|
|
|
|
|
|
|
|
WeakReference< XNameAccess >& rContainerRef( bFormsContainer ? m_xForms : m_xReports );
|
|
|
|
Reference< XNameAccess > xContainer = rContainerRef;
|
|
|
|
if ( !xContainer.is() )
|
|
|
|
{
|
2007-11-21 14:37:45 +00:00
|
|
|
TContentPtr& rContainerData( m_pImpl->getObjectContainer( _eType ) );
|
2008-03-06 16:58:17 +00:00
|
|
|
rContainerRef = xContainer = new ODocumentContainer( m_pImpl->m_aContext.getLegacyServiceFactory(), *this, rContainerData, bFormsContainer );
|
2006-02-07 09:18:42 +00:00
|
|
|
impl_reparent_nothrow( xContainer );
|
|
|
|
}
|
|
|
|
return xContainer;
|
|
|
|
}
|
2007-07-24 11:04:32 +00:00
|
|
|
|
2006-02-07 09:18:42 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-09-04 06:35:42 +00:00
|
|
|
void ODatabaseDocument::impl_closeControllerFrames_nolck_throw( sal_Bool _bDeliverOwnership )
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2007-07-24 11:04:32 +00:00
|
|
|
Controllers aCopy = m_aControllers;
|
2005-09-23 11:04:55 +00:00
|
|
|
|
2009-07-03 12:24:35 +00:00
|
|
|
Controllers::iterator aEnd = aCopy.end();
|
|
|
|
for ( Controllers::iterator aIter = aCopy.begin(); aIter != aEnd ; ++aIter )
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2007-07-24 11:04:32 +00:00
|
|
|
if ( !aIter->is() )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
try
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2007-07-24 11:04:32 +00:00
|
|
|
Reference< XCloseable> xFrame( (*aIter)->getFrame(), UNO_QUERY );
|
|
|
|
if ( xFrame.is() )
|
|
|
|
xFrame->close( _bDeliverOwnership );
|
|
|
|
}
|
|
|
|
catch( const CloseVetoException& ) { throw; }
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
}
|
2005-09-23 11:04:55 +00:00
|
|
|
}
|
|
|
|
|
2007-07-24 11:04:32 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
struct DisposeControllerFrame : public ::std::unary_function< Reference< XController >, void >
|
|
|
|
{
|
|
|
|
void operator()( const Reference< XController >& _rxController ) const
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if ( !_rxController.is() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Reference< XFrame > xFrame( _rxController->getFrame() );
|
|
|
|
::comphelper::disposeComponent( xFrame );
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODatabaseDocument::impl_disposeControllerFrames_nothrow()
|
|
|
|
{
|
|
|
|
Controllers aCopy;
|
|
|
|
aCopy.swap( m_aControllers ); // ensure m_aControllers is empty afterwards
|
|
|
|
::std::for_each( aCopy.begin(), aCopy.end(), DisposeControllerFrame() );
|
|
|
|
}
|
|
|
|
|
2005-09-23 11:04:55 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-10-16 06:57:26 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (CloseVetoException, RuntimeException)
|
2005-09-23 11:04:55 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
// nearly everything below can/must be done without our mutex locked, the below is just for
|
|
|
|
// the checks for being disposed and the like
|
|
|
|
// SYNCHRONIZED ->
|
|
|
|
{
|
|
|
|
DocumentGuard aGuard( *this );
|
|
|
|
m_bClosing = true;
|
|
|
|
}
|
|
|
|
// <- SYNCHRONIZED
|
2005-09-23 11:04:55 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
// allow listeners to veto
|
|
|
|
lang::EventObject aEvent( *this );
|
|
|
|
m_aCloseListener.forEach< XCloseListener >(
|
|
|
|
boost::bind( &XCloseListener::queryClosing, _1, boost::cref( aEvent ), boost::cref( _bDeliverOwnership ) ) );
|
2005-09-23 11:04:55 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// notify that we're going to unload
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnPrepareUnload" );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
impl_closeControllerFrames_nolck_throw( _bDeliverOwnership );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
m_aCloseListener.notifyEach( &XCloseListener::notifyClosing, (const lang::EventObject&)aEvent );
|
|
|
|
|
|
|
|
dispose();
|
|
|
|
}
|
|
|
|
catch ( const Exception& )
|
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( m_aMutex );
|
2008-10-16 06:57:26 +00:00
|
|
|
m_bClosing = false;
|
|
|
|
throw;
|
|
|
|
}
|
2005-09-23 11:04:55 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// SYNCHRONIZED ->
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( m_aMutex );
|
2008-10-16 06:57:26 +00:00
|
|
|
m_bClosing = false;
|
|
|
|
// <- SYNCHRONIZED
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::addCloseListener( const Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2004-10-22 07:58:51 +00:00
|
|
|
m_aCloseListener.addInterface(Listener);
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::removeCloseListener( const Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
m_aCloseListener.removeInterface(Listener);
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Reference< XNameAccess > SAL_CALL ODatabaseDocument::getFormDocuments( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
|
2006-02-07 09:18:42 +00:00
|
|
|
return impl_getDocumentContainer_throw( ODatabaseModelImpl::E_FORM );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Reference< XNameAccess > SAL_CALL ODatabaseDocument::getReportDocuments( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
|
2006-02-07 09:18:42 +00:00
|
|
|
return impl_getDocumentContainer_throw( ODatabaseModelImpl::E_REPORT );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
void ODatabaseDocument::WriteThroughComponent( const Reference< XComponent >& xComponent, const sal_Char* pStreamName,
|
|
|
|
const sal_Char* pServiceName, const Sequence< Any >& _rArguments, const Sequence< PropertyValue >& rMediaDesc,
|
|
|
|
const Reference<XStorage>& _xStorageToSaveTo ) const
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
OSL_ENSURE( pStreamName, "Need stream name!" );
|
|
|
|
OSL_ENSURE( pServiceName, "Need service name!" );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
|
|
|
// open stream
|
|
|
|
::rtl::OUString sStreamName = ::rtl::OUString::createFromAscii( pStreamName );
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XStream > xStream = _xStorageToSaveTo->openStreamElement( sStreamName, ElementModes::READWRITE | ElementModes::TRUNCATE );
|
2004-08-02 14:09:11 +00:00
|
|
|
if ( !xStream.is() )
|
2008-03-06 16:58:17 +00:00
|
|
|
return;
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XOutputStream > xOutputStream( xStream->getOutputStream() );
|
|
|
|
OSL_ENSURE( xOutputStream.is(), "Can't create output stream in package!" );
|
|
|
|
if ( !xOutputStream.is() )
|
|
|
|
return;
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XSeekable > xSeek( xOutputStream, UNO_QUERY );
|
2004-08-02 14:09:11 +00:00
|
|
|
if ( xSeek.is() )
|
|
|
|
xSeek->seek(0);
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XPropertySet > xStreamProp( xOutputStream, UNO_QUERY_THROW );
|
|
|
|
xStreamProp->setPropertyValue( INFO_MEDIATYPE, makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "text/xml" ) ) ) );
|
|
|
|
xStreamProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ), makeAny( (sal_Bool)sal_True ) );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
|
|
|
// write the stuff
|
2008-03-06 16:58:17 +00:00
|
|
|
WriteThroughComponent( xOutputStream, xComponent, pServiceName, _rArguments, rMediaDesc );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
void ODatabaseDocument::WriteThroughComponent( const Reference< XOutputStream >& xOutputStream,
|
|
|
|
const Reference< XComponent >& xComponent, const sal_Char* pServiceName, const Sequence< Any >& _rArguments,
|
|
|
|
const Sequence< PropertyValue >& rMediaDesc ) const
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
|
|
|
OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
|
|
|
|
OSL_ENSURE( xComponent.is(), "Need component!" );
|
|
|
|
OSL_ENSURE( NULL != pServiceName, "Need component name!" );
|
|
|
|
|
|
|
|
// get component
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XActiveDataSource > xSaxWriter;
|
|
|
|
OSL_VERIFY( m_pImpl->m_aContext.createComponent( "com.sun.star.xml.sax.Writer", xSaxWriter ) );
|
|
|
|
if ( !xSaxWriter.is() )
|
|
|
|
return;
|
2004-08-02 14:09:11 +00:00
|
|
|
|
|
|
|
// connect XML writer to output stream
|
|
|
|
xSaxWriter->setOutputStream( xOutputStream );
|
|
|
|
|
|
|
|
// prepare arguments (prepend doc handler to given arguments)
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XDocumentHandler > xDocHandler( xSaxWriter,UNO_QUERY);
|
|
|
|
Sequence<Any> aArgs( 1 + _rArguments.getLength() );
|
2004-08-02 14:09:11 +00:00
|
|
|
aArgs[0] <<= xDocHandler;
|
2008-03-06 16:58:17 +00:00
|
|
|
for ( sal_Int32 i = 0; i < _rArguments.getLength(); ++i )
|
|
|
|
aArgs[ i+1 ] = _rArguments[i];
|
2004-08-02 14:09:11 +00:00
|
|
|
|
|
|
|
// get filter component
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XExporter > xExporter;
|
|
|
|
OSL_VERIFY( m_pImpl->m_aContext.createComponentWithArguments( pServiceName, aArgs, xExporter ) );
|
|
|
|
if ( !xExporter.is() )
|
|
|
|
return;
|
2004-08-02 14:09:11 +00:00
|
|
|
|
|
|
|
// connect model and filter
|
|
|
|
xExporter->setSourceDocument( xComponent );
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
// filter
|
|
|
|
Reference< XFilter > xFilter( xExporter, UNO_QUERY_THROW );
|
|
|
|
xFilter->filter( rMediaDesc );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2009-04-24 18:34:24 +00:00
|
|
|
void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _rxTargetStorage, const ::comphelper::NamedValueCollection& _rMediaDescriptor ) const
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
// extract status indicator
|
2005-03-30 10:55:24 +00:00
|
|
|
Sequence< Any > aDelegatorArguments;
|
2009-04-24 18:34:24 +00:00
|
|
|
lcl_extractStatusIndicator( _rMediaDescriptor, aDelegatorArguments );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
/** property map for export info set */
|
|
|
|
comphelper::PropertyMapEntry aExportInfoMap[] =
|
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
{ MAP_LEN( "BaseURI"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 },
|
2008-10-01 12:28:29 +00:00
|
|
|
{ MAP_LEN( "StreamName"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 },
|
2008-12-01 12:31:27 +00:00
|
|
|
{ MAP_LEN( "UsePrettyPrinting" ), 0, &::getCppuType((sal_Bool*)0), beans::PropertyAttribute::MAYBEVOID, 0},
|
2008-10-01 12:28:29 +00:00
|
|
|
{ NULL, 0, 0, NULL, 0, 0 }
|
|
|
|
};
|
|
|
|
uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
|
|
|
|
|
|
|
|
SvtSaveOptions aSaveOpt;
|
|
|
|
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")), uno::makeAny(aSaveOpt.IsPrettyPrinting()));
|
2008-12-01 12:31:27 +00:00
|
|
|
if ( aSaveOpt.IsSaveRelFSys() )
|
|
|
|
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(_rMediaDescriptor.getOrDefault("URL",::rtl::OUString())));
|
|
|
|
|
CWS-TOOLING: integrate CWS dba32h
2009-10-12 12:21:44 +0200 msc r276827 : remove warning for issue 102712 because the issue is fixed
2009-10-05 07:14:20 +0200 oj r276658 : #105585# add missing dependency for OOO_UI
2009-10-02 12:50:19 +0200 fs r276632 : #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 12:46:12 +0200 fs r276631 : #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 13:09:07 +0200 fs r276596 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 12:35:56 +0200 fs r276589 : #i105509# don't rely on default form component names, use indexes
2009-10-01 11:19:18 +0200 fs r276584 : copying the fix for #i105082# into this CWS
2009-10-01 11:13:22 +0200 fs r276583 : improved logs
2009-10-01 11:10:44 +0200 fs r276581 : #i105505#
2009-10-01 08:07:57 +0200 fs r276575 : manual merge of trunk, to allow cwslocalize to run
2009-09-30 22:48:30 +0200 fs r276574 : removed that strange ONLOAD definition
2009-09-30 12:58:18 +0200 fs r276553 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 12:56:45 +0200 fs r276552 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 11:47:45 +0200 fs r276549 : #i105235#
2009-09-29 12:27:40 +0200 fs r276521 : #i105367#
2009-09-28 12:08:17 +0200 oj r276485 : #i105371# export version in manifest.xml as well
2009-09-28 12:07:02 +0200 oj r276484 : #i105371# export version in manifest.xml as well
2009-09-28 09:48:01 +0200 oj r276481 : #i105366# init drivers when not empty
2009-09-25 14:31:27 +0200 fs r276466 : CWS-TOOLING: rebase CWS dba32h to trunk@276429 (milestone: DEV300:m60)
2009-09-24 13:52:54 +0200 fs r276422 : #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 11:42:03 +0200 fs r276413 : #i105234# proper zoom handling for the nav bar
2009-09-24 11:41:40 +0200 fs r276412 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-23 12:21:22 +0200 oj r276377 : remove dos lineends
2009-09-23 11:44:52 +0200 oj r276376 : #i105216# load config on demand
2009-09-23 11:44:19 +0200 oj r276375 : #i105216# load config on demand
2009-09-23 11:43:35 +0200 oj r276374 : #i105216# load config on demand
2009-09-21 09:13:03 +0200 oj r276307 : #i105158# use Thread support
2009-09-18 13:06:50 +0200 fs r276277 : #i105147#
2009-09-18 11:48:23 +0200 oj r276271 : #i105158# new method for thread safety
2009-09-18 10:42:56 +0200 fs r276266 : CWS-TOOLING: rebase CWS dba32h to trunk@276192 (milestone: DEV300:m59)
2009-09-18 08:30:03 +0200 oj r276263 : #i105016# load correct ldap so
2009-09-17 13:42:31 +0200 oj r276240 : change count of check boxes
2009-09-17 13:32:59 +0200 oj r276239 : revert false to true for currency
2009-09-17 09:14:46 +0200 oj r276220 : #i104901# add patch for every issue
2009-09-17 09:10:29 +0200 oj r276219 : #i104901# add patch for every issue
2009-09-11 13:47:49 +0200 oj r276060 : #i104901# fix for indentity
2009-09-11 12:14:14 +0200 fs r276056 : #i104594# allow to render controls without an SdrPageView
2009-09-11 11:49:31 +0200 fs r276055 : CWS-TOOLING: rebase CWS dba32h to trunk@276043 (milestone: DEV300:m58)
2009-09-10 08:41:40 +0200 oj r276021 : #i104911# export variable-set not for repeating sections
2009-10-14 18:48:09 +00:00
|
|
|
::rtl::OUString aVersion;
|
|
|
|
SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion();
|
|
|
|
|
|
|
|
// older versions can not have this property set, it exists only starting from ODF1.2
|
|
|
|
if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
|
|
|
|
aVersion = ODFVER_012_TEXT;
|
|
|
|
|
|
|
|
if ( aVersion.getLength() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
xInfoSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Version" )), uno::makeAny( aVersion ) );
|
|
|
|
}
|
|
|
|
catch( uno::Exception& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
sal_Int32 nArgsLen = aDelegatorArguments.getLength();
|
|
|
|
aDelegatorArguments.realloc(nArgsLen+1);
|
|
|
|
aDelegatorArguments[nArgsLen++] <<= xInfoSet;
|
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW );
|
|
|
|
xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( (rtl::OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XComponent > xComponent( *const_cast< ODatabaseDocument* >( this ), UNO_QUERY_THROW );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
Sequence< PropertyValue > aMediaDescriptor;
|
|
|
|
_rMediaDescriptor >>= aMediaDescriptor;
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("settings.xml"))));
|
2008-03-06 16:58:17 +00:00
|
|
|
WriteThroughComponent( xComponent, "settings.xml", "com.sun.star.comp.sdb.XMLSettingsExporter",
|
|
|
|
aDelegatorArguments, aMediaDescriptor, _rxTargetStorage );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml"))));
|
2008-03-06 16:58:17 +00:00
|
|
|
WriteThroughComponent( xComponent, "content.xml", "com.sun.star.comp.sdb.DBExportFilter",
|
|
|
|
aDelegatorArguments, aMediaDescriptor, _rxTargetStorage );
|
2004-08-02 14:09:11 +00:00
|
|
|
|
2008-03-06 16:58:17 +00:00
|
|
|
m_pImpl->storeLibraryContainersTo( _rxTargetStorage );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XUIConfigurationManager > SAL_CALL ODatabaseDocument::getUIConfigurationManager( ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2004-08-02 14:09:11 +00:00
|
|
|
if ( !m_xUIConfigurationManager.is() )
|
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
m_pImpl->m_aContext.createComponent( "com.sun.star.ui.UIConfigurationManager", m_xUIConfigurationManager );
|
|
|
|
Reference< XUIConfigurationStorage > xUIConfigStorage( m_xUIConfigurationManager, UNO_QUERY );
|
2004-08-02 14:09:11 +00:00
|
|
|
if ( xUIConfigStorage.is() )
|
|
|
|
{
|
|
|
|
rtl::OUString aUIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" ));
|
|
|
|
Reference< XStorage > xConfigStorage;
|
|
|
|
|
|
|
|
// First try to open with READWRITE and then READ
|
|
|
|
xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READWRITE );
|
|
|
|
if ( xConfigStorage.is() )
|
|
|
|
{
|
|
|
|
rtl::OUString aUIConfigMediaType( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.xml.ui.configuration" ));
|
|
|
|
rtl::OUString aMediaType;
|
|
|
|
Reference< XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
|
2007-11-09 07:11:44 +00:00
|
|
|
Any a = xPropSet->getPropertyValue( INFO_MEDIATYPE );
|
2004-08-02 14:09:11 +00:00
|
|
|
if ( !( a >>= aMediaType ) || ( aMediaType.getLength() == 0 ))
|
|
|
|
{
|
|
|
|
a <<= aUIConfigMediaType;
|
2007-11-09 07:11:44 +00:00
|
|
|
xPropSet->setPropertyValue( INFO_MEDIATYPE, a );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READ );
|
|
|
|
|
|
|
|
// initialize ui configuration manager with document substorage
|
|
|
|
xUIConfigStorage->setStorage( xConfigStorage );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_xUIConfigurationManager;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw (RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2005-07-08 09:36:11 +00:00
|
|
|
Reference< XDocumentSubStorageSupplier > xStorageAccess( m_pImpl->getDocumentSubStorageSupplier() );
|
|
|
|
return xStorageAccess->getDocumentSubStorage( aStorageName, nMode );
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:33:50 +00:00
|
|
|
Sequence< ::rtl::OUString > SAL_CALL ODatabaseDocument::getDocumentSubStoragesNames( ) throw (::com::sun::star::io::IOException, RuntimeException)
|
2004-08-02 14:09:11 +00:00
|
|
|
{
|
2005-07-08 09:36:11 +00:00
|
|
|
Reference< XDocumentSubStorageSupplier > xStorageAccess( m_pImpl->getDocumentSubStorageSupplier() );
|
|
|
|
return xStorageAccess->getDocumentSubStoragesNames();
|
2004-08-02 14:09:11 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference< XStorage >& _rxNewRootStorage )
|
|
|
|
{
|
|
|
|
Reference< XInterface > xMe( *const_cast< ODatabaseDocument* >( this ) );
|
|
|
|
|
|
|
|
m_aStorageListeners.forEach< XStorageChangeListener >(
|
|
|
|
boost::bind( &XStorageChangeListener::notifyStorageChange, _1, boost::cref( xMe ), boost::cref( _rxNewRootStorage ) ) );
|
|
|
|
}
|
|
|
|
|
2005-03-10 15:33:50 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseDocument::disposing()
|
2005-01-21 16:03:37 +00:00
|
|
|
{
|
2005-12-21 12:34:54 +00:00
|
|
|
if ( !m_pImpl.is() )
|
|
|
|
{
|
|
|
|
// this means that we're already disposed
|
|
|
|
DBG_ASSERT( ODatabaseDocument_OfficeDocument::rBHelper.bDisposed, "ODatabaseDocument::disposing: no impl anymore, but not yet disposed!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
if ( impl_isInitialized() )
|
|
|
|
m_aEventNotifier.notifyDocumentEvent( "OnUnload" );
|
|
|
|
|
|
|
|
Reference< XModel > xHoldAlive( this );
|
|
|
|
|
|
|
|
m_aEventNotifier.disposing();
|
|
|
|
|
|
|
|
lang::EventObject aDisposeEvent(static_cast<XWeak*>(this));
|
|
|
|
m_aModifyListeners.disposeAndClear( aDisposeEvent );
|
|
|
|
m_aCloseListener.disposeAndClear( aDisposeEvent );
|
|
|
|
m_aStorageListeners.disposeAndClear( aDisposeEvent );
|
|
|
|
|
2008-12-16 13:30:53 +00:00
|
|
|
// this is the list of objects which we currently hold as member. Upon resetting
|
|
|
|
// those members, we can (potentially) release the last reference to them, in which
|
|
|
|
// case they will be deleted - if they're C++ implementations, that is :).
|
|
|
|
// Some of those implementations are offending enough to require the SolarMutex, which
|
|
|
|
// means we should not release the last reference while our own mutex is locked ...
|
|
|
|
::std::list< Reference< XInterface > > aKeepAlive;
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// SYNCHRONIZED ->
|
2008-12-16 13:30:53 +00:00
|
|
|
::osl::ClearableMutexGuard aGuard( m_aMutex );
|
2008-10-16 06:57:26 +00:00
|
|
|
|
2007-07-24 11:04:32 +00:00
|
|
|
DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" );
|
2006-12-01 16:29:18 +00:00
|
|
|
// normally, nobody should explicitly dispose, but only XCloseable::close the document. And upon
|
2006-03-29 11:33:47 +00:00
|
|
|
// closing, our controllers are closed, too
|
2005-09-23 11:04:55 +00:00
|
|
|
|
2008-12-16 13:30:53 +00:00
|
|
|
aKeepAlive.push_back( m_xUIConfigurationManager );
|
2008-10-16 06:57:26 +00:00
|
|
|
m_xUIConfigurationManager = NULL;
|
2008-04-04 13:32:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
clearObjectContainer( m_xForms );
|
|
|
|
clearObjectContainer( m_xReports );
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// reset the macro mode: in case the our impl struct stays alive (e.g. because our DataSource
|
|
|
|
// object still exists), and somebody subsequently re-opens the document, we want to have
|
|
|
|
// the security warning, again.
|
|
|
|
m_pImpl->resetMacroExecutionMode();
|
2005-03-10 15:33:50 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// similar argueing for our ViewMonitor
|
|
|
|
m_aViewMonitor.reset();
|
2005-05-06 08:18:46 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// tell our Impl to forget us
|
|
|
|
m_pImpl->modelIsDisposing( impl_isInitialized(), ODatabaseModelImpl::ResetModelAccess() );
|
2006-12-01 16:29:18 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// now, at the latest, the controller array should be empty. Controllers are
|
|
|
|
// expected to listen for our disposal, and disconnect then
|
|
|
|
DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" );
|
|
|
|
impl_disposeControllerFrames_nothrow();
|
|
|
|
|
2008-12-16 13:30:53 +00:00
|
|
|
aKeepAlive.push_back( m_xModuleManager );
|
2008-10-16 06:57:26 +00:00
|
|
|
m_xModuleManager.clear();
|
2008-12-16 13:30:53 +00:00
|
|
|
|
|
|
|
aKeepAlive.push_back( m_xTitleHelper );
|
2008-10-16 06:57:26 +00:00
|
|
|
m_xTitleHelper.clear();
|
2006-12-01 16:29:18 +00:00
|
|
|
|
2005-03-10 15:33:50 +00:00
|
|
|
m_pImpl.clear();
|
2008-12-16 13:30:53 +00:00
|
|
|
|
|
|
|
aGuard.clear();
|
2008-10-16 06:57:26 +00:00
|
|
|
// <- SYNCHRONIZED
|
2008-12-16 13:30:53 +00:00
|
|
|
|
|
|
|
aKeepAlive.clear();
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// XComponent
|
|
|
|
void SAL_CALL ODatabaseDocument::dispose( ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
::cppu::WeakComponentImplHelperBase::dispose();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::addEventListener( const Reference< lang::XEventListener >& _xListener ) throw (RuntimeException)
|
2005-03-10 15:33:50 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
::cppu::WeakComponentImplHelperBase::addEventListener( _xListener );
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
void SAL_CALL ODatabaseDocument::removeEventListener( const Reference< lang::XEventListener >& _xListener ) throw (RuntimeException)
|
2005-03-10 15:33:50 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
::cppu::WeakComponentImplHelperBase::removeEventListener( _xListener );
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
|
|
|
// XServiceInfo
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
rtl::OUString ODatabaseDocument::getImplementationName( ) throw(RuntimeException)
|
|
|
|
{
|
2008-01-30 07:33:34 +00:00
|
|
|
return getImplementationName_static();
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2008-01-30 07:33:34 +00:00
|
|
|
rtl::OUString ODatabaseDocument::getImplementationName_static( ) throw(RuntimeException)
|
2005-03-10 15:33:50 +00:00
|
|
|
{
|
|
|
|
return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseDocument");
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames( ) throw (RuntimeException)
|
|
|
|
{
|
2008-01-30 07:33:34 +00:00
|
|
|
return getSupportedServiceNames_static();
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2008-01-30 07:33:34 +00:00
|
|
|
Reference< XInterface > ODatabaseDocument::Create( const Reference< XComponentContext >& _rxContext )
|
2005-03-10 15:33:50 +00:00
|
|
|
{
|
2008-01-30 07:33:34 +00:00
|
|
|
::comphelper::ComponentContext aContext( _rxContext );
|
|
|
|
Reference< XUnoTunnel > xDBContextTunnel( aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ), UNO_QUERY_THROW );
|
|
|
|
ODatabaseContext* pContext = reinterpret_cast< ODatabaseContext* >( xDBContextTunnel->getSomething( ODatabaseContext::getUnoTunnelImplementationId() ) );
|
|
|
|
|
2008-06-25 11:31:38 +00:00
|
|
|
::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( aContext.getLegacyServiceFactory(), *pContext ) );
|
2008-10-16 06:57:26 +00:00
|
|
|
Reference< XModel > xModel( pImpl->createNewModel_deliverOwnership( false ) );
|
2008-01-30 07:33:34 +00:00
|
|
|
return xModel.get();
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2008-01-30 07:33:34 +00:00
|
|
|
Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames_static( ) throw (RuntimeException)
|
2005-03-10 15:33:50 +00:00
|
|
|
{
|
|
|
|
Sequence< ::rtl::OUString > aSNS( 2 );
|
|
|
|
aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"));
|
|
|
|
aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OfficeDocument"));
|
|
|
|
return aSNS;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
sal_Bool ODatabaseDocument::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XDataSource > SAL_CALL ODatabaseDocument::getDataSource() throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit );
|
|
|
|
return m_pImpl->getOrCreateDataSource();
|
2005-03-10 15:33:50 +00:00
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::loadFromStorage( const Reference< XStorage >& /*xStorage*/, const Sequence< PropertyValue >& /*aMediaDescriptor*/ ) throw (IllegalArgumentException, DoubleInitializationException, IOException, Exception, RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
throw Exception(
|
|
|
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Embedding of database documents is not supported." ) ),
|
|
|
|
// TODO: resource
|
|
|
|
*this
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::storeToStorage( const Reference< XStorage >& _rxStorage, const Sequence< PropertyValue >& _rMediaDescriptor ) throw (IllegalArgumentException, IOException, Exception, RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2009-04-24 18:34:24 +00:00
|
|
|
impl_storeToStorage_throw( _rxStorage, _rMediaDescriptor, aGuard );
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::switchToStorage( const Reference< XStorage >& _rxNewRootStorage ) throw (IllegalArgumentException, IOException, Exception, RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
Reference< XStorage > xNewRootStorage( m_pImpl->switchToStorage( _rxNewRootStorage ) );
|
|
|
|
|
|
|
|
aGuard.clear();
|
|
|
|
impl_notifyStorageChange_nolck_nothrow( xNewRootStorage );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentStorage( ) throw (IOException, Exception, RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
|
|
|
return m_pImpl->getOrCreateRootStorage();
|
2008-03-06 16:58:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::addStorageChangeListener( const Reference< XStorageChangeListener >& _Listener ) throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
m_aStorageListeners.addInterface( _Listener );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::removeStorageChangeListener( const Reference< XStorageChangeListener >& _Listener ) throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
m_aStorageListeners.addInterface( _Listener );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XStorageBasedLibraryContainer > SAL_CALL ODatabaseDocument::getBasicLibraries() throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
|
2008-03-06 16:58:17 +00:00
|
|
|
return m_pImpl->getLibraryContainer( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XStorageBasedLibraryContainer > SAL_CALL ODatabaseDocument::getDialogLibraries() throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
return m_pImpl->getLibraryContainer( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
::sal_Bool SAL_CALL ODatabaseDocument::getAllowMacroExecution() throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
return m_pImpl->adjustMacroMode_AutoReject();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XEmbeddedScripts > SAL_CALL ODatabaseDocument::getScriptContainer() throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< provider::XScriptProvider > SAL_CALL ODatabaseDocument::getScriptProvider( ) throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-03-06 16:58:17 +00:00
|
|
|
|
|
|
|
Reference< XScriptProvider > xScriptProvider( m_xScriptProvider );
|
|
|
|
if ( !xScriptProvider.is() )
|
|
|
|
{
|
|
|
|
Reference < XScriptProviderFactory > xFactory(
|
|
|
|
m_pImpl->m_aContext.getSingleton( "com.sun.star.script.provider.theMasterScriptProviderFactory" ), UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
Any aScriptProviderContext;
|
2009-04-24 18:34:24 +00:00
|
|
|
if ( m_bAllowDocumentScripting )
|
2008-03-06 16:58:17 +00:00
|
|
|
aScriptProviderContext <<= Reference< XModel >( this );
|
|
|
|
|
|
|
|
xScriptProvider.set( xFactory->createScriptProvider( aScriptProviderContext ), UNO_SET_THROW );
|
|
|
|
m_xScriptProvider = xScriptProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
return xScriptProvider;
|
|
|
|
}
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XNameReplace > SAL_CALL ODatabaseDocument::getEvents( ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
|
|
|
|
return m_pEventContainer;
|
|
|
|
}
|
2008-03-06 16:58:17 +00:00
|
|
|
|
2005-03-10 15:33:50 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseDocument::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
if ( m_pImpl.is() )
|
|
|
|
m_pImpl->disposing(Source);
|
2005-01-21 16:03:37 +00:00
|
|
|
}
|
2005-12-21 12:34:54 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------
|
2008-03-06 16:58:17 +00:00
|
|
|
Reference< XInterface > ODatabaseDocument::getThis() const
|
2005-12-21 12:34:54 +00:00
|
|
|
{
|
2008-03-06 16:58:17 +00:00
|
|
|
return *const_cast< ODatabaseDocument* >( this );
|
2005-12-21 12:34:54 +00:00
|
|
|
}
|
2007-04-16 15:23:47 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
struct CreateAny : public ::std::unary_function< Reference<XController>, Any>
|
2007-07-24 11:04:32 +00:00
|
|
|
{
|
|
|
|
Any operator() (const Reference<XController>& lhs) const
|
|
|
|
{
|
|
|
|
return makeAny(lhs);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-04-16 15:23:47 +00:00
|
|
|
// XModel2
|
|
|
|
Reference< XEnumeration > SAL_CALL ODatabaseDocument::getControllers( ) throw (RuntimeException)
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2007-07-24 11:04:32 +00:00
|
|
|
uno::Sequence< Any> aController( m_aControllers.size() );
|
|
|
|
::std::transform( m_aControllers.begin(), m_aControllers.end(), aController.getArray(), CreateAny() );
|
2007-04-16 15:23:47 +00:00
|
|
|
return new ::comphelper::OAnyEnumeration(aController);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Sequence< ::rtl::OUString > SAL_CALL ODatabaseDocument::getAvailableViewControllerNames( ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
Sequence< ::rtl::OUString > aNames(1);
|
|
|
|
aNames[0] = SERVICE_SDB_APPLICATIONCONTROLLER;
|
|
|
|
return aNames;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-06-06 13:02:08 +00:00
|
|
|
Reference< XController2 > SAL_CALL ODatabaseDocument::createDefaultViewController( const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException)
|
2007-04-16 15:23:47 +00:00
|
|
|
{
|
2008-06-06 13:02:08 +00:00
|
|
|
return createViewController(
|
|
|
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ),
|
|
|
|
Sequence< PropertyValue >(),
|
|
|
|
_Frame
|
|
|
|
);
|
2007-04-16 15:23:47 +00:00
|
|
|
}
|
2008-06-06 13:02:08 +00:00
|
|
|
|
2007-04-16 15:23:47 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-06-06 13:02:08 +00:00
|
|
|
Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( const ::rtl::OUString& _ViewName, const Sequence< PropertyValue >& _Arguments, const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException)
|
2007-04-16 15:23:47 +00:00
|
|
|
{
|
2008-06-06 13:02:08 +00:00
|
|
|
if ( !_ViewName.equalsAscii( "Default" ) && !_ViewName.equalsAscii( "Preview" ) )
|
|
|
|
throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
|
|
|
|
if ( !_Frame.is() )
|
|
|
|
throw IllegalArgumentException( ::rtl::OUString(), *this, 3 );
|
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-06-06 13:02:08 +00:00
|
|
|
::comphelper::ComponentContext aContext( m_pImpl->m_aContext );
|
|
|
|
aGuard.clear();
|
|
|
|
|
|
|
|
Reference< XController2 > xController;
|
|
|
|
aContext.createComponent( "org.openoffice.comp.dbu.OApplicationController", xController );
|
|
|
|
|
|
|
|
::comphelper::NamedValueCollection aInitArgs( _Arguments );
|
|
|
|
aInitArgs.put( "Frame", _Frame );
|
|
|
|
if ( _ViewName.equalsAscii( "Preview" ) )
|
|
|
|
aInitArgs.put( "Preview", sal_Bool( sal_True ) );
|
|
|
|
Reference< XInitialization > xInitController( xController, UNO_QUERY_THROW );
|
|
|
|
xInitController->initialize( aInitArgs.getWrappedPropertyValues() );
|
|
|
|
|
|
|
|
return xController;
|
2007-04-16 15:23:47 +00:00
|
|
|
}
|
2008-06-06 13:02:08 +00:00
|
|
|
|
2007-04-16 15:23:47 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:32:17 +00:00
|
|
|
//=============================================================================
|
2008-04-08 11:46:07 +00:00
|
|
|
Reference< XTitle > ODatabaseDocument::impl_getTitleHelper_throw()
|
2008-04-04 13:32:17 +00:00
|
|
|
{
|
|
|
|
if ( ! m_xTitleHelper.is ())
|
|
|
|
{
|
2008-04-08 11:46:07 +00:00
|
|
|
Reference< XUntitledNumbers > xDesktop(
|
|
|
|
m_pImpl->m_aContext.createComponent( "com.sun.star.frame.Desktop" ),
|
|
|
|
UNO_QUERY_THROW );
|
|
|
|
uno::Reference< frame::XModel > xThis (getThis(), uno::UNO_QUERY_THROW);
|
2008-04-04 13:32:17 +00:00
|
|
|
|
2008-04-08 11:46:07 +00:00
|
|
|
::framework::TitleHelper* pHelper = new ::framework::TitleHelper(m_pImpl->m_aContext.getLegacyServiceFactory());
|
2008-04-04 13:32:17 +00:00
|
|
|
m_xTitleHelper.set(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
|
|
|
|
pHelper->setOwner (xThis );
|
|
|
|
pHelper->connectWithUntitledNumbers (xDesktop);
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_xTitleHelper;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHelper_throw(const uno::Reference< uno::XInterface >& _xComponent)
|
|
|
|
{
|
|
|
|
if ( !m_xModuleManager.is() )
|
2008-04-08 11:46:07 +00:00
|
|
|
m_xModuleManager.set( m_pImpl->m_aContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
|
2008-04-04 13:32:17 +00:00
|
|
|
|
2008-06-16 11:30:48 +00:00
|
|
|
::rtl::OUString sModuleId;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
sModuleId = m_xModuleManager->identify( _xComponent );
|
|
|
|
}
|
|
|
|
catch(uno::Exception)
|
|
|
|
{
|
|
|
|
// ni
|
|
|
|
}
|
2008-04-04 13:32:17 +00:00
|
|
|
uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
|
|
|
|
|
|
|
|
TNumberedController::iterator aFind = m_aNumberedControllers.find(sModuleId);
|
|
|
|
if ( aFind == m_aNumberedControllers.end() )
|
|
|
|
{
|
|
|
|
uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW);
|
|
|
|
::comphelper::NumberedCollection* pHelper = new ::comphelper::NumberedCollection();
|
|
|
|
xNumberedControllers.set(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
|
|
|
|
|
|
|
|
pHelper->setOwner (xThis);
|
|
|
|
//pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : "));
|
|
|
|
|
|
|
|
m_aNumberedControllers.insert(TNumberedController::value_type(sModuleId,xNumberedControllers));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
xNumberedControllers = aFind->second;
|
|
|
|
|
|
|
|
return xNumberedControllers;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XTitle
|
|
|
|
::rtl::OUString SAL_CALL ODatabaseDocument::getTitle()
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// SYNCHRONIZED ->
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit );
|
|
|
|
return impl_getTitleHelper_throw()->getTitle();
|
2008-04-04 13:32:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XTitle
|
|
|
|
void SAL_CALL ODatabaseDocument::setTitle( const ::rtl::OUString& sTitle )
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// SYNCHRONIZED ->
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
|
|
|
impl_getTitleHelper_throw()->setTitle( sTitle );
|
|
|
|
m_aEventNotifier.notifyDocumentEventAsync( "OnTitleChanged" );
|
|
|
|
// <- SYNCHRONIZED
|
2008-04-04 13:32:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XTitleChangeBroadcaster
|
|
|
|
void SAL_CALL ODatabaseDocument::addTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener )
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// SYNCHRONIZED ->
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-04-04 13:32:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
uno::Reference< frame::XTitleChangeBroadcaster > xBroadcaster( impl_getTitleHelper_throw(), uno::UNO_QUERY_THROW );
|
|
|
|
xBroadcaster->addTitleChangeListener( xListener );
|
2008-04-04 13:32:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XTitleChangeBroadcaster
|
|
|
|
void SAL_CALL ODatabaseDocument::removeTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener )
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// SYNCHRONIZED ->
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-04-04 13:32:17 +00:00
|
|
|
|
2008-10-16 06:57:26 +00:00
|
|
|
uno::Reference< frame::XTitleChangeBroadcaster > xBroadcaster( impl_getTitleHelper_throw(), uno::UNO_QUERY_THROW );
|
|
|
|
xBroadcaster->removeTitleChangeListener( xListener );
|
2008-04-04 13:32:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XUntitledNumbers
|
|
|
|
::sal_Int32 SAL_CALL ODatabaseDocument::leaseNumber( const uno::Reference< uno::XInterface >& xComponent )
|
|
|
|
throw (lang::IllegalArgumentException,
|
|
|
|
uno::RuntimeException )
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-04-04 13:32:17 +00:00
|
|
|
return impl_getUntitledHelper_throw(xComponent)->leaseNumber (xComponent);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XUntitledNumbers
|
|
|
|
void SAL_CALL ODatabaseDocument::releaseNumber( ::sal_Int32 nNumber )
|
|
|
|
throw (lang::IllegalArgumentException,
|
|
|
|
uno::RuntimeException )
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-04-04 13:32:17 +00:00
|
|
|
impl_getUntitledHelper_throw()->releaseNumber (nNumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XUntitledNumbers
|
|
|
|
void SAL_CALL ODatabaseDocument::releaseNumberForComponent( const uno::Reference< uno::XInterface >& xComponent )
|
|
|
|
throw (lang::IllegalArgumentException,
|
|
|
|
uno::RuntimeException )
|
|
|
|
{
|
2008-10-16 06:57:26 +00:00
|
|
|
DocumentGuard aGuard( *this );
|
2008-04-04 13:32:17 +00:00
|
|
|
impl_getUntitledHelper_throw(xComponent)->releaseNumberForComponent (xComponent);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// css.frame.XUntitledNumbers
|
|
|
|
::rtl::OUString SAL_CALL ODatabaseDocument::getUntitledPrefix() throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return ::rtl::OUString();/*RTL_CONSTASCII_USTRINGPARAM(" : "));*/
|
|
|
|
}
|
2005-12-21 12:34:54 +00:00
|
|
|
|
2005-02-16 15:07:41 +00:00
|
|
|
//------------------------------------------------------------------
|
2004-08-02 14:09:11 +00:00
|
|
|
//........................................................................
|
|
|
|
} // namespace dbaccess
|
|
|
|
//........................................................................
|
2005-02-16 15:07:41 +00:00
|
|
|
|
2005-03-04 08:44:36 +00:00
|
|
|
|