helpauthoring/HelpAuthoring/Comment.xba       |    3 ++
 helpauthoring/HelpAuthoring/Embed.xba         |   27 ++++++++++++++++++--------
 helpauthoring/HelpAuthoring/Helpers.xba       |    8 +++----
 helpauthoring/HelpAuthoring/OtherElements.xba |    6 +++--
 4 files changed, 30 insertions(+), 14 deletions(-)

New commits:
commit 947978deaff85e19270d21ff09a76fbf33b69f2e
Author: Yousuf Philips <philip...@hotmail.com>
Date:   Tue Sep 15 00:07:11 2015 +0400

    Various fixes to functions so they preform better
    
    Change-Id: I8fddd3be3dbcfbbf9f1c8673d5de6932d413f600
    Reviewed-on: https://gerrit.libreoffice.org/18577
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/helpauthoring/HelpAuthoring/Comment.xba 
b/helpauthoring/HelpAuthoring/Comment.xba
index 3156357..52b428d 100644
--- a/helpauthoring/HelpAuthoring/Comment.xba
+++ b/helpauthoring/HelpAuthoring/Comment.xba
@@ -61,6 +61,9 @@ Sub Main
             InsertTag(&quot;COMMENT_&quot;,&quot;&lt;COMMENT&gt;&quot;)
             SetCharStyle(&quot;hlp_aux_comment&quot;)
             InsertTag(&quot;COMMENT&quot;,oTxtComment.Text)
+            goLeft( 1, 1 )
+            SetCharStyle(&quot;hlp_aux_comment&quot;)
+            goRight( 1 )
             InsertTag(&quot;_COMMENT&quot;,&quot;&lt;/COMMENT&gt;&quot;)
         End If
     End If
diff --git a/helpauthoring/HelpAuthoring/Embed.xba 
b/helpauthoring/HelpAuthoring/Embed.xba
index 0f82833..8291232 100644
--- a/helpauthoring/HelpAuthoring/Embed.xba
+++ b/helpauthoring/HelpAuthoring/Embed.xba
@@ -182,6 +182,11 @@ Sub UpdateFileName
             oTxtHidFName.Text = ShortFName
         End If
 
+               DocRoot = GetDocumentRoot()
+               if FileExists( DocRoot + oTxtHidFName.Text ) then
+                       oTxtHidFName.Text = DocRoot + oTxtHidFName.Text
+               end if
+
         oButBrowseIDs = oDialog.GetControl(&quot;butBrowseIDs&quot;)
         If not(FileExists(oTxtHidFName.Text)) Then
             msgbox oTxtHidFName.Text+&quot; cannot be 
found.&quot;,48,&quot;D&apos;oh!&quot;
@@ -242,11 +247,13 @@ Sub BrowseEmbed
                 arTmp(n) = 
Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),&quot;id=&quot;)-3)
                 sId = Left(arTmp(n),Instr(arTmp(n),&quot;&quot;&quot;&quot;)-1)
                 arTmp(n) = 
Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),&quot;&gt;&quot;))
-                If Instr(arTmp(n),&quot;&lt;/section&gt;&quot;)&gt;0 Then
+                If Instr(arTmp(n),&quot;&lt;/section&gt;&quot;) &gt; 0 Then
                     arTmp(n) = 
Left(arTmp(n),Instr(arTmp(n),&quot;&lt;/section&gt;&quot;)-1)
-                End If
-                If Len(arTmp(n) &gt; 100) Then
-                    arTmp(n) = Left(arTmp(n),100)+&quot;...&quot;
+                       If Len(arTmp(n) &gt; 100) Then
+                           arTmp(n) = Left(arTmp(n),100)+&quot;...&quot;
+                       End If
+                   else
+                       arTmp(n) = &quot;[[Unable to get related text]]&quot;
                 End If
                 sDim = ubound(arSecs())
                 arSecs(sDim) = sId+&quot;: &quot;+arTmp(n)
