jferard / fastods

A very fast and lightweight (no dependency) library for creating ODS (Open Document Spreadsheet, mainly for Calc) files in Java. It's a Martin Schulz's SimpleODS fork
GNU General Public License v3.0
36 stars 6 forks source link

Add macros #160

Closed jferard closed 5 years ago

jferard commented 5 years ago

The idea is:

  1. to provide a method to insert CharSequences in the ods package file
  2. to provide in tool a method to insert macros (Python, Basic, Java).
jferard commented 5 years ago
<office:document-content...>
    <office:scripts>
        <office:event-listeners><script:event-listener script:language="ooo:script" script:event-name="dom:load" xlink:href="vnd.sun.star.script:Standard.Module1.Main?language=Basic&amp;location=application" xlink:type="simple"/></office:event-listeners>
    </office:scripts>
        <office:font-face-decls> ...
Basic
    Standard
        FastODS.xml
        script-lb.xml
    script-lc.xml

LC:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:libraries PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "libraries.dtd">
<library:libraries xmlns:library="http://openoffice.org/2000/library" xmlns:xlink="http://www.w3.org/1999/xlink">
 <library:library library:name="Standard" library:link="false"/>
</library:libraries>

LB:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Standard" library:readonly="false" library:passwordprotected="false">
 <library:element library:name="FastODS"/>
</library:library>

FastODS.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="FastODS" script:language="StarBasic" script:moduleType="normal">

Sub Main
    for each oElem in ThisComponent.DatabaseRanges
        oElem.refresh
    next oElem
End Sub
</script:module>