ooo-build r15409 - in trunk: . patches/dev300 patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r15409 - in trunk: . patches/dev300 patches/vba
- Date: Tue, 24 Feb 2009 16:55:47 +0000 (UTC)
Author: noelpwer
Date: Tue Feb 24 16:55:47 2009
New Revision: 15409
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15409&view=rev
Log:
2009-02-24 Noel Power <noel power novell com>
* patches/vba/vba-improve-toolbarapi-macro-search.diff: deal with
alternative macro action specifications
* patches/dev300/apply:
Added:
trunk/patches/vba/vba-improve-toolbarapi-macro-search.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Tue Feb 24 16:55:47 2009
@@ -1842,6 +1842,7 @@
[ VBAObjects ]
vba-combobox-listindex-fix.diff, n#476891, Fong
vba-fix-copysheet-toend.diff, n#478187
+vba-improve-toolbarapi-macro-search.diff
[ VBAUntested ]
SectionOwner => noelpwer
vba-basic-null.diff i#85349, jjiao
Added: trunk/patches/vba/vba-improve-toolbarapi-macro-search.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-improve-toolbarapi-macro-search.diff Tue Feb 24 16:55:47 2009
@@ -0,0 +1,61 @@
+diff --git vbahelper/source/vbahelper/vbacommandbarcontrol.cxx vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+index fdea661..718cdd0 100644
+--- vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
++++ vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+@@ -290,19 +290,51 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u
+ rtl::OUString aCommandURL;
+ rtl::OUString sScheme = rtl::OUString::createFromAscii( "vnd.sun.star.script:");
+ SbModule* pModule = StarBASIC::GetActiveModule();
+- if( pModule )
++ StarBASIC* pLib = pModule ? dynamic_cast< StarBASIC* >( pModule->GetParent() ) : NULL;
++
++ // Ok, we should be able to deal with the following params for onAction
++ // a) macro ( we assume the macro lives in this Project ( that is not really a valid assumption but we can't currently search outside this Library yet )
++ // b) module.macro ( again assume the macro is in this Project )
++ // c) project.module.macro fully specified
++
++ if( pModule && pLib )
+ {
+- String sTmp = _onaction;
+- if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pModule->Find( sTmp, SbxCLASS_METHOD ) ) )
++ String sProject;
++ String sModule;
++ String sMacro = _onaction;
++
++ sal_Int32 nMacroDot = _onaction.lastIndexOf( '.' );
++
++ if ( nMacroDot != -1 )
++ {
++ sMacro = _onaction.copy( nMacroDot + 1 );
++
++ sal_Int32 nProjectDot = _onaction.lastIndexOf( '.', nMacroDot - 1 );
++ if ( nProjectDot != -1 )
++ {
++ sModule = _onaction.copy( nProjectDot + 1, nMacroDot - nProjectDot - 1 );
++ pModule = NULL; // force full spec. no search
++
++ }
++ else
++ sModule = _onaction.copy( 0, nMacroDot );
++ pModule = pLib->FindModule( sModule );
++ }
++
++ // Hopefully eventually if no project is specified 'Find' below
++ // will do the right thing
++ if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pModule ? pModule->Find( sMacro, SbxCLASS_METHOD ) : NULL ) )
+ {
+ if( pMethod )
+ {
+- sTmp.Insert( '.', 0 ).Insert( pModule->GetName(), 0 ).Insert( '.', 0 ).Insert( pModule->GetParent()->GetName(), 0 );
++ sModule = pModule->GetName();
++ sProject = pModule->GetParent()->GetName();
+ }
+ }
++ sMacro.Insert( '.', 0 ).Insert( sModule, 0 ).Insert( '.', 0 ).Insert( sProject, 0 );
+
+ rtl::OUString sUrlPart2 = rtl::OUString::createFromAscii( "?language=Basic&location=document");
+- aCommandURL = sScheme.concat( sTmp ).concat( sUrlPart2 );
++ aCommandURL = sScheme.concat( sMacro ).concat( sUrlPart2 );
+ OSL_TRACE("**** METHOD IS %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]