diff options
Diffstat (limited to 'patches/vba/vba-menubar-objects.diff')
-rw-r--r-- | patches/vba/vba-menubar-objects.diff | 1732 |
1 files changed, 0 insertions, 1732 deletions
diff --git a/patches/vba/vba-menubar-objects.diff b/patches/vba/vba-menubar-objects.diff deleted file mode 100644 index eea2ac0a4..000000000 --- a/patches/vba/vba-menubar-objects.diff +++ /dev/null @@ -1,1732 +0,0 @@ -diff --git oovbaapi/ooo/vba/excel/XApplication.idl oovbaapi/ooo/vba/excel/XApplication.idl -index 2d903de..cf758f3 100644 ---- oovbaapi/ooo/vba/excel/XApplication.idl -+++ oovbaapi/ooo/vba/excel/XApplication.idl -@@ -103,6 +103,7 @@ interface XApplication : com::sun::star::uno::XInterface - raises(com::sun::star::script::BasicErrorException); - void Volatile([in] any Volatile); - any Caller( [in] any aIndex ); -+ any MenuBars( [in] any aIndex ); - }; - - }; }; }; -diff --git oovbaapi/ooo/vba/excel/XGlobals.idl oovbaapi/ooo/vba/excel/XGlobals.idl -index b21e902..782da39 100644 ---- oovbaapi/ooo/vba/excel/XGlobals.idl -+++ oovbaapi/ooo/vba/excel/XGlobals.idl -@@ -76,6 +76,7 @@ XRange Intersect([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, - any Names( [in] any Index ); - XRange Union([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] /*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] /*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any Arg16, [in] /*Optional*/ any Arg17, [in] /*Optional*/ any Arg18, [in] /*Optional*/ any Arg19, [in] /*Optional*/ any Arg20, [in] /*Optional*/ any Arg21, [in] /*Optional*/ any Arg22, [in] /*Optional*/ any Arg23, [in] /*Optional*/ any Arg24, [in] /*Optional*/ any Arg25, [in] /*Optional*/ any Arg26, [in] /*Optional*/ any Arg27, [in] /*Optional*/ any Arg28, [in] /*Optional*/ any Arg29, [in] /*Optional*/ any Arg30) - raises(com::sun::star::script::BasicErrorException); -+ any MenuBars( [in] any aIndex ); - - }; - -diff --git oovbaapi/ooo/vba/excel/XMenu.idl oovbaapi/ooo/vba/excel/XMenu.idl -new file mode 100644 -index 0000000..cb3698b ---- /dev/null -+++ oovbaapi/ooo/vba/excel/XMenu.idl -@@ -0,0 +1,62 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef __ooo_vba_excel_XMenu_idl__ -+#define __ooo_vba_excel_XMenu_idl__ -+ -+#ifndef __com_sun_star_uno_XInterface_idl__ -+#include <com/sun/star/uno/XInterface.idl> -+#endif -+ -+#ifndef __ooo_vba_XHelperInterface_idl__ -+#include <ooo/vba/XHelperInterface.idl> -+#endif -+//============================================================================= -+ -+module ooo { module vba { module excel { -+//============================================================================= -+ -+interface XMenu -+{ -+ interface XHelperInterface; -+ -+ [attribute] string Caption; -+ -+ void Delete() raises ( com::sun::star::script::BasicErrorException ); -+ any MenuItems( [in] any Index ) raises ( com::sun::star::script::BasicErrorException ); -+}; -+ -+}; }; }; -+ -+#endif -diff --git oovbaapi/ooo/vba/excel/XMenuBar.idl oovbaapi/ooo/vba/excel/XMenuBar.idl -new file mode 100644 -index 0000000..3ead272 ---- /dev/null -+++ oovbaapi/ooo/vba/excel/XMenuBar.idl -@@ -0,0 +1,59 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef __ooo_vba_excel_XMenuBar_idl__ -+#define __ooo_vba_excel_XMenuBar_idl__ -+ -+#ifndef __com_sun_star_uno_XInterface_idl__ -+#include <com/sun/star/uno/XInterface.idl> -+#endif -+ -+#ifndef __ooo_vba_XHelperInterface_idl__ -+#include <ooo/vba/XHelperInterface.idl> -+#endif -+//============================================================================= -+ -+module ooo { module vba { module excel { -+//============================================================================= -+ -+interface XMenuBar -+{ -+ interface XHelperInterface; -+ -+ any Menus( [in] any Index ) raises ( com::sun::star::script::BasicErrorException ); -+}; -+ -+}; }; }; -+ -+#endif -diff --git oovbaapi/ooo/vba/excel/XMenuBars.idl oovbaapi/ooo/vba/excel/XMenuBars.idl -new file mode 100644 -index 0000000..3a46c3b ---- /dev/null -+++ oovbaapi/ooo/vba/excel/XMenuBars.idl -@@ -0,0 +1,66 @@ -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: XMenuBars.idl,v $ -+ * $Revision: 1.0 $ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+#ifndef __ooo_vba_excel_XMenuBars_idl__ -+#define __ooo_vba_excel_XMenuBars_idl__ -+ -+#ifndef __com_sun_star_uno_XInterface_idl__ -+#include <com/sun/star/uno/XInterface.idl> -+#endif -+ -+#ifndef __ooo_vba_XHelperInterface_idl__ -+#include <ooo/vba/XHelperInterface.idl> -+#endif -+ -+#ifndef __com_sun_star_helper_script_BasicErrorException_idl__ -+#include <com/sun/star/script/BasicErrorException.idl> -+#endif -+ -+#ifndef __ooo_vba_XCollection_idl__ -+#include <ooo/vba/XCollection.idl> -+#endif -+ -+//============================================================================= -+ -+module ooo { module vba { module excel { -+ -+//============================================================================= -+ -+interface XMenuBars -+{ -+ interface ooo::vba::XCollection; -+}; -+ -+//============================================================================= -+ -+}; }; }; -+ -+#endif -+ -+ -diff --git oovbaapi/ooo/vba/excel/XMenuItem.idl oovbaapi/ooo/vba/excel/XMenuItem.idl -new file mode 100644 -index 0000000..2dcfb2f ---- /dev/null -+++ oovbaapi/ooo/vba/excel/XMenuItem.idl -@@ -0,0 +1,62 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef __ooo_vba_excel_XMenuItem_idl__ -+#define __ooo_vba_excel_XMenuItem_idl__ -+ -+#ifndef __com_sun_star_uno_XInterface_idl__ -+#include <com/sun/star/uno/XInterface.idl> -+#endif -+ -+#ifndef __ooo_vba_XHelperInterface_idl__ -+#include <ooo/vba/XHelperInterface.idl> -+#endif -+//============================================================================= -+ -+module ooo { module vba { module excel { -+//============================================================================= -+ -+interface XMenuItem -+{ -+ interface XHelperInterface; -+ -+ [attribute] string Caption; -+ [attribute] string OnAction; -+ -+ void Delete() raises ( com::sun::star::script::BasicErrorException ); -+}; -+ -+}; }; }; -+ -+#endif -diff --git oovbaapi/ooo/vba/excel/XMenuItems.idl oovbaapi/ooo/vba/excel/XMenuItems.idl -new file mode 100644 -index 0000000..9ba7b38 ---- /dev/null -+++ oovbaapi/ooo/vba/excel/XMenuItems.idl -@@ -0,0 +1,70 @@ -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: XMenuItems.idl,v $ -+ * $Revision: 1.0 $ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+#ifndef __ooo_vba_excel_XMenuItems_idl__ -+#define __ooo_vba_excel_XMenuItems_idl__ -+ -+#ifndef __com_sun_star_uno_XInterface_idl__ -+#include <com/sun/star/uno/XInterface.idl> -+#endif -+ -+#ifndef __ooo_vba_XHelperInterface_idl__ -+#include <ooo/vba/XHelperInterface.idl> -+#endif -+ -+#ifndef __com_sun_star_helper_script_BasicErrorException_idl__ -+#include <com/sun/star/script/BasicErrorException.idl> -+#endif -+ -+#ifndef __ooo_vba_XCollection_idl__ -+#include <ooo/vba/XCollection.idl> -+#endif -+ -+//============================================================================= -+ -+module ooo { module vba { module excel { -+ -+//============================================================================= -+ -+interface XMenuItem; -+ -+interface XMenuItems -+{ -+ interface ooo::vba::XCollection; -+ -+ XMenuItem Add( [in] string Caption, [in] any OnAction, [in] any ShortcutKey, [in] any Before, [in] any Restore, [in] any StatusBar, [in] any HelpFile, [in] any HelpContextID ) raises ( com::sun::star::script::BasicErrorException ); -+}; -+ -+//============================================================================= -+ -+}; }; }; -+ -+#endif -+ -+ -diff --git oovbaapi/ooo/vba/excel/XMenus.idl oovbaapi/ooo/vba/excel/XMenus.idl -new file mode 100644 -index 0000000..c8e4ea2 ---- /dev/null -+++ oovbaapi/ooo/vba/excel/XMenus.idl -@@ -0,0 +1,70 @@ -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: XMenus.idl,v $ -+ * $Revision: 1.0 $ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+#ifndef __ooo_vba_excel_XMenus_idl__ -+#define __ooo_vba_excel_XMenus_idl__ -+ -+#ifndef __com_sun_star_uno_XInterface_idl__ -+#include <com/sun/star/uno/XInterface.idl> -+#endif -+ -+#ifndef __ooo_vba_XHelperInterface_idl__ -+#include <ooo/vba/XHelperInterface.idl> -+#endif -+ -+#ifndef __com_sun_star_helper_script_BasicErrorException_idl__ -+#include <com/sun/star/script/BasicErrorException.idl> -+#endif -+ -+#ifndef __ooo_vba_XCollection_idl__ -+#include <ooo/vba/XCollection.idl> -+#endif -+ -+//============================================================================= -+ -+module ooo { module vba { module excel { -+ -+//============================================================================= -+ -+interface XMenu; -+ -+interface XMenus -+{ -+ interface ooo::vba::XCollection; -+ -+ XMenu Add( [in] string Caption, [in] any Before, [in] any Restore ) raises ( com::sun::star::script::BasicErrorException ); -+}; -+ -+//============================================================================= -+ -+}; }; }; -+ -+#endif -+ -+ -diff --git oovbaapi/ooo/vba/excel/makefile.mk oovbaapi/ooo/vba/excel/makefile.mk -index 232f83c..f3ad793 100644 ---- oovbaapi/ooo/vba/excel/makefile.mk -+++ oovbaapi/ooo/vba/excel/makefile.mk -@@ -103,6 +103,12 @@ IDLFILES= XGlobals.idl\ - XVPageBreak.idl \ - XVPageBreaks.idl \ - TextFrame.idl \ -+ XMenuBar.idl \ -+ XMenuBars.idl \ -+ XMenu.idl \ -+ XMenus.idl \ -+ XMenuItem.idl \ -+ XMenuItems.idl \ - - - # ------------------------------------------------------------------ -diff --git sc/source/ui/vba/makefile.mk sc/source/ui/vba/makefile.mk -index 9350a3b..2f8a16f 100644 ---- sc/source/ui/vba/makefile.mk -+++ sc/source/ui/vba/makefile.mk -@@ -104,7 +104,13 @@ SLOFILES= \ - $(SLO)$/vbapagebreak.obj \ - $(SLO)$/vbapagebreaks.obj \ - $(SLO)$/service.obj \ -- $(SLO)$/vbaeventshelper.obj -+ $(SLO)$/vbaeventshelper.obj \ -+ $(SLO)$/vbamenubar.obj \ -+ $(SLO)$/vbamenubars.obj \ -+ $(SLO)$/vbamenu.obj \ -+ $(SLO)$/vbamenus.obj \ -+ $(SLO)$/vbamenuitem.obj \ -+ $(SLO)$/vbamenuitems.obj \ - - # --- Targets ------------------------------------------------------ - -diff --git sc/source/ui/vba/vbaapplication.cxx sc/source/ui/vba/vbaapplication.cxx -index c06f3bd..68d0834 100644 ---- sc/source/ui/vba/vbaapplication.cxx -+++ sc/source/ui/vba/vbaapplication.cxx -@@ -43,6 +43,7 @@ - #include <ooo/vba/excel/XlMousePointer.hpp> - #include <com/sun/star/sheet/XNamedRanges.hpp> - #include <com/sun/star/sheet/XCellRangeAddressable.hpp> -+#include<ooo/vba/XCommandBars.hpp> - - #include "vbaapplication.hxx" - #include "vbaworkbooks.hxx" -@@ -54,6 +55,7 @@ - #include "vbawindow.hxx" - #include "vbawindows.hxx" - #include "vbaglobals.hxx" -+#include "vbamenubars.hxx" - #include "tabvwsh.hxx" - #include "gridwin.hxx" - #include "vbanames.hxx" -@@ -1186,6 +1188,19 @@ ScVbaApplication::getCurrentDocument() throw (css::uno::RuntimeException) - return getCurrentExcelDoc(); - } - -+uno::Any SAL_CALL -+ScVbaApplication::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException) -+{ -+ uno::Reference< XCommandBars > xCommandBars( CommandBars( uno::Any() ), uno::UNO_QUERY_THROW ); -+ uno::Reference< XCollection > xMenuBars( new ScVbaMenuBars( this, mxContext, xCommandBars ) ); -+ if ( aIndex.hasValue() ) -+ { -+ return uno::Any ( xMenuBars->Item( aIndex, uno::Any() ) ); -+ } -+ -+ return uno::Any( xMenuBars ); -+} -+ - rtl::OUString& - ScVbaApplication::getServiceImplName() - { -diff --git sc/source/ui/vba/vbaapplication.hxx sc/source/ui/vba/vbaapplication.hxx -index d7098b4..8e5da56 100644 ---- sc/source/ui/vba/vbaapplication.hxx -+++ sc/source/ui/vba/vbaapplication.hxx -@@ -101,6 +101,7 @@ public: - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) throw (css::uno::RuntimeException ); - virtual css::uno::Any SAL_CALL Caller( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); -+ virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - // XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -diff --git sc/source/ui/vba/vbaglobals.cxx sc/source/ui/vba/vbaglobals.cxx -index d32eb78..ac5e4f5 100644 ---- sc/source/ui/vba/vbaglobals.cxx -+++ sc/source/ui/vba/vbaglobals.cxx -@@ -211,6 +211,12 @@ ScVbaGlobals::Rows( const uno::Any& aIndex ) throw (uno::RuntimeException) - - } - -+uno::Any SAL_CALL -+ScVbaGlobals::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException) -+{ -+ return uno::Any( getApplication()->MenuBars(aIndex) ); -+} -+ - uno::Sequence< ::rtl::OUString > SAL_CALL - ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException) - { -diff --git sc/source/ui/vba/vbaglobals.hxx sc/source/ui/vba/vbaglobals.hxx -index 89861ee..66dd1fa 100644 ---- sc/source/ui/vba/vbaglobals.hxx -+++ sc/source/ui/vba/vbaglobals.hxx -@@ -83,6 +83,8 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - -+ virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); -+ - - - // XMultiServiceFactory -diff --git sc/source/ui/vba/vbamenu.cxx sc/source/ui/vba/vbamenu.cxx -new file mode 100644 -index 0000000..58972b0 ---- /dev/null -+++ sc/source/ui/vba/vbamenu.cxx -@@ -0,0 +1,91 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#include "vbamenu.hxx" -+#include "vbamenuitems.hxx" -+ -+using namespace com::sun::star; -+using namespace ooo::vba; -+ -+ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : Menu_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl ) -+{ -+} -+ -+::rtl::OUString SAL_CALL -+ScVbaMenu::getCaption() throw ( uno::RuntimeException ) -+{ -+ return m_xCommandBarControl->getCaption(); -+} -+ -+void SAL_CALL -+ScVbaMenu::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) -+{ -+ m_xCommandBarControl->setCaption( _caption ); -+} -+ -+void SAL_CALL -+ScVbaMenu::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) -+{ -+ m_xCommandBarControl->Delete(); -+} -+ -+uno::Any SAL_CALL -+ScVbaMenu::MenuItems( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) -+{ -+ uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW ); -+ uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) ); -+ if( aIndex.hasValue() ) -+ { -+ return xMenuItems->Item( aIndex, uno::Any() ); -+ } -+ return uno::makeAny( xMenuItems ); -+} -+ -+rtl::OUString& -+ScVbaMenu::getServiceImplName() -+{ -+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenu") ); -+ return sImplName; -+} -+uno::Sequence<rtl::OUString> -+ScVbaMenu::getServiceNames() -+{ -+ static uno::Sequence< rtl::OUString > aServiceNames; -+ if ( aServiceNames.getLength() == 0 ) -+ { -+ aServiceNames.realloc( 1 ); -+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menu" ) ); -+ } -+ return aServiceNames; -+} -diff --git sc/source/ui/vba/vbamenu.hxx sc/source/ui/vba/vbamenu.hxx -new file mode 100644 -index 0000000..cd96857 ---- /dev/null -+++ sc/source/ui/vba/vbamenu.hxx -@@ -0,0 +1,62 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef SC_VBA_MENU_HXX -+#define SC_VBA_MENU_HXX -+ -+#include <ooo/vba/excel/XMenu.hpp> -+#include <ooo/vba/XCommandBarControl.hpp> -+#include <vbahelper/vbahelperinterface.hxx> -+ -+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenu > Menu_BASE; -+ -+class ScVbaMenu : public Menu_BASE -+{ -+private: -+ css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl; -+ -+public: -+ ScVbaMenu( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException ); -+ -+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); -+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); -+ -+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); -+ virtual css::uno::Any SAL_CALL MenuItems( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); -+ -+ // XHelperInterface -+ virtual rtl::OUString& getServiceImplName(); -+ virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -+}; -+#endif//SC_VBA_MENU_HXX -diff --git sc/source/ui/vba/vbamenubar.cxx sc/source/ui/vba/vbamenubar.cxx -new file mode 100644 -index 0000000..9386028 ---- /dev/null -+++ sc/source/ui/vba/vbamenubar.cxx -@@ -0,0 +1,74 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#include "vbamenubar.hxx" -+#include "vbamenus.hxx" -+#include <ooo/vba/XCommandBarControls.hpp> -+ -+using namespace com::sun::star; -+using namespace ooo::vba; -+ -+ScVbaMenuBar::ScVbaMenuBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBar >& xCommandBar ) throw( uno::RuntimeException ) : MenuBar_BASE( xParent, xContext ), m_xCommandBar( xCommandBar ) -+{ -+} -+ -+uno::Any SAL_CALL -+ScVbaMenuBar::Menus( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) -+{ -+ uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBar->Controls( uno::Any() ), uno::UNO_QUERY_THROW ); -+ uno::Reference< excel::XMenus > xMenus( new ScVbaMenus( this, mxContext, xCommandBarControls ) ); -+ if( aIndex.hasValue() ) -+ { -+ return xMenus->Item( aIndex, uno::Any() ); -+ } -+ return uno::makeAny( xMenus ); -+} -+ -+rtl::OUString& -+ScVbaMenuBar::getServiceImplName() -+{ -+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBar") ); -+ return sImplName; -+} -+uno::Sequence<rtl::OUString> -+ScVbaMenuBar::getServiceNames() -+{ -+ static uno::Sequence< rtl::OUString > aServiceNames; -+ if ( aServiceNames.getLength() == 0 ) -+ { -+ aServiceNames.realloc( 1 ); -+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBar" ) ); -+ } -+ return aServiceNames; -+} -diff --git sc/source/ui/vba/vbamenubar.hxx sc/source/ui/vba/vbamenubar.hxx -new file mode 100644 -index 0000000..fa39054 ---- /dev/null -+++ sc/source/ui/vba/vbamenubar.hxx -@@ -0,0 +1,58 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef SC_VBA_MENUBAR_HXX -+#define SC_VBA_MENUBAR_HXX -+ -+#include <ooo/vba/excel/XMenuBar.hpp> -+#include <ooo/vba/XCommandBar.hpp> -+#include <vbahelper/vbahelperinterface.hxx> -+ -+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuBar > MenuBar_BASE; -+ -+class ScVbaMenuBar : public MenuBar_BASE -+{ -+private: -+ css::uno::Reference< ov::XCommandBar > m_xCommandBar; -+ -+public: -+ ScVbaMenuBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBar >& xCommandBar ) throw( css::uno::RuntimeException ); -+ -+ virtual css::uno::Any SAL_CALL Menus( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); -+ -+ // XHelperInterface -+ virtual rtl::OUString& getServiceImplName(); -+ virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -+}; -+#endif//SC_VBA_MENUBAR_HXX -diff --git sc/source/ui/vba/vbamenubars.cxx sc/source/ui/vba/vbamenubars.cxx -new file mode 100644 -index 0000000..a5f9e9b ---- /dev/null -+++ sc/source/ui/vba/vbamenubars.cxx -@@ -0,0 +1,146 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#include "vbamenubars.hxx" -+#include "vbamenubar.hxx" -+#include <ooo/vba/excel/XlSheetType.hpp> -+ -+using namespace com::sun::star; -+using namespace ooo::vba; -+ -+ -+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuBarEnumeration_BASE; -+ -+class MenuBarEnumeration : public MenuBarEnumeration_BASE -+{ -+ uno::Reference< XHelperInterface > m_xParent; -+ uno::Reference< uno::XComponentContext > m_xContext; -+ uno::Reference< container::XEnumeration > m_xEnumeration; -+public: -+ MenuBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) -+ { -+ } -+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) -+ { -+ return m_xEnumeration->hasMoreElements(); -+ } -+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) -+ { -+ // FIXME: should be add menubar -+ if( hasMoreElements() ) -+ { -+ uno::Reference< XCommandBar > xCommandBar( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); -+ uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( m_xParent, m_xContext, xCommandBar ) ); -+ return uno::makeAny( xMenuBar ); -+ } -+ else -+ throw container::NoSuchElementException(); -+ return uno::Any(); -+ } -+}; -+ -+ScVbaMenuBars::ScVbaMenuBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBars >& xCommandBars ) throw ( uno::RuntimeException ) : MenuBars_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBars( xCommandBars ) -+{ -+} -+ -+ScVbaMenuBars::~ScVbaMenuBars() -+{ -+} -+ -+// XEnumerationAccess -+uno::Type SAL_CALL -+ScVbaMenuBars::getElementType() throw ( uno::RuntimeException ) -+{ -+ return excel::XMenuBar::static_type( 0 ); -+} -+ -+uno::Reference< container::XEnumeration > -+ScVbaMenuBars::createEnumeration() throw ( uno::RuntimeException ) -+{ -+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBars, uno::UNO_QUERY_THROW ); -+ return uno::Reference< container::XEnumeration >( new MenuBarEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) ); -+} -+ -+uno::Any -+ScVbaMenuBars::createCollectionObject( const uno::Any& aSource ) -+{ -+ // make no sense -+ return aSource; -+} -+ -+sal_Int32 SAL_CALL -+ScVbaMenuBars::getCount() throw(css::uno::RuntimeException) -+{ -+ return m_xCommandBars->getCount(); -+} -+ -+// ScVbaCollectionBaseImpl -+uno::Any SAL_CALL -+ScVbaMenuBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) -+{ -+ sal_Int16 nIndex = 0; -+ aIndex >>= nIndex; -+ if( nIndex == excel::XlSheetType::xlWorksheet ) -+ { -+ uno::Any aSource; -+ aSource <<= rtl::OUString::createFromAscii( "Worksheet Menu Bar" ); -+ uno::Reference< XCommandBar > xCommandBar( m_xCommandBars->Item( aSource, uno::Any() ), uno::UNO_QUERY_THROW ); -+ uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( this, mxContext, xCommandBar ) ); -+ return uno::makeAny( xMenuBar ); -+ } -+ -+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); -+ -+ return uno::Any(); -+} -+ -+// XHelperInterface -+rtl::OUString& -+ScVbaMenuBars::getServiceImplName() -+{ -+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBars") ); -+ return sImplName; -+} -+uno::Sequence<rtl::OUString> -+ScVbaMenuBars::getServiceNames() -+{ -+ static uno::Sequence< rtl::OUString > aServiceNames; -+ if ( aServiceNames.getLength() == 0 ) -+ { -+ aServiceNames.realloc( 1 ); -+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBars" ) ); -+ } -+ return aServiceNames; -+} -+ -diff --git sc/source/ui/vba/vbamenubars.hxx sc/source/ui/vba/vbamenubars.hxx -new file mode 100644 -index 0000000..0d8ea58 ---- /dev/null -+++ sc/source/ui/vba/vbamenubars.hxx -@@ -0,0 +1,69 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef SC_VBA_MENUBARS_HXX -+#define SC_VBA_MENUBARS_HXX -+ -+#include <ooo/vba/excel/XMenuBars.hpp> -+#include <ooo/vba/excel/XMenuBar.hpp> -+#include <ooo/vba/XCommandBars.hpp> -+#include <com/sun/star/container/XNameAccess.hpp> -+#include <cppuhelper/implbase1.hxx> -+#include <vbahelper/vbahelperinterface.hxx> -+#include <vbahelper/vbacollectionimpl.hxx> -+ -+typedef CollTestImplHelper< ov::excel::XMenuBars > MenuBars_BASE; -+ -+class ScVbaMenuBars : public MenuBars_BASE -+{ -+private: -+ css::uno::Reference< ov::XCommandBars > m_xCommandBars; -+ -+public: -+ ScVbaMenuBars( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBars >& xCommandBars ) throw (css::uno::RuntimeException); -+ virtual ~ScVbaMenuBars(); -+ -+ // XEnumerationAccess -+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); -+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); -+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); -+ -+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); -+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException); -+ // XHelperInterface -+ virtual rtl::OUString& getServiceImplName(); -+ virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -+}; -+ -+#endif//SC_VBA_MENUBARS_HXX -diff --git sc/source/ui/vba/vbamenuitem.cxx sc/source/ui/vba/vbamenuitem.cxx -new file mode 100644 -index 0000000..48254cc ---- /dev/null -+++ sc/source/ui/vba/vbamenuitem.cxx -@@ -0,0 +1,90 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#include "vbamenuitem.hxx" -+ -+using namespace com::sun::star; -+using namespace ooo::vba; -+ -+ScVbaMenuItem::ScVbaMenuItem( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : MenuItem_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl ) -+{ -+} -+ -+::rtl::OUString SAL_CALL -+ScVbaMenuItem::getCaption() throw ( uno::RuntimeException ) -+{ -+ return m_xCommandBarControl->getCaption(); -+} -+ -+void SAL_CALL -+ScVbaMenuItem::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) -+{ -+ m_xCommandBarControl->setCaption( _caption ); -+} -+ -+::rtl::OUString SAL_CALL -+ScVbaMenuItem::getOnAction() throw ( uno::RuntimeException ) -+{ -+ return m_xCommandBarControl->getOnAction(); -+} -+ -+void SAL_CALL -+ScVbaMenuItem::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException) -+{ -+ m_xCommandBarControl->setOnAction( _onaction ); -+} -+ -+void SAL_CALL -+ScVbaMenuItem::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) -+{ -+ m_xCommandBarControl->Delete(); -+} -+ -+rtl::OUString& -+ScVbaMenuItem::getServiceImplName() -+{ -+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItem") ); -+ return sImplName; -+} -+uno::Sequence<rtl::OUString> -+ScVbaMenuItem::getServiceNames() -+{ -+ static uno::Sequence< rtl::OUString > aServiceNames; -+ if ( aServiceNames.getLength() == 0 ) -+ { -+ aServiceNames.realloc( 1 ); -+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItem" ) ); -+ } -+ return aServiceNames; -+} -diff --git sc/source/ui/vba/vbamenuitem.hxx sc/source/ui/vba/vbamenuitem.hxx -new file mode 100644 -index 0000000..bf4c087 ---- /dev/null -+++ sc/source/ui/vba/vbamenuitem.hxx -@@ -0,0 +1,63 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef SC_VBA_MENUITEM_HXX -+#define SC_VBA_MENUITEM_HXX -+ -+#include <ooo/vba/excel/XMenuItem.hpp> -+#include <ooo/vba/XCommandBarControl.hpp> -+#include <vbahelper/vbahelperinterface.hxx> -+ -+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuItem > MenuItem_BASE; -+ -+class ScVbaMenuItem : public MenuItem_BASE -+{ -+private: -+ css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl; -+ -+public: -+ ScVbaMenuItem( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException ); -+ -+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); -+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); -+ virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException); -+ virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException); -+ -+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); -+ -+ // XHelperInterface -+ virtual rtl::OUString& getServiceImplName(); -+ virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -+}; -+#endif//SC_VBA_MENUITEM_HXX -diff --git sc/source/ui/vba/vbamenuitems.cxx sc/source/ui/vba/vbamenuitems.cxx -new file mode 100644 -index 0000000..3a5cd79 ---- /dev/null -+++ sc/source/ui/vba/vbamenuitems.cxx -@@ -0,0 +1,159 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#include "vbamenuitems.hxx" -+#include "vbamenuitem.hxx" -+#include "vbamenu.hxx" -+#include <ooo/vba/office/MsoControlType.hpp> -+ -+using namespace com::sun::star; -+using namespace ooo::vba; -+ -+ -+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE; -+ -+class MenuEnumeration : public MenuEnumeration_BASE -+{ -+ uno::Reference< XHelperInterface > m_xParent; -+ uno::Reference< uno::XComponentContext > m_xContext; -+ uno::Reference< container::XEnumeration > m_xEnumeration; -+public: -+ MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) -+ { -+ } -+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) -+ { -+ return m_xEnumeration->hasMoreElements(); -+ } -+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) -+ { -+ // FIXME: should be add menu -+ if( hasMoreElements() ) -+ { -+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); -+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup ) -+ { -+ uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) ); -+ return uno::makeAny( xMenu ); -+ } -+ else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton ) -+ { -+ uno::Reference< excel::XMenuItem > xMenuItem( new ScVbaMenuItem( m_xParent, m_xContext, xCommandBarControl ) ); -+ return uno::makeAny( xMenuItem ); -+ } -+ nextElement(); -+ } -+ else -+ throw container::NoSuchElementException(); -+ return uno::Any(); -+ } -+}; -+ -+ScVbaMenuItems::ScVbaMenuItems( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : MenuItems_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls ) -+{ -+} -+ -+// XEnumerationAccess -+uno::Type SAL_CALL -+ScVbaMenuItems::getElementType() throw ( uno::RuntimeException ) -+{ -+ return excel::XMenuItem::static_type( 0 ); -+} -+ -+uno::Reference< container::XEnumeration > -+ScVbaMenuItems::createEnumeration() throw ( uno::RuntimeException ) -+{ -+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW ); -+ return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) ); -+} -+ -+uno::Any -+ScVbaMenuItems::createCollectionObject( const uno::Any& aSource ) -+{ -+ // make no sense -+ return aSource; -+} -+ -+sal_Int32 SAL_CALL -+ScVbaMenuItems::getCount() throw(css::uno::RuntimeException) -+{ -+ // FIXME: should check if it is a popup menu -+ return m_xCommandBarControls->getCount(); -+} -+ -+// ScVbaCollectionBaseImpl -+uno::Any SAL_CALL -+ScVbaMenuItems::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) -+{ -+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW ); -+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup ) -+ return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) ); -+ else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton ) -+ return uno::makeAny( uno::Reference< excel::XMenuItem > ( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) ) ); -+ throw uno::RuntimeException(); -+} -+ -+uno::Reference< excel::XMenuItem > SAL_CALL ScVbaMenuItems::Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& /*ShortcutKey*/, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& /*StatusBar*/, const css::uno::Any& /*HelpFile*/, const css::uno::Any& /*HelpContextID*/ ) throw (css::script::BasicErrorException, css::uno::RuntimeException) -+{ -+ sal_Int32 nType = office::MsoControlType::msoControlButton; -+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore ); -+ xCommandBarControl->setCaption( Caption ); -+ if( OnAction.hasValue() ) -+ { -+ rtl::OUString sAction; -+ OnAction >>= sAction; -+ xCommandBarControl->setOnAction( sAction ); -+ } -+ return uno::Reference< excel::XMenuItem >( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) ); -+} -+ -+// XHelperInterface -+rtl::OUString& -+ScVbaMenuItems::getServiceImplName() -+{ -+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItems") ); -+ return sImplName; -+} -+uno::Sequence<rtl::OUString> -+ScVbaMenuItems::getServiceNames() -+{ -+ static uno::Sequence< rtl::OUString > aServiceNames; -+ if ( aServiceNames.getLength() == 0 ) -+ { -+ aServiceNames.realloc( 1 ); -+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItems" ) ); -+ } -+ return aServiceNames; -+} -+ -diff --git sc/source/ui/vba/vbamenuitems.hxx sc/source/ui/vba/vbamenuitems.hxx -new file mode 100644 -index 0000000..8aeb931 ---- /dev/null -+++ sc/source/ui/vba/vbamenuitems.hxx -@@ -0,0 +1,68 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef SC_VBA_MENUITEMS_HXX -+#define SC_VBA_MENUITEMS_HXX -+ -+#include <ooo/vba/excel/XMenuItems.hpp> -+#include <ooo/vba/excel/XMenuItem.hpp> -+#include <ooo/vba/XCommandBarControls.hpp> -+#include <vbahelper/vbahelperinterface.hxx> -+#include <vbahelper/vbacollectionimpl.hxx> -+ -+typedef CollTestImplHelper< ov::excel::XMenuItems > MenuItems_BASE; -+ -+class ScVbaMenuItems : public MenuItems_BASE -+{ -+private: -+ css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls; -+ -+public: -+ ScVbaMenuItems( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException ); -+ -+ // XEnumerationAccess -+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); -+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); -+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); -+ -+ // Methods -+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); -+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); -+ virtual css::uno::Reference< ov::excel::XMenuItem > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& ShortcutKey, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& StatusBar, const css::uno::Any& HelpFile, const css::uno::Any& HelpContextID ) throw (css::script::BasicErrorException, css::uno::RuntimeException); -+ // XHelperInterface -+ virtual rtl::OUString& getServiceImplName(); -+ virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -+}; -+ -+#endif//SC_VBA_MENUITEMS_HXX -diff --git sc/source/ui/vba/vbamenus.cxx sc/source/ui/vba/vbamenus.cxx -new file mode 100644 -index 0000000..7d5a21b ---- /dev/null -+++ sc/source/ui/vba/vbamenus.cxx -@@ -0,0 +1,145 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#include "vbamenus.hxx" -+#include "vbamenu.hxx" -+#include <ooo/vba/office/MsoControlType.hpp> -+ -+using namespace com::sun::star; -+using namespace ooo::vba; -+ -+ -+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE; -+ -+class MenuEnumeration : public MenuEnumeration_BASE -+{ -+ uno::Reference< XHelperInterface > m_xParent; -+ uno::Reference< uno::XComponentContext > m_xContext; -+ uno::Reference< container::XEnumeration > m_xEnumeration; -+public: -+ MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) -+ { -+ } -+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) -+ { -+ return m_xEnumeration->hasMoreElements(); -+ } -+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) -+ { -+ // FIXME: should be add menu -+ if( hasMoreElements() ) -+ { -+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); -+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup ) -+ { -+ uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) ); -+ return uno::makeAny( xMenu ); -+ } -+ nextElement(); -+ } -+ else -+ throw container::NoSuchElementException(); -+ return uno::Any(); -+ } -+}; -+ -+ScVbaMenus::ScVbaMenus( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : Menus_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls ) -+{ -+} -+ -+// XEnumerationAccess -+uno::Type SAL_CALL -+ScVbaMenus::getElementType() throw ( uno::RuntimeException ) -+{ -+ return excel::XMenu::static_type( 0 ); -+} -+ -+uno::Reference< container::XEnumeration > -+ScVbaMenus::createEnumeration() throw ( uno::RuntimeException ) -+{ -+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW ); -+ return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) ); -+} -+ -+uno::Any -+ScVbaMenus::createCollectionObject( const uno::Any& aSource ) -+{ -+ // make no sense -+ return aSource; -+} -+ -+sal_Int32 SAL_CALL -+ScVbaMenus::getCount() throw(css::uno::RuntimeException) -+{ -+ // FIXME: should check if it is a popup menu -+ return m_xCommandBarControls->getCount(); -+} -+ -+// ScVbaCollectionBaseImpl -+uno::Any SAL_CALL -+ScVbaMenus::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) -+{ -+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW ); -+ if( xCommandBarControl->getType() != office::MsoControlType::msoControlPopup ) -+ throw uno::RuntimeException(); -+ return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) ); -+} -+ -+uno::Reference< excel::XMenu > SAL_CALL ScVbaMenus::Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException) -+{ -+ sal_Int32 nType = office::MsoControlType::msoControlPopup; -+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore ); -+ xCommandBarControl->setCaption( Caption ); -+ return uno::Reference< excel::XMenu >( new ScVbaMenu( this, mxContext, xCommandBarControl ) ); -+} -+ -+// XHelperInterface -+rtl::OUString& -+ScVbaMenus::getServiceImplName() -+{ -+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenus") ); -+ return sImplName; -+} -+uno::Sequence<rtl::OUString> -+ScVbaMenus::getServiceNames() -+{ -+ static uno::Sequence< rtl::OUString > aServiceNames; -+ if ( aServiceNames.getLength() == 0 ) -+ { -+ aServiceNames.realloc( 1 ); -+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menus" ) ); -+ } -+ return aServiceNames; -+} -+ -diff --git sc/source/ui/vba/vbamenus.hxx sc/source/ui/vba/vbamenus.hxx -new file mode 100644 -index 0000000..596127e ---- /dev/null -+++ sc/source/ui/vba/vbamenus.hxx -@@ -0,0 +1,68 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * last change: $Author$ $Date$ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+#ifndef SC_VBA_MENUS_HXX -+#define SC_VBA_MENUS_HXX -+ -+#include <ooo/vba/excel/XMenus.hpp> -+#include <ooo/vba/excel/XMenu.hpp> -+#include <ooo/vba/XCommandBarControls.hpp> -+#include <vbahelper/vbahelperinterface.hxx> -+#include <vbahelper/vbacollectionimpl.hxx> -+ -+typedef CollTestImplHelper< ov::excel::XMenus > Menus_BASE; -+ -+class ScVbaMenus : public Menus_BASE -+{ -+private: -+ css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls; -+ -+public: -+ ScVbaMenus( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException ); -+ -+ // XEnumerationAccess -+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); -+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); -+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); -+ -+ // Methods -+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); -+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); -+ virtual css::uno::Reference< ov::excel::XMenu > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException); -+ // XHelperInterface -+ virtual rtl::OUString& getServiceImplName(); -+ virtual css::uno::Sequence<rtl::OUString> getServiceNames(); -+}; -+ -+#endif//SC_VBA_MENUS_HXX |