summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-11-16 14:25:51 +0000
committerOliver Bolte <obo@openoffice.org>2004-11-16 14:25:51 +0000
commit01c01363e7bd3e3625a2b0d416b933a033eb3fcc (patch)
tree64563566c406c72da10a7bad39c4e4e2b81f1b9d /sfx2
parent7dd14bfd4cfbd56d9b1a052d7d58dcf0c4bbfacb (diff)
INTEGRATION: CWS docking4 (1.43.4); FILE MERGED
2004/11/08 16:07:02 cd 1.43.4.5: #i33132# Added missing createElement call so showElement has a valid element 2004/11/02 16:43:02 ssa 1.43.4.4: RESYNC: (1.44-1.45); FILE MERGED 2004/11/01 07:37:37 cd 1.43.4.3: #i33132# Base implementation for toggle toolbars - must be overwritten by other modules if they need a different behavior 2004/10/11 14:57:15 cd 1.43.4.2: RESYNC: (1.43-1.44); FILE MERGED 2004/10/01 13:29:09 toconnor 1.43.4.1: #i34745# changes are applied by the dialog code, so no need to call update
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appserv.cxx71
1 files changed, 62 insertions, 9 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 701c14752204..d84e4ad6c215 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: appserv.cxx,v $
*
- * $Revision: 1.49 $
+ * $Revision: 1.50 $
*
- * last change: $Author: obo $ $Date: 2004-11-16 12:34:21 $
+ * last change: $Author: obo $ $Date: 2004-11-16 15:25:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,9 @@
#ifndef _COM_SUN_STAR_UTIL_CloseVetoException_HPP_
#include <com/sun/star/util/CloseVetoException.hpp>
#endif
+#ifndef _DRAFTS_COM_SUN_STAR_FRAME_XLAYOUTMANAGER_HPP_
+#include <drafts/com/sun/star/frame/XLayoutManager.hpp>
+#endif
#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_HPP_
#include <com/sun/star/embed/XStorage.hpp>
@@ -156,6 +159,9 @@
#ifndef _VCL_STDTEXT_HXX
#include <vcl/stdtext.hxx>
#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
#include <svtools/pathoptions.hxx>
#include <svtools/moduleoptions.hxx>
@@ -392,13 +398,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
const short nRet = pDlg->Execute();
- for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst();
- pFrame;
- pFrame = SfxViewFrame::GetNext( *pFrame ) )
- {
- pFrame->GetDispatcher()->Update_Impl( TRUE );
- }
-
if ( nRet )
bDone = TRUE;
@@ -607,6 +606,60 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
bDone = true;
break;
+ case SID_AVAILABLE_TOOLBARS:
+ {
+ SfxStringItem const * pToolbarName = static_cast< SfxStringItem const *>(
+ rReq.GetArg(SID_AVAILABLE_TOOLBARS, false, TYPE(SfxStringItem)));
+
+ if ( pToolbarName )
+ {
+ com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame;
+ Reference < XFramesSupplier > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance(
+ DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
+ xFrame = xDesktop->getActiveFrame();
+
+ Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY );
+ Reference< drafts::com::sun::star::frame::XLayoutManager > xLayoutManager;
+ if ( xPropSet.is() )
+ {
+ try
+ {
+ Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
+ aValue >>= xLayoutManager;
+ }
+ catch ( ::com::sun::star::uno::RuntimeException& e )
+ {
+ throw e;
+ }
+ catch ( ::com::sun::star::uno::Exception& )
+ {
+ }
+ }
+
+ if ( xLayoutManager.is() )
+ {
+ rtl::OUString aToolbarResName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/" ));
+ rtl::OUStringBuffer aBuf( aToolbarResName );
+ aBuf.append( pToolbarName->GetValue() );
+
+ // Parameter auswerten
+ rtl::OUString aToolbarName( aBuf.makeStringAndClear() );
+ BOOL bShow( !xLayoutManager->isElementVisible( aToolbarName ));
+
+ if ( bShow )
+ {
+ xLayoutManager->createElement( aToolbarName );
+ xLayoutManager->showElement( aToolbarName );
+ }
+ else
+ xLayoutManager->hideElement( aToolbarName );
+ }
+ }
+
+ bDone = true;
+ break;
+ }
+
default:
break;
}