summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-08-01 10:09:39 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-08-01 10:09:39 +0000
commita81b5347d1e8f49732392bb14b05b6c71a556030 (patch)
treedf7a19a9bfdff2ef24644a5b94f0473a4ab39e29
parent7f0e9704f0187e94610865b3baeb6fec63cf4450 (diff)
INTEGRATION: CWS fwk68 (1.33.70); FILE MERGED
2007/07/12 09:15:38 cd 1.33.70.2: #i72119# Support retrieval of add-on images for normal toolbars 2007/07/10 08:29:52 cd 1.33.70.1: #i67769# Use DockingWindow::Close instead of layout manager API to close window
-rw-r--r--framework/source/uielement/toolbarmanager.cxx37
1 files changed, 29 insertions, 8 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 45543f227ff6..70e91db8a2b3 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: toolbarmanager.cxx,v $
*
- * $Revision: 1.34 $
+ * $Revision: 1.35 $
*
- * last change: $Author: ihi $ $Date: 2007-07-10 15:13:31 $
+ * last change: $Author: hr $ $Date: 2007-08-01 11:09:39 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -468,10 +468,12 @@ void ToolBarManager::RefreshImages()
if ( nId > 0 )
{
OUString aCommandURL = m_pToolBar->GetItemCommand( nId );
- m_pToolBar->SetItemImage( nId, GetImageFromURL( m_xFrame,
- aCommandURL,
- bBigImages,
- m_bIsHiContrast ));
+ Image aImage = GetImageFromURL( m_xFrame, aCommandURL, bBigImages, m_bIsHiContrast );
+ // Try also to query for add-on images before giving up and use an
+ // empty image.
+ if ( !aImage )
+ aImage = QueryAddonsImage( aCommandURL, bBigImages, m_bIsHiContrast );
+ m_pToolBar->SetItemImage( nId, aImage );
}
}
@@ -1475,6 +1477,7 @@ void ToolBarManager::RequestImages()
++pIter;
}
+ sal_Bool bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() );
m_bIsHiContrast = m_pToolBar->GetSettings().GetStyleSettings().GetFaceColor().IsDark();
sal_Int16 p = getImageTypeFromBools( SvtMiscOptions().AreCurrentSymbolsLarge(), m_bIsHiContrast );
@@ -1492,6 +1495,10 @@ void ToolBarManager::RequestImages()
if ( !aImage )
{
aImage = Image( aModGraphicSeq[i] );
+ // Try also to query for add-on images before giving up and use an
+ // empty image.
+ if ( !aImage )
+ aImage = QueryAddonsImage( aCmdURLSeq[i], bBigImages, m_bIsHiContrast );
m_pToolBar->SetItemImage( pIter->second.nId, aImage );
if ( pIter->second.aIds.size() > 0 )
{
@@ -1910,6 +1917,7 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu )
pExecuteInfo->aToolbarResName = m_aResourceName;
pExecuteInfo->nCmd = EXEC_CMD_CLOSETOOLBAR;
pExecuteInfo->xLayoutManager = getLayoutManagerFromFrame( m_xFrame );
+ pExecuteInfo->xWindow = VCLUnoHelper::GetInterface( m_pToolBar );
Application::PostUserEvent( STATIC_LINK(0, ToolBarManager, ExecuteHdl_Impl), pExecuteInfo );
}
@@ -2108,9 +2116,16 @@ IMPL_STATIC_LINK_NOINSTANCE( ToolBarManager, ExecuteHdl_Impl, ExecuteInfo*, pExe
{
// Asynchronous execution as this can lead to our own destruction!
if (( pExecuteInfo->nCmd == EXEC_CMD_CLOSETOOLBAR ) &&
- ( pExecuteInfo->xLayoutManager.is() ))
+ ( pExecuteInfo->xLayoutManager.is() ) &&
+ ( pExecuteInfo->xWindow.is() ))
{
- pExecuteInfo->xLayoutManager->destroyElement( pExecuteInfo->aToolbarResName );
+ // Use docking window close to close the toolbar. The layout manager is
+ // listener and will react correctly according to the context sensitive
+ // flag of our toolbar.
+ Window* pWin = VCLUnoHelper::GetWindow( pExecuteInfo->xWindow );
+ DockingWindow* pDockWin = dynamic_cast< DockingWindow* >( pWin );
+ if ( pDockWin )
+ pDockWin->Close();
}
}
catch ( Exception& )
@@ -2121,4 +2136,10 @@ IMPL_STATIC_LINK_NOINSTANCE( ToolBarManager, ExecuteHdl_Impl, ExecuteInfo*, pExe
return 0;
}
+Image ToolBarManager::QueryAddonsImage( const ::rtl::OUString& aCommandURL, bool bBigImages, bool bHiContrast )
+{
+ Image aImage = framework::AddonsOptions().GetImageFromURL( aCommandURL, bBigImages, bHiContrast );
+ return aImage;
+}
+
}