Page 1 of 1

[Solved] SpecialCells on OOo 3.3.0 / LO 3.3.0

PostPosted: Tue Feb 01, 2011 3:57 pm
by mrw7
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

Re: SpecialCells on OOo330/LO330

PostPosted: Tue Feb 01, 2011 4:50 pm
by hanya
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.

Re: SpecialCells on OOo330/LO330

PostPosted: Tue Feb 01, 2011 5:11 pm
by Villeroy
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

Re: SpecialCells on OOo330/LO330

PostPosted: Tue Feb 01, 2011 5:53 pm
by hanya
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")

[Solved] SpecialCells on OOo330/LO330

PostPosted: Tue Feb 01, 2011 10:33 pm
by mrw7
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.

Re: [Solved] SpecialCells on OOo330/LO330

PostPosted: Wed Apr 06, 2011 9:11 pm
by Villeroy
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.

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

PostPosted: Fri Jul 26, 2013 12:18 am
by Villeroy
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

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

PostPosted: Mon Oct 30, 2017 12:48 pm
by mikekaganski
@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.)