summaryrefslogtreecommitdiff
path: root/patches/vba/basic-ide-module-object-name-combile.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/vba/basic-ide-module-object-name-combile.diff')
-rw-r--r--patches/vba/basic-ide-module-object-name-combile.diff98
1 files changed, 0 insertions, 98 deletions
diff --git a/patches/vba/basic-ide-module-object-name-combile.diff b/patches/vba/basic-ide-module-object-name-combile.diff
deleted file mode 100644
index ecea8b877..000000000
--- a/patches/vba/basic-ide-module-object-name-combile.diff
+++ /dev/null
@@ -1,98 +0,0 @@
---- oovbaapi/ooo/vba/excel/XWorksheet.idl.old 2009-04-06 16:42:00.000000000 +0000
-+++ oovbaapi/ooo/vba/excel/XWorksheet.idl 2009-04-06 16:42:00.000000000 +0000
-@@ -42,6 +42,9 @@
- #include <com/sun/star/script/XInvocation.idl>
- #endif
-
-+#ifndef __com_sun_star_container_XNamed_idl__
-+#include <com/sun/star/container/XNamed.idl>
-+#endif
- //=============================================================================
-
- module ooo { module vba { module excel {
-@@ -57,8 +60,8 @@ interface XWorksheet
- {
- interface ::ooo::vba::XHelperInterface;
- interface ::com::sun::star::script::XInvocation;
-+ interface ::com::sun::star::container::XNamed;
-
-- [attribute] string Name;
- [attribute] boolean Visible;
- [attribute, readonly] long StandardHeight;
- [attribute, readonly] long StandardWidth;
---- sc/source/ui/vba/vbaworksheet.hxx.old 2009-04-06 16:42:00.000000000 +0000
-+++ sc/source/ui/vba/vbaworksheet.hxx 2009-04-06 16:42:00.000000000 +0000
-@@ -45,6 +45,7 @@
- #include <ooo/vba/excel/XPageSetup.hpp>
- #include <ooo/vba/excel/XHPageBreaks.hpp>
- #include <ooo/vba/excel/XChartObjects.hpp>
-+#include <com/sun/star/container/XNamed.hpp>
-
- #include "vbahelperinterface.hxx"
-
---- basctl/source/basicide/basides2.cxx.old 2009-04-06 16:41:59.000000000 +0000
-+++ basctl/source/basicide/basides2.cxx 2009-04-06 16:42:00.000000000 +0000
-@@ -55,11 +55,32 @@
- #include <tools/diagnose_ex.h>
- #include <sfx2/sfxdefs.hxx>
- #include <sfx2/signaturestate.hxx>
-+#include <com/sun/star/script/ModuleInfo.hpp>
-+#include <com/sun/star/container/XNameContainer.hpp>
-+#include <com/sun/star/container/XNamed.hpp>
-+#include <com/sun/star/lang/XServiceInfo.hpp>
-
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::uno;
- namespace css = ::com::sun::star;
-
-+void lcl_getObjectName( const uno::Reference< container::XNameContainer >& rLib, const String& rModName, String& rObjName )
-+{
-+ uno::Any aElement( rLib->getByName( rModName ) );
-+ script::ModuleInfo aModuleInfo;
-+ if( aElement >>= aModuleInfo )
-+ {
-+ uno::Any aObject( aModuleInfo.ModuleObject );
-+ uno::Reference< lang::XServiceInfo > xServiceInfo( aObject, uno::UNO_QUERY );
-+ if( xServiceInfo.is() && xServiceInfo->supportsService( rtl::OUString::createFromAscii( "org.openoffice.excel.Worksheet" ) ) )
-+ {
-+ uno::Reference< container::XNamed > xNamed( aObject, uno::UNO_QUERY );
-+ if( xNamed.is() )
-+ rObjName = xNamed->getName();
-+ }
-+ }
-+}
-+
- IMPL_LINK_INLINE_START( BasicIDEShell, ObjectDialogCancelHdl, ObjectCatalog *, EMPTYARG )
- {
- ShowObjectDialog( FALSE, TRUE );
-@@ -232,7 +253,7 @@ ModulWindow* BasicIDEShell::CreateBasWin
- if ( !aLibName.Len() )
- aLibName = String::CreateFromAscii( "Standard" );
-
-- rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
-+ uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
-
- if ( !aModName.Len() )
- aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
-@@ -272,7 +293,20 @@ ModulWindow* BasicIDEShell::CreateBasWin
- DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" );
- }
- if( nKey )
-- pTabBar->InsertPage( (USHORT)nKey, aModName );
-+ {
-+ if( xLib.is() )
-+ {
-+ // display a nice friendly name in the ObjectModule tab,
-+ // combining the objectname and module name, e.g. Sheet1 ( Financials )
-+ String sObjName;
-+ lcl_getObjectName( xLib, rModName, sObjName );
-+ if( sObjName.Len() )
-+ {
-+ aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")");
-+ }
-+ }
-+ pTabBar->InsertPage( (USHORT)nKey, aModName );
-+ }
- pTabBar->Sort();
- pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
- if ( !pCurWin )