2001-01-09 14:43:04 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:07:57 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
2008-04-10 13:07:57 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
2008-04-10 13:07:57 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
2008-04-10 13:07:57 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
2008-04-10 13:07:57 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
2008-04-10 13:07:57 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-01-09 14:43:04 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2006-09-17 05:58:43 +00:00
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_dbaccess.hxx"
|
2001-01-09 14:43:04 +00:00
|
|
|
#ifndef DBAUI_GENERICCONTROLLER_HXX
|
|
|
|
#include "genericcontroller.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _COMPHELPER_UNO3_HXX_
|
|
|
|
#include <comphelper/uno3.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_
|
|
|
|
#include <toolkit/awt/vclxwindow.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef DBACCESS_UI_BROWSER_ID_HXX
|
|
|
|
#include "browserids.hxx"
|
|
|
|
#endif
|
2004-08-02 14:34:22 +00:00
|
|
|
#ifndef _SV_SVAPP_HXX //autogen
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#endif
|
2001-04-23 08:30:31 +00:00
|
|
|
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
|
|
|
|
#include <toolkit/helper/vclunohelper.hxx>
|
|
|
|
#endif
|
2001-01-09 14:43:04 +00:00
|
|
|
#ifndef DBAUI_DATAVIEW_HXX
|
|
|
|
#include "dataview.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _TOOLS_DEBUG_HXX
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#endif
|
2006-06-20 01:58:07 +00:00
|
|
|
#ifndef TOOLS_DIAGNOSE_EX_H
|
|
|
|
#include <tools/diagnose_ex.h>
|
|
|
|
#endif
|
2001-01-09 14:43:04 +00:00
|
|
|
#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
|
|
|
|
#include "dbustrings.hrc"
|
|
|
|
#endif
|
|
|
|
#ifndef _VCL_STDTEXT_HXX
|
|
|
|
#include <vcl/stdtext.hxx>
|
|
|
|
#endif
|
2001-06-21 16:51:14 +00:00
|
|
|
#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
|
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
|
|
|
#endif
|
2008-04-04 13:56:57 +00:00
|
|
|
#include <framework/titlehelper.hxx>
|
2001-06-21 16:51:14 +00:00
|
|
|
#ifndef _COMPHELPER_SEQUENCE_HXX_
|
|
|
|
#include <comphelper/sequence.hxx>
|
|
|
|
#endif
|
2001-03-15 07:29:16 +00:00
|
|
|
#ifndef _COMPHELPER_EXTRACT_HXX_
|
|
|
|
#include <comphelper/extract.hxx>
|
2001-01-09 14:43:04 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
|
|
|
|
#include <com/sun/star/sdbc/XDataSource.hpp>
|
|
|
|
#endif
|
2001-02-27 14:11:05 +00:00
|
|
|
#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
|
|
|
|
#include <com/sun/star/sdb/SQLContext.hpp>
|
|
|
|
#endif
|
2001-01-09 14:43:04 +00:00
|
|
|
#ifndef _COM_SUN_STAR_SDB_XCOMPLETEDCONNECTION_HPP_
|
|
|
|
#include <com/sun/star/sdb/XCompletedConnection.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_
|
|
|
|
#include <com/sun/star/task/XInteractionHandler.hpp>
|
|
|
|
#endif
|
2002-06-26 07:17:57 +00:00
|
|
|
#ifndef _COM_SUN_STAR_UTIL_XCLOSEABLE_HPP_
|
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
|
|
|
#endif
|
2001-02-23 14:17:34 +00:00
|
|
|
#ifndef DBAUI_TOOLS_HXX
|
|
|
|
#include "UITools.hxx"
|
2001-01-09 14:43:04 +00:00
|
|
|
#endif
|
2004-11-16 13:31:01 +00:00
|
|
|
#ifndef _DBAUI_COMMON_TYPES_HXX_
|
|
|
|
#include "commontypes.hxx"
|
|
|
|
#endif
|
|
|
|
|
2001-03-30 12:04:24 +00:00
|
|
|
#ifndef _SV_WAITOBJ_HXX
|
|
|
|
#include <vcl/waitobj.hxx>
|
|
|
|
#endif
|
2001-04-24 13:36:44 +00:00
|
|
|
#ifndef _URLOBJ_HXX
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef SVTOOLS_URIHELPER_HXX
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/urihelper.hxx>
|
2001-04-24 13:36:44 +00:00
|
|
|
#endif
|
2001-05-10 11:25:36 +00:00
|
|
|
#ifndef _DBAUI_DATASOURCECONNECTOR_HXX_
|
|
|
|
#include "datasourceconnector.hxx"
|
|
|
|
#endif
|
2002-08-26 06:52:15 +00:00
|
|
|
#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/moduleoptions.hxx>
|
2002-08-26 06:52:15 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
|
|
|
|
#include <com/sun/star/frame/FrameSearchFlag.hpp>
|
|
|
|
#endif
|
2008-03-06 17:14:19 +00:00
|
|
|
#ifndef _COM_SUN_STAR_FRAME_STATUS_VISIBILITY_HPP_
|
2008-03-05 16:08:08 +00:00
|
|
|
#include <com/sun/star/frame/status/Visibility.hpp>
|
2008-03-06 17:14:19 +00:00
|
|
|
#endif
|
2004-08-02 14:34:22 +00:00
|
|
|
#ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_
|
|
|
|
#include <com/sun/star/util/XModifiable.hpp>
|
|
|
|
#endif
|
2004-02-25 14:32:25 +00:00
|
|
|
#ifndef _RTL_USTRING_HXX_
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#endif
|
2006-08-15 09:49:24 +00:00
|
|
|
#ifndef _RTL_LOGFILE_HXX_
|
|
|
|
#include <rtl/logfile.hxx>
|
|
|
|
#endif
|
2001-10-26 12:10:16 +00:00
|
|
|
#include <algorithm>
|
2007-01-29 14:47:50 +00:00
|
|
|
#include <hash_map>
|
2008-06-16 11:33:12 +00:00
|
|
|
#include <cppuhelper/implbase1.hxx>
|
2008-06-25 13:02:57 +00:00
|
|
|
#include <limits>
|
2001-10-26 12:10:16 +00:00
|
|
|
|
2008-03-05 15:52:59 +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;
|
2008-03-05 16:08:08 +00:00
|
|
|
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;
|
2008-04-04 13:56:57 +00:00
|
|
|
using namespace ::com::sun::star;
|
2001-01-09 14:43:04 +00:00
|
|
|
using namespace ::dbtools;
|
|
|
|
using namespace ::comphelper;
|
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
// -------------------------------------------------------------------------
|
2008-06-25 13:02:57 +00:00
|
|
|
#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() )
|
2002-01-24 16:43:35 +00:00
|
|
|
|
2004-11-16 13:31:01 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
typedef ::std::hash_map< sal_Int16, sal_Int16 > CommandHashMap;
|
|
|
|
typedef ::std::list< DispatchInformation > DispatchInfoList;
|
|
|
|
|
2008-06-16 11:33:12 +00:00
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
const ::rtl::OUString& getConfirmDeletionURL()
|
|
|
|
{
|
|
|
|
static const ::rtl::OUString sConfirmDeletionURL( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ConfirmDeletion" ) );
|
|
|
|
return sConfirmDeletionURL;
|
|
|
|
}
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//= UserDefinedFeatures
|
|
|
|
//==========================================================================
|
|
|
|
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 = sal_True;
|
|
|
|
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,
|
|
|
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ),
|
|
|
|
FrameSearchFlag::AUTO
|
|
|
|
) );
|
|
|
|
|
|
|
|
if ( xDispatch == xController )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( false, "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" );
|
|
|
|
xDispatch.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( xDispatch.is() )
|
|
|
|
xDispatch->dispatch( _rFeatureURL, _rArgs );
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
//==========================================================================
|
|
|
|
//= OGenericUnoController_Data
|
|
|
|
//==========================================================================
|
|
|
|
struct OGenericUnoController_Data
|
|
|
|
{
|
|
|
|
::sfx2::UserInputInterception m_aUserInputInterception;
|
2008-10-01 12:28:29 +00:00
|
|
|
UserDefinedFeatures m_aUserDefinedFeatures;
|
2008-06-25 13:02:57 +00:00
|
|
|
|
|
|
|
OGenericUnoController_Data( OGenericUnoController& _rController, ::osl::Mutex& _rMutex )
|
|
|
|
:m_aUserInputInterception( _rController, _rMutex )
|
2008-10-01 12:28:29 +00:00
|
|
|
,m_aUserDefinedFeatures( _rController.getXController() )
|
2008-06-25 13:02:57 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//= OGenericUnoController
|
|
|
|
//==========================================================================
|
2005-09-23 11:21:38 +00:00
|
|
|
DBG_NAME(OGenericUnoController)
|
2001-01-09 14:43:04 +00:00
|
|
|
// -------------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFactory >& _rM)
|
2008-12-01 12:31:27 +00:00
|
|
|
:OGenericUnoController_Base( getMutex() )
|
2010-02-09 17:26:40 +01:00
|
|
|
,m_pView(NULL)
|
2006-06-20 01:58:07 +00:00
|
|
|
#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))
|
2007-07-06 07:04:34 +00:00
|
|
|
,m_xServiceFactory(_rM)
|
2008-03-06 17:14:19 +00:00
|
|
|
,m_aCurrentFrame( *this )
|
2005-01-05 11:33:47 +00:00
|
|
|
,m_bPreview(sal_False)
|
|
|
|
,m_bReadOnly(sal_False)
|
2006-06-20 01:58:07 +00:00
|
|
|
,m_bCurrentlyModified(sal_False)
|
2008-04-04 13:56:57 +00:00
|
|
|
,m_bExternalTitle(sal_False)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2008-10-01 12:28:29 +00:00
|
|
|
osl_incrementInterlockedCount( &m_refCount );
|
|
|
|
{
|
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_decrementInterlockedCount( &m_refCount );
|
|
|
|
|
2005-09-23 11:21:38 +00:00
|
|
|
DBG_CTOR(OGenericUnoController,NULL);
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
try
|
|
|
|
{
|
2002-01-24 16:43:35 +00:00
|
|
|
m_xUrlTransformer = Reference< XURLTransformer > (_rM->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), UNO_QUERY);
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
}
|
2004-11-16 13:31:01 +00:00
|
|
|
|
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test
2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test
2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ...
2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in
2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs)
2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing
2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing
2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript
2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test
2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test
2009-11-03 14:25:44 +0000 fs r277324 : #i10000#
2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs
2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ...
2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM)
2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion
2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense
2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE
2009-10-21 07:08:35 +0000 fs r277075 : spare useless call
2009-10-20 21:26:31 +0000 fs r277072 : #i10000#
2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62)
2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch
2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks.
2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk)
2009-10-15 12:52:39 +0000 fs r276939 : #i10000#
2009-10-15 12:44:26 +0000 fs r276938 : #i10000#
2009-10-15 12:00:33 +0000 fs r276936 : #i10000#
2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg
2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const
2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#:
introduce an option to the layout manager to preserve, if possible, the size of the content window
when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing.
(the option is incompatible with in-place editing, anyway)
This is because such embedded objects couple the (content) window size to the VisAreaSize, in that
both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize,
and restores it upon next open. This, however, leads to different content window sizes when the
window is closed with another toolbar set than used during opening.
This patch here prevents those different content window sizes. Also, now the content window size
doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content
window size stays the same, and the container window size is adjusted.
2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows
2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable)
2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows
2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service
2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist
2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified
2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command
2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 12:59:17 +0000 fs r276754 : #i87693#
2009-10-07 11:19:22 +0000 fs r276752 : #i10000#
2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller)
2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion
2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release:
when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing
the ref count, again. This ensures that our adapter cannot create references to the dying object anymore.
(A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous
release/dispose/destroy pattern, namely WeakComponentImplHelperBase)
2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying
2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool)
2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked
2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails
2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet
revealed some inconsistencies, in whether the objects are cached by their URL, or by their
registration name. This has been changed to caching by registration name.
2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case
2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed
2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable
(timing-dependent) results/failures. Instead, every test sets up a new odb file.
Also, did some re-factoring, improved the cleanup code, and caught a few more errors.
2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now
2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose
2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now
2009-10-06 12:49:22 +0000 fs r276707 : typo
2009-10-06 12:49:03 +0000 fs r276706 : typo
2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class
2009-10-06 12:48:02 +0000 fs r276704 : typo
2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably
2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence
2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope
2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create
2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope
2009-10-05 09:46:17 +0000 fs r276671 : #i10000#
2009-10-05 08:43:58 +0000 fs r276664 : #i105505#
release: dispose the (base classes) weak connection point before disposing ourself,
and in particular before temporarily incrementing our ref count, again.
This way, we prevent that a separate thread re-surrects us (using the weak connection
point's queryAdapted) while we're in the process of destruction
2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release)
2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead
2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics
2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants
2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign
2009-10-04 19:53:30 +0000 fs r276657 : #105560#
remove unused code
thanks to cmc@openoffice.org for submitting the patch
2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc)
2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60)
2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ...
2009-10-02 10:52:24 +0000 fs r276634 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes
2009-10-01 09:12:20 +0000 fs r276582 : #i105505#
2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion
2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods
2009-09-30 06:35:59 +0000 fs r276538 : #i10000#
2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113#
2009-09-29 10:27:10 +0000 fs r276520 : #i105367#
2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles
2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc
2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE...
2009-09-28 20:53:36 +0000 fs r276503 : #i104117#
cleaned up the mess with help IDs in module extensions.
Formerly, extensions used to use help IDs which were declared in module svx, and vice versa.
Also, help ID ranges were not respected.
2009-09-28 11:25:36 +0000 fs r276489 : typo
2009-09-28 11:25:10 +0000 fs r276488 : #i105235#
2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar
2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-16 11:11:43 +0000 fs r276195 : #i105082#
consolidated the sub storage handling, by delegating more functionality into
the DocumentStorageAccess class. As a result, there won't be that many unnecessary
commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages
and DocumentStorageAccess::m_aExposedStorages) have been consolidated.
This is not really part of the fix of issue 105082, but it helped reducing the
calls to the storage/package implementation.
2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures)
2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved
2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error
2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS
2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models
2009-09-14 10:33:02 +0000 fs r276106 : removed dead file
2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor
2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text
2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
|
|
|
#ifdef WNT
|
2008-03-06 17:14:19 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
OGenericUnoController::OGenericUnoController()
|
2008-12-01 12:31:27 +00:00
|
|
|
:OGenericUnoController_Base( getMutex() )
|
2010-02-09 17:26:40 +01:00
|
|
|
,m_pView(NULL)
|
2008-03-06 17:14:19 +00:00
|
|
|
#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)
|
|
|
|
{
|
|
|
|
OSL_ENSURE( false, "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();
|
|
|
|
}
|
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
|
2008-03-06 17:14:19 +00:00
|
|
|
|
2004-11-16 13:31:01 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
OGenericUnoController::~OGenericUnoController()
|
|
|
|
{
|
2005-09-23 11:21:38 +00:00
|
|
|
|
|
|
|
DBG_DTOR(OGenericUnoController,NULL);
|
2004-11-16 13:31:01 +00:00
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 01:58:07 +00:00
|
|
|
sal_Bool OGenericUnoController::Construct(Window* /*pParent*/)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2001-08-23 13:46:27 +00:00
|
|
|
OSL_ENSURE( getView(), "the view is NULL!" );
|
|
|
|
|
|
|
|
if ( getView() )
|
|
|
|
{
|
|
|
|
getView()->Construct();
|
|
|
|
getView()->Show();
|
|
|
|
}
|
|
|
|
|
2005-03-10 15:45:35 +00:00
|
|
|
m_aSupportedFeatures.clear();
|
2007-07-06 07:04:34 +00:00
|
|
|
fillSupportedFeatures();
|
2001-01-09 14:43:04 +00:00
|
|
|
|
|
|
|
// create the database context
|
2007-07-06 07:04:34 +00:00
|
|
|
DBG_ASSERT(getORB().is(), "OGenericUnoController::Construct need a service factory!");
|
2001-01-09 14:43:04 +00:00
|
|
|
try
|
|
|
|
{
|
2007-07-06 07:04:34 +00:00
|
|
|
m_xDatabaseContext = Reference< XNameAccess >(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY);
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
2001-06-21 16:51:14 +00:00
|
|
|
DBG_ERROR("OGenericUnoController::Construct: could not create (or start listening at) the database context!");
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!m_xDatabaseContext.is())
|
|
|
|
{ // at least notify the user. Though the whole component does not make any sense without the database context ...
|
|
|
|
ShowServiceNotAvailableError(getView(), String(SERVICE_SDB_DATABASECONTEXT), sal_True);
|
|
|
|
}
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
IMPL_LINK(OGenericUnoController, OnAsyncInvalidateAll, void*, EMPTYARG)
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( !OGenericUnoController_Base::rBHelper.bInDispose && !OGenericUnoController_Base::rBHelper.bDisposed )
|
2001-05-22 07:51:23 +00:00
|
|
|
InvalidateFeature_Impl();
|
2001-01-09 14:43:04 +00:00
|
|
|
return 0L;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2006-07-10 14:23:57 +00:00
|
|
|
void OGenericUnoController::impl_initialize()
|
2004-08-02 14:34:22 +00:00
|
|
|
{
|
|
|
|
}
|
2001-01-09 14:43:04 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException)
|
|
|
|
{
|
2004-08-02 14:34:22 +00:00
|
|
|
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2005-03-10 15:45:35 +00:00
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
Reference< XWindow > xParent;
|
|
|
|
Reference< XFrame > xFrame;
|
2001-01-09 14:43:04 +00:00
|
|
|
|
|
|
|
PropertyValue aValue;
|
2005-01-05 11:33:47 +00:00
|
|
|
const Any* pIter = aArguments.getConstArray();
|
|
|
|
const Any* pEnd = pIter + aArguments.getLength();
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2005-01-05 11:33:47 +00:00
|
|
|
for ( ; pIter != pEnd; ++pIter )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2005-01-05 11:33:47 +00:00
|
|
|
if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "Frame" ) ) )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2005-09-23 11:21:38 +00:00
|
|
|
xFrame.set(aValue.Value,UNO_QUERY_THROW);
|
2005-01-05 11:33:47 +00:00
|
|
|
}
|
2005-02-09 14:18:26 +00:00
|
|
|
/* #i42316#
|
2005-01-05 11:33:47 +00:00
|
|
|
else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "ReadOnly" ) ) )
|
|
|
|
{
|
|
|
|
aValue.Value >>= m_bReadOnly;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2005-02-09 14:18:26 +00:00
|
|
|
*/
|
2005-01-05 11:33:47 +00:00
|
|
|
else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "Preview" ) ) )
|
|
|
|
{
|
|
|
|
aValue.Value >>= m_bPreview;
|
2005-02-09 14:18:26 +00:00
|
|
|
m_bReadOnly = sal_True;
|
2005-01-05 11:33:47 +00:00
|
|
|
}
|
|
|
|
}
|
2005-03-10 15:45:35 +00:00
|
|
|
try
|
2005-01-05 11:33:47 +00:00
|
|
|
{
|
2008-06-06 13:08:24 +00:00
|
|
|
if ( !xFrame.is() )
|
|
|
|
throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "need a frame" ) ), *this, 1 );
|
|
|
|
|
|
|
|
xParent = xFrame->getContainerWindow();
|
|
|
|
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation(xParent);
|
|
|
|
Window* pParentWin = pParentComponent ? pParentComponent->GetWindow() : NULL;
|
|
|
|
if (!pParentWin)
|
2005-03-10 15:45:35 +00:00
|
|
|
{
|
2008-06-06 13:08:24 +00:00
|
|
|
throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "Parent window is null" ), *this, 1 );
|
2005-03-10 15:45:35 +00:00
|
|
|
}
|
2008-06-06 13:08:24 +00:00
|
|
|
|
|
|
|
m_aInitParameters.assign( aArguments );
|
|
|
|
Construct( pParentWin );
|
|
|
|
|
2005-03-10 15:45:35 +00:00
|
|
|
ODataView* pView = getView();
|
2008-06-06 13:08:24 +00:00
|
|
|
if ( !pView )
|
|
|
|
throw RuntimeException( ::rtl::OUString::createFromAscii( "unable to create a view" ), *this );
|
|
|
|
|
|
|
|
if ( m_bReadOnly || m_bPreview )
|
|
|
|
pView->EnableInput( FALSE );
|
2006-07-10 14:23:57 +00:00
|
|
|
|
|
|
|
impl_initialize();
|
2005-01-05 11:33:47 +00:00
|
|
|
}
|
2005-03-10 15:45:35 +00:00
|
|
|
catch(Exception& e)
|
2005-01-05 11:33:47 +00:00
|
|
|
{
|
2005-03-10 15:45:35 +00:00
|
|
|
// no one clears my view if I won't
|
|
|
|
::std::auto_ptr<Window> aTemp(m_pView);
|
|
|
|
m_pView = NULL;
|
2010-02-09 17:26:40 +01:00
|
|
|
throw;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
}
|
2001-06-21 16:51:14 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::acquire( ) throw ()
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
OGenericUnoController_Base::acquire();
|
2001-06-21 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::release( ) throw ()
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
OGenericUnoController_Base::release();
|
2001-06-21 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
// -------------------------------------------------------------------------
|
2008-03-06 17:14:19 +00:00
|
|
|
void OGenericUnoController::startFrameListening( const Reference< XFrame >& _rxFrame )
|
2002-01-24 16:43:35 +00:00
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( _rxFrame.is() )
|
|
|
|
_rxFrame->addFrameActionListener( this );
|
2002-01-24 16:43:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
2008-03-06 17:14:19 +00:00
|
|
|
void OGenericUnoController::stopFrameListening( const Reference< XFrame >& _rxFrame )
|
2002-01-24 16:43:35 +00:00
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( _rxFrame.is() )
|
|
|
|
_rxFrame->removeFrameActionListener( this );
|
2002-01-24 16:43:35 +00:00
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::disposing(const EventObject& Source) throw( RuntimeException )
|
|
|
|
{
|
|
|
|
// our frame ?
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( Source.Source == getFrame() )
|
|
|
|
stopFrameListening( getFrame() );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::modified(const EventObject& aEvent) throw( RuntimeException )
|
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2004-08-02 14:34:22 +00:00
|
|
|
if ( !isDataSourceReadOnly() )
|
|
|
|
{
|
|
|
|
Reference<XModifiable> xModi(aEvent.Source,UNO_QUERY);
|
|
|
|
if ( xModi.is() )
|
2005-01-21 16:09:05 +00:00
|
|
|
m_bCurrentlyModified = xModi->isModified(); // can only be reset by save
|
2004-08-02 14:34:22 +00:00
|
|
|
else
|
|
|
|
m_bCurrentlyModified = sal_True;
|
|
|
|
}
|
2002-01-24 16:43:35 +00:00
|
|
|
InvalidateFeature(ID_BROWSER_SAVEDOC);
|
2001-01-09 14:43:04 +00:00
|
|
|
InvalidateFeature(ID_BROWSER_UNDO);
|
|
|
|
}
|
2008-06-06 13:08:24 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
Reference< XWindow > SAL_CALL OGenericUnoController::getComponentWindow() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return VCLUnoHelper::GetInterface( getView() );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
::rtl::OUString SAL_CALL OGenericUnoController::getViewControllerName() throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) );
|
|
|
|
}
|
|
|
|
|
2009-12-11 11:28:14 +01:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
Sequence< PropertyValue > SAL_CALL OGenericUnoController::getCreationArguments() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
// 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 >();
|
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------
|
2008-03-06 17:14:19 +00:00
|
|
|
void OGenericUnoController::attachFrame( const Reference< XFrame >& _rxFrame ) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2007-09-26 13:48:32 +00:00
|
|
|
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
stopFrameListening( m_aCurrentFrame.getFrame() );
|
|
|
|
Reference< XFrame > xFrame = m_aCurrentFrame.attachFrame( _rxFrame );
|
2008-04-08 11:46:07 +00:00
|
|
|
startFrameListening( xFrame );
|
2002-01-24 16:43:35 +00:00
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
loadMenu( xFrame );
|
|
|
|
|
2004-11-17 13:47:54 +00:00
|
|
|
if ( getView() )
|
2008-03-06 17:14:19 +00:00
|
|
|
getView()->attachFrame( xFrame );
|
2004-08-02 14:34:22 +00:00
|
|
|
}
|
2008-03-06 17:14:19 +00:00
|
|
|
|
2004-09-09 08:41:47 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2004-11-16 13:31:01 +00:00
|
|
|
struct CommandCollector : public ::std::unary_function< SupportedFeatures::value_type, void>
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2004-11-16 13:31:01 +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
|
|
|
|
2004-11-16 13:31:01 +00:00
|
|
|
void operator() ( const SupportedFeatures::value_type& lhs )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2004-11-16 13:31:01 +00:00
|
|
|
if ( lhs.second.nFeatureId == m_nFeature )
|
|
|
|
m_rFeatureCommands.insert( lhs.first );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2004-09-09 08:41:47 +00:00
|
|
|
};
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2006-07-10 14:23:57 +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 )
|
|
|
|
{
|
2006-08-11 16:16:41 +00:00
|
|
|
// 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
|
|
|
|
// 2006-08-07 / frank.schoenheit@sun.com
|
2006-07-10 14:23:57 +00:00
|
|
|
if ( !!_rFeatureState.sTitle )
|
|
|
|
_out_rStates.push_back( makeAny( *_rFeatureState.sTitle ) );
|
2006-08-11 16:16:41 +00:00
|
|
|
if ( !!_rFeatureState.bChecked )
|
|
|
|
_out_rStates.push_back( makeAny( (sal_Bool)*_rFeatureState.bChecked ) );
|
2008-03-05 16:08:08 +00:00
|
|
|
if ( !!_rFeatureState.bInvisible )
|
|
|
|
_out_rStates.push_back( makeAny( Visibility( !*_rFeatureState.bInvisible ) ) );
|
2007-07-06 07:04:34 +00:00
|
|
|
if ( _rFeatureState.aValue.hasValue() )
|
|
|
|
_out_rStates.push_back( _rFeatureState.aValue );
|
2006-07-10 14:23:57 +00:00
|
|
|
if ( _out_rStates.empty() )
|
|
|
|
_out_rStates.push_back( Any() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::ImplBroadcastFeatureState(const ::rtl::OUString& _rFeature, const Reference< XStatusListener > & xListener, sal_Bool _bIgnoreCache)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2004-11-16 13:31:01 +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 neccessary
|
2006-07-10 14:23:57 +00:00
|
|
|
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
|
2006-07-10 14:23:57 +00:00
|
|
|
sal_Bool bAlreadyCached = ( m_aStateCache.find(nFeat) != m_aStateCache.end() );
|
|
|
|
if ( bAlreadyCached )
|
|
|
|
if ( ( rCachedState.bEnabled == aFeatState.bEnabled )
|
|
|
|
&& ( rCachedState.bChecked == aFeatState.bChecked )
|
2008-03-05 16:08:08 +00:00
|
|
|
&& ( rCachedState.bInvisible == aFeatState.bInvisible )
|
2006-07-10 14:23:57 +00:00
|
|
|
&& ( rCachedState.sTitle == aFeatState.sTitle )
|
|
|
|
)
|
|
|
|
return;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
rCachedState = aFeatState;
|
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
FeatureStateEvent aEvent;
|
2001-01-09 14:43:04 +00:00
|
|
|
aEvent.FeatureURL.Complete = _rFeature;
|
|
|
|
if (m_xUrlTransformer.is())
|
|
|
|
m_xUrlTransformer->parseStrict(aEvent.FeatureURL);
|
2002-01-24 16:43:35 +00:00
|
|
|
aEvent.Source = (XDispatch*)this;
|
2001-01-09 14:43:04 +00:00
|
|
|
aEvent.IsEnabled = aFeatState.bEnabled;
|
2006-07-10 14:23:57 +00:00
|
|
|
|
|
|
|
// collect all states to be notified
|
|
|
|
States aStates;
|
|
|
|
lcl_collectStates( aFeatState, aStates );
|
2001-01-09 14:43:04 +00:00
|
|
|
|
|
|
|
// a special listener ?
|
2006-07-10 14:23:57 +00:00
|
|
|
if ( xListener.is() )
|
|
|
|
lcl_notifyMultipleStates( *xListener.get(), aEvent, aStates );
|
2001-01-09 14:43:04 +00:00
|
|
|
else
|
2002-01-24 16:43:35 +00:00
|
|
|
{ // no -> iterate through all listeners responsible for the URL
|
2004-11-16 13:31:01 +00:00
|
|
|
StringBag aFeatureCommands;
|
|
|
|
::std::for_each(
|
|
|
|
m_aSupportedFeatures.begin(),
|
|
|
|
m_aSupportedFeatures.end(),
|
|
|
|
CommandCollector( nFeat, aFeatureCommands )
|
|
|
|
);
|
2004-09-09 08:41:47 +00:00
|
|
|
|
2005-07-08 09:38:35 +00:00
|
|
|
// 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
|
|
|
|
// #121276# / 2005-05-19 / frank.schoenheit@sun.com
|
|
|
|
Dispatch aNotifyLoop( m_arrStatusListener );
|
|
|
|
DispatchIterator iterSearch = aNotifyLoop.begin();
|
|
|
|
DispatchIterator iterEnd = aNotifyLoop.end();
|
2001-01-09 14:43:04 +00:00
|
|
|
|
|
|
|
while (iterSearch != iterEnd)
|
|
|
|
{
|
|
|
|
DispatchTarget& rCurrent = *iterSearch;
|
2004-11-16 13:31:01 +00:00
|
|
|
if ( aFeatureCommands.find( rCurrent.aURL.Complete ) != aFeatureCommands.end() )
|
2004-09-09 08:41:47 +00:00
|
|
|
{
|
2006-07-10 14:23:57 +00:00
|
|
|
aEvent.FeatureURL = rCurrent.aURL;
|
|
|
|
lcl_notifyMultipleStates( *rCurrent.xListener.get(), aEvent, aStates );
|
2004-09-09 08:41:47 +00:00
|
|
|
}
|
2001-01-09 14:43:04 +00:00
|
|
|
++iterSearch;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-03-10 15:45:35 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
sal_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 )
|
2005-03-10 15:45:35 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
return ( m_aSupportedFeatures.end() != aFeaturePos && aFeaturePos->first.getLength());
|
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::InvalidateFeature(const ::rtl::OUString& _rURLPath, const Reference< XStatusListener > & _xListener, sal_Bool _bForceBroadcast)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2004-11-16 13:31:01 +00:00
|
|
|
ImplInvalidateFeature( m_aSupportedFeatures[ _rURLPath ].nFeatureId, _xListener, _bForceBroadcast );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2002-01-24 16:43:35 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::InvalidateFeature_Impl()
|
|
|
|
{
|
2001-02-19 11:07:30 +00:00
|
|
|
#ifdef DBG_UTIL
|
|
|
|
static sal_Int32 s_nRecursions = 0;
|
|
|
|
++s_nRecursions;
|
|
|
|
#endif
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
sal_Bool bEmpty = sal_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();
|
2001-02-12 12:56:51 +00:00
|
|
|
if (!bEmpty)
|
|
|
|
aNextFeature = m_aFeaturesToInvalidate.front();
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
while(!bEmpty)
|
|
|
|
{
|
2002-01-24 16:43:35 +00:00
|
|
|
if ( ALL_FEATURES == aNextFeature.nId )
|
2001-02-19 11:07:30 +00:00
|
|
|
{
|
2001-01-09 14:43:04 +00:00
|
|
|
InvalidateAll_Impl();
|
2001-02-19 11:07:30 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-01-09 14:43:04 +00:00
|
|
|
else
|
|
|
|
{
|
2002-01-24 16:43:35 +00:00
|
|
|
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 )
|
2002-01-24 16:43:35 +00:00
|
|
|
);
|
|
|
|
|
2005-07-08 09:38:35 +00:00
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
if ( m_aSupportedFeatures.end() == aFeaturePos )
|
|
|
|
{
|
|
|
|
::rtl::OString sMessage( "OGenericUnoController::InvalidateFeature_Impl: feature id " );
|
|
|
|
sMessage += ::rtl::OString::valueOf( aNextFeature.nId );
|
|
|
|
sMessage += ::rtl::OString( " has been invalidated, but is not supported!" );
|
|
|
|
OSL_ENSURE( false, sMessage.getStr() );
|
|
|
|
}
|
|
|
|
#endif
|
2002-01-24 16:43:35 +00:00
|
|
|
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
|
|
|
}
|
2001-02-19 11:07:30 +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
|
|
|
}
|
2001-02-19 11:07:30 +00:00
|
|
|
|
|
|
|
#ifdef DBG_UTIL
|
|
|
|
--s_nRecursions;
|
|
|
|
#endif
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2001-02-19 11:07:30 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
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
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
sal_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
|
|
|
}
|
2002-01-24 16:43:35 +00:00
|
|
|
|
|
|
|
if ( bWasEmpty )
|
2001-01-09 14:43:04 +00:00
|
|
|
m_aAsyncInvalidateAll.Call();
|
|
|
|
}
|
|
|
|
|
2002-01-24 18:23:16 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::InvalidateFeature(sal_uInt16 _nId, const Reference< XStatusListener > & _xListener, sal_Bool _bForceBroadcast)
|
|
|
|
{
|
|
|
|
ImplInvalidateFeature( _nId, _xListener, _bForceBroadcast );
|
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::InvalidateAll()
|
|
|
|
{
|
2002-01-24 18:23:16 +00:00
|
|
|
ImplInvalidateFeature( ALL_FEATURES, NULL, sal_True );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2002-01-24 16:43:35 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::InvalidateAll_Impl()
|
|
|
|
{
|
|
|
|
// ---------------------------------
|
|
|
|
// invalidate all aupported features
|
2004-11-16 13:31:01 +00:00
|
|
|
|
|
|
|
for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
|
|
|
|
aIter != m_aSupportedFeatures.end();
|
|
|
|
++aIter
|
|
|
|
)
|
|
|
|
ImplBroadcastFeatureState( aIter->first, NULL, sal_True );
|
2001-01-09 14:43:04 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( m_aFeatureMutex);
|
2001-02-19 11:07:30 +00:00
|
|
|
DBG_ASSERT(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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
Reference< XDispatch > OGenericUnoController::queryDispatch(const URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2002-01-24 16:43:35 +00:00
|
|
|
Reference< XDispatch > xReturn;
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::queryDispatch: shouldn't this be filled at construction time?" );
|
2007-07-06 07:04:34 +00:00
|
|
|
if ( m_aSupportedFeatures.empty() )
|
|
|
|
fillSupportedFeatures();
|
2008-06-25 13:02:57 +00:00
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
// 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 )
|
|
|
|
)
|
2002-01-24 16:43:35 +00:00
|
|
|
)
|
|
|
|
{
|
2008-06-16 11:33:12 +00:00
|
|
|
xReturn = this;
|
2002-01-24 16:43:35 +00:00
|
|
|
}
|
|
|
|
// 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
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
// outta here
|
|
|
|
return xReturn;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
Sequence< Reference< XDispatch > > OGenericUnoController::queryDispatches(const Sequence< DispatchDescriptor >& aDescripts) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2002-01-24 16:43:35 +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
|
|
|
|
2002-01-24 16:43:35 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
Reference< XDispatchProvider > OGenericUnoController::getSlaveDispatchProvider(void) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
return m_xSlaveDispatcher;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::setSlaveDispatchProvider(const Reference< XDispatchProvider > & _xNewProvider) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
m_xSlaveDispatcher = _xNewProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
Reference< XDispatchProvider > OGenericUnoController::getMasterDispatchProvider(void) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
return m_xMasterDispatcher;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::setMasterDispatchProvider(const Reference< XDispatchProvider > & _xNewProvider) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
m_xMasterDispatcher = _xNewProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-02-19 12:54:45 +00:00
|
|
|
void OGenericUnoController::dispatch(const URL& _aURL, const Sequence< PropertyValue >& aArgs) throw(RuntimeException)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2005-09-23 11:21:38 +00:00
|
|
|
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
|
|
|
|
// Since the fix for #123967#, 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.
|
|
|
|
// #i52602# / frank.schoenheit@sun.com / 2005-07-29
|
2006-08-15 09:49:24 +00:00
|
|
|
|
|
|
|
#ifdef TIMELOG
|
|
|
|
::rtl::OString sLog( "OGenericUnoController::dispatch( '" );
|
|
|
|
sLog += ::rtl::OString( _aURL.Main.getStr(), _aURL.Main.getLength(), osl_getThreadTextEncoding() );
|
|
|
|
sLog += ::rtl::OString( "' )" );
|
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", sLog.getStr() );
|
|
|
|
#endif
|
|
|
|
|
2006-10-18 12:30:13 +00:00
|
|
|
executeChecked(_aURL,aArgs);
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::addStatusListener(const Reference< XStatusListener > & aListener, const URL& _rURL) throw(RuntimeException)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2006-07-10 14:23:57 +00:00
|
|
|
// parse the ULR now and here, this saves later parsing in each notification round
|
|
|
|
URL aParsedURL( _rURL );
|
|
|
|
if ( m_xUrlTransformer.is() )
|
|
|
|
m_xUrlTransformer->parseStrict( aParsedURL );
|
|
|
|
|
2002-01-24 16:43:35 +00:00
|
|
|
// remeber the listener together with the URL
|
2006-07-10 14:23:57 +00:00
|
|
|
m_arrStatusListener.insert( m_arrStatusListener.end(), DispatchTarget( aParsedURL, aListener ) );
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// initially broadcast the state
|
2006-07-10 14:23:57 +00:00
|
|
|
ImplBroadcastFeatureState( aParsedURL.Complete, aListener, sal_True );
|
2001-01-09 14:43:04 +00:00
|
|
|
// force the new state to be broadcasted to the new listener
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::removeStatusListener(const Reference< XStatusListener > & aListener, const URL& _rURL) throw(RuntimeException)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
DispatchIterator iterSearch = m_arrStatusListener.begin();
|
|
|
|
|
2001-04-24 13:36:44 +00:00
|
|
|
sal_Bool bRemoveForAll = (_rURL.Complete.getLength() == 0);
|
2002-01-24 16:43:35 +00:00
|
|
|
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
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
2002-01-24 16:43:35 +00:00
|
|
|
m_arrStatusListener.erase( iterSearch );
|
2001-01-09 14:43:04 +00:00
|
|
|
if (!bRemoveForAll)
|
2002-01-24 16:43:35 +00:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::removeStatusListener: shouldn't this be filled at construction time?" );
|
2007-07-06 07:04:34 +00:00
|
|
|
if ( m_aSupportedFeatures.empty() )
|
|
|
|
fillSupportedFeatures();
|
2008-06-25 13:02:57 +00:00
|
|
|
|
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
|
2004-11-16 13:31:01 +00:00
|
|
|
StateCacheIterator 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-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------
|
2001-03-01 14:17:55 +00:00
|
|
|
void OGenericUnoController::disposing()
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
{
|
|
|
|
EventObject aDisposeEvent;
|
2001-06-21 16:51:14 +00:00
|
|
|
aDisposeEvent.Source = static_cast<XWeak*>(this);
|
2004-08-02 14:34:22 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2004-08-02 14:34:22 +00:00
|
|
|
m_xDatabaseContext = NULL;
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( m_aFeatureMutex);
|
2001-01-23 09:35:13 +00:00
|
|
|
m_aAsyncInvalidateAll.CancelCall();
|
2001-01-09 14:43:04 +00:00
|
|
|
m_aFeaturesToInvalidate.clear();
|
|
|
|
}
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
releaseNumberForComponent();
|
2008-04-04 13:56:57 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// check out from all the objects we are listening
|
|
|
|
// the frame
|
2008-03-06 17:14:19 +00:00
|
|
|
stopFrameListening( m_aCurrentFrame.getFrame() );
|
|
|
|
m_aCurrentFrame.attachFrame( NULL );
|
|
|
|
|
2005-09-23 11:21:38 +00:00
|
|
|
m_xMasterDispatcher = NULL;
|
|
|
|
m_xSlaveDispatcher = NULL;
|
2007-07-06 07:04:34 +00:00
|
|
|
m_xServiceFactory = NULL;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
// disambiguate
|
|
|
|
OGenericUnoController_Base::WeakComponentImplHelperBase::addEventListener( xListener );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
// disambiguate
|
|
|
|
OGenericUnoController_Base::WeakComponentImplHelperBase::removeEventListener( xListener );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
void OGenericUnoController::frameAction(const FrameActionEvent& aEvent) throw( RuntimeException )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( aEvent.Frame == m_aCurrentFrame.getFrame() )
|
|
|
|
m_aCurrentFrame.frameAction( aEvent.Action );
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2004-11-16 13:31:01 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
//------------------------------------------------------------------------------
|
2004-11-16 13:31:01 +00:00
|
|
|
void OGenericUnoController::implDescribeSupportedFeature( const sal_Char* _pAsciiCommandURL,
|
|
|
|
sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2006-03-31 11:12:49 +00:00
|
|
|
#ifdef DBG_UTIL
|
|
|
|
DBG_ASSERT( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" );
|
2004-11-16 13:31:01 +00:00
|
|
|
#endif
|
2008-06-25 13:02:57 +00:00
|
|
|
OSL_PRECOND( _nFeatureId < FIRST_USER_DEFINED_FEATURE, "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" );
|
2004-11-16 13:31:01 +00:00
|
|
|
|
|
|
|
ControllerFeature aFeature;
|
|
|
|
aFeature.Command = ::rtl::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;
|
|
|
|
}
|
2004-09-09 08:41:47 +00:00
|
|
|
|
2004-11-16 13:31:01 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
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 = sal_True;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
aReturn = m_pData->m_aUserDefinedFeatures.getState( getURLForId( _nId ) );
|
|
|
|
break;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return aReturn;
|
|
|
|
}
|
2008-06-25 13:02:57 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
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 );
|
2008-06-25 13:02:57 +00:00
|
|
|
}
|
|
|
|
|
2001-08-16 09:39:41 +00:00
|
|
|
//------------------------------------------------------------------------------
|
2002-01-24 16:43:35 +00:00
|
|
|
URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
|
|
|
URL aReturn;
|
2002-01-24 16:43:35 +00:00
|
|
|
if ( m_xUrlTransformer.is() )
|
2001-08-27 05:57:24 +00:00
|
|
|
{
|
2002-01-24 16:43:35 +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 )
|
2002-01-24 16:43:35 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
if ( m_aSupportedFeatures.end() != aIter && aIter->first.getLength() )
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2001-08-27 05:57:24 +00:00
|
|
|
aReturn.Complete = aIter->first;
|
2002-01-24 16:43:35 +00:00
|
|
|
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;
|
|
|
|
}
|
2001-05-10 11:25:36 +00:00
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
//-------------------------------------------------------------------------
|
2008-10-01 12:28:29 +00:00
|
|
|
bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId ) const
|
2008-06-25 13:02:57 +00:00
|
|
|
{
|
|
|
|
return ( _nFeatureId >= FIRST_USER_DEFINED_FEATURE ) && ( _nFeatureId < LAST_USER_DEFINED_FEATURE );
|
|
|
|
}
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
bool OGenericUnoController::isUserDefinedFeature( const ::rtl::OUString& _rFeatureURL ) const
|
|
|
|
{
|
|
|
|
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 ) : false;
|
|
|
|
}
|
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OGenericUnoController::supportsService(const ::rtl::OUString& ServiceName) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
|
2002-01-24 16:43:35 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
const ::rtl::OUString* pArray = aSupported.getConstArray();
|
2002-01-24 16:43:35 +00:00
|
|
|
const ::rtl::OUString* pArrayEnd = aSupported.getConstArray() + aSupported.getLength();
|
|
|
|
|
|
|
|
for ( ;( pArray != pArrayEnd ) && !pArray->equals( ServiceName ); ++pArray )
|
|
|
|
;
|
|
|
|
return pArray != pArrayEnd;
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2001-05-10 11:25:36 +00:00
|
|
|
|
2001-01-09 14:43:04 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2001-05-10 11:25:36 +00:00
|
|
|
void OGenericUnoController::startConnectionListening(const Reference< XConnection >& _rxConnection)
|
2001-01-09 14:43:04 +00:00
|
|
|
{
|
2001-05-10 11:25:36 +00:00
|
|
|
// we have to remove ourself before dispoing the connection
|
|
|
|
Reference< XComponent > xComponent(_rxConnection, UNO_QUERY);
|
|
|
|
if (xComponent.is())
|
2001-06-21 16:51:14 +00:00
|
|
|
xComponent->addEventListener(static_cast<XFrameActionListener*>(this));
|
2001-05-10 11:25:36 +00:00
|
|
|
}
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2001-05-10 11:25:36 +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())
|
2001-06-21 16:51:14 +00:00
|
|
|
xComponent->removeEventListener(static_cast<XFrameActionListener*>(this));
|
2001-05-10 11:25:36 +00:00
|
|
|
}
|
2004-08-02 14:34:22 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-12-01 12:31:27 +00:00
|
|
|
Reference< XConnection > OGenericUnoController::connect( const Reference< XDataSource>& _xDataSource,
|
|
|
|
::dbtools::SQLExceptionInfo* _pErrorInfo )
|
2004-08-02 14:34:22 +00:00
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
WaitObject aWaitCursor( getView() );
|
2004-08-02 14:34:22 +00:00
|
|
|
|
2007-07-24 11:07:21 +00:00
|
|
|
ODatasourceConnector aConnector( getORB(), getView(), ::rtl::OUString() );
|
2008-12-01 12:31:27 +00:00
|
|
|
Reference< XConnection > xConnection = aConnector.connect( _xDataSource, _pErrorInfo );
|
|
|
|
startConnectionListening( xConnection );
|
2004-08-02 14:34:22 +00:00
|
|
|
|
|
|
|
return xConnection;
|
|
|
|
}
|
2001-08-15 05:47:21 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-12-01 12:31:27 +00:00
|
|
|
Reference< XConnection > OGenericUnoController::connect( const ::rtl::OUString& _rDataSourceName,
|
|
|
|
const ::rtl::OUString& _rContextInformation, ::dbtools::SQLExceptionInfo* _pErrorInfo )
|
2001-05-10 11:25:36 +00:00
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
WaitObject aWaitCursor( getView() );
|
2001-01-09 14:43:04 +00:00
|
|
|
|
2007-07-24 11:07:21 +00:00
|
|
|
ODatasourceConnector aConnector( getORB(), getView(), _rContextInformation );
|
2008-12-01 12:31:27 +00:00
|
|
|
Reference<XConnection> xConnection = aConnector.connect( _rDataSourceName, _pErrorInfo );
|
|
|
|
startConnectionListening( xConnection );
|
2001-01-15 08:37:29 +00:00
|
|
|
|
|
|
|
return xConnection;
|
|
|
|
}
|
2001-05-10 11:25:36 +00:00
|
|
|
|
2001-01-15 08:37:29 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::showError(const SQLExceptionInfo& _rInfo)
|
|
|
|
{
|
2001-02-23 14:17:34 +00:00
|
|
|
::dbaui::showError(_rInfo,getView(),getORB());
|
2001-01-09 14:43:04 +00:00
|
|
|
}
|
2001-02-23 14:17:34 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
Reference< XLayoutManager > OGenericUnoController::getLayoutManager(const Reference< XFrame >& _xFrame) const
|
2001-04-24 13:36:44 +00:00
|
|
|
{
|
2004-02-25 14:32:25 +00:00
|
|
|
Reference< XPropertySet > xPropSet( _xFrame, UNO_QUERY );
|
2008-04-04 13:56:57 +00:00
|
|
|
Reference< XLayoutManager > xLayoutManager;
|
2004-02-25 14:32:25 +00:00
|
|
|
if ( xPropSet.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2004-08-02 14:34:22 +00:00
|
|
|
xLayoutManager.set(xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))),UNO_QUERY);
|
2004-02-25 14:32:25 +00:00
|
|
|
}
|
|
|
|
catch ( Exception& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2004-09-09 08:41:47 +00:00
|
|
|
return xLayoutManager;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::loadMenu(const Reference< XFrame >& _xFrame)
|
|
|
|
{
|
2008-04-04 13:56:57 +00:00
|
|
|
Reference< XLayoutManager > xLayoutManager = getLayoutManager(_xFrame);
|
2004-02-25 14:32:25 +00:00
|
|
|
if ( xLayoutManager.is() )
|
2004-09-09 08:41:47 +00:00
|
|
|
{
|
|
|
|
xLayoutManager->lock();
|
2004-02-25 14:32:25 +00:00
|
|
|
xLayoutManager->createElement( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" )));
|
2004-09-09 08:41:47 +00:00
|
|
|
xLayoutManager->createElement( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/toolbar" )));
|
|
|
|
xLayoutManager->unlock();
|
|
|
|
xLayoutManager->doLayout();
|
|
|
|
}
|
2004-10-22 11:03:46 +00:00
|
|
|
|
|
|
|
onLoadedMenu( xLayoutManager );
|
2004-09-09 08:41:47 +00:00
|
|
|
}
|
2004-10-22 11:03:46 +00:00
|
|
|
|
2004-09-09 08:41:47 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
void OGenericUnoController::onLoadedMenu(const Reference< XLayoutManager >& /*_xLayoutManager*/)
|
2004-09-09 08:41:47 +00:00
|
|
|
{
|
2004-10-22 11:03:46 +00:00
|
|
|
// not interested in
|
2001-04-24 13:36:44 +00:00
|
|
|
}
|
2004-10-22 11:03:46 +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(OGenericUnoController, OnAsyncCloseTask, void*, EMPTYARG)
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( !OGenericUnoController_Base::rBHelper.bInDispose )
|
2001-09-19 12:20:12 +00:00
|
|
|
{
|
2002-06-24 09:29:26 +00:00
|
|
|
try
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
Reference< util::XCloseable > xCloseable( m_aCurrentFrame.getFrame(), UNO_QUERY_THROW );
|
2008-03-05 15:52:59 +00:00
|
|
|
xCloseable->close( sal_False ); // false - holds the owner ship for this frame inside this object!
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2002-10-11 07:53:05 +00:00
|
|
|
}
|
2001-09-19 12:20:12 +00:00
|
|
|
}
|
|
|
|
return 0L;
|
2001-04-24 13:36:44 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2001-10-18 05:50:04 +00:00
|
|
|
Any SAL_CALL OGenericUnoController::getViewData(void) throw( RuntimeException )
|
|
|
|
{
|
|
|
|
return Any();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 01:58:07 +00:00
|
|
|
void SAL_CALL OGenericUnoController::restoreViewData(const Any& /*Data*/) throw( RuntimeException )
|
2001-10-18 05:50:04 +00:00
|
|
|
{
|
|
|
|
}
|
2008-03-06 17:14:19 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XModel > SAL_CALL OGenericUnoController::getModel(void) throw( RuntimeException )
|
|
|
|
{
|
|
|
|
return Reference< XModel >();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XFrame > SAL_CALL OGenericUnoController::getFrame(void) throw( RuntimeException )
|
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2008-03-06 17:14:19 +00:00
|
|
|
return m_aCurrentFrame.getFrame();
|
|
|
|
}
|
|
|
|
|
2001-10-18 05:50:04 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 01:58:07 +00:00
|
|
|
sal_Bool SAL_CALL OGenericUnoController::attachModel(const Reference< XModel > & /*xModel*/) throw( RuntimeException )
|
2001-10-18 05:50:04 +00:00
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
OSL_ENSURE( false, "OGenericUnoController::attachModel: not supported!" );
|
2001-10-18 05:50:04 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
2008-03-06 17:14:19 +00:00
|
|
|
|
2001-10-18 05:50:04 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2007-07-06 07:04:34 +00:00
|
|
|
void OGenericUnoController::executeUnChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
|
|
|
|
{
|
|
|
|
Execute(_nCommandId, aArgs);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
void OGenericUnoController::executeUnChecked(const util::URL& _rCommand, const Sequence< PropertyValue >& aArgs)
|
2002-02-11 11:43:58 +00:00
|
|
|
{
|
2008-06-25 13:02:57 +00:00
|
|
|
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::executeUnChecked: shouldn't this be filled at construction time?" );
|
2007-07-06 07:04:34 +00:00
|
|
|
if ( m_aSupportedFeatures.empty() )
|
|
|
|
fillSupportedFeatures();
|
2008-06-25 13:02:57 +00:00
|
|
|
|
2004-11-16 13:31:01 +00:00
|
|
|
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCommand.Complete );
|
2002-02-11 11:43:58 +00:00
|
|
|
if (aIter != m_aSupportedFeatures.end())
|
2004-11-16 13:31:01 +00:00
|
|
|
Execute( aIter->second.nFeatureId, aArgs );
|
2002-02-11 11:43:58 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
void OGenericUnoController::executeChecked(const util::URL& _rCommand, const Sequence< PropertyValue >& aArgs)
|
2002-02-11 11:43:58 +00:00
|
|
|
{
|
2008-06-25 13:02:57 +00:00
|
|
|
OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::executeChecked: shouldn't this be filled at construction time?" );
|
2007-07-06 07:04:34 +00:00
|
|
|
if ( m_aSupportedFeatures.empty() )
|
|
|
|
fillSupportedFeatures();
|
2008-06-25 13:02:57 +00:00
|
|
|
|
2004-11-16 13:31:01 +00:00
|
|
|
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCommand.Complete );
|
|
|
|
if ( aIter != m_aSupportedFeatures.end() )
|
2002-02-11 11:43:58 +00:00
|
|
|
{
|
2004-11-16 13:31:01 +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
|
|
|
|
{
|
|
|
|
::rtl::OUString lcl_getModuleHelpModuleName( const Reference< XFrame >& _rxFrame )
|
|
|
|
{
|
|
|
|
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 = xParentFrame.query( _rxFrame->getCreator() );
|
|
|
|
// 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
|
|
|
|
{
|
2003-04-15 15:03:18 +00:00
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2002-08-26 06:52:15 +00:00
|
|
|
Sequence< ::rtl::OUString > sServiceNames = xSI->getSupportedServiceNames();
|
|
|
|
const ::rtl::OUString* pLoop = sServiceNames.getConstArray();
|
|
|
|
for ( sal_Int32 i=0; i<sServiceNames.getLength(); ++i, ++pLoop )
|
|
|
|
{
|
|
|
|
sal_Int32 nDummy = 0;
|
2006-06-20 01:58:07 +00:00
|
|
|
(void)nDummy;
|
2002-08-26 06:52:15 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// check which service we know ....
|
|
|
|
static const sal_Char* pTransTable[] = {
|
2005-02-17 10:06:30 +00:00
|
|
|
"com.sun.star.sdb.OfficeDatabaseDocument","sdatabase",
|
2007-07-06 07:04:34 +00:00
|
|
|
"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,
|
|
|
|
"lcl_getModuleHelpModuleName: odd size of translation table!" );
|
|
|
|
|
|
|
|
// loop through the table
|
|
|
|
sal_Int32 nTableEntries = ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) / 2;
|
|
|
|
const sal_Char** pDocumentService = pTransTable;
|
|
|
|
const sal_Char** pHelpModuleName = pTransTable + 1;
|
|
|
|
for ( sal_Int32 j=0; j<nTableEntries; ++j )
|
|
|
|
{
|
|
|
|
if ( xSI->supportsService( ::rtl::OUString::createFromAscii( *pDocumentService ) ) )
|
|
|
|
{ // 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";
|
2004-08-02 14:34:22 +00:00
|
|
|
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
|
|
|
|
{
|
|
|
|
OSL_ENSURE( sal_False, "lcl_getModuleHelpModuleName: no installed module found" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
2008-05-05 14:53:19 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2002-08-26 06:52:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( !pReturn )
|
|
|
|
pReturn = "swriter";
|
|
|
|
|
|
|
|
return ::rtl::OUString::createFromAscii( pReturn );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-08-02 13:26:28 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void OGenericUnoController::openHelpAgent(rtl::OUString const& _suHelpStringURL )
|
|
|
|
{
|
|
|
|
rtl::OUString suURL(_suHelpStringURL);
|
|
|
|
rtl::OUString sLanguage = rtl::OUString::createFromAscii("Language=");
|
|
|
|
if (suURL.indexOf(sLanguage) == -1)
|
|
|
|
{
|
2008-06-25 13:02:57 +00:00
|
|
|
AppendConfigToken(suURL, sal_False /* sal_False := add '&' */ );
|
2007-08-02 13:26:28 +00:00
|
|
|
}
|
|
|
|
URL aURL;
|
|
|
|
aURL.Complete = suURL;
|
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
openHelpAgent( aURL );
|
2007-08-02 13:26:28 +00:00
|
|
|
}
|
|
|
|
|
2010-07-10 18:21:24 +02:00
|
|
|
void OGenericUnoController::openHelpAgent(const rtl::OString& _sHelpId)
|
2008-03-06 17:14:19 +00:00
|
|
|
{
|
2010-07-10 18:21:24 +02:00
|
|
|
openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _sHelpId ) );
|
2007-08-02 13:26:28 +00:00
|
|
|
}
|
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
void OGenericUnoController::openHelpAgent( const URL& _rURL )
|
2007-08-02 13:26:28 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
URL aURL( _rURL );
|
2007-08-02 13:26:28 +00:00
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
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;
|
2008-03-06 17:14:19 +00:00
|
|
|
if ( xDispProv.is() )
|
2002-08-26 06:52:15 +00:00
|
|
|
xHelpDispatch = xDispProv->queryDispatch(aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_helpagent")), FrameSearchFlag::PARENT | FrameSearchFlag::SELF);
|
|
|
|
OSL_ENSURE(xHelpDispatch.is(), "SbaTableQueryBrowser::openHelpAgent: could not get a dispatcher!");
|
|
|
|
if (xHelpDispatch.is())
|
|
|
|
{
|
|
|
|
xHelpDispatch->dispatch(aURL, Sequence< PropertyValue >());
|
|
|
|
}
|
|
|
|
}
|
2008-05-05 14:53:19 +00:00
|
|
|
catch( const Exception& )
|
2002-08-26 06:52:15 +00:00
|
|
|
{
|
2008-05-05 14:53:19 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2002-08-26 06:52:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
Reference< awt::XWindow> OGenericUnoController::getTopMostContainerWindow() const
|
2003-03-19 16:57:12 +00:00
|
|
|
{
|
|
|
|
Reference< ::com::sun::star::awt::XWindow> xWindow;
|
2008-03-06 17:14:19 +00:00
|
|
|
|
2003-03-19 16:57:12 +00:00
|
|
|
// get the top most window
|
2008-03-06 17:14:19 +00:00
|
|
|
Reference< XFrame > xFrame( m_aCurrentFrame.getFrame() );
|
|
|
|
if ( xFrame.is() )
|
2003-03-19 16:57:12 +00:00
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
xWindow = xFrame->getContainerWindow();
|
|
|
|
|
2003-03-19 16:57:12 +00:00
|
|
|
while ( xFrame.is() && !xFrame->isTop() )
|
|
|
|
{
|
2008-03-06 17:14:19 +00:00
|
|
|
xFrame.set( xFrame->getCreator(), UNO_QUERY );
|
2003-03-19 16:57:12 +00:00
|
|
|
}
|
|
|
|
if ( xFrame.is() )
|
|
|
|
xWindow = xFrame->getContainerWindow();
|
|
|
|
}
|
|
|
|
return xWindow;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw()
|
2004-08-02 14:34:22 +00:00
|
|
|
{
|
2008-04-04 13:56:57 +00:00
|
|
|
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2008-04-04 13:56:57 +00:00
|
|
|
|
|
|
|
if ( ! m_xTitleHelper.is ())
|
2004-08-02 14:34:22 +00:00
|
|
|
{
|
2008-04-04 13:56:57 +00:00
|
|
|
Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
|
|
|
|
Reference< XController > xThis(static_cast< XController* >(this), UNO_QUERY_THROW);
|
|
|
|
|
|
|
|
::framework::TitleHelper* pHelper = new ::framework::TitleHelper(m_xServiceFactory);
|
|
|
|
m_xTitleHelper.set( static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW);
|
|
|
|
|
|
|
|
pHelper->setOwner (xThis );
|
|
|
|
pHelper->connectWithUntitledNumbers (xUntitledProvider);
|
2004-08-02 14:34:22 +00:00
|
|
|
}
|
2008-04-04 13:56:57 +00:00
|
|
|
|
|
|
|
return m_xTitleHelper;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// XTitle
|
|
|
|
::rtl::OUString SAL_CALL OGenericUnoController::getTitle()
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2008-04-04 13:56:57 +00:00
|
|
|
if ( m_bExternalTitle )
|
|
|
|
return impl_getTitleHelper_throw()->getTitle ();
|
|
|
|
return getPrivateTitle() + impl_getTitleHelper_throw()->getTitle ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// XTitle
|
|
|
|
void SAL_CALL OGenericUnoController::setTitle(const ::rtl::OUString& sTitle)
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
|
2008-12-01 12:31:27 +00:00
|
|
|
::osl::MutexGuard aGuard( getMutex() );
|
2008-04-04 13:56:57 +00:00
|
|
|
m_bExternalTitle = sal_True;
|
|
|
|
impl_getTitleHelper_throw()->setTitle (sTitle);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// XTitleChangeBroadcaster
|
|
|
|
void SAL_CALL OGenericUnoController::addTitleChangeListener(const Reference< XTitleChangeListener >& xListener)
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), UNO_QUERY);
|
|
|
|
if (xBroadcaster.is ())
|
|
|
|
xBroadcaster->addTitleChangeListener (xListener);
|
|
|
|
}
|
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2008-04-04 13:56:57 +00:00
|
|
|
void SAL_CALL OGenericUnoController::removeTitleChangeListener(const Reference< XTitleChangeListener >& xListener)
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), UNO_QUERY);
|
|
|
|
if (xBroadcaster.is ())
|
|
|
|
xBroadcaster->removeTitleChangeListener (xListener);
|
2004-08-02 14:34:22 +00:00
|
|
|
}
|
2008-06-25 13:02:57 +00:00
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// XUserInputInterception
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::addKeyHandler( const Reference< XKeyHandler >& _rxHandler ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
if ( _rxHandler.is() )
|
|
|
|
m_pData->m_aUserInputInterception.addKeyHandler( _rxHandler );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::removeKeyHandler( const Reference< XKeyHandler >& _rxHandler ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
m_pData->m_aUserInputInterception.removeKeyHandler( _rxHandler );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::addMouseClickHandler( const Reference< XMouseClickHandler >& _rxHandler ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
if ( _rxHandler.is() )
|
|
|
|
m_pData->m_aUserInputInterception.addMouseClickHandler( _rxHandler );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OGenericUnoController::removeMouseClickHandler( const Reference< XMouseClickHandler >& _rxHandler ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
m_pData->m_aUserInputInterception.removeMouseClickHandler( _rxHandler );
|
|
|
|
}
|
|
|
|
|
|
|
|
// =============================================================================
|
2004-08-02 14:34:22 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2004-09-09 08:41:47 +00:00
|
|
|
void OGenericUnoController::executeChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
|
2004-08-02 14:34:22 +00:00
|
|
|
{
|
|
|
|
if ( isCommandEnabled(_nCommandId) )
|
2004-09-09 08:41:47 +00:00
|
|
|
Execute(_nCommandId, aArgs);
|
2004-08-02 14:34:22 +00:00
|
|
|
}
|
2004-11-16 13:31:01 +00:00
|
|
|
|
2004-08-02 14:34:22 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool OGenericUnoController::isCommandEnabled(sal_uInt16 _nCommandId) const
|
|
|
|
{
|
|
|
|
return GetState( _nCommandId ).bEnabled;
|
|
|
|
}
|
2008-03-06 17:14:19 +00:00
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_uInt16 OGenericUnoController::registerCommandURL( const ::rtl::OUString& _rCompleteCommandURL )
|
|
|
|
{
|
|
|
|
if ( !_rCompleteCommandURL.getLength() )
|
|
|
|
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 )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( false, "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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-06 17:14:19 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool OGenericUnoController::isDataSourceReadOnly() const
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-06-25 13:02:57 +00:00
|
|
|
Reference< XController > OGenericUnoController::getXController() throw( RuntimeException )
|
2008-03-06 17:14:19 +00:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2008-06-25 13:02:57 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
bool OGenericUnoController::interceptUserInput( const NotifyEvent& _rEvent )
|
|
|
|
{
|
|
|
|
return m_pData->m_aUserInputInterception.handleNotifyEvent( _rEvent );
|
|
|
|
}
|
|
|
|
|
2007-07-06 07:04:34 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool OGenericUnoController::isCommandChecked(sal_uInt16 _nCommandId) const
|
|
|
|
{
|
|
|
|
FeatureState aState = GetState( _nCommandId );
|
2004-11-16 13:31:01 +00:00
|
|
|
|
2007-07-06 07:04:34 +00:00
|
|
|
return aState.bChecked && (sal_Bool)*aState.bChecked;
|
|
|
|
}
|
2004-08-02 14:34:22 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2007-06-12 04:33:49 +00:00
|
|
|
sal_Bool OGenericUnoController::isCommandEnabled( const ::rtl::OUString& _rCompleteCommandURL ) const
|
2004-09-09 08:41:47 +00:00
|
|
|
{
|
2007-06-12 04:33:49 +00:00
|
|
|
OSL_ENSURE( _rCompleteCommandURL.getLength(), "OGenericUnoController::isCommandEnabled: Empty command url!" );
|
2007-07-06 07:04:34 +00:00
|
|
|
|
2004-09-09 08:41:47 +00:00
|
|
|
sal_Bool bIsEnabled = sal_False;
|
2007-06-12 04:33:49 +00:00
|
|
|
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCompleteCommandURL );
|
2004-11-16 13:31:01 +00:00
|
|
|
if ( aIter != m_aSupportedFeatures.end() )
|
|
|
|
bIsEnabled = isCommandEnabled( aIter->second.nFeatureId );
|
2004-09-09 08:41:47 +00:00
|
|
|
|
|
|
|
return bIsEnabled;
|
|
|
|
}
|
2004-11-16 13:31:01 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Sequence< ::sal_Int16 > SAL_CALL OGenericUnoController::getSupportedCommandGroups() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
CommandHashMap aCmdHashMap;
|
|
|
|
for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
|
|
|
|
aIter != m_aSupportedFeatures.end();
|
|
|
|
++aIter
|
|
|
|
)
|
2005-09-23 11:21:38 +00:00
|
|
|
if ( aIter->second.GroupId != CommandGroup::INTERNAL )
|
|
|
|
aCmdHashMap.insert( CommandHashMap::value_type( aIter->second.GroupId, 0 ));
|
2004-11-16 13:31:01 +00:00
|
|
|
|
|
|
|
Sequence< sal_Int16 > aCommandGroups( aCmdHashMap.size() );
|
|
|
|
::std::transform( aCmdHashMap.begin(),
|
|
|
|
aCmdHashMap.end(),
|
|
|
|
aCommandGroups.getArray(),
|
|
|
|
::std::select1st< CommandHashMap::value_type >()
|
|
|
|
);
|
|
|
|
|
|
|
|
return aCommandGroups;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
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(),
|
|
|
|
::std::identity< DispatchInformation >()
|
|
|
|
);
|
|
|
|
|
|
|
|
return aInformation;
|
|
|
|
}
|
2007-07-06 07:04:34 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OGenericUnoController::fillSupportedFeatures()
|
|
|
|
{
|
|
|
|
#ifdef DBG_UTIL
|
|
|
|
m_bDescribingSupportedFeatures = true;
|
|
|
|
#endif
|
|
|
|
describeSupportedFeatures();
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#ifdef DBG_UTIL
|
|
|
|
m_bDescribingSupportedFeatures = false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2008-06-25 13:52:19 +00:00
|
|
|
|
|
|
|
void SAL_CALL OGenericUnoController::dispose() throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::vos::OGuard aSolarGuard(Application::GetSolarMutex());
|
|
|
|
OGenericUnoController_Base::dispose();
|
|
|
|
}
|
2008-06-26 10:43:10 +00:00
|
|
|
} // namespace dbaui
|
|
|
|
|