summaryrefslogtreecommitdiff
path: root/helpauthoring
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-01-26 12:45:54 +0100
committerOlivier Hallot <ohallot@collabora.co.uk>2016-04-12 15:04:51 +0000
commit5f231ff8263565988470f7fbedb90ff3a4883174 (patch)
tree4fee374f35f06857b9ecd5b1c39fd7f22a527195 /helpauthoring
parent4732c3fec3a712b89ee87ecaef1714cfffd91030 (diff)
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@collabora.co.uk> Tested-by: Olivier Hallot <ohallot@collabora.co.uk>
Diffstat (limited to 'helpauthoring')
-rw-r--r--helpauthoring/filter/soffice2xmlhelp.xsl16
-rw-r--r--helpauthoring/filter/xmlhelp.dtd12
-rw-r--r--helpauthoring/filter/xmlhelp2soffice.xsl25
3 files changed, 48 insertions, 5 deletions
diff --git a/helpauthoring/filter/soffice2xmlhelp.xsl b/helpauthoring/filter/soffice2xmlhelp.xsl
index 058348b2..418da440 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">
+&lt;bascode&gt;</xsl:text>
+</xsl:template>
+
+<xsl:template match="text:variable-set[@text:name='_BASCODE']">
+<xsl:text disable-output-escaping="yes">
+&lt;/bascode&gt;</xsl:text>
+</xsl:template>
+
+<!--
+######################################################
CREATED, SEE HEADER
######################################################
-->
diff --git a/helpauthoring/filter/xmlhelp.dtd b/helpauthoring/filter/xmlhelp.dtd
index 3d915d83..aecabd27 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 f835193f..ad7ea381 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="'&lt;BASCODE&gt;'"/>
+ </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="'&lt;/BASCODE&gt;'"/>
+ </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"/>