@@ -261,10 +268,14 @@ Sub BrowseEmbed
                 arTmp(n) = 
Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),&quot;id=&quot;)-3)
                 sId = Left(arTmp(n),Instr(arTmp(n),&quot;&quot;&quot;&quot;)-1)
                 arTmp(n) = 
Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),&quot;&gt;&quot;))
-                arTmp(n) = 
Left(arTmp(n),Instr(arTmp(n),&quot;&lt;/variable&gt;&quot;)-1)
-                If Len(arTmp(n) &gt; 100) Then
-                    arTmp(n) = Left(arTmp(n),100)+&quot;...&quot;
-                End If
+                if Instr(arTmp(n),&quot;&lt;/variable&gt;&quot;) &gt; 0 then
+                       arTmp(n) = 
Left(arTmp(n),Instr(arTmp(n),&quot;&lt;/variable&gt;&quot;)-1)
+                       If Len(arTmp(n) &gt; 100) Then
+                           arTmp(n) = Left(arTmp(n),100)+&quot;...&quot;
+                       End If
+                   else
+                       arTmp(n) = &quot;[[Unable to get related text]]&quot;
+                   end if
                 sDim = ubound(arVars())
                 arVars(sDim) = sId+&quot;: &quot;+arTmp(n)
                 sDim = ubound(arVars())+1
diff --git a/helpauthoring/HelpAuthoring/Helpers.xba 
b/helpauthoring/HelpAuthoring/Helpers.xba
index 25d533e..cece54b 100644
--- a/helpauthoring/HelpAuthoring/Helpers.xba
+++ b/helpauthoring/HelpAuthoring/Helpers.xba
@@ -409,10 +409,10 @@ end Sub
 &apos;=======================================================
 Sub InsertNewParaData
 
-        If not IsHelpFile Then
-        msgbox(strErr_NoHelpFile)
-        Exit Sub
-    End If
+    &apos;If not IsHelpFile Then
+    &apos;    msgbox(strErr_NoHelpFile)
+    &apos;    Exit Sub
+    &apos;End If
 
     oSel = thiscomponent.getcurrentcontroller.getselection
     oCur = oSel(0).getText.createTextCursorByRange(oSel(0))
diff --git a/helpauthoring/HelpAuthoring/OtherElements.xba 
b/helpauthoring/HelpAuthoring/OtherElements.xba
index bae4f31..ab81d99 100644
--- a/helpauthoring/HelpAuthoring/OtherElements.xba
+++ b/helpauthoring/HelpAuthoring/OtherElements.xba
@@ -90,6 +90,8 @@ Sub InsertSwitchOSParagraph
 End Sub
 
 Sub InsertSwitchOSInline
+    InsertText( &quot; &quot; )
+    GoLeft( 1 )
        InsertTag(&quot;SWITCHINLINE_&quot;,&quot;&lt;SWITCHINLINE 
select=&quot;&quot;sys&quot;&quot;&gt;&quot;,&quot;hlp_aux_switch&quot;)
 
        InsertCaseInlineNow(&quot;WIN&quot;)
@@ -103,7 +105,6 @@ Sub InsertSwitchOSInline
 
     InsertTag(&quot;_SWITCHINLINE&quot;,&quot;&lt;/SWITCHINLINE&gt;&quot;)
     SetCharStyle(&quot;Default Style&quot;)
-    InsertText( &quot; &quot; )
 End Sub
 
 Sub InsertSwitchAppParagraph
@@ -139,6 +140,8 @@ Sub InsertSwitchAppParagraph
 End Sub
 
 Sub InsertSwitchAppInline
+    InsertText( &quot; &quot; )
+    GoLeft( 1 )
        InsertTag(&quot;SWITCHINLINE_&quot;,&quot;&lt;SWITCHINLINE 
select=&quot;&quot;appl&quot;&quot;&gt;&quot;,&quot;hlp_aux_switch&quot;)
 
        InsertCaseInlineNow(&quot;WRITER&quot;)
@@ -156,7 +159,6 @@ Sub InsertSwitchAppInline
 
     InsertTag(&quot;_SWITCHINLINE&quot;,&quot;&lt;/SWITCHINLINE&gt;&quot;)
     SetCharStyle(&quot;Default Style&quot;)
-    InsertText( &quot; &quot; )
 End Sub
 
 Sub InsertCaseNow(sType As String)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to