1 --- oovbaapi/ooo/vba/excel/XWorksheet.idl.old 2009-04-06 16:42:00.000000000 +0000
2 +++ oovbaapi/ooo/vba/excel/XWorksheet.idl 2009-04-06 16:42:00.000000000 +0000
4 #include <com/sun/star/script/XInvocation.idl>
7 +#ifndef __com_sun_star_container_XNamed_idl__
8 +#include <com/sun/star/container/XNamed.idl>
10 //=============================================================================
12 module ooo { module vba { module excel {
13 @@ -57,8 +60,8 @@ interface XWorksheet
15 interface ::ooo::vba::XHelperInterface;
16 interface ::com::sun::star::script::XInvocation;
17 + interface ::com::sun::star::container::XNamed;
19 - [attribute] string Name;
20 [attribute] boolean Visible;
21 [attribute, readonly] long StandardHeight;
22 [attribute, readonly] long StandardWidth;
23 --- sc/source/ui/vba/vbaworksheet.hxx.old 2009-04-06 16:42:00.000000000 +0000
24 +++ sc/source/ui/vba/vbaworksheet.hxx 2009-04-06 16:42:00.000000000 +0000
26 #include <ooo/vba/excel/XPageSetup.hpp>
27 #include <ooo/vba/excel/XHPageBreaks.hpp>
28 #include <ooo/vba/excel/XChartObjects.hpp>
29 +#include <com/sun/star/container/XNamed.hpp>
31 #include "vbahelperinterface.hxx"
33 --- basctl/source/basicide/basides2.cxx.old 2009-04-06 16:41:59.000000000 +0000
34 +++ basctl/source/basicide/basides2.cxx 2009-04-06 16:42:00.000000000 +0000
36 #include <tools/diagnose_ex.h>
37 #include <sfx2/sfxdefs.hxx>
38 #include <sfx2/signaturestate.hxx>
39 +#include <com/sun/star/script/ModuleInfo.hpp>
40 +#include <com/sun/star/container/XNameContainer.hpp>
41 +#include <com/sun/star/container/XNamed.hpp>
42 +#include <com/sun/star/lang/XServiceInfo.hpp>
44 using namespace ::com::sun::star;
45 using namespace ::com::sun::star::uno;
46 namespace css = ::com::sun::star;
48 +void lcl_getObjectName( const uno::Reference< container::XNameContainer >& rLib, const String& rModName, String& rObjName )
50 + uno::Any aElement( rLib->getByName( rModName ) );
51 + script::ModuleInfo aModuleInfo;
52 + if( aElement >>= aModuleInfo )
54 + uno::Any aObject( aModuleInfo.ModuleObject );
55 + uno::Reference< lang::XServiceInfo > xServiceInfo( aObject, uno::UNO_QUERY );
56 + if( xServiceInfo.is() && xServiceInfo->supportsService( rtl::OUString::createFromAscii( "org.openoffice.excel.Worksheet" ) ) )
58 + uno::Reference< container::XNamed > xNamed( aObject, uno::UNO_QUERY );
60 + rObjName = xNamed->getName();
65 IMPL_LINK_INLINE_START( BasicIDEShell, ObjectDialogCancelHdl, ObjectCatalog *, EMPTYARG )
67 ShowObjectDialog( FALSE, TRUE );
68 @@ -232,7 +253,7 @@ ModulWindow* BasicIDEShell::CreateBasWin
69 if ( !aLibName.Len() )
70 aLibName = String::CreateFromAscii( "Standard" );
72 - rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
73 + uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
75 if ( !aModName.Len() )
76 aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
77 @@ -272,7 +293,20 @@ ModulWindow* BasicIDEShell::CreateBasWin
78 DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" );
81 - pTabBar->InsertPage( (USHORT)nKey, aModName );
85 + // display a nice friendly name in the ObjectModule tab,
86 + // combining the objectname and module name, e.g. Sheet1 ( Financials )
88 + lcl_getObjectName( xLib, rModName, sObjName );
89 + if( sObjName.Len() )
91 + aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")");
94 + pTabBar->InsertPage( (USHORT)nKey, aModName );
97 pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );