summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/macrodlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide/macrodlg.cxx')
-rw-r--r--basctl/source/basicide/macrodlg.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index f3e41e60d34b..41a5fa488950 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -382,7 +382,15 @@ SbMethod* MacroChooser::CreateMacro()
SbModule* pModule = 0;
String aModName( aDesc.GetName() );
if ( aModName.Len() )
+ {
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) )
+ {
+ sal_uInt16 nIndex = 0;
+ aModName = aModName.GetToken( 0, ' ', nIndex );
+ }
pModule = pBasic->FindModule( aModName );
+ }
else if ( pBasic->GetModules()->Count() )
pModule = (SbModule*)pBasic->GetModules()->Get( 0 );
@@ -710,6 +718,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
BasicManager* pBasMgr = aDocument.getBasicManager();
String aLib( aDesc.GetLibName() );
String aMod( aDesc.GetName() );
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) )
+ {
+ sal_uInt16 nIndex = 0;
+ aMod = aMod.GetToken( 0, ' ', nIndex );
+ }
String aSub( aDesc.GetMethodName() );
SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, String() );
if ( pButton == &aEditButton )