some interface changes for imageproducer

This commit is contained in:
Mathias Bauer
2001-05-03 16:04:14 +00:00
parent a5c9f4d8c5
commit 44f1357642
4 changed files with 30 additions and 21 deletions

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: imageproducer.hxx,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change: $Author: cd $ $Date: 2001-05-03 08:02:22 $
* last change: $Author: mba $ $Date: 2001-05-03 17:03:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,10 +79,15 @@
#include <rtl/ustring.hxx>
#endif
typedef Image* ( *pfunc_getImage)( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL );
namespace framework
{
typedef Image ( *pfunc_getImage)( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig );
pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pGetImageFunc );
Image* SAL_CALL GetImageFromURL( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL );
Image SAL_CALL GetImageFromURL( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig );
};
#endif // __FRAMEWORK_HELPER_IMAGEPRODUCER_HXX_

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: bmkmenu.cxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: cd $ $Date: 2001-05-03 08:04:20 $
* last change: $Author: mba $ $Date: 2001-05-03 17:04:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -277,11 +277,11 @@ void BmkMenu::Initialize()
{
USHORT nId = CreateMenuId();
Image* pImage = GetImageFromURL( m_xFrame, aURL );
if ( pImage )
InsertItem( nId, aTitle, *pImage );
else
Image aImage = GetImageFromURL( m_xFrame, aURL, FALSE );
if ( !aImage )
InsertItem( nId, aTitle );
else
InsertItem( nId, aTitle, aImage );
BmkMenu::Attributes* pUserAttributes = new BmkMenu::Attributes;
pUserAttributes->aTargetFrame = aTargetFrame;

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: menumanager.cxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: cd $ $Date: 2001-05-03 13:21:25 $
* last change: $Author: mba $ $Date: 2001-05-03 17:04:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -242,10 +242,9 @@ MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, Menu* pMenu, sal_Bool bDe
}
else if ( pMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
{
Image* pImage = GetImageFromURL( rFrame, aItemCommand );
if ( pImage )
pMenu->SetItemImage( nItemId, *pImage );
Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE );
if ( !!aImage )
pMenu->SetItemImage( nItemId, aImage );
m_aMenuItemHandlerVector.push_back( new MenuItemHandler( nItemId, NULL, REFERENCE< XDISPATCH >() ));
}

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: imageproducer.cxx,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change: $Author: cd $ $Date: 2001-05-03 08:01:51 $
* last change: $Author: mba $ $Date: 2001-05-03 17:04:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,9 @@
#include <helper/imageproducer.hxx>
namespace framework
{
static pfunc_getImage _pGetImageFunc = NULL;
pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pNewGetImageFunc )
@@ -72,11 +75,13 @@ pfunc_getImage SAL_CALL SetImageProducer( pfunc_getImage pNewGetImageFunc )
}
Image* SAL_CALL GetImageFromURL( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL )
Image SAL_CALL GetImageFromURL( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig )
{
if ( _pGetImageFunc )
return _pGetImageFunc( rFrame, aURL );
return _pGetImageFunc( rFrame, aURL, bBig );
else
return NULL;
return Image();
}
};