helpauthoring/HelpAuthoring/Helpers.xba         |   18 ++++++++++++
 helpauthoring/description.xml                   |    2 -
 helpauthoring/filter/soffice2xmlhelp.xsl        |    4 ++
 helpauthoring/filter/xmlhelp2soffice.xsl        |   36 +++++++++++++++++++++++-
 helpauthoring/registry/Addons.xcu               |   32 +++++++++++++++++++++
 helpauthoring/template/Help/xmlhelptemplate.ott |binary
 6 files changed, 89 insertions(+), 3 deletions(-)

New commits:
commit cbc76cb097e3b3e2fb3912153171c1dd1e799955
Author: liongold <beimaginativeegr...@gmail.com>
Date:   Tue May 30 12:55:10 2017 +0000

    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.hal...@edx.srv.br>
    Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br>

diff --git a/helpauthoring/HelpAuthoring/Helpers.xba 
b/helpauthoring/HelpAuthoring/Helpers.xba
index a01d4d6..01ad023 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 065dc1f..f4eac8f 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 418da44..afec3e8 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 ad7ea38..d594f88 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 67fce67..a19eda8 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 f6bac40..e386155 100644
Binary files a/helpauthoring/template/Help/xmlhelptemplate.ott and 
b/helpauthoring/template/Help/xmlhelptemplate.ott differ
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to