[Solved] SpecialCells on OOo 3.3.0 / LO 3.3.0

Discussions about using 3rd party extension with OpenOffice.org

[Solved] SpecialCells on OOo 3.3.0 / LO 3.3.0

Postby mrw7 » Tue Feb 01, 2011 3:57 pm

Hi,
for years I have been using Villeroy's extension Special Cells (http://ooomacros.org/user.php#221020) which helped a lot to discover mistakes in my spreadsheets - thank you very, very much Villeroy.
Now it fails to install on both OOo330 and LO330. I tried to adapt the Addons.xcu and managed to install the extension but it does not start up.
Do you, Villeroy, know what is the problem with SpecialCells and OOo330 and do you plan to to make a compatible version? It would really be great! Or does anybody know, how to change the extension's code?

Thank you in advance.
Martin
Last edited by mrw7 on Tue Feb 01, 2011 10:33 pm, edited 1 time in total.
OOo321, OOo330, LO330 on WinXP+SP3, Win7
mrw7
 
Posts: 2
Joined: Tue Feb 01, 2011 3:39 pm

Re: SpecialCells on OOo330/LO330

Postby hanya » Tue Feb 01, 2011 4:50 pm

It has a problem about node name, 2nd line in the Addons.xcu:
Code: Select all   Expand viewCollapse view
<oor:node xmlns:oor="http://openoffice.org/2001/registry" ....
should be fixed like the following
Code: Select all   Expand viewCollapse view
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" ....

And last tag should be changed also, replace
Code: Select all   Expand viewCollapse view
</oor:node>
with
Code: Select all   Expand viewCollapse view
</oor:component-data>


There are some extension having this problem in their Addons.xcu files.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 884
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: SpecialCells on OOo330/LO330

Postby Villeroy » Tue Feb 01, 2011 5:11 pm

Thank you, hanya for dropping in. Parts of the extension do not work anymore even with your suggested patch.
The source code needs a minimal patch to make it run with the help buttons disabled:
Code: Select all   Expand viewCollapse view
class ConfigProvider(XJobExecutor,unohelper.Base):
    RootNode = 'name.AndreasSaeger.SpecialCells.Localization/LocalizedStrings'
    HelpDoc = 'SpecialCells.sxw'
    Bookmark = '#_TOP'
    def __init__(self,ctx,):
        try:
            self.FileAccess = createUnoService(ctx, 'com.sun.star.ucb.SimpleFileAccess')
            self.Desktop = getDesktop(ctx)
            self.ConfRoot = getConfigurationRoot(ctx,ConfigProvider.RootNode)
            # %origin%/../help/SpecialCells.sxw
            # vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/SHZUe5_/SpecialCells.0.5.62.uno.zip/registry/../help/en/SpecialCells.sxw
            EXP = getMacroExpander(ctx)
            sMacroString = self.ConfRoot.getByName('HelpPath')
            sPrefix = "vnd.sun.star.expand:"
            sURL = EXP.expandMacros(sMacroString)
            n = len(sPrefix)
            if sURL.startswith(sPrefix):
                sURL = sURL[n:]
            self.HelpPath = sURL
        except:
            raise

Change the last word "raise" to "pass" which will ignore the error, effectively disabling the help function.
Now the content dialog will work in both LibreOffice and OOo (without help file) but the formatting dialog raises a very strange network error under OOo. Under LibreOffice both dialogs work well.
I'll attach the version I'm using currently with LibreOffice. Since the help file is a plain old sxw document you can extract the help directory and open your language version from there.
See my posting of 06 Apr 2011
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26763
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: SpecialCells on OOo330/LO330

Postby hanya » Tue Feb 01, 2011 5:53 pm

Villeroy wrote:The source code needs a minimal patch to make it run with the help buttons disabled:
It is also caused by the configuration changes. I have never tried to use BootstrapContext but now I can do like this:
Code: Select all   Expand viewCollapse view
def getMacroExpander(ctx):
    btx = ctx.getServiceManager().createInstanceWithContext("com.sun.star.configuration.bootstrap.BootstrapContext", ctx)
    if btx:
        return btx.getValueByName("/singletons/com.sun.star.util.theMacroExpander")
    else:
        return ctx.getValueByName("/singletons/com.sun.star.util.theMacroExpander")
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 884
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

