popuptoolbarcontroller.cxx (4e7d57d8) popuptoolbarcontroller.cxx (7a164331)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 5 unchanged lines hidden (view full) ---

14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 5 unchanged lines hidden (view full) ---

14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
22// MARKER(update_precomp.py): autogen include statement, do not remove
23#include "precompiled_framework.hxx"
24
25#include <uielement/popuptoolbarcontroller.hxx>
26#include <framework/menuconfiguration.hxx>
27#include <toolkit/awt/vclxmenu.hxx>
28#include <comphelper/processfactory.hxx>
29#include <svtools/imagemgr.hxx>

--- 273 unchanged lines hidden (view full) ---

303 if ( !m_aLastURL.getLength() )
304 return;
305
306 OUString aTarget( RTL_CONSTASCII_USTRINGPARAM( "_default" ) );
307 if ( m_xPopupMenu.is() )
308 {
309 // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu
310 MenuConfiguration::Attributes* pMenuAttributes( 0 );
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_framework.hxx"
26
27#include <uielement/popuptoolbarcontroller.hxx>
28#include <framework/menuconfiguration.hxx>
29#include <toolkit/awt/vclxmenu.hxx>
30#include <comphelper/processfactory.hxx>
31#include <svtools/imagemgr.hxx>

--- 273 unchanged lines hidden (view full) ---

305 if ( !m_aLastURL.getLength() )
306 return;
307
308 OUString aTarget( RTL_CONSTASCII_USTRINGPARAM( "_default" ) );
309 if ( m_xPopupMenu.is() )
310 {
311 // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu
312 MenuConfiguration::Attributes* pMenuAttributes( 0 );
311 VCLXPopupMenu* pTkPopupMenu =
313 VCLXPopupMenu* pTkPopupMenu =
312 ( VCLXPopupMenu * ) VCLXMenu::GetImplementation( m_xPopupMenu );
313
314 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
315 PopupMenu* pVCLPopupMenu = dynamic_cast< PopupMenu * >( pTkPopupMenu->GetMenu() );
316 if ( pVCLPopupMenu )
317 pMenuAttributes = reinterpret_cast< MenuConfiguration::Attributes* >(
318 pVCLPopupMenu->GetUserValue( pVCLPopupMenu->GetCurItemId() ) );
319
320 if ( pMenuAttributes )
321 aTarget = pMenuAttributes->aTargetFrame;
322 }
323
324 css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 );
314 ( VCLXPopupMenu * ) VCLXMenu::GetImplementation( m_xPopupMenu );
315
316 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
317 PopupMenu* pVCLPopupMenu = dynamic_cast< PopupMenu * >( pTkPopupMenu->GetMenu() );
318 if ( pVCLPopupMenu )
319 pMenuAttributes = reinterpret_cast< MenuConfiguration::Attributes* >(
320 pVCLPopupMenu->GetUserValue( pVCLPopupMenu->GetCurItemId() ) );
321
322 if ( pMenuAttributes )
323 aTarget = pMenuAttributes->aTargetFrame;
324 }
325
326 css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 );
325 aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
327 aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ) );
326 aArgs[0].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ) );
327
328 dispatchCommand( m_aLastURL, aArgs, aTarget );
329}
330
331void NewToolbarController::functionExecuted( const OUString &rCommand )
332{
333 setItemImage( rCommand );
334}
335
336/**
328 aArgs[0].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ) );
329
330 dispatchCommand( m_aLastURL, aArgs, aTarget );
331}
332
333void NewToolbarController::functionExecuted( const OUString &rCommand )
334{
335 setItemImage( rCommand );
336}
337
338/**
337 it return the existing state of the given URL in the popupmenu of this toolbox control.
339 it returns the existing state of the given URL in the popupmenu of this toolbox control.
338
339 If the given URL can be located as an action command of one menu item of the
340 popup menu of this control, we return sal_True. Otherwise we return sal_False.
341 Further we return a fallback URL, in case we have to return sal_False. Because
340
341 If the given URL can be located as an action command of one menu item of the
342 popup menu of this control, we return sal_True. Otherwise we return sal_False.
343 Further we return a fallback URL, in case we have to return sal_False. Because
342 the outside code must select a valid item of the popup menu every time ...
344 the outside code must select a valid item of the popup menu every time...
343 and we define it here. By the way this method was written to handle
344 error situations gracefully. E.g. it can be called during creation time
345 but then we have no valid menu. For this case we know another fallback URL.
346 Then we return the private:factory/ URL of the default factory.
347
348 @param rPopupMenu
345 and we define it here. By the way this method was written to handle
346 error situations gracefully. E.g. it can be called during creation time
347 but then we have no valid menu. For this case we know another fallback URL.
348 Then we return the private:factory/ URL of the default factory.
349
350 @param rPopupMenu
349 pounts to the popup menu, on which item we try to locate the given URL
351 points to the popup menu, on which item we try to locate the given URL
350 Can be NULL! Search will be suppressed then.
351
352 @param sURL
353 the URL for searching
354
355 @param sFallback
356 contains the fallback URL in case we return FALSE
357 Must point to valid memory!

--- 100 unchanged lines hidden ---
352 Can be NULL! Search will be suppressed then.
353
354 @param sURL
355 the URL for searching
356
357 @param sFallback
358 contains the fallback URL in case we return FALSE
359 Must point to valid memory!

--- 100 unchanged lines hidden ---