[Libreoffice-commits] dev-tools.git: helpauthoring/filter

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Tue Apr 12 15:05:09 UTC 2016


 helpauthoring/filter/soffice2xmlhelp.xsl |   16 ++++++++++++++++
 helpauthoring/filter/xmlhelp.dtd         |   12 +++++++-----
 helpauthoring/filter/xmlhelp2soffice.xsl |   25 +++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 5 deletions(-)

New commits:
commit 5f231ff8263565988470f7fbedb90ff3a4883174
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Tue Jan 26 12:45:54 2016 +0100

    tdf#94057 - add support for bascode tag (preserve on roundtrip)
    
    it was introduced with d06c698b799e0e4ceaf3a3760c9589fe29dc29a9 on core
    to have LO apply syntax-highlighting for Basic (for 4.1.0)
    
    This change will preserve the tag on import/export, but has no sanity
    checks (like open and closing tags must match), and no
    encapsulation/surrounding of the paragraphs.
    Also no UI controls to insert the tags yet.
    
    Change-Id: Idb434aed739e0d8eaceddbd6f48147028c8eec3e
    Reviewed-on: https://gerrit.libreoffice.org/21803
    Reviewed-by: Olivier Hallot <ohallot at collabora.co.uk>
    Tested-by: Olivier Hallot <ohallot at collabora.co.uk>

diff --git a/helpauthoring/filter/soffice2xmlhelp.xsl b/helpauthoring/filter/soffice2xmlhelp.xsl
index 058348b..418da44 100644
--- a/helpauthoring/filter/soffice2xmlhelp.xsl
+++ b/helpauthoring/filter/soffice2xmlhelp.xsl
@@ -344,6 +344,22 @@ COMMENT
 
 <!--
 ######################################################
+BASCODE
+######################################################
+-->
+
+<xsl:template match="text:variable-set[@text:name='BASCODE_']">
+<xsl:text disable-output-escaping="yes">
+<bascode></xsl:text>
+</xsl:template>
+
+<xsl:template match="text:variable-set[@text:name='_BASCODE']">
+<xsl:text disable-output-escaping="yes">
+</bascode></xsl:text>
+</xsl:template>
+
+<!--
+######################################################
 CREATED,  SEE HEADER
 ######################################################
 -->
diff --git a/helpauthoring/filter/xmlhelp.dtd b/helpauthoring/filter/xmlhelp.dtd
index 3d915d8..aecabd2 100644
--- a/helpauthoring/filter/xmlhelp.dtd
+++ b/helpauthoring/filter/xmlhelp.dtd
@@ -33,7 +33,9 @@ Version 03-Feb-2006
   localize CDATA #IMPLIED
 >
 
-<!ELEMENT body (section | paragraph | table | comment | bookmark | switch | embed | list | sort)*>
+<!ELEMENT bascode (paragraph+)>
+
+<!ELEMENT body (section | paragraph | table | comment | bookmark | switch | embed | list | sort | bascode)*>
 
 <!ELEMENT bookmark (bookmark_value)*>
 <!ATTLIST bookmark
@@ -54,7 +56,7 @@ Version 03-Feb-2006
   localize CDATA #IMPLIED
 >
 
-<!ELEMENT case (paragraph | table | comment | bookmark | embed | link | list | switch | section | sort)*>
+<!ELEMENT case (paragraph | table | comment | bookmark | embed | link | list | switch | section | sort | bascode)*>
 <!ATTLIST case
   select CDATA #REQUIRED
 >
@@ -71,7 +73,7 @@ Version 03-Feb-2006
   date CDATA #REQUIRED
 >
 
-<!ELEMENT default (paragraph | table | comment | bookmark | embed | link | list | switch | section | sort)*>
+<!ELEMENT default (paragraph | table | comment | bookmark | embed | link | list | switch | section | sort | bascode)*>
 
 <!ELEMENT defaultinline (#PCDATA | image | embedvar | br | emph | sub | sup | item | link | switchinline | variable | ahelp | object)*>
 
@@ -163,7 +165,7 @@ Version 03-Feb-2006
   localize CDATA #IMPLIED
 >
 
-<!ELEMENT section (section | paragraph | table | list | comment | bookmark | embed | switch | sort )*>
+<!ELEMENT section (section | paragraph | table | list | comment | bookmark | embed | switch | sort | bascode)*>
 <!ATTLIST section
   id CDATA #REQUIRED
 >
@@ -193,7 +195,7 @@ Version 03-Feb-2006
   id CDATA #REQUIRED
 >
 
-<!ELEMENT tablecell (section | paragraph | comment | embed | bookmark | image | list)*>
+<!ELEMENT tablecell (section | paragraph | comment | embed | bookmark | image | list | bascode)*>
 <!ATTLIST tablecell
   colspan CDATA #IMPLIED
   rowspan CDATA #IMPLIED
diff --git a/helpauthoring/filter/xmlhelp2soffice.xsl b/helpauthoring/filter/xmlhelp2soffice.xsl
index f835193..ad7ea38 100644
--- a/helpauthoring/filter/xmlhelp2soffice.xsl
+++ b/helpauthoring/filter/xmlhelp2soffice.xsl
@@ -477,6 +477,29 @@ COMMENT
 
 <!--
 ######################################################
+BASCODE
+######################################################
+-->
+    <xsl:template match="bascode">
+        <text:p text:style-name="hlp_aux_comment">
+            <text:span text:style-name="hlp_aux_tag">
+                <text:variable-set text:name="BASCODE_" text:value-type="string">
+                    <xsl:value-of select="'<BASCODE>'"/>
+                </text:variable-set>
+            </text:span>
+        </text:p>
+        <xsl:apply-templates />
+        <text:p text:style-name="hlp_aux_comment">
+            <text:span text:style-name="hlp_aux_tag">
+                <text:variable-set text:name="_BASCODE" text:value-type="string">
+                    <xsl:value-of select="'</BASCODE>'"/>
+                </text:variable-set>
+            </text:span>
+        </text:p>
+    </xsl:template>
+
+<!--
+######################################################
 CREATED,  SEE HEADER
   + date CDATA #REQUIRED
 ######################################################
@@ -1280,6 +1303,8 @@ VARIABLE
             <text:variable-decl text:value-type="string" text:name="AVIS_"/>
             <text:variable-decl text:value-type="string" text:name="_AVIS"/>
             <text:variable-decl text:value-type="string" text:name="AHID_"/>
+            <text:variable-decl text:value-type="string" text:name="BASCODE_"/>
+            <text:variable-decl text:value-type="string" text:name="_BASCODE"/>
             <text:variable-decl text:value-type="string" text:name="BOOKMARK"/>
             <text:variable-decl text:value-type="string" text:name="BOOKMARK_"/>
             <text:variable-decl text:value-type="string" text:name="_BOOKMARK"/>


More information about the Libreoffice-commits mailing list