Hello,
How do I insert a hyperlink to a C++ Addin function that takes two arguments??
Thanks,
Saleem
Hyperlink to C++ Addin Function
Hyperlink to C++ Addin Function
OpenOffice 3.4.0
Mac OS X 10.5.8
Mac OS X 10.5.8
Re: Hyperlink to C++ Addin Function
Hallo
In 'my' ~/user/Scripts/python/setsheetcontent2.py file are the 2 Functions:
from Calc executing test with :
that print as expected into Terminal:
Karolus
In 'my' ~/user/Scripts/python/setsheetcontent2.py file are the 2 Functions:
Code: Select all
def test(*args):
params = parameter_from_string(args[0])
print 'arg_1: {0}\narg_2: {1}'.format(*params)
def parameter_from_string( string ):
return string.split('params=')[1].split(';')
from Calc executing test with :
Code: Select all
=HYPERLINK("vnd.sun.star.script:setsheetcontent2.py$test?language=Python&location=user¶ms=42;88")
Code: Select all
arg_1: 42
arg_2: 88
Karolus
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Re: Hyperlink to C++ Addin Function
By mere definition an "addin" is meant to be a collection of additional cell functions for the Calc component. Such a function is usable in formula context, it takes arguments and it returns one number or one text value or mutiple values in array context.
I assume that you don't mean addin functions since a hyperlink can not return any value.
Most extensions add functionality by other means. Then they are called "addon".
Taking my SpecialCells extension as an example, I can call both services DialogCellFormatRanges and DialogCellContents with a service: URL:
service:name.AndreasSaeger.SpecialCells.DialogCellFormatRanges
service:name.AndreasSaeger.SpecialCells.DialogCellContents
Same with MRI:
service:mytools.Mri
I assume that you don't mean addin functions since a hyperlink can not return any value.
Most extensions add functionality by other means. Then they are called "addon".
Taking my SpecialCells extension as an example, I can call both services DialogCellFormatRanges and DialogCellContents with a service: URL:
service:name.AndreasSaeger.SpecialCells.DialogCellFormatRanges
service:name.AndreasSaeger.SpecialCells.DialogCellContents
Same with MRI:
service:mytools.Mri
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Hyperlink to C++ Addin Function
Karolus has answered my question but in python -- I just want the C++ equivalent to his answer -- the URL in this case is not clear to me....
I am not referring to calling C++ functions -- the function I would like to call when someone click on the hyperlink has a return type of void and takes in two arguments....it changes some static variables and changes the behavior of my addin....
Saleem
I am not referring to calling C++ functions -- the function I would like to call when someone click on the hyperlink has a return type of void and takes in two arguments....it changes some static variables and changes the behavior of my addin....
Saleem
OpenOffice 3.4.0
Mac OS X 10.5.8
Mac OS X 10.5.8
Re: Hyperlink to C++ Addin Function
karolus calls a Python macro which is a completely different thing.
That routine would be called like this:
vnd.sun.star.script:Library.Module.RoutineName?language=Python&location=application&arg1=blah&arg2=123
As far as I know, you can not write any macros in C++ but you can call a macro which instaciates your addon.
Hyperlink triggers macro, macro preprocesses some arguments and triggers the add-on:
or you call your add-on directly through a service: URL
service:MyAddon.MyService?arg1=blah&arg2=123
That routine would be called like this:
vnd.sun.star.script:Library.Module.RoutineName?language=Python&location=application&arg1=blah&arg2=123
As far as I know, you can not write any macros in C++ but you can call a macro which instaciates your addon.
Hyperlink triggers macro, macro preprocesses some arguments and triggers the add-on:
Code: Select all
def RoutineName(*args):
srv = MyOffice.createUnoService("MyAddOn.MyService")
params = parameter_from_string(args[0])
srv.trigger(params)
service:MyAddon.MyService?arg1=blah&arg2=123
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice