ooo-build r14829 - in trunk: . patches/vba
- From: pflin svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14829 - in trunk: . patches/vba
- Date: Fri, 12 Dec 2008 06:45:44 +0000 (UTC)
Author: pflin
Date: Fri Dec 12 06:45:44 2008
New Revision: 14829
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14829&view=rev
Log:
2008-12-12 Fong Lin <pflin novell com>
* patches/vba/vba-commandbar-fix.diff: Add CommandBarButton and
CommandBarPopup objects.
Modified:
trunk/ChangeLog
trunk/patches/vba/vba-commandbar-fix.diff
Modified: trunk/patches/vba/vba-commandbar-fix.diff
==============================================================================
--- trunk/patches/vba/vba-commandbar-fix.diff (original)
+++ trunk/patches/vba/vba-commandbar-fix.diff Fri Dec 12 06:45:44 2008
@@ -13,10 +13,10 @@
}; };
diff --git oovbaapi/ooo/vba/XCommandBarButton.idl oovbaapi/ooo/vba/XCommandBarButton.idl
new file mode 100644
-index 0000000..507ba2e
+index 0000000..c93f236
--- /dev/null
+++ oovbaapi/ooo/vba/XCommandBarButton.idl
-@@ -0,0 +1,57 @@
+@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
@@ -57,18 +57,13 @@
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
-+
-+#ifndef __ooo_vba_XCommandBarControl_idl__
-+#include <ooo/vba/XCommandBarControl.idl>
-+#endif
+//=============================================================================
+
+module ooo { module vba {
+//=============================================================================
+
-+interface XCommandBarButton
++interface XCommandBarButton: com::sun::star::uno::XInterface
+{
-+ interface XCommandBarControl;
+};
+
+}; };
@@ -76,10 +71,10 @@
+#endif
diff --git oovbaapi/ooo/vba/XCommandBarPopup.idl oovbaapi/ooo/vba/XCommandBarPopup.idl
new file mode 100644
-index 0000000..dc98b84
+index 0000000..cfcecfe
--- /dev/null
+++ oovbaapi/ooo/vba/XCommandBarPopup.idl
-@@ -0,0 +1,57 @@
+@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
@@ -120,18 +115,13 @@
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
-+
-+#ifndef __ooo_vba_XCommandBarControl_idl__
-+#include <ooo/vba/XCommandBarControl.idl>
-+#endif
+//=============================================================================
+
+module ooo { module vba {
+//=============================================================================
+
-+interface XCommandBarPopup
++interface XCommandBarPopup: com::sun::star::uno::XInterface
+{
-+ interface XCommandBarControl;
+};
+
+}; };
@@ -151,7 +141,7 @@
# ------------------------------------------------------------------
diff --git sc/source/ui/vba/vbacommandbar.cxx sc/source/ui/vba/vbacommandbar.cxx
-index b0ececd..24e5189 100644
+index 76885c4..b5c283d 100644
--- sc/source/ui/vba/vbacommandbar.cxx
+++ sc/source/ui/vba/vbacommandbar.cxx
@@ -37,6 +37,7 @@
@@ -196,7 +186,7 @@
ScVbaCommandBar::getServiceImplName()
{
diff --git sc/source/ui/vba/vbacommandbar.hxx sc/source/ui/vba/vbacommandbar.hxx
-index 286bed1..bbeda7c 100644
+index ff659aa..920dc18 100644
--- sc/source/ui/vba/vbacommandbar.hxx
+++ sc/source/ui/vba/vbacommandbar.hxx
@@ -97,6 +97,8 @@ public:
@@ -209,7 +199,7 @@
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
diff --git sc/source/ui/vba/vbacommandbarcontrol.cxx sc/source/ui/vba/vbacommandbarcontrol.cxx
-index afefd7b..00d9de2 100644
+index afefd7b..8a39074 100644
--- sc/source/ui/vba/vbacommandbarcontrol.cxx
+++ sc/source/ui/vba/vbacommandbarcontrol.cxx
@@ -33,6 +33,8 @@
@@ -226,7 +216,7 @@
}
-ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_sName( sName )
-+ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nType, sal_Int32 nPosition ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_sName( sName ), m_nType( nType ), m_nPosition( nPosition )
++ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Int32 nType ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_sName( sName ), m_nPosition( nPosition ), m_nType( nType )
{
// exsiting CommandBarBarControl
m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
@@ -270,11 +260,27 @@
m_bTemporary = sal_True;
}
-ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_nPosition( nPosition ), m_bTemporary( bTemporary )
-+ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary, sal_Int32 nType) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_nPosition( nPosition ), m_bTemporary( bTemporary ), m_nType( nType )
++ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Bool bTemporary, sal_Int32 nType) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_nPosition( nPosition ), m_bTemporary( bTemporary ), m_nType( nType )
{
m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
initObjects();
-@@ -161,27 +135,32 @@ ScVbaCommandBarControl::initObjects() throw (uno::RuntimeException)
+@@ -130,14 +104,7 @@ ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInt
+ {
+ m_sName = sName;
+ }
+- if( sCommand.getLength() > 0 )
+- {
+- m_sCommand = sCommand;
+- }
+- else
+- {
+- m_sCommand = rtl::OUString::createFromAscii("vnd.openoffice.org:") + sName;
+- }
++ m_sCommand = rtl::OUString::createFromAscii("vnd.openoffice.org:") + sName;
+ if( m_bIsMenu )
+ {
+ m_sBarName = rtl::OUString::createFromAscii("private:resource/menubar/menubar");
+@@ -161,27 +128,32 @@ ScVbaCommandBarControl::initObjects() throw (uno::RuntimeException)
m_xBarSettings.set( m_pCommandBarControls->GetBarSettings(), uno::UNO_QUERY_THROW );
m_bIsMenu = m_pCommandBarControls->IsMenu();
m_sName = rtl::OUString::createFromAscii( "Custom" );
@@ -316,7 +322,7 @@
if( m_pCommandBarControls->GetParentCommandBar() != NULL )
{
// create a new menu
-@@ -191,7 +170,6 @@ ScVbaCommandBarControl::createNewMenuBarControl()
+@@ -191,7 +163,6 @@ ScVbaCommandBarControl::createNewMenuBarControl()
else if( m_pCommandBarControls->GetParentCommandBarControl() != NULL )
{
// create a new menu entry
@@ -324,7 +330,7 @@
ScVbaCommandBarControl* pPc = m_pCommandBarControls->GetParentCommandBarControl();
beans::PropertyValues aPropertyValues;
pPc->GetCurrentSettings()->getByIndex( pPc->GetPosition() ) >>= aPropertyValues;
-@@ -204,7 +182,7 @@ ScVbaCommandBarControl::createNewMenuBarControl()
+@@ -204,7 +175,7 @@ ScVbaCommandBarControl::createNewMenuBarControl()
pPc->GetCurrentSettings()->replaceByIndex( pPc->GetPosition(), uno::makeAny( pPc->GetPropertyValues() ) );
}
m_xCurrentSettings.set( lcl_getPropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer") ), uno::UNO_QUERY_THROW );
@@ -333,7 +339,7 @@
}
if( m_xUICfgManager->hasSettings( m_sBarName ) )
{
-@@ -229,7 +207,7 @@ ScVbaCommandBarControl::createNewToolBarControl()
+@@ -229,7 +200,7 @@ ScVbaCommandBarControl::createNewToolBarControl()
aPropertys[1].Name = rtl::OUString::createFromAscii("Label");
aPropertys[1].Value <<= m_sName;
aPropertys[2].Name = rtl::OUString::createFromAscii("Type");
@@ -342,7 +348,7 @@
aPropertys[3].Name = rtl::OUString::createFromAscii("IsVisible");
aPropertys[3].Value <<= sal_True;
-@@ -314,10 +292,25 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u
+@@ -314,10 +285,25 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u
{
if( m_xCurrentSettings.is() )
{
@@ -369,17 +375,17 @@
m_xCurrentSettings->replaceByIndex( m_nPosition, uno::makeAny( aNewPropertyValues ) );
if( m_xUICfgManager->hasSettings( m_sBarName ) )
{
-@@ -401,3 +394,57 @@ ScVbaCommandBarControl::getServiceNames()
+@@ -401,3 +387,57 @@ ScVbaCommandBarControl::getServiceNames()
}
return aServiceNames;
}
+
+//////////// ScVbaCommandBarPopup //////////////////////////////
-+ScVbaCommandBarPopup::ScVbaCommandBarPopup( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName ) throw (uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext ), ScVbaCommandBarControl( xParent, xContext, sName, office::MsoControlType::msoControlPopup )
++ScVbaCommandBarPopup::ScVbaCommandBarPopup( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition ) throw (uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext, sName, nPosition, office::MsoControlType::msoControlPopup )
+{
+}
+
-+ScVbaCommandBarPopup::ScVbaCommandBarPopup( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext ), ScVbaCommandBarControl( xParent, xContext, sName, sCommand, nPosition, bTemporary, office::MsoControlType::msoControlPopup )
++ScVbaCommandBarPopup::ScVbaCommandBarPopup( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarPopup_BASE( xParent, xContext, sName, nPosition, bTemporary, office::MsoControlType::msoControlPopup)
+{
+}
+
@@ -402,11 +408,11 @@
+}
+
+//////////// ScVbaCommandBarButton //////////////////////////////
-+ScVbaCommandBarButton::ScVbaCommandBarButton( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName ) throw (uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext ), ScVbaCommandBarControl( xParent, xContext, sName, office::MsoControlType::msoControlButton )
++ScVbaCommandBarButton::ScVbaCommandBarButton( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition ) throw (uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext, sName, nPosition, office::MsoControlType::msoControlButton )
+{
+}
+
-+ScVbaCommandBarButton::ScVbaCommandBarButton( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext ), ScVbaCommandBarControl( xParent, xContext, sName, sCommand, nPosition, bTemporary,office::MsoControlType::msoControlButton )
++ScVbaCommandBarButton::ScVbaCommandBarButton( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarButton_BASE( xParent, xContext, sName, nPosition, bTemporary, office::MsoControlType::msoControlButton)
+{
+}
+
@@ -428,7 +434,7 @@
+ return aServiceNames;
+}
diff --git sc/source/ui/vba/vbacommandbarcontrol.hxx sc/source/ui/vba/vbacommandbarcontrol.hxx
-index 8aec911..cc237bd 100644
+index aa0540d..f0a404e 100644
--- sc/source/ui/vba/vbacommandbarcontrol.hxx
+++ sc/source/ui/vba/vbacommandbarcontrol.hxx
@@ -36,6 +36,9 @@
@@ -439,7 +445,7 @@
+#include <ooo/vba/XCommandBarButton.hpp>
+#include <ooo/vba/office/MsoControlType.hpp>
- #include "vbahelperinterface.hxx"
+ #include <oovbaapi/vbahelperinterface.hxx>
#include "vbacommandbarcontrols.hxx"
@@ -64,8 +67,12 @@ private:
void createNewMenuBarControl();
@@ -447,8 +453,8 @@
public:
- ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName ) throw (css::uno::RuntimeException);
- ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
-+ ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nType = ov::office::MsoControlType::msoControlButton, sal_Int32 nPosition = 0 ) throw (css::uno::RuntimeException);
-+ ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary, sal_Int32 nType = ov::office::MsoControlType::msoControlButton ) throw (css::uno::RuntimeException);
++ ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition = 0, sal_Int32 nType = ov::office::MsoControlType::msoControlButton ) throw (css::uno::RuntimeException);
++ ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Bool bTemporary, sal_Int32 nType = ov::office::MsoControlType::msoControlButton ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::ui::XUIConfigurationManager > GetUICfgManager() { return m_xUICfgManager; };
+ css::uno::Reference< css::ui::XUIConfigurationPersistence > GetUICfgPers() { return m_xUICfgPers; };
+ css::uno::Reference< css::container::XIndexContainer > GetBarSettings() { return m_xBarSettings; };
@@ -456,103 +462,28 @@
sal_Int32 GetPosition() { return m_nPosition; };
css::uno::Reference< css::container::XIndexContainer > GetCurrentSettings() { return m_xCurrentSettings; };
css::beans::PropertyValues GetPropertyValues() { return m_aPropertyValues; };
-@@ -87,4 +94,102 @@ public:
+@@ -87,4 +94,27 @@ public:
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
+
-+// FIXME: the following classes don't work now
-+typedef InheritedHelperInterfaceImpl1< ov::XCommandBarPopup > CommandBarPopup_BASE;
-+class ScVbaCommandBarPopup : public CommandBarPopup_BASE, ScVbaCommandBarControl
++typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE;
++class ScVbaCommandBarPopup : public CommandBarPopup_BASE
+{
+public:
-+ ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName ) throw (css::uno::RuntimeException);
-+ ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
-+
-+ // Attributes
-+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::getCaption();
-+ }
-+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::setCaption( _caption );
-+ }
-+ virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::getOnAction();
-+ }
-+ virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::setOnAction( _onaction );
-+ }
-+ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::getVisible();
-+ }
-+ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::setVisible( _visible );
-+ }
-+
-+ // Methods
-+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::Delete();
-+ }
-+ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::Controls( aIndex );
-+ }
-+
++ ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition = 0 ) throw (css::uno::RuntimeException);
++ ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
-+typedef InheritedHelperInterfaceImpl1< ov::XCommandBarButton > CommandBarButton_BASE;
-+class ScVbaCommandBarButton : public CommandBarButton_BASE, ScVbaCommandBarControl
++typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE;
++class ScVbaCommandBarButton : public CommandBarButton_BASE
+{
+public:
-+ ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName ) throw (css::uno::RuntimeException);
-+ ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
-+
-+ // Attributes
-+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::getCaption();
-+ }
-+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::setCaption( _caption );
-+ }
-+ virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::getOnAction();
-+ }
-+ virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::setOnAction( _onaction );
-+ }
-+ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::getVisible();
-+ }
-+ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::setVisible( _visible );
-+ }
-+
-+ // Methods
-+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
-+ {
-+ ScVbaCommandBarControl::Delete();
-+ }
-+ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
-+ {
-+ return ScVbaCommandBarControl::Controls( aIndex );
-+ }
-+
++ ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition = 0 ) throw (css::uno::RuntimeException);
++ ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
@@ -560,7 +491,7 @@
+
#endif//SC_VBA_COMMANDBARCONTROL_HXX
diff --git sc/source/ui/vba/vbacommandbarcontrols.cxx sc/source/ui/vba/vbacommandbarcontrols.cxx
-index 15cca20..8106f7f 100644
+index 15cca20..02cec01 100644
--- sc/source/ui/vba/vbacommandbarcontrols.cxx
+++ sc/source/ui/vba/vbacommandbarcontrols.cxx
@@ -38,6 +38,8 @@
@@ -597,7 +528,7 @@
}
else
{
-@@ -171,7 +191,59 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
+@@ -171,7 +191,62 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
// only surport the aSource as a name string, because this class is a API wrapper
rtl::OUString sName;
if( aSource >>= sName )
@@ -646,10 +577,13 @@
+ {
+ uno::Reference< container::XIndexContainer > xSubMenu;
+ lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii( "ItemDescriptorContainer" ) ) >>= xSubMenu;
++ ScVbaCommandBarControl* pNewCommandBarControl = NULL;
+ if( xSubMenu.is() )
-+ return uno::makeAny( uno::Reference< XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sName, office::MsoControlType::msoControlPopup, nPosition ) ) );
++ pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, sName, nPosition );
+ else
-+ return uno::makeAny( uno::Reference< XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sName, office::MsoControlType::msoControlButton, nPosition ) ) );
++ pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, sName, nPosition );
++
++ return uno::makeAny( uno::Reference< XCommandBarControl > ( pNewCommandBarControl ) );
+ }
+ else
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("The CommandBarControl do not exist"), uno::Reference< uno::XInterface >() );
@@ -658,7 +592,7 @@
return uno::Any();
}
-@@ -214,16 +286,38 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
+@@ -214,16 +289,43 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
// evalute the action of the new control
}
if( Before.hasValue() )
@@ -687,21 +621,26 @@
}
- return uno::Reference< XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sCaption, sCommand, nPosition, bTemporary ) );
+
++ ScVbaCommandBarControl* pNewCommandBarControl = NULL;
+ if( nType == office::MsoControlType::msoControlButton )
+ {
-+ return uno::Reference< XCommandBarControl >( new ScVbaCommandBarControl( this, mxContext, sCaption, sCommand, nPosition, bTemporary, office::MsoControlType::msoControlButton ) );
++ pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, sCaption, nPosition, bTemporary );
+ }
+ else if ( nType == office::MsoControlType::msoControlPopup )
+ {
-+ return uno::Reference< XCommandBarControl >( new ScVbaCommandBarControl( this, mxContext, sCaption, sCommand, nPosition, bTemporary, office::MsoControlType::msoControlPopup ) );
++ pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, sCaption, nPosition, bTemporary );
++ }
++ else
++ {
++ pNewCommandBarControl = new ScVbaCommandBarControl( this, mxContext, sCaption, nPosition, bTemporary );
+ }
+
-+ return uno::Reference< XCommandBarControl >( new ScVbaCommandBarControl( this, mxContext, sCaption, sCommand, nPosition, bTemporary ) );
++ return uno::Reference< XCommandBarControl >( pNewCommandBarControl );
}
// XHelperInterface
diff --git sc/source/ui/vba/vbacommandbarcontrols.hxx sc/source/ui/vba/vbacommandbarcontrols.hxx
-index 9ee0322..8e7d1e1 100644
+index 2355678..4ebfe88 100644
--- sc/source/ui/vba/vbacommandbarcontrols.hxx
+++ sc/source/ui/vba/vbacommandbarcontrols.hxx
@@ -56,6 +56,7 @@ private:
@@ -713,10 +652,10 @@
public:
ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::container::XIndexAccess > xIndexAccess ) throw( css::uno::RuntimeException );
diff --git sc/source/ui/vba/vbacommandbars.cxx sc/source/ui/vba/vbacommandbars.cxx
-index 79e43f5..a111609 100644
+index ad5ad43..7913000 100644
--- sc/source/ui/vba/vbacommandbars.cxx
+++ sc/source/ui/vba/vbacommandbars.cxx
-@@ -201,6 +201,20 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) th
+@@ -202,6 +202,20 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) th
{
return createCollectionObject( aIndex );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]