summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliongold <beimaginativeegroup@gmail.com>2017-05-30 12:55:10 +0000
committerOlivier Hallot <olivier.hallot@edx.srv.br>2017-06-02 16:10:07 +0200
commitcbc76cb097e3b3e2fb3912153171c1dd1e799955 (patch)
tree9d6549cb1ca9392af81f6d3121f239cad411ee4c
parenta97fadc4c85337c59650d23ad0710c4c4d4015a3 (diff)
tdf#108054 - Implementing <sup> and <sub> in the HelpAuthoring extension
Change-Id: I56cef73bf7132265d5c2ce2c2b04d9f43dd481ba Reviewed-on: https://gerrit.libreoffice.org/38218 Reviewed-by: Olivier Hallot <olivier.hallot@edx.srv.br> Tested-by: Olivier Hallot <olivier.hallot@edx.srv.br>
-rw-r--r--helpauthoring/HelpAuthoring/Helpers.xba18
-rw-r--r--helpauthoring/description.xml2
-rw-r--r--helpauthoring/filter/soffice2xmlhelp.xsl4
-rw-r--r--helpauthoring/filter/xmlhelp2soffice.xsl36
-rw-r--r--helpauthoring/registry/Addons.xcu32
-rw-r--r--helpauthoring/template/Help/xmlhelptemplate.ottbin12078 -> 12589 bytes
6 files changed, 89 insertions, 3 deletions
diff --git a/helpauthoring/HelpAuthoring/Helpers.xba b/helpauthoring/HelpAuthoring/Helpers.xba
index a01d4d6a..01ad0234 100644
--- a/helpauthoring/HelpAuthoring/Helpers.xba
+++ b/helpauthoring/HelpAuthoring/Helpers.xba
@@ -396,6 +396,24 @@ Sub SetCharBold
SetCharStyle( &quot;hlp_emph&quot; )
End Sub
+&apos;=======================================================
+&apos; SetCharSuperscript
+&apos;-------------------------------------------------------
+&apos;
+&apos;=======================================================
+Sub SetCharSuperscript
+ SetCharStyle( &quot;hlp_sup&quot; )
+End Sub
+
+&apos;=======================================================
+&apos; SetCharSubscript
+&apos;-------------------------------------------------------
+&apos;
+&apos;=======================================================
+Sub SetCharSubscript
+ SetCharStyle( &quot;hlp_sub&quot; )
+End Sub
+
Sub SetCharMenuItem
SetCharStyle( &quot;hlp_menuitem&quot; )
End Sub
diff --git a/helpauthoring/description.xml b/helpauthoring/description.xml
index 065dc1f3..f4eac8f7 100644
--- a/helpauthoring/description.xml
+++ b/helpauthoring/description.xml
@@ -23,7 +23,7 @@
<identifier value="org.openoffice.helpauthoring"/>
- <version value="3.1.4"/>
+ <version value="3.1.5"/>
<display-name>
<name lang="en">Help Authoring Extension</name>
diff --git a/helpauthoring/filter/soffice2xmlhelp.xsl b/helpauthoring/filter/soffice2xmlhelp.xsl
index 418da440..afec3e87 100644
--- a/helpauthoring/filter/soffice2xmlhelp.xsl
+++ b/helpauthoring/filter/soffice2xmlhelp.xsl
@@ -1137,7 +1137,7 @@ VARIABLE
<!--
######################################################
-text:span, covers EMPH and ITEM
+text:span, covers EMPH, SUP, SUB and ITEM
######################################################
-->
@@ -1166,6 +1166,8 @@ text:span, covers EMPH and ITEM
</xsl:when>
<xsl:when test="not(starts-with($masterstyle,'hlp_'))"><xsl:apply-templates/></xsl:when>
<xsl:when test="$masterstyle = 'hlp_emph'"><emph><xsl:apply-templates/></emph></xsl:when>
+ <xsl:when test="$masterstyle = 'hlp_sup'"><sup><xsl:apply-templates/></sup></xsl:when>
+ <xsl:when test="$masterstyle = 'hlp_sub'"><sub><xsl:apply-templates/></sub></xsl:when>
<xsl:otherwise>
<xsl:variable name="spanstyle"><xsl:value-of select="substring-after($masterstyle,'hlp_')"/></xsl:variable><item type="{$spanstyle}"><xsl:apply-templates /></item></xsl:otherwise>
</xsl:choose>
diff --git a/helpauthoring/filter/xmlhelp2soffice.xsl b/helpauthoring/filter/xmlhelp2soffice.xsl
index ad7ea381..d594f88e 100644
--- a/helpauthoring/filter/xmlhelp2soffice.xsl
+++ b/helpauthoring/filter/xmlhelp2soffice.xsl
@@ -96,7 +96,7 @@ FILTER FOR OPENOFFICE.ORG 2+
</xsl:variable>
<xsl:variable name="defaultcharstyles">
- <xsl:value-of select="'acronym emph keycode literal menuitem path'"/>
+ <xsl:value-of select="'acronym emph keycode literal menuitem path sup sub'"/>
</xsl:variable>
<xsl:template match="/">
@@ -499,6 +499,28 @@ BASCODE
</xsl:template>
<!--
+#######################################################
+SUP
+#######################################################
+-->
+ <xsl:template match="sup">
+ <text:span text:style-name="hlp_sup">
+ <xsl:apply-templates />
+ </text:span>
+ </xsl:template>
+
+<!--
+#######################################################
+SUB
+#######################################################
+-->
+ <xsl:template match="sub">
+ <text:span text:style-name="hlp_sub">
+ <xsl:apply-templates />
+ </text:span>
+ </xsl:template>
+
+<!--
######################################################
CREATED, SEE HEADER
+ date CDATA #REQUIRED
@@ -1336,6 +1358,12 @@ VARIABLE
<text:variable-decl text:value-type="string" text:name="_SECTION"/>
<text:variable-decl text:value-type="string" text:name="SORT_"/>
<text:variable-decl text:value-type="string" text:name="_SORT"/>
+ <!-- MIGHT NOT BE NEEDED -->
+ <text:variable-decl text:value-type="string" text:name="SUB_"/>
+ <text:variable-decl text:value-type="string" text:name="_SUB"/>
+ <text:variable-decl text:value-type="string" text:name="SUP_"/>
+ <text:variable-decl text:value-type="string" text:name="_SUP"/>
+ <!-- END -->
<text:variable-decl text:value-type="string" text:name="SWITCH_"/>
<text:variable-decl text:value-type="string" text:name="_SWITCH"/>
<text:variable-decl text:value-type="string" text:name="SWITCHINLINE_"/>
@@ -1639,6 +1667,12 @@ CREATESTYLES
<style:style style:name="hlp_5f_emph" style:display-name="hlp_emph" style:family="text">
<style:text-properties fo:font-weight="bold"/>
</style:style>
+ <style:style style:name="hlp_5f_sub" style:display-name="hlp_sub" style:family="text">
+ <style:text-properties style:text-position="sub 58%"/>
+ </style:style>
+ <style:style style:name="hlp_5f_sup" style:display-name="hlp_sup" style:family="text">
+ <style:text-properties style:text-position="super 58%"/>
+ </style:style>
<style:style style:name="hlp_5f_aux_5f_comment" style:display-name="hlp_aux_comment" style:family="text">
<style:text-properties fo:color="#800000" fo:background-color="#e6ff00"/>
</style:style>
diff --git a/helpauthoring/registry/Addons.xcu b/helpauthoring/registry/Addons.xcu
index 67fce672..a19eda87 100644
--- a/helpauthoring/registry/Addons.xcu
+++ b/helpauthoring/registry/Addons.xcu
@@ -143,6 +143,22 @@
<value xml:lang="en-US">Default</value>
</prop>
</node>
+ <node oor:name="m03" oor:op="replace">
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>.uno:StyleApply?Style:string=hlp_sup&amp;FamilyName:string=CharacterStyles</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml-lang="en-US">Superscript (hlp_sup)</value>
+ </prop>
+ </node>
+ <node oor:name="m04" oor:op="replace">
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>.uno.StyleApply?Style:string=hlp_sub&amp;FamilyName:string=CharacterStyles</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml-lang="en-US">Subscript (hlp_sub)</value>
+ </prop>
+ </node>
</node>
</node>
@@ -866,6 +882,22 @@
<value xml:lang="en-US">Menu</value>
</prop>
</node>
+ <node oor:name="m74" oor:op="replace">
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>vnd.sun.star.script:HelpAuthoring.Helpers.SetCharSuperscript?language=Basic&amp;location=application</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml-lang="en-US">Superscript</value>
+ </prop>
+ </node>
+ <node oor:name="m75" oor:op="replace">
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>vnd.sun.star.script:HelpAuthoring.Helpers.SetCharSubscript?language=Basic&amp;location=application</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml-lang="en-US">Subscript</value>
+ </prop>
+ </node>
<node oor:name="m90" oor:op="replace">
<prop oor:name="URL" oor:type="xs:string">
diff --git a/helpauthoring/template/Help/xmlhelptemplate.ott b/helpauthoring/template/Help/xmlhelptemplate.ott
index f6bac409..e386155e 100644
--- a/helpauthoring/template/Help/xmlhelptemplate.ott
+++ b/helpauthoring/template/Help/xmlhelptemplate.ott
Binary files differ