Files
libreoffice/dbaccess/source/ui/browser/genericcontroller.cxx

1525 lines
52 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-14 17:39:53 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <dbaccess/genericcontroller.hxx>
2001-01-09 14:43:04 +00:00
#include <comphelper/uno3.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include "browserids.hxx"
#include <vcl/svapp.hxx>
2001-04-23 08:30:31 +00:00
#include <toolkit/helper/vclunohelper.hxx>
#include <dbaccess/dataview.hxx>
#include <tools/diagnose_ex.h>
2011-02-03 00:33:36 +01:00
#include <osl/diagnose.h>
2001-01-09 14:43:04 +00:00
#include "dbustrings.hrc"
#include <vcl/stdtext.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <framework/titlehelper.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/extract.hxx>
#include <cppuhelper/supportsservice.hxx>
2001-01-09 14:43:04 +00:00
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
2001-02-27 14:11:05 +00:00
#include <com/sun/star/sdb/SQLContext.hpp>
2001-01-09 14:43:04 +00:00
#include <com/sun/star/sdb/XCompletedConnection.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
2002-06-26 07:17:57 +00:00
#include <com/sun/star/util/XCloseable.hpp>
2001-02-23 14:17:34 +00:00
#include "UITools.hxx"
#include "commontypes.hxx"
#include <vcl/waitobj.hxx>
#include <svl/urihelper.hxx>
#include "datasourceconnector.hxx"
#include <unotools/moduleoptions.hxx>
2002-08-26 06:52:15 +00:00
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/status/Visibility.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <rtl/ustring.hxx>
2001-10-26 12:10:16 +00:00
#include <algorithm>
2011-02-08 19:44:44 +01:00
#include <o3tl/compat_functional.hxx>
#include <boost/scoped_ptr.hpp>
2011-02-05 18:31:11 +01:00
#include <boost/unordered_map.hpp>
#include <cppuhelper/implbase1.hxx>
#include <limits>
2001-10-26 12:10:16 +00:00
using namespace ::com::sun::star;
2001-01-09 14:43:04 +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::frame::status;
2001-01-09 14:43:04 +00:00
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::task;
2001-04-23 08:30:31 +00:00
using namespace ::com::sun::star::awt;
2001-01-09 14:43:04 +00:00
using namespace ::dbtools;
using namespace ::comphelper;
#define ALL_FEATURES -1
#define FIRST_USER_DEFINED_FEATURE ( ::std::numeric_limits< sal_uInt16 >::max() - 1000 )
#define LAST_USER_DEFINED_FEATURE ( ::std::numeric_limits< sal_uInt16 >::max() )
2011-02-05 18:31:11 +01:00
typedef ::boost::unordered_map< sal_Int16, sal_Int16 > CommandHashMap;
typedef ::std::list< DispatchInformation > DispatchInfoList;
const OUString& getConfirmDeletionURL()
{
static const OUString sConfirmDeletionURL( ".uno:FormSlots/ConfirmDeletion" );
return sConfirmDeletionURL;
}
2001-01-09 14:43:04 +00:00
namespace dbaui
{
// UserDefinedFeatures
2008-10-01 12:28:29 +00:00
class UserDefinedFeatures
{
public:
UserDefinedFeatures( const Reference< XController >& _rxController );
FeatureState getState( const URL& _rFeatureURL );
void execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs );
private:
::com::sun::star::uno::WeakReference< XController > m_aController;
};
UserDefinedFeatures::UserDefinedFeatures( const Reference< XController >& _rxController )
:m_aController( _rxController )
{
}
FeatureState UserDefinedFeatures::getState( const URL& /*_rFeatureURL*/ )
{
// for now, enable all the time
// TODO: we should ask the dispatcher. However, this is laborious, since you cannot ask a dispatcher
// directly, but need to add a status listener.
FeatureState aState;
aState.bEnabled = true;
2008-10-01 12:28:29 +00:00
return aState;
}
void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs )
{
try
{
Reference< XController > xController( (Reference< XController >)m_aController, UNO_SET_THROW );
Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW );
Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch(
_rFeatureURL,
OUString( "_self" ),
2008-10-01 12:28:29 +00:00
FrameSearchFlag::AUTO
) );
if ( xDispatch == xController )
{
SAL_WARN("dbaccess.ui", "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" );
2008-10-01 12:28:29 +00:00
xDispatch.clear();
}
if ( xDispatch.is() )
xDispatch->dispatch( _rFeatureURL, _rArgs );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
}
// OGenericUnoController_Data
struct OGenericUnoController_Data
{
::sfx2::UserInputInterception m_aUserInputInterception;
2008-10-01 12:28:29 +00:00
UserDefinedFeatures m_aUserDefinedFeatures;
OGenericUnoController_Data( OGenericUnoController& _rController, ::osl::Mutex& _rMutex )
:m_aUserInputInterception( _rController, _rMutex )
2008-10-01 12:28:29 +00:00
,m_aUserDefinedFeatures( _rController.getXController() )
{
}
};
// OGenericUnoController
OGenericUnoController::OGenericUnoController(const Reference< XComponentContext >& _rM)
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
:OGenericUnoController_Base( getMutex() )
,m_pView(NULL)
#ifdef DBG_UTIL
,m_bDescribingSupportedFeatures( false )
#endif
2001-03-01 14:17:55 +00:00
,m_aAsyncInvalidateAll(LINK(this, OGenericUnoController, OnAsyncInvalidateAll))
2001-09-19 12:20:12 +00:00
,m_aAsyncCloseTask(LINK(this, OGenericUnoController, OnAsyncCloseTask))
,m_xContext(_rM)
,m_aCurrentFrame( *this )
,m_bPreview(false)
,m_bReadOnly(false)
,m_bCurrentlyModified(false)
,m_bExternalTitle(false)
2001-01-09 14:43:04 +00:00
{
osl_atomic_increment( &m_refCount );
2008-10-01 12:28:29 +00:00
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
m_pData.reset( new OGenericUnoController_Data( *this, getMutex() ) );
2008-10-01 12:28:29 +00:00
}
osl_atomic_decrement( &m_refCount );
2008-10-01 12:28:29 +00:00
2001-01-09 14:43:04 +00:00
try
{
m_xUrlTransformer = URLTransformer::create(_rM);
2001-01-09 14:43:04 +00:00
}
catch(Exception&)
{
DBG_UNHANDLED_EXCEPTION();
2001-01-09 14:43:04 +00:00
}
}
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4702)
OGenericUnoController::OGenericUnoController()
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
:OGenericUnoController_Base( getMutex() )
,m_pView(NULL)
#ifdef DBG_UTIL
,m_bDescribingSupportedFeatures( false )
#endif
,m_aAsyncInvalidateAll(LINK(this, OGenericUnoController, OnAsyncInvalidateAll))
,m_aAsyncCloseTask(LINK(this, OGenericUnoController, OnAsyncCloseTask))
,m_aCurrentFrame( *this )
,m_bPreview(sal_False)
,m_bReadOnly(sal_False)
,m_bCurrentlyModified(sal_False)
{
SAL_WARN("dbaccess.ui", "OGenericUnoController::OGenericUnoController: illegal call!" );
// This ctor only exists because the MSVC compiler complained about an unresolved external
// symbol. It should not be used at all. Since using it yields strange runtime problems,
// we simply abort here.
abort();
}
#pragma warning(pop)
dba33a: summary migration from SVN 2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test 2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test 2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ... 2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in 2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs) 2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing 2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing 2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript 2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test 2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test 2009-11-03 14:25:44 +0000 fs r277324 : #i10000# 2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs 2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ... 2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM) 2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion 2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense 2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE 2009-10-21 07:08:35 +0000 fs r277075 : spare useless call 2009-10-20 21:26:31 +0000 fs r277072 : #i10000# 2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62) 2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch 2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks. 2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk) 2009-10-15 12:52:39 +0000 fs r276939 : #i10000# 2009-10-15 12:44:26 +0000 fs r276938 : #i10000# 2009-10-15 12:00:33 +0000 fs r276936 : #i10000# 2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg 2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const 2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#: introduce an option to the layout manager to preserve, if possible, the size of the content window when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing. (the option is incompatible with in-place editing, anyway) This is because such embedded objects couple the (content) window size to the VisAreaSize, in that both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize, and restores it upon next open. This, however, leads to different content window sizes when the window is closed with another toolbar set than used during opening. This patch here prevents those different content window sizes. Also, now the content window size doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content window size stays the same, and the container window size is adjusted. 2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows 2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable) 2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows 2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service 2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist 2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties 2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified 2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command 2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol 2009-10-07 12:59:17 +0000 fs r276754 : #i87693# 2009-10-07 11:19:22 +0000 fs r276752 : #i10000# 2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller) 2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for issue #i105371# 2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for issue #i105371# 2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion 2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol 2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release: when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing the ref count, again. This ensures that our adapter cannot create references to the dying object anymore. (A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous release/dispose/destroy pattern, namely WeakComponentImplHelperBase) 2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying 2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool) 2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked 2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails 2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet revealed some inconsistencies, in whether the objects are cached by their URL, or by their registration name. This has been changed to caching by registration name. 2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case 2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed 2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable (timing-dependent) results/failures. Instead, every test sets up a new odb file. Also, did some re-factoring, improved the cleanup code, and caught a few more errors. 2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now 2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose 2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now 2009-10-06 12:49:22 +0000 fs r276707 : typo 2009-10-06 12:49:03 +0000 fs r276706 : typo 2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class 2009-10-06 12:48:02 +0000 fs r276704 : typo 2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably 2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence 2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope 2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create 2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope 2009-10-05 09:46:17 +0000 fs r276671 : #i10000# 2009-10-05 08:43:58 +0000 fs r276664 : #i105505# release: dispose the (base classes) weak connection point before disposing ourself, and in particular before temporarily incrementing our ref count, again. This way, we prevent that a separate thread re-surrects us (using the weak connection point's queryAdapted) while we're in the process of destruction 2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release) 2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead 2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics 2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants 2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign 2009-10-04 19:53:30 +0000 fs r276657 : #105560# remove unused code thanks to cmc@openoffice.org for submitting the patch 2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc) 2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60) 2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ... 2009-10-02 10:52:24 +0000 fs r276634 : #i105505# If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized. In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl call attachResource. This ensures that the model is initialized completely, including firing the necessary events. 2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document 2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document 2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes 2009-10-01 09:12:20 +0000 fs r276582 : #i105505# 2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion 2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods 2009-09-30 06:35:59 +0000 fs r276538 : #i10000# 2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113# 2009-09-29 10:27:10 +0000 fs r276520 : #i105367# 2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles 2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc 2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE... 2009-09-28 20:53:36 +0000 fs r276503 : #i104117# cleaned up the mess with help IDs in module extensions. Formerly, extensions used to use help IDs which were declared in module svx, and vice versa. Also, help ID ranges were not respected. 2009-09-28 11:25:36 +0000 fs r276489 : typo 2009-09-28 11:25:10 +0000 fs r276488 : #i105235# 2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document) 2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar 2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double 2009-09-16 11:11:43 +0000 fs r276195 : #i105082# consolidated the sub storage handling, by delegating more functionality into the DocumentStorageAccess class. As a result, there won't be that many unnecessary commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages and DocumentStorageAccess::m_aExposedStorages) have been consolidated. This is not really part of the fix of issue 105082, but it helped reducing the calls to the storage/package implementation. 2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures) 2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved 2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error 2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS 2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models 2009-09-14 10:33:02 +0000 fs r276106 : removed dead file 2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor 2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text 2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
#endif
OGenericUnoController::~OGenericUnoController()
{
}
bool OGenericUnoController::Construct(Window* /*pParent*/)
2001-01-09 14:43:04 +00:00
{
OSL_ENSURE( getView(), "the view is NULL!" );
if ( getView() )
{
getView()->Construct();
getView()->Show();
}
m_aSupportedFeatures.clear();
fillSupportedFeatures();
2001-01-09 14:43:04 +00:00
// create the database context
2011-02-03 00:33:36 +01:00
OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!");
2001-01-09 14:43:04 +00:00
try
{
m_xDatabaseContext = DatabaseContext::create(getORB());
2001-01-09 14:43:04 +00:00
}
catch(const Exception&)
2001-01-09 14:43:04 +00:00
{
SAL_WARN("dbaccess.ui","OGenericUnoController::Construct: could not create (or start listening at) the database context!");
// at least notify the user. Though the whole component does not make any sense without the database context ...
ShowServiceNotAvailableError(getView(), OUString("com.sun.star.sdb.DatabaseContext"), true);
2001-01-09 14:43:04 +00:00
}
return true;
2001-01-09 14:43:04 +00:00
}
IMPL_LINK_NOARG(OGenericUnoController, OnAsyncInvalidateAll)
2001-01-09 14:43:04 +00:00
{
if ( !OGenericUnoController_Base::rBHelper.bInDispose && !OGenericUnoController_Base::rBHelper.bDisposed )
InvalidateFeature_Impl();
2001-01-09 14:43:04 +00:00
return 0L;
}
void OGenericUnoController::impl_initialize()
{
}
void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
SolarMutexGuard aSolarGuard;
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
Reference< XWindow > xParent;
Reference< XFrame > xFrame;
2001-01-09 14:43:04 +00:00
PropertyValue aValue;
const Any* pIter = aArguments.getConstArray();
const Any* pEnd = pIter + aArguments.getLength();
2001-01-09 14:43:04 +00:00
for ( ; pIter != pEnd; ++pIter )
2001-01-09 14:43:04 +00:00
{
if ( ( *pIter >>= aValue ) && aValue.Name.equalsAscii( "Frame" ) )
2001-01-09 14:43:04 +00:00
{
xFrame.set(aValue.Value,UNO_QUERY_THROW);
}
else if ( ( *pIter >>= aValue ) && aValue.Name.equalsAscii( "Preview" ) )
{
aValue.Value >>= m_bPreview;
m_bReadOnly = true;
}
}
try
{
if ( !xFrame.is() )
throw IllegalArgumentException("need a frame", *this, 1 );
xParent = xFrame->getContainerWindow();
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation(xParent);
Window* pParentWin = pParentComponent ? pParentComponent->GetWindow() : NULL;
if (!pParentWin)
{
throw IllegalArgumentException("Parent window is null", *this, 1 );
}
m_aInitParameters.assign( aArguments );
Construct( pParentWin );
ODataView* pView = getView();
if ( !pView )
throw RuntimeException("unable to create a view", *this );
if ( m_bReadOnly || m_bPreview )
pView->EnableInput( false );
impl_initialize();
}
2011-10-25 11:27:54 +03:00
catch(Exception&)
{
// no one clears my view if I won't
boost::scoped_ptr<Window> aTemp(m_pView);
m_pView = NULL;
throw;
2001-01-09 14:43:04 +00:00
}
}
void SAL_CALL OGenericUnoController::acquire( ) throw ()
{
OGenericUnoController_Base::acquire();
}
void SAL_CALL OGenericUnoController::release( ) throw ()
{
OGenericUnoController_Base::release();
}
void OGenericUnoController::startFrameListening( const Reference< XFrame >& _rxFrame )
{
if ( _rxFrame.is() )
_rxFrame->addFrameActionListener( this );
}
void OGenericUnoController::stopFrameListening( const Reference< XFrame >& _rxFrame )
{
if ( _rxFrame.is() )
_rxFrame->removeFrameActionListener( this );
}
void OGenericUnoController::disposing(const EventObject& Source) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
// our frame ?
if ( Source.Source == getFrame() )
stopFrameListening( getFrame() );
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::modified(const EventObject& aEvent) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
if ( !isDataSourceReadOnly() )
{
Reference<XModifiable> xModi(aEvent.Source,UNO_QUERY);
if ( xModi.is() )
m_bCurrentlyModified = xModi->isModified(); // can only be reset by save
else
m_bCurrentlyModified = true;
}
InvalidateFeature(ID_BROWSER_SAVEDOC);
2001-01-09 14:43:04 +00:00
InvalidateFeature(ID_BROWSER_UNDO);
}
Reference< XWindow > SAL_CALL OGenericUnoController::getComponentWindow() throw (RuntimeException, std::exception)
{
return VCLUnoHelper::GetInterface( getView() );
}
OUString SAL_CALL OGenericUnoController::getViewControllerName() throw (::com::sun::star::uno::RuntimeException, std::exception)
{
return OUString( "Default" );
}
Sequence< PropertyValue > SAL_CALL OGenericUnoController::getCreationArguments() throw (RuntimeException, std::exception)
{
// currently we do not support any creation args, so anything passed to XModel2::createViewController would be
// lost, so we can equally return an empty sequence here
return Sequence< PropertyValue >();
}
void OGenericUnoController::attachFrame( const Reference< XFrame >& _rxFrame ) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
SolarMutexGuard aSolarGuard;
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
2001-01-09 14:43:04 +00:00
stopFrameListening( m_aCurrentFrame.getFrame() );
Reference< XFrame > xFrame = m_aCurrentFrame.attachFrame( _rxFrame );
2008-04-08 11:46:07 +00:00
startFrameListening( xFrame );
loadMenu( xFrame );
if ( getView() )
getView()->attachFrame( xFrame );
}
struct CommandCollector : public ::std::unary_function< SupportedFeatures::value_type, void>
2001-01-09 14:43:04 +00:00
{
sal_uInt16 m_nFeature;
StringBag& m_rFeatureCommands;
CommandCollector( sal_uInt16 _nFeature, StringBag& _rFeatureCommands )
:m_nFeature ( _nFeature )
,m_rFeatureCommands( _rFeatureCommands )
{
}
2001-01-09 14:43:04 +00:00
void operator() ( const SupportedFeatures::value_type& lhs )
2001-01-09 14:43:04 +00:00
{
if ( lhs.second.nFeatureId == m_nFeature )
m_rFeatureCommands.insert( lhs.first );
2001-01-09 14:43:04 +00:00
}
};
2001-01-09 14:43:04 +00:00
namespace
{
typedef ::std::vector< Any > States;
void lcl_notifyMultipleStates( XStatusListener& _rListener, FeatureStateEvent& _rEvent, const States& _rStates )
{
for ( States::const_iterator state = _rStates.begin();
state != _rStates.end();
++state
)
{
_rEvent.State = *state;
_rListener.statusChanged( _rEvent );
}
}
void lcl_collectStates( const FeatureState& _rFeatureState, States& _out_rStates )
{
// order matters, due to a bug in framework which resets the check state when any non-boolean event
// arrives
// #i68215# is the bug to (re-)introduce this "ordered" notification here
// #i67882# is the bug which was caused by the real fix which we did in framework
// #i68216# is the bug which requests to fix the code in Draw which relies on
// framework's implementation details
if ( !!_rFeatureState.sTitle )
_out_rStates.push_back( makeAny( *_rFeatureState.sTitle ) );
if ( !!_rFeatureState.bChecked )
_out_rStates.push_back( makeAny( *_rFeatureState.bChecked ) );
if ( !!_rFeatureState.bInvisible )
_out_rStates.push_back( makeAny( Visibility( !*_rFeatureState.bInvisible ) ) );
if ( _rFeatureState.aValue.hasValue() )
_out_rStates.push_back( _rFeatureState.aValue );
if ( _out_rStates.empty() )
_out_rStates.push_back( Any() );
}
}
void OGenericUnoController::ImplBroadcastFeatureState(const OUString& _rFeature, const Reference< XStatusListener > & xListener, bool _bIgnoreCache)
2001-01-09 14:43:04 +00:00
{
sal_uInt16 nFeat = m_aSupportedFeatures[ _rFeature ].nFeatureId;
FeatureState aFeatState( GetState( nFeat ) );
2001-01-09 14:43:04 +00:00
FeatureState& rCachedState = m_aStateCache[nFeat]; // creates if necessary
if ( !_bIgnoreCache )
2001-01-09 14:43:04 +00:00
{
// check if we really need to notify the listeners : this method may be called much more often than needed, so check
// the cached state of the feature
bool bAlreadyCached = ( m_aStateCache.find(nFeat) != m_aStateCache.end() );
if ( bAlreadyCached )
if ( ( rCachedState.bEnabled == aFeatState.bEnabled )
&& ( rCachedState.bChecked == aFeatState.bChecked )
&& ( rCachedState.bInvisible == aFeatState.bInvisible )
&& ( rCachedState.sTitle == aFeatState.sTitle )
)
return;
2001-01-09 14:43:04 +00:00
}
rCachedState = aFeatState;
FeatureStateEvent aEvent;
2001-01-09 14:43:04 +00:00
aEvent.FeatureURL.Complete = _rFeature;
if (m_xUrlTransformer.is())
m_xUrlTransformer->parseStrict(aEvent.FeatureURL);
aEvent.Source = (XDispatch*)this;
2001-01-09 14:43:04 +00:00
aEvent.IsEnabled = aFeatState.bEnabled;
// collect all states to be notified
States aStates;
lcl_collectStates( aFeatState, aStates );
2001-01-09 14:43:04 +00:00
// a special listener ?
if ( xListener.is() )
lcl_notifyMultipleStates( *xListener.get(), aEvent, aStates );
2001-01-09 14:43:04 +00:00
else
{ // no -> iterate through all listeners responsible for the URL
StringBag aFeatureCommands;
::std::for_each(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
CommandCollector( nFeat, aFeatureCommands )
);
// it is possible that listeners are registered or revoked while
// we are notifying them, so we must use a copy of m_arrStatusListener, not
// m_arrStatusListener itself
Dispatch aNotifyLoop( m_arrStatusListener );
Dispatch::iterator iterSearch = aNotifyLoop.begin();
Dispatch::iterator iterEnd = aNotifyLoop.end();
2001-01-09 14:43:04 +00:00
while (iterSearch != iterEnd)
{
DispatchTarget& rCurrent = *iterSearch;
if ( aFeatureCommands.find( rCurrent.aURL.Complete ) != aFeatureCommands.end() )
{
aEvent.FeatureURL = rCurrent.aURL;
lcl_notifyMultipleStates( *rCurrent.xListener.get(), aEvent, aStates );
}
2001-01-09 14:43:04 +00:00
++iterSearch;
}
}
}
bool OGenericUnoController::isFeatureSupported( sal_Int32 _nId )
{
SupportedFeatures::iterator aFeaturePos = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
2008-10-01 12:28:29 +00:00
::std::bind2nd( CompareFeatureById(), _nId )
);
return ( m_aSupportedFeatures.end() != aFeaturePos && !aFeaturePos->first.isEmpty());
}
void OGenericUnoController::InvalidateFeature(const OUString& _rURLPath, const Reference< XStatusListener > & _xListener, bool _bForceBroadcast)
2001-01-09 14:43:04 +00:00
{
ImplInvalidateFeature( m_aSupportedFeatures[ _rURLPath ].nFeatureId, _xListener, _bForceBroadcast );
2001-01-09 14:43:04 +00:00
}
2001-01-09 14:43:04 +00:00
void OGenericUnoController::InvalidateFeature_Impl()
{
#ifdef DBG_UTIL
static sal_Int32 s_nRecursions = 0;
++s_nRecursions;
#endif
bool bEmpty = true;
2008-10-01 12:28:29 +00:00
FeatureListener aNextFeature;
2001-01-09 14:43:04 +00:00
{
::osl::MutexGuard aGuard( m_aFeatureMutex);
bEmpty = m_aFeaturesToInvalidate.empty();
if (!bEmpty)
aNextFeature = m_aFeaturesToInvalidate.front();
2001-01-09 14:43:04 +00:00
}
while(!bEmpty)
{
if ( ALL_FEATURES == aNextFeature.nId )
{
2001-01-09 14:43:04 +00:00
InvalidateAll_Impl();
break;
}
2001-01-09 14:43:04 +00:00
else
{
SupportedFeatures::iterator aFeaturePos = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
2008-10-01 12:28:29 +00:00
::std::bind2nd( CompareFeatureById(), aNextFeature.nId )
);
#if OSL_DEBUG_LEVEL > 0
if ( m_aSupportedFeatures.end() == aFeaturePos )
{
OString sMessage( "OGenericUnoController::InvalidateFeature_Impl: feature id " );
sMessage += OString::number( aNextFeature.nId );
sMessage += OString( " has been invalidated, but is not supported!" );
SAL_WARN("dbaccess.ui", sMessage.getStr() );
}
#endif
if ( m_aSupportedFeatures.end() != aFeaturePos )
// we really know this feature
ImplBroadcastFeatureState( aFeaturePos->first, aNextFeature.xListener, aNextFeature.bForceBroadcast );
2001-01-09 14:43:04 +00:00
}
::osl::MutexGuard aGuard( m_aFeatureMutex);
m_aFeaturesToInvalidate.pop_front();
bEmpty = m_aFeaturesToInvalidate.empty();
if (!bEmpty)
aNextFeature = m_aFeaturesToInvalidate.front();
2001-01-09 14:43:04 +00:00
}
#ifdef DBG_UTIL
--s_nRecursions;
#endif
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, bool _bForceBroadcast )
2001-01-09 14:43:04 +00:00
{
#if OSL_DEBUG_LEVEL > 0
if ( _nId != -1 )
{
SupportedFeatures::iterator aFeaturePos = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
::std::bind2nd( CompareFeatureById(), _nId )
);
OSL_ENSURE( aFeaturePos != m_aSupportedFeatures.end(), "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" );
}
#endif
2008-10-01 12:28:29 +00:00
FeatureListener aListener;
aListener.nId = _nId;
aListener.xListener = _xListener;
aListener.bForceBroadcast = _bForceBroadcast;
2001-01-09 14:43:04 +00:00
bool bWasEmpty;
2001-01-09 14:43:04 +00:00
{
2008-10-01 12:28:29 +00:00
::osl::MutexGuard aGuard( m_aFeatureMutex );
2001-01-09 14:43:04 +00:00
bWasEmpty = m_aFeaturesToInvalidate.empty();
2008-10-01 12:28:29 +00:00
m_aFeaturesToInvalidate.push_back( aListener );
2001-01-09 14:43:04 +00:00
}
if ( bWasEmpty )
2001-01-09 14:43:04 +00:00
m_aAsyncInvalidateAll.Call();
}
void OGenericUnoController::InvalidateFeature(sal_uInt16 _nId, const Reference< XStatusListener > & _xListener, bool _bForceBroadcast)
{
ImplInvalidateFeature( _nId, _xListener, _bForceBroadcast );
}
2001-01-09 14:43:04 +00:00
void OGenericUnoController::InvalidateAll()
{
ImplInvalidateFeature( ALL_FEATURES, NULL, true );
2001-01-09 14:43:04 +00:00
}
2001-01-09 14:43:04 +00:00
void OGenericUnoController::InvalidateAll_Impl()
{
2010-11-24 01:07:16 +00:00
// invalidate all supported features
for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
aIter != m_aSupportedFeatures.end();
++aIter
)
ImplBroadcastFeatureState( aIter->first, NULL, true );
2001-01-09 14:43:04 +00:00
{
::osl::MutexGuard aGuard( m_aFeatureMutex);
2011-02-03 00:33:36 +01:00
OSL_ENSURE(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!");
2001-01-09 14:43:04 +00:00
m_aFeaturesToInvalidate.pop_front();
if(!m_aFeaturesToInvalidate.empty())
m_aAsyncInvalidateAll.Call();
}
}
Reference< XDispatch > OGenericUnoController::queryDispatch(const URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
Reference< XDispatch > xReturn;
2001-01-09 14:43:04 +00:00
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::queryDispatch: shouldn't this be filled at construction time?" );
if ( m_aSupportedFeatures.empty() )
fillSupportedFeatures();
// URL's we can handle ourself?
if ( aURL.Complete.equals( getConfirmDeletionURL() )
2008-10-01 12:28:29 +00:00
|| ( ( m_aSupportedFeatures.find( aURL.Complete ) != m_aSupportedFeatures.end() )
&& !isUserDefinedFeature( aURL.Complete )
)
)
{
xReturn = this;
}
// no? -> ask the slave dispatcher
else if ( m_xSlaveDispatcher.is() )
{
xReturn = m_xSlaveDispatcher->queryDispatch(aURL, aTargetFrameName, nSearchFlags);
}
2001-01-09 14:43:04 +00:00
// outta here
return xReturn;
2001-01-09 14:43:04 +00:00
}
Sequence< Reference< XDispatch > > OGenericUnoController::queryDispatches(const Sequence< DispatchDescriptor >& aDescripts) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
Sequence< Reference< XDispatch > > aReturn;
sal_Int32 nLen = aDescripts.getLength();
if ( nLen )
{
aReturn.realloc( nLen );
Reference< XDispatch >* pReturn = aReturn.getArray();
const Reference< XDispatch >* pReturnEnd = aReturn.getArray() + nLen;
const DispatchDescriptor* pDescripts = aDescripts.getConstArray();
2001-01-09 14:43:04 +00:00
for ( ; pReturn != pReturnEnd; ++ pReturn, ++pDescripts )
{
*pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags );
}
}
2001-01-09 14:43:04 +00:00
return aReturn;
}
Reference< XDispatchProvider > OGenericUnoController::getSlaveDispatchProvider(void) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
return m_xSlaveDispatcher;
}
void OGenericUnoController::setSlaveDispatchProvider(const Reference< XDispatchProvider > & _xNewProvider) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
m_xSlaveDispatcher = _xNewProvider;
}
Reference< XDispatchProvider > OGenericUnoController::getMasterDispatchProvider(void) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
return m_xMasterDispatcher;
}
void OGenericUnoController::setMasterDispatchProvider(const Reference< XDispatchProvider > & _xNewProvider) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
m_xMasterDispatcher = _xNewProvider;
}
void OGenericUnoController::dispatch(const URL& _aURL, const Sequence< PropertyValue >& aArgs) throw(RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
SolarMutexGuard aSolarGuard;
2011-02-07 20:20:28 +01:00
// The SolarMutex is not locked anymore when the framework calls into
// here. So, lock it ourself. The real solution would be to lock it only in the places
// where it's needed, but a) this might turn out difficult, since we then also need to care
// for locking in the proper order (SolarMutex and m_aMutex), and b) this would be too many places
// for the time frame of the fix.
2011-02-27 22:55:22 +01:00
// #i52602#
executeChecked(_aURL,aArgs);
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::addStatusListener(const Reference< XStatusListener > & aListener, const URL& _rURL) throw(RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
2014-04-10 10:28:38 +02:00
// parse the URL now and here, this saves later parsing in each notification round
URL aParsedURL( _rURL );
if ( m_xUrlTransformer.is() )
m_xUrlTransformer->parseStrict( aParsedURL );
2010-11-24 01:07:16 +00:00
// remember the listener together with the URL
m_arrStatusListener.insert( m_arrStatusListener.end(), DispatchTarget( aParsedURL, aListener ) );
2001-01-09 14:43:04 +00:00
// initially broadcast the state
ImplBroadcastFeatureState( aParsedURL.Complete, aListener, true );
2010-11-24 01:07:16 +00:00
// force the new state to be broadcast to the new listener
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::removeStatusListener(const Reference< XStatusListener > & aListener, const URL& _rURL) throw(RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
Dispatch::iterator iterSearch = m_arrStatusListener.begin();
2001-01-09 14:43:04 +00:00
bool bRemoveForAll = _rURL.Complete.isEmpty();
while ( iterSearch != m_arrStatusListener.end() )
2001-01-09 14:43:04 +00:00
{
DispatchTarget& rCurrent = *iterSearch;
if ( (rCurrent.xListener == aListener)
&& ( bRemoveForAll
2001-04-24 13:36:44 +00:00
|| (rCurrent.aURL.Complete.equals(_rURL.Complete))
2001-01-09 14:43:04 +00:00
)
)
{
m_arrStatusListener.erase( iterSearch++ );
2001-01-09 14:43:04 +00:00
if (!bRemoveForAll)
// remove the listener only for the given URL, so we can exit the loop after deletion
2001-01-09 14:43:04 +00:00
break;
}
else
++iterSearch;
}
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::removeStatusListener: shouldn't this be filled at construction time?" );
if ( m_aSupportedFeatures.empty() )
fillSupportedFeatures();
2001-04-24 13:36:44 +00:00
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find(_rURL.Complete);
2001-01-09 14:43:04 +00:00
if (aIter != m_aSupportedFeatures.end())
{ // clear the cache for that feature
StateCache::iterator aCachePos = m_aStateCache.find( aIter->second.nFeatureId );
if ( aCachePos != m_aStateCache.end() )
m_aStateCache.erase( aCachePos );
2001-01-09 14:43:04 +00:00
}
// now remove the listener from the deque
2008-10-01 12:28:29 +00:00
::osl::MutexGuard aGuard( m_aFeatureMutex );
2001-08-27 05:57:24 +00:00
m_aFeaturesToInvalidate.erase(
::std::remove_if( m_aFeaturesToInvalidate.begin(),
m_aFeaturesToInvalidate.end(),
2008-10-01 12:28:29 +00:00
::std::bind2nd(FindFeatureListener(),aListener))
2001-08-27 05:57:24 +00:00
,m_aFeaturesToInvalidate.end());
2001-01-09 14:43:04 +00:00
}
2008-10-01 12:28:29 +00:00
void OGenericUnoController::releaseNumberForComponent()
{
try
{
Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
if ( xUntitledProvider.is() )
xUntitledProvider->releaseNumberForComponent(static_cast<XWeak*>(this));
}
catch( const Exception& )
{
// NII
}
}
2001-03-01 14:17:55 +00:00
void OGenericUnoController::disposing()
2001-01-09 14:43:04 +00:00
{
{
EventObject aDisposeEvent;
aDisposeEvent.Source = static_cast<XWeak*>(this);
Dispatch aStatusListener = m_arrStatusListener;
Dispatch::iterator aEnd = aStatusListener.end();
for (Dispatch::iterator aIter = aStatusListener.begin(); aIter != aEnd; ++aIter)
{
aIter->xListener->disposing(aDisposeEvent);
}
m_arrStatusListener.clear();
2001-01-09 14:43:04 +00:00
}
m_xDatabaseContext = NULL;
2001-01-09 14:43:04 +00:00
{
::osl::MutexGuard aGuard( m_aFeatureMutex);
m_aAsyncInvalidateAll.CancelCall();
2001-01-09 14:43:04 +00:00
m_aFeaturesToInvalidate.clear();
}
2008-10-01 12:28:29 +00:00
releaseNumberForComponent();
2001-01-09 14:43:04 +00:00
// check out from all the objects we are listening
// the frame
stopFrameListening( m_aCurrentFrame.getFrame() );
m_aCurrentFrame.attachFrame( NULL );
m_xMasterDispatcher = NULL;
m_xSlaveDispatcher = NULL;
2011-03-10 10:59:14 +01:00
m_xTitleHelper.clear();
m_xUrlTransformer.clear();
m_aInitParameters.clear();
2001-01-09 14:43:04 +00:00
}
void SAL_CALL OGenericUnoController::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
// disambiguate
OGenericUnoController_Base::WeakComponentImplHelperBase::addEventListener( xListener );
2001-01-09 14:43:04 +00:00
}
void SAL_CALL OGenericUnoController::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
// disambiguate
OGenericUnoController_Base::WeakComponentImplHelperBase::removeEventListener( xListener );
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::frameAction(const FrameActionEvent& aEvent) throw( RuntimeException, std::exception )
2001-01-09 14:43:04 +00:00
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
if ( aEvent.Frame == m_aCurrentFrame.getFrame() )
m_aCurrentFrame.frameAction( aEvent.Action );
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::implDescribeSupportedFeature( const sal_Char* _pAsciiCommandURL,
sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup )
2001-01-09 14:43:04 +00:00
{
#ifdef DBG_UTIL
2011-02-03 00:33:36 +01:00
OSL_ENSURE( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" );
#endif
OSL_PRECOND( _nFeatureId < FIRST_USER_DEFINED_FEATURE, "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" );
ControllerFeature aFeature;
aFeature.Command = OUString::createFromAscii( _pAsciiCommandURL );
aFeature.nFeatureId = _nFeatureId;
aFeature.GroupId = _nCommandGroup;
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( m_aSupportedFeatures.find( aFeature.Command ) == m_aSupportedFeatures.end(),
"OGenericUnoController::implDescribeSupportedFeature: this feature is already there!" );
#endif
m_aSupportedFeatures[ aFeature.Command ] = aFeature;
}
void OGenericUnoController::describeSupportedFeatures()
{
// add all supported features
implDescribeSupportedFeature( ".uno:Copy", ID_BROWSER_COPY, CommandGroup::EDIT );
implDescribeSupportedFeature( ".uno:Cut", ID_BROWSER_CUT, CommandGroup::EDIT );
implDescribeSupportedFeature( ".uno:Paste", ID_BROWSER_PASTE, CommandGroup::EDIT );
implDescribeSupportedFeature( ".uno:ClipboardFormatItems", ID_BROWSER_CLIPBOARD_FORMAT_ITEMS );
implDescribeSupportedFeature( ".uno:DSBEditDoc", ID_BROWSER_EDITDOC, CommandGroup::DOCUMENT );
2001-01-09 14:43:04 +00:00
}
2008-10-01 12:28:29 +00:00
FeatureState OGenericUnoController::GetState( sal_uInt16 _nId ) const
2001-01-09 14:43:04 +00:00
{
FeatureState aReturn;
// (disabled automatically)
2008-10-01 12:28:29 +00:00
switch ( _nId )
2001-01-09 14:43:04 +00:00
{
2008-10-01 12:28:29 +00:00
case ID_BROWSER_UNDO:
case ID_BROWSER_SAVEDOC:
aReturn.bEnabled = true;
2008-10-01 12:28:29 +00:00
break;
default:
aReturn = m_pData->m_aUserDefinedFeatures.getState( getURLForId( _nId ) );
break;
2001-01-09 14:43:04 +00:00
}
return aReturn;
}
void OGenericUnoController::Execute( sal_uInt16 _nId, const Sequence< PropertyValue>& _rArgs )
{
OSL_ENSURE( isUserDefinedFeature( _nId ),
"OGenericUnoController::Execute: responsible for user defined features only!" );
2008-10-01 12:28:29 +00:00
// user defined features can be handled by dispatch interceptors resp. protocol handlers only.
// So, we need to do a queryDispatch, and dispatch the URL
m_pData->m_aUserDefinedFeatures.execute( getURLForId( _nId ), _rArgs );
}
URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
2001-01-09 14:43:04 +00:00
{
URL aReturn;
if ( m_xUrlTransformer.is() )
2001-08-27 05:57:24 +00:00
{
SupportedFeatures::const_iterator aIter = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
2008-10-01 12:28:29 +00:00
::std::bind2nd( CompareFeatureById(), _nId )
);
if ( m_aSupportedFeatures.end() != aIter && !aIter->first.isEmpty() )
2001-01-09 14:43:04 +00:00
{
2001-08-27 05:57:24 +00:00
aReturn.Complete = aIter->first;
m_xUrlTransformer->parseStrict( aReturn );
2001-01-09 14:43:04 +00:00
}
2001-08-27 05:57:24 +00:00
}
2001-01-09 14:43:04 +00:00
return aReturn;
}
2008-10-01 12:28:29 +00:00
bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId ) const
{
return ( _nFeatureId >= FIRST_USER_DEFINED_FEATURE ) && ( _nFeatureId < LAST_USER_DEFINED_FEATURE );
}
bool OGenericUnoController::isUserDefinedFeature( const OUString& _rFeatureURL ) const
2008-10-01 12:28:29 +00:00
{
SupportedFeatures::const_iterator pos = m_aSupportedFeatures.find( _rFeatureURL );
OSL_PRECOND( pos != m_aSupportedFeatures.end(),
"OGenericUnoController::isUserDefinedFeature: this is no supported feature at all!" );
return ( pos != m_aSupportedFeatures.end() ) && isUserDefinedFeature( pos->second.nFeatureId );
2008-10-01 12:28:29 +00:00
}
sal_Bool SAL_CALL OGenericUnoController::supportsService(const OUString& ServiceName) throw(RuntimeException, std::exception)
2001-01-09 14:43:04 +00:00
{
return cppu::supportsService(this, ServiceName);
2001-01-09 14:43:04 +00:00
}
void OGenericUnoController::startConnectionListening(const Reference< XConnection >& _rxConnection)
2001-01-09 14:43:04 +00:00
{
// we have to remove ourself before dispoing the connection
Reference< XComponent > xComponent(_rxConnection, UNO_QUERY);
if (xComponent.is())
xComponent->addEventListener(static_cast<XFrameActionListener*>(this));
}
2001-01-09 14:43:04 +00:00
void OGenericUnoController::stopConnectionListening(const Reference< XConnection >& _rxConnection)
{
// we have to remove ourself before dispoing the connection
Reference< XComponent > xComponent(_rxConnection, UNO_QUERY);
if (xComponent.is())
xComponent->removeEventListener(static_cast<XFrameActionListener*>(this));
}
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
Reference< XConnection > OGenericUnoController::connect( const Reference< XDataSource>& _xDataSource,
::dbtools::SQLExceptionInfo* _pErrorInfo )
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
WaitObject aWaitCursor( getView() );
ODatasourceConnector aConnector( getORB(), getView(), OUString() );
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
Reference< XConnection > xConnection = aConnector.connect( _xDataSource, _pErrorInfo );
startConnectionListening( xConnection );
return xConnection;
}
Reference< XConnection > OGenericUnoController::connect( const OUString& _rDataSourceName,
const OUString& _rContextInformation, ::dbtools::SQLExceptionInfo* _pErrorInfo )
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
WaitObject aWaitCursor( getView() );
2001-01-09 14:43:04 +00:00
ODatasourceConnector aConnector( getORB(), getView(), _rContextInformation );
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
Reference<XConnection> xConnection = aConnector.connect( _rDataSourceName, _pErrorInfo );
startConnectionListening( xConnection );
return xConnection;
}
void OGenericUnoController::showError(const SQLExceptionInfo& _rInfo)
{
::dbaui::showError(_rInfo,getView(),getORB());
2001-01-09 14:43:04 +00:00
}
Reference< XLayoutManager > OGenericUnoController::getLayoutManager(const Reference< XFrame >& _xFrame) const
2001-04-24 13:36:44 +00:00
{
Reference< XPropertySet > xPropSet( _xFrame, UNO_QUERY );
Reference< XLayoutManager > xLayoutManager;
if ( xPropSet.is() )
{
try
{
xLayoutManager.set(xPropSet->getPropertyValue("LayoutManager"),UNO_QUERY);
}
catch ( Exception& )
{
}
}
return xLayoutManager;
}
void OGenericUnoController::loadMenu(const Reference< XFrame >& _xFrame)
{
Reference< XLayoutManager > xLayoutManager = getLayoutManager(_xFrame);
if ( xLayoutManager.is() )
{
xLayoutManager->lock();
xLayoutManager->createElement( OUString( "private:resource/menubar/menubar" ));
xLayoutManager->createElement( OUString( "private:resource/toolbar/toolbar" ));
xLayoutManager->unlock();
xLayoutManager->doLayout();
}
onLoadedMenu( xLayoutManager );
}
void OGenericUnoController::onLoadedMenu(const Reference< XLayoutManager >& /*_xLayoutManager*/)
{
// not interested in
2001-04-24 13:36:44 +00:00
}
2001-04-24 13:36:44 +00:00
void OGenericUnoController::closeTask()
{
2001-09-19 12:20:12 +00:00
m_aAsyncCloseTask.Call();
}
IMPL_LINK_NOARG(OGenericUnoController, OnAsyncCloseTask)
2001-09-19 12:20:12 +00:00
{
if ( !OGenericUnoController_Base::rBHelper.bInDispose )
2001-09-19 12:20:12 +00:00
{
2002-06-24 09:29:26 +00:00
try
{
Reference< util::XCloseable > xCloseable( m_aCurrentFrame.getFrame(), UNO_QUERY_THROW );
xCloseable->close( sal_False ); // false - holds the owner ship for this frame inside this object!
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
2001-09-19 12:20:12 +00:00
}
return 0L;
2001-04-24 13:36:44 +00:00
}
Any SAL_CALL OGenericUnoController::getViewData(void) throw( RuntimeException, std::exception )
{
return Any();
}
void SAL_CALL OGenericUnoController::restoreViewData(const Any& /*Data*/) throw( RuntimeException, std::exception )
{
}
Reference< XModel > SAL_CALL OGenericUnoController::getModel(void) throw( RuntimeException, std::exception )
{
return Reference< XModel >();
}
Reference< XFrame > SAL_CALL OGenericUnoController::getFrame(void) throw( RuntimeException, std::exception )
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
return m_aCurrentFrame.getFrame();
}
sal_Bool SAL_CALL OGenericUnoController::attachModel(const Reference< XModel > & /*xModel*/) throw( RuntimeException, std::exception )
{
SAL_WARN("dbaccess.ui", "OGenericUnoController::attachModel: not supported!" );
return sal_False;
}
void OGenericUnoController::executeUnChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
{
Execute(_nCommandId, aArgs);
}
void OGenericUnoController::executeUnChecked(const util::URL& _rCommand, const Sequence< PropertyValue >& aArgs)
2002-02-11 11:43:58 +00:00
{
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::executeUnChecked: shouldn't this be filled at construction time?" );
if ( m_aSupportedFeatures.empty() )
fillSupportedFeatures();
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCommand.Complete );
2002-02-11 11:43:58 +00:00
if (aIter != m_aSupportedFeatures.end())
Execute( aIter->second.nFeatureId, aArgs );
2002-02-11 11:43:58 +00:00
}
void OGenericUnoController::executeChecked(const util::URL& _rCommand, const Sequence< PropertyValue >& aArgs)
2002-02-11 11:43:58 +00:00
{
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::executeChecked: shouldn't this be filled at construction time?" );
if ( m_aSupportedFeatures.empty() )
fillSupportedFeatures();
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCommand.Complete );
if ( aIter != m_aSupportedFeatures.end() )
2002-02-11 11:43:58 +00:00
{
sal_uInt16 nFeatureId = aIter->second.nFeatureId;
if ( GetState( nFeatureId ).bEnabled )
Execute( nFeatureId, aArgs );
2002-02-11 11:43:58 +00:00
}
}
2002-08-26 06:52:15 +00:00
namespace
{
OUString lcl_getModuleHelpModuleName( const Reference< XFrame >& _rxFrame )
2002-08-26 06:52:15 +00:00
{
const sal_Char* pReturn = NULL;
try
{
// get the model of the document in the given frame
Reference< XController > xController;
if ( _rxFrame.is() )
xController = _rxFrame->getController();
Reference< XModel > xModel;
if ( xController.is() )
xModel = xController->getModel();
Reference< XServiceInfo > xSI( xModel, UNO_QUERY );
if ( !xSI.is() )
{ // try to go up the frame hierarchy
Reference< XFrame > xParentFrame;
if ( _rxFrame.is() )
xParentFrame.set(_rxFrame->getCreator(), css::uno::UNO_QUERY);
2002-08-26 06:52:15 +00:00
// did we find a parent frame? Which is no top-level frame?
if ( xParentFrame.is() && !_rxFrame->isTop() )
// TODO: to prevent framework assertions, re-insert this "isTop" once 98303 is fixed
return lcl_getModuleHelpModuleName( xParentFrame );
}
else
{
#if OSL_DEBUG_LEVEL > 0
Sequence< OUString > sServiceNames = xSI->getSupportedServiceNames();
const OUString* pLoop = sServiceNames.getConstArray();
2002-08-26 06:52:15 +00:00
for ( sal_Int32 i=0; i<sServiceNames.getLength(); ++i, ++pLoop )
{
sal_Int32 nDummy = 0;
(void)nDummy;
2002-08-26 06:52:15 +00:00
}
#endif
// check which service we know ....
static const sal_Char* pTransTable[] = {
"com.sun.star.sdb.OfficeDatabaseDocument","sdatabase",
"com.sun.star.report.ReportDefinition","sdatabase",
2002-08-26 06:52:15 +00:00
"com.sun.star.text.TextDocument", "swriter",
"com.sun.star.sheet.SpreadsheetDocument", "scalc",
"com.sun.star.presentation.PresentationDocument", "simpress",
"com.sun.star.drawing.DrawingDocument", "sdraw",
"com.sun.star.formula.FormularProperties", "smath",
"com.sun.star.chart.ChartDocument", "schart"
};
OSL_ENSURE( ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) % 2 == 0,
2002-08-26 06:52:15 +00:00
"lcl_getModuleHelpModuleName: odd size of translation table!" );
// loop through the table
sal_Int32 nTableEntries = ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) / 2;
2002-08-26 06:52:15 +00:00
const sal_Char** pDocumentService = pTransTable;
const sal_Char** pHelpModuleName = pTransTable + 1;
for ( sal_Int32 j=0; j<nTableEntries; ++j )
{
if ( xSI->supportsService( OUString::createFromAscii( *pDocumentService ) ) )
2002-08-26 06:52:15 +00:00
{ // found a table entry which matches the model's services
pReturn = *pHelpModuleName;
break;
}
++pDocumentService; ++pDocumentService;
++pHelpModuleName; ++pHelpModuleName;
}
}
if ( !pReturn )
{
// could not determine the document type we're living in
// ->fallback
SvtModuleOptions aModOpt;
if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
pReturn = "swriter";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) )
pReturn = "sdatabase";
2002-08-26 06:52:15 +00:00
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
pReturn = "scalc";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
pReturn = "simpress";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
pReturn = "sdraw";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
pReturn = "smath";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCHART ) )
pReturn = "schart";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SBASIC ) )
pReturn = "sbasic";
else
{
SAL_WARN("dbaccess.ui", "lcl_getModuleHelpModuleName: no installed module found" );
2002-08-26 06:52:15 +00:00
}
}
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
2002-08-26 06:52:15 +00:00
}
if ( !pReturn )
pReturn = "swriter";
return OUString::createFromAscii( pReturn );
2002-08-26 06:52:15 +00:00
}
}
void OGenericUnoController::openHelpAgent(OUString const& _suHelpStringURL )
{
OUString suURL(_suHelpStringURL);
OUString sLanguage( "Language=" );
if (suURL.indexOf(sLanguage) == -1)
{
AppendConfigToken(suURL, false /* sal_False := add '&' */ );
}
URL aURL;
aURL.Complete = suURL;
openHelpAgent( aURL );
}
void OGenericUnoController::openHelpAgent(const OString& _sHelpId)
{
openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _sHelpId ) );
}
void OGenericUnoController::openHelpAgent( const URL& _rURL )
{
try
{
URL aURL( _rURL );
if ( m_xUrlTransformer.is() )
m_xUrlTransformer->parseStrict(aURL);
Reference< XDispatchProvider > xDispProv( m_aCurrentFrame.getFrame(), UNO_QUERY );
2002-08-26 06:52:15 +00:00
Reference< XDispatch > xHelpDispatch;
if ( xDispProv.is() )
xHelpDispatch = xDispProv->queryDispatch(aURL, OUString( "_helpagent" ), FrameSearchFlag::PARENT | FrameSearchFlag::SELF);
2002-08-26 06:52:15 +00:00
OSL_ENSURE(xHelpDispatch.is(), "SbaTableQueryBrowser::openHelpAgent: could not get a dispatcher!");
if (xHelpDispatch.is())
{
xHelpDispatch->dispatch(aURL, Sequence< PropertyValue >());
}
}
catch( const Exception& )
2002-08-26 06:52:15 +00:00
{
DBG_UNHANDLED_EXCEPTION();
2002-08-26 06:52:15 +00:00
}
}
Reference< awt::XWindow> OGenericUnoController::getTopMostContainerWindow() const
{
Reference< ::com::sun::star::awt::XWindow> xWindow;
// get the top most window
Reference< XFrame > xFrame( m_aCurrentFrame.getFrame() );
if ( xFrame.is() )
{
xWindow = xFrame->getContainerWindow();
while ( xFrame.is() && !xFrame->isTop() )
{
xFrame.set( xFrame->getCreator(), UNO_QUERY );
}
if ( xFrame.is() )
xWindow = xFrame->getContainerWindow();
}
return xWindow;
}
Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw()
{
SolarMutexGuard aSolarGuard;
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
if ( ! m_xTitleHelper.is ())
{
Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
Reference< XController > xThis(static_cast< XController* >(this), UNO_QUERY_THROW);
::framework::TitleHelper* pHelper = new ::framework::TitleHelper( m_xContext );
m_xTitleHelper.set( static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW);
pHelper->setOwner (xThis );
pHelper->connectWithUntitledNumbers (xUntitledProvider);
}
return m_xTitleHelper;
}
// XTitle
OUString SAL_CALL OGenericUnoController::getTitle()
throw (RuntimeException, std::exception)
{
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
if ( m_bExternalTitle )
return impl_getTitleHelper_throw()->getTitle ();
return getPrivateTitle() + impl_getTitleHelper_throw()->getTitle ();
}
// XTitle
void SAL_CALL OGenericUnoController::setTitle(const OUString& sTitle)
throw (RuntimeException, std::exception)
{
SolarMutexGuard aSolarGuard;
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
::osl::MutexGuard aGuard( getMutex() );
m_bExternalTitle = true;
impl_getTitleHelper_throw()->setTitle (sTitle);
}
// XTitleChangeBroadcaster
void SAL_CALL OGenericUnoController::addTitleChangeListener(const Reference< XTitleChangeListener >& xListener)
throw (RuntimeException, std::exception)
{
Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), UNO_QUERY);
if (xBroadcaster.is ())
xBroadcaster->addTitleChangeListener (xListener);
}
void SAL_CALL OGenericUnoController::removeTitleChangeListener(const Reference< XTitleChangeListener >& xListener)
throw (RuntimeException, std::exception)
{
Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), UNO_QUERY);
if (xBroadcaster.is ())
xBroadcaster->removeTitleChangeListener (xListener);
}
// XUserInputInterception
void SAL_CALL OGenericUnoController::addKeyHandler( const Reference< XKeyHandler >& _rxHandler ) throw (RuntimeException, std::exception)
{
if ( _rxHandler.is() )
m_pData->m_aUserInputInterception.addKeyHandler( _rxHandler );
}
void SAL_CALL OGenericUnoController::removeKeyHandler( const Reference< XKeyHandler >& _rxHandler ) throw (RuntimeException, std::exception)
{
m_pData->m_aUserInputInterception.removeKeyHandler( _rxHandler );
}
void SAL_CALL OGenericUnoController::addMouseClickHandler( const Reference< XMouseClickHandler >& _rxHandler ) throw (RuntimeException, std::exception)
{
if ( _rxHandler.is() )
m_pData->m_aUserInputInterception.addMouseClickHandler( _rxHandler );
}
void SAL_CALL OGenericUnoController::removeMouseClickHandler( const Reference< XMouseClickHandler >& _rxHandler ) throw (RuntimeException, std::exception)
{
m_pData->m_aUserInputInterception.removeMouseClickHandler( _rxHandler );
}
void OGenericUnoController::executeChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
{
if ( isCommandEnabled(_nCommandId) )
Execute(_nCommandId, aArgs);
}
bool OGenericUnoController::isCommandEnabled(sal_uInt16 _nCommandId) const
{
return GetState( _nCommandId ).bEnabled;
}
sal_uInt16 OGenericUnoController::registerCommandURL( const OUString& _rCompleteCommandURL )
{
if ( _rCompleteCommandURL.isEmpty() )
return 0;
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCompleteCommandURL );
if ( aIter != m_aSupportedFeatures.end() )
return aIter->second.nFeatureId;
// this is a previously unkwnon command
sal_uInt16 nFeatureId = FIRST_USER_DEFINED_FEATURE;
while ( isFeatureSupported( nFeatureId ) && ( nFeatureId < LAST_USER_DEFINED_FEATURE ) )
++nFeatureId;
if ( nFeatureId == LAST_USER_DEFINED_FEATURE )
{
SAL_WARN("dbaccess.ui", "OGenericUnoController::registerCommandURL: no more space for user defined features!" );
return 0L;
}
ControllerFeature aFeature;
aFeature.Command = _rCompleteCommandURL;
aFeature.nFeatureId = nFeatureId;
aFeature.GroupId = CommandGroup::INTERNAL;
m_aSupportedFeatures[ aFeature.Command ] = aFeature;
return nFeatureId;
}
void OGenericUnoController::notifyHiContrastChanged()
{
}
bool OGenericUnoController::isDataSourceReadOnly() const
{
return false;
}
Reference< XController > OGenericUnoController::getXController() throw( RuntimeException )
{
return this;
}
bool OGenericUnoController::interceptUserInput( const NotifyEvent& _rEvent )
{
return m_pData->m_aUserInputInterception.handleNotifyEvent( _rEvent );
}
bool OGenericUnoController::isCommandChecked(sal_uInt16 _nCommandId) const
{
FeatureState aState = GetState( _nCommandId );
return aState.bChecked && *aState.bChecked;
}
bool OGenericUnoController::isCommandEnabled( const OUString& _rCompleteCommandURL ) const
{
OSL_ENSURE( !_rCompleteCommandURL.isEmpty(), "OGenericUnoController::isCommandEnabled: Empty command url!" );
bool bIsEnabled = false;
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCompleteCommandURL );
if ( aIter != m_aSupportedFeatures.end() )
bIsEnabled = isCommandEnabled( aIter->second.nFeatureId );
return bIsEnabled;
}
Sequence< ::sal_Int16 > SAL_CALL OGenericUnoController::getSupportedCommandGroups() throw (RuntimeException, std::exception)
{
CommandHashMap aCmdHashMap;
for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
aIter != m_aSupportedFeatures.end();
++aIter
)
if ( aIter->second.GroupId != CommandGroup::INTERNAL )
aCmdHashMap.insert( CommandHashMap::value_type( aIter->second.GroupId, 0 ));
Sequence< sal_Int16 > aCommandGroups( aCmdHashMap.size() );
::std::transform( aCmdHashMap.begin(),
aCmdHashMap.end(),
aCommandGroups.getArray(),
2011-02-08 19:44:44 +01:00
::o3tl::select1st< CommandHashMap::value_type >()
);
return aCommandGroups;
}
2010-11-23 15:43:42 +00:00
namespace
{
//Current c++0x draft (apparently) has std::identity, but not operator()
template<typename T> struct SGI_identity : public std::unary_function<T,T>
{
T& operator()(T& x) const { return x; }
const T& operator()(const T& x) const { return x; }
};
}
Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (RuntimeException, std::exception)
{
DispatchInfoList aInformationList;
DispatchInformation aDispatchInfo;
for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
aIter != m_aSupportedFeatures.end();
++aIter
)
{
if ( sal_Int16( aIter->second.GroupId ) == CommandGroup )
{
aDispatchInfo = aIter->second;
aInformationList.push_back( aDispatchInfo );
}
}
Sequence< DispatchInformation > aInformation( aInformationList.size() );
::std::transform( aInformationList.begin(),
aInformationList.end(),
aInformation.getArray(),
2010-11-23 15:43:42 +00:00
SGI_identity< DispatchInformation >()
);
return aInformation;
}
void OGenericUnoController::fillSupportedFeatures()
{
#ifdef DBG_UTIL
m_bDescribingSupportedFeatures = true;
#endif
describeSupportedFeatures();
#ifdef DBG_UTIL
m_bDescribingSupportedFeatures = false;
#endif
}
void SAL_CALL OGenericUnoController::dispose() throw(::com::sun::star::uno::RuntimeException, std::exception)
{
SolarMutexGuard aSolarGuard;
OGenericUnoController_Base::dispose();
}
2008-06-26 10:43:10 +00:00
} // namespace dbaui
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */