196de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
396de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
496de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
596de5490SAndrew Rist  * distributed with this work for additional information
696de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
796de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
896de5490SAndrew Rist  * "License"); you may not use this file except in compliance
996de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
1096de5490SAndrew Rist  *
1196de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1296de5490SAndrew Rist  *
1396de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1496de5490SAndrew Rist  * software distributed under the License is distributed on an
1596de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1696de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
1796de5490SAndrew Rist  * specific language governing permissions and limitations
1896de5490SAndrew Rist  * under the License.
1996de5490SAndrew Rist  *
2096de5490SAndrew Rist  *************************************************************/
2196de5490SAndrew Rist 
2296de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25*b63233d8Sdamjan #include "precompiled_dbui.hxx"
26cdf0e10cSrcweir #ifndef DBACCESS_TOOLBOXCONTROLLER_HXX
27cdf0e10cSrcweir #include "toolboxcontroller.hxx"
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_IMAGETYPE_HPP_
30cdf0e10cSrcweir #include <com/sun/star/ui/ImageType.hpp>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
33cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchProvider.hpp>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
36cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _SV_MENU_HXX
39cdf0e10cSrcweir #include <vcl/menu.hxx>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGER_HPP_
42cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGERSUPPLIER_HPP_
45cdf0e10cSrcweir #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XIMAGEMANAGER_HPP_
48cdf0e10cSrcweir #include <com/sun/star/ui/XImageManager.hpp>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_IMAGETYPE_HPP_
51cdf0e10cSrcweir #include <com/sun/star/ui/ImageType.hpp>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HPP_
54cdf0e10cSrcweir #include <com/sun/star/graphic/XGraphic.hpp>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir #ifndef _SV_SVAPP_HXX //autogen
57cdf0e10cSrcweir #include <vcl/svapp.hxx>
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir #ifndef _SV_TOOLBOX_HXX
60cdf0e10cSrcweir #include <vcl/toolbox.hxx>
61cdf0e10cSrcweir #endif
62cdf0e10cSrcweir #ifndef _DBU_RESOURCE_HRC_
63cdf0e10cSrcweir #include "dbu_resource.hrc"
64cdf0e10cSrcweir #endif
65cdf0e10cSrcweir #ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
66cdf0e10cSrcweir #include <svtools/miscopt.hxx>
67cdf0e10cSrcweir #endif
68cdf0e10cSrcweir #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
69cdf0e10cSrcweir #include <unotools/moduleoptions.hxx>
70cdf0e10cSrcweir #endif
71cdf0e10cSrcweir #ifndef TOOLS_DIAGNOSE_EX_H
72cdf0e10cSrcweir #include <tools/diagnose_ex.h>
73cdf0e10cSrcweir #endif
74cdf0e10cSrcweir #ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
75cdf0e10cSrcweir #include <svtools/menuoptions.hxx>
76cdf0e10cSrcweir #endif
77cdf0e10cSrcweir #ifndef _VOS_MUTEX_HXX_
78cdf0e10cSrcweir #include <vos/mutex.hxx>
79cdf0e10cSrcweir #endif
80cdf0e10cSrcweir #ifndef _DBU_REGHELPER_HXX_
81cdf0e10cSrcweir #include "dbu_reghelper.hxx"
82cdf0e10cSrcweir #endif
83cdf0e10cSrcweir #ifndef DBAUI_TOOLS_HXX
84cdf0e10cSrcweir #include "UITools.hxx"
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 
createRegistryInfo_OToolboxController()88cdf0e10cSrcweir extern "C" void SAL_CALL createRegistryInfo_OToolboxController()
89cdf0e10cSrcweir {
90cdf0e10cSrcweir 	static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OToolboxController> aAutoRegistration;
91cdf0e10cSrcweir }
92cdf0e10cSrcweir namespace dbaui
93cdf0e10cSrcweir {
94cdf0e10cSrcweir 	using namespace svt;
95cdf0e10cSrcweir 	using namespace ::com::sun::star::graphic;
96cdf0e10cSrcweir 	using namespace com::sun::star::uno;
97cdf0e10cSrcweir 	using namespace com::sun::star::beans;
98cdf0e10cSrcweir 	using namespace com::sun::star::lang;
99cdf0e10cSrcweir 	using namespace ::com::sun::star::frame;
100cdf0e10cSrcweir 	using namespace ::com::sun::star::util;
101cdf0e10cSrcweir 	using namespace ::com::sun::star::ui;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     namespace
104cdf0e10cSrcweir     {
lcl_copy(Menu * _pMenu,sal_uInt16 _nMenuId,sal_uInt16 _nMenuPos,ToolBox * _pToolBox,sal_uInt16 _nToolId,const::rtl::OUString & _sCommand)105cdf0e10cSrcweir         void lcl_copy(Menu* _pMenu,sal_uInt16 _nMenuId,sal_uInt16 _nMenuPos,ToolBox* _pToolBox,sal_uInt16 _nToolId,const ::rtl::OUString& _sCommand)
106cdf0e10cSrcweir         {
107cdf0e10cSrcweir             if ( _pMenu->GetItemType(_nMenuPos) != MENUITEM_STRING )
108cdf0e10cSrcweir                 _pToolBox->SetItemImage(_nToolId, _pMenu->GetItemImage(_nMenuId));
109cdf0e10cSrcweir             _pToolBox->SetItemCommand( _nToolId, _sCommand);
110cdf0e10cSrcweir             _pToolBox->SetHelpId(_nToolId, _pMenu->GetHelpId(_nMenuId));
111cdf0e10cSrcweir             _pToolBox->SetHelpText(_nToolId, _pMenu->GetHelpText(_nMenuId));
112cdf0e10cSrcweir             _pToolBox->SetQuickHelpText(_nToolId, _pMenu->GetTipHelpText(_nMenuId));
113cdf0e10cSrcweir             _pToolBox->SetItemText(_nToolId, _pMenu->GetItemText(_nMenuId));
114cdf0e10cSrcweir         }
115cdf0e10cSrcweir     }
116cdf0e10cSrcweir 
OToolboxController(const Reference<XMultiServiceFactory> & _rxORB)117cdf0e10cSrcweir 	OToolboxController::OToolboxController(const Reference< XMultiServiceFactory >& _rxORB)
118cdf0e10cSrcweir 		: m_nToolBoxId(1)
119cdf0e10cSrcweir 	{
120cdf0e10cSrcweir 		osl_incrementInterlockedCount(&m_refCount);
121cdf0e10cSrcweir 		m_xServiceManager = _rxORB;
122cdf0e10cSrcweir 		osl_decrementInterlockedCount(&m_refCount);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	}
125cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
126cdf0e10cSrcweir 	IMPLEMENT_SERVICE_INFO1_STATIC(OToolboxController,"com.sun.star.sdb.ApplicationToolboxController","com.sun.star.frame.ToolboxController")
127cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
128cdf0e10cSrcweir 	// XInterface
queryInterface(const Type & _rType)129cdf0e10cSrcweir 	Any SAL_CALL OToolboxController::queryInterface( const Type& _rType ) throw (RuntimeException)
130cdf0e10cSrcweir 	{
131cdf0e10cSrcweir 		Any aReturn = ToolboxController::queryInterface(_rType);
132cdf0e10cSrcweir 		if (!aReturn.hasValue())
133cdf0e10cSrcweir 			aReturn = TToolboxController_BASE::queryInterface(_rType);
134cdf0e10cSrcweir 		return aReturn;
135cdf0e10cSrcweir 	}
136cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
acquire()137cdf0e10cSrcweir 	void SAL_CALL OToolboxController::acquire() throw ()
138cdf0e10cSrcweir 	{
139cdf0e10cSrcweir 		ToolboxController::acquire();
140cdf0e10cSrcweir 	}
141cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
release()142cdf0e10cSrcweir 	void SAL_CALL OToolboxController::release() throw ()
143cdf0e10cSrcweir 	{
144cdf0e10cSrcweir 		ToolboxController::release();
145cdf0e10cSrcweir 	}
146cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
initialize(const Sequence<Any> & _rArguments)147cdf0e10cSrcweir 	void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException)
148cdf0e10cSrcweir 	{
149cdf0e10cSrcweir 		ToolboxController::initialize(_rArguments);
150cdf0e10cSrcweir 		vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
151cdf0e10cSrcweir 		::osl::MutexGuard aGuard(m_aMutex);
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 		if ( m_aCommandURL.equalsAscii(".uno:DBNewForm") )
154cdf0e10cSrcweir 		{
155cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewForm"))           ,sal_True));
156cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewView"))           ,sal_True));
157cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewViewSQL"))        ,sal_True));
158cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewQuery"))          ,sal_True));
159cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewQuerySql"))       ,sal_True));
160cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewReport"))			,sal_True));
161cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewReportAutoPilot")),sal_True));
162cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewTable"))          ,sal_True));
163cdf0e10cSrcweir 		}
164cdf0e10cSrcweir 		else
165cdf0e10cSrcweir 		{
166cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Refresh"))         ,sal_True));
167cdf0e10cSrcweir 			m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBRebuildData"))   ,sal_True));
168cdf0e10cSrcweir 		}
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 		TCommandState::iterator aIter = m_aStates.begin();
171cdf0e10cSrcweir         TCommandState::iterator aEnd = m_aStates.end();
172cdf0e10cSrcweir 		for (; aIter != aEnd; ++aIter)
173cdf0e10cSrcweir 			addStatusListener(aIter->first);
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 		ToolBox*    pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
176cdf0e10cSrcweir 		if ( pToolBox )
177cdf0e10cSrcweir 		{
178cdf0e10cSrcweir 			sal_uInt16 nCount = pToolBox->GetItemCount();
179cdf0e10cSrcweir 			for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos)
180cdf0e10cSrcweir 			{
181cdf0e10cSrcweir 				sal_uInt16 nItemId = pToolBox->GetItemId(nPos);
182cdf0e10cSrcweir 				if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) )
183cdf0e10cSrcweir 				{
184cdf0e10cSrcweir 					m_nToolBoxId = nItemId;
185cdf0e10cSrcweir 					break;
186cdf0e10cSrcweir 				}
187cdf0e10cSrcweir 			}
188cdf0e10cSrcweir 
189cdf0e10cSrcweir             // check if paste special is allowed, when not don't add DROPDOWN
190cdf0e10cSrcweir 			pToolBox->SetItemBits(m_nToolBoxId,pToolBox->GetItemBits(m_nToolBoxId) | TIB_DROPDOWN);
191cdf0e10cSrcweir 		}
192cdf0e10cSrcweir 	}
193cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
statusChanged(const FeatureStateEvent & Event)194cdf0e10cSrcweir 	void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException )
195cdf0e10cSrcweir 	{
196cdf0e10cSrcweir         vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
197cdf0e10cSrcweir 		::osl::MutexGuard aGuard(m_aMutex);
198cdf0e10cSrcweir 		TCommandState::iterator aFind = m_aStates.find( Event.FeatureURL.Complete );
199cdf0e10cSrcweir 		if ( aFind != m_aStates.end() )
200cdf0e10cSrcweir         {
201cdf0e10cSrcweir 			aFind->second = Event.IsEnabled;
202cdf0e10cSrcweir             if ( m_aCommandURL == aFind->first && !Event.IsEnabled )
203cdf0e10cSrcweir             {
204cdf0e10cSrcweir                 ::std::auto_ptr<PopupMenu> pMenu = getMenu();
205cdf0e10cSrcweir                 sal_uInt16 nCount = pMenu->GetItemCount();
206cdf0e10cSrcweir                 for (sal_uInt16 i = 0; i < nCount; ++i)
207cdf0e10cSrcweir                 {
208cdf0e10cSrcweir                     sal_uInt16 nItemId = pMenu->GetItemId(i);
209cdf0e10cSrcweir                     aFind = m_aStates.find(pMenu->GetItemCommand(nItemId));
210cdf0e10cSrcweir                     if ( aFind != m_aStates.end() && aFind->second )
211cdf0e10cSrcweir                     {
212cdf0e10cSrcweir                         m_aCommandURL = aFind->first;
213cdf0e10cSrcweir 
214cdf0e10cSrcweir                         ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
215cdf0e10cSrcweir                         lcl_copy(pMenu.get(),nItemId,i,pToolBox,m_nToolBoxId, m_aCommandURL);
216cdf0e10cSrcweir                         break;
217cdf0e10cSrcweir                     }
218cdf0e10cSrcweir                 }
219cdf0e10cSrcweir             }
220cdf0e10cSrcweir         }
221cdf0e10cSrcweir 	}
222cdf0e10cSrcweir     // -----------------------------------------------------------------------------
getMenu()223cdf0e10cSrcweir     ::std::auto_ptr<PopupMenu> OToolboxController::getMenu()
224cdf0e10cSrcweir     {
225cdf0e10cSrcweir         ::std::auto_ptr<PopupMenu> pMenu;
226cdf0e10cSrcweir 		if ( m_aStates.size() > 2 )
227cdf0e10cSrcweir 		{
228cdf0e10cSrcweir 			pMenu.reset( new PopupMenu( ModuleRes( RID_MENU_APP_NEW ) ) );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 			sal_Bool bHighContrast = isHighContrast();
231cdf0e10cSrcweir 
232cdf0e10cSrcweir 			try
233cdf0e10cSrcweir 			{
234cdf0e10cSrcweir 				Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(getServiceManager()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),UNO_QUERY);
235cdf0e10cSrcweir 				Reference<XUIConfigurationManager> xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument")));
236cdf0e10cSrcweir 				Reference<XImageManager> xImageMgr(xUIConfigMgr->getImageManager(),UNO_QUERY);
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 				short nImageType = hasBigImages() ? ImageType::SIZE_LARGE : ImageType::SIZE_DEFAULT;
240cdf0e10cSrcweir 				if ( bHighContrast )
241cdf0e10cSrcweir 					nImageType |= ImageType::COLOR_HIGHCONTRAST;
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 				Sequence< ::rtl::OUString> aSeq(1);
244cdf0e10cSrcweir 				sal_uInt16 nCount = pMenu->GetItemCount();
245cdf0e10cSrcweir 				for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos)
246cdf0e10cSrcweir 				{
247cdf0e10cSrcweir                     if ( pMenu->GetItemType( nPos ) == MENUITEM_SEPARATOR )
248cdf0e10cSrcweir                         continue;
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 					sal_uInt16 nItemId = pMenu->GetItemId(nPos);
251cdf0e10cSrcweir 					aSeq[0] = pMenu->GetItemCommand(nItemId);
252cdf0e10cSrcweir 					Sequence< Reference<XGraphic> > aImages = xImageMgr->getImages(nImageType,aSeq);
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 					Image aImage(aImages[0]);
255cdf0e10cSrcweir 					pMenu->SetItemImage(nItemId,aImage);
256cdf0e10cSrcweir 					TCommandState::iterator aFind = m_aStates.find( aSeq[0] );
257cdf0e10cSrcweir 					if ( aFind != m_aStates.end() )
258cdf0e10cSrcweir 					{
259cdf0e10cSrcweir 						pMenu->EnableItem(nItemId,aFind->second);
260cdf0e10cSrcweir 					}
261cdf0e10cSrcweir 				}
262cdf0e10cSrcweir 			}
263cdf0e10cSrcweir 			catch(const Exception&)
264cdf0e10cSrcweir 			{
265cdf0e10cSrcweir                 DBG_UNHANDLED_EXCEPTION();
266cdf0e10cSrcweir 			}
267cdf0e10cSrcweir 		}
268cdf0e10cSrcweir 		else
269cdf0e10cSrcweir 		{
270cdf0e10cSrcweir 			pMenu.reset( new PopupMenu( ModuleRes( RID_MENU_REFRESH_DATA ) ) );
271cdf0e10cSrcweir 		}
272cdf0e10cSrcweir         return pMenu;
273cdf0e10cSrcweir     }
274cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
createPopupWindow()275cdf0e10cSrcweir 	Reference< ::com::sun::star::awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw (RuntimeException)
276cdf0e10cSrcweir 	{
277cdf0e10cSrcweir 		// execute the menu
278cdf0e10cSrcweir 		vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
279cdf0e10cSrcweir 		::osl::MutexGuard aGuard(m_aMutex);
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 		ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
282cdf0e10cSrcweir         ::std::auto_ptr<PopupMenu> pMenu = getMenu();
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 		sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN);
285cdf0e10cSrcweir 		// "cleanup" the toolbox state
286cdf0e10cSrcweir 		Point aPoint = pToolBox->GetItemRect( m_nToolBoxId ).TopLeft();
287cdf0e10cSrcweir 		MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC );
288cdf0e10cSrcweir 		pToolBox->MouseMove( aLeave );
289cdf0e10cSrcweir 		pToolBox->SetItemDown( m_nToolBoxId, sal_False);
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 		if ( nSelected )
292cdf0e10cSrcweir 		{
293cdf0e10cSrcweir             m_aCommandURL = pMenu->GetItemCommand(nSelected);
294cdf0e10cSrcweir             lcl_copy(pMenu.get(),nSelected,pMenu->GetItemPos(nSelected),pToolBox,m_nToolBoxId, m_aCommandURL);
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 			Reference<XDispatch> xDispatch = m_aListenerMap.find(m_aCommandURL)->second;
297cdf0e10cSrcweir 			if ( xDispatch.is() )
298cdf0e10cSrcweir 			{
299cdf0e10cSrcweir 				URL aUrl;
300cdf0e10cSrcweir 				Sequence < PropertyValue > aArgs;
301cdf0e10cSrcweir 				aUrl.Complete = m_aCommandURL;
302cdf0e10cSrcweir 				OSL_ENSURE(aUrl.Complete.getLength(),"Command is empty!");
303cdf0e10cSrcweir 				if ( getURLTransformer().is() )
304cdf0e10cSrcweir 					getURLTransformer()->parseStrict(aUrl);
305cdf0e10cSrcweir 				xDispatch->dispatch(aUrl,aArgs);
306cdf0e10cSrcweir 
307cdf0e10cSrcweir 			}
308cdf0e10cSrcweir 		}
309cdf0e10cSrcweir 		return Reference< ::com::sun::star::awt::XWindow >();
310cdf0e10cSrcweir 	}
311cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
312cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
313cdf0e10cSrcweir //..........................................................................
314cdf0e10cSrcweir } // dbaui
315cdf0e10cSrcweir //..........................................................................
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 
318