[Solved] SpecialCells on OOo330/LO330

Postby mrw7 » Tue Feb 01, 2011 10:33 pm

Thank you very much Villeroy - SpecialCells 0.7.3 works on OOo330.
Also thanks to you hanya. I have not tried your patch but in the next days I surely will.
OOo321, OOo330, LO330 on WinXP+SP3, Win7
mrw7
 
Posts: 2
Joined: Tue Feb 01, 2011 3:39 pm

Re: [Solved] SpecialCells on OOo330/LO330

Postby Villeroy » Wed Apr 06, 2011 9:11 pm

Today I used my extension and I noticed that hanya's patch enables the help files of my SpecialCells extension.
Here comes version 0.7.4 for version 3.3 as it used to work with all versions from 1.4 to 3.2. I tested this new version with 2.4.3 and LibreOffice 3.3.2.
Do not extract the .zip file. Close all spreadsheets, call menu:Tools>Extensions... and add this .zip.

I want to thank this forum's most valued members hanya for the patch and Hagar de l'Est for the French localization.
Attachments
SpecialCells.0.7.4.zip
SpecialCells extension. Install the .zip file as is. Do not extract.
(674.67 KiB) Downloaded 1977 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26763
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] SpecialCells on OOo 3.3.0 / LO 3.3.0

Postby Villeroy » Fri Jul 26, 2013 12:18 am

Some Basic code as a quick work-around for the missing tool bar in AOO 4.
Put it anywhere below "My Macros" and assign your own GUI elements (buttons, menu, hyperlink, shortcut to the respective routines.
Code: Select all   Expand viewCollapse view
REM  *****  BASIC  *****
REM Provisional starters for the SpecialCell extension

REM Macro URLs for this module in global Standard library:
REM vnd.sun.star.script:Standard.Module1.ContentsDialog?language=Basic&location=application
REM vnd.sun.star.script:Standard.Module1.FormatsDialog?language=Basic&location=application
REM vnd.sun.star.script:Standard.Module1.HelpFile?language=Basic&location=application

REM call the contents dialog
Sub ContentsDialog
serv = createUnoService("name.AndreasSaeger.SpecialCells.DialogCellContents")
serv.trigger("")
End Sub

REM call the formattings dialog
Sub FormatsDialog
serv= createUnoService("name.AndreasSaeger.SpecialCells.DialogCellFormatRanges")
serv.trigger("")
End Sub

REM call the help file
Sub HelpFile
serv= createUnoService("name.AndreasSaeger.SpecialCells.ConfigProvider")
serv.trigger("#_TOP")
End Sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26763
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] SpecialCells on OOo 3.3.0 / LO 3.3.0

Postby mikekaganski » Mon Oct 30, 2017 12:48 pm

@Villeroy:

Thank you for your extension!

I have tried it with LibreOffice 5.4, and it turned out that there were some issues with SpecialCells.py:
1. It has non-ASCII character in its license header, and its encoding is not UTF-8
2. Inconsistencies in space and tab usage in indentation
3. Using legacy (already invalid) syntax for "not equal" operator "<>"
4. Absent parentheses in calls for exec.

I attach the file changed to fix these problems in case you'll find it useful to include into the extension.

Maybe you have some current repo with an updated extension? (I only found https://sourceforge.net/projects/ooomac ... cialCells/ with an outdated version.)
Attachments
SpecialCells.py.zip
SpecialCells.py fixed for LibreOffice 5.4
(11.98 KiB) Downloaded 69 times
LibreOffice 5.4 on Windows 10
mikekaganski
 
Posts: 1
Joined: Mon Oct 30, 2017 12:39 pm


Return to Extensions

Who is online

Users browsing this forum: No registered users and 1 guest