|
4 | 4 |
|
5 | 5 | Option Explicit
|
6 | 6 |
|
| 7 | + |
| 8 | +'Returns the include statement with the absolute path of the LO-file |
| 9 | +'Returns an empty String if the file is not yet saved |
| 10 | +Function GetRelativeIncludeStatement As String |
| 11 | + Dim sURL |
| 12 | + Dim sParts |
| 13 | + Dim sPath |
| 14 | + |
| 15 | + sURL=ThisComponent.getURL() |
| 16 | + If Len(sURL) > 0 And Not IsNull(sURL) Then |
| 17 | + sParts=Split(sURL,"/") |
| 18 | + ReDim Preserve sParts(0 to UBound(sParts) -1) |
| 19 | + sPath=ConvertFromURL(Join(sParts,"/")) |
| 20 | + While InStr (sPath, "\") > 0 ' replace "\" by "/", even in Windows LilyPond expects paths to be written with forward slashes |
| 21 | + Mid (sPath, InStr (sPath, "\"), 1, "/") |
| 22 | + Wend |
| 23 | + GetRelativeIncludeStatement="-I" & Chr(34) & sPath & Chr(34) |
| 24 | + Else |
| 25 | + GetRelativeIncludeStatement="" |
| 26 | + End If |
| 27 | +End Function |
| 28 | + |
| 29 | + |
7 | 30 | Function CallLilyPond() As Boolean
|
8 | 31 | Dim sCommand As String
|
9 | 32 | Dim sBackendOpt As String
|
10 | 33 | Dim sLilyPondOutput As String
|
11 | 34 |
|
| 35 | + Dim sRelativeIncludeStatement As String |
| 36 | + sRelativeIncludeStatement=GetRelativeIncludeStatement() |
| 37 | + |
| 38 | + If Len(sRelativeIncludeStatement) > 0 Then |
| 39 | + If Len(sIncludeStatement) > 0 Then |
| 40 | + sIncludeStatement=sRelativeIncludeStatement & " " & sIncludeStatement |
| 41 | + Else |
| 42 | + sIncludeStatement=sRelativeIncludeStatement |
| 43 | + End If |
| 44 | + End If |
| 45 | + |
12 | 46 | sBackendOpt="-dbackend=eps"
|
13 | 47 | If Val(sLilyPondVersionMajor)=2 and Val(sLilyPondVersionMinor)<=10 Then
|
14 | 48 | sBackendOpt="-b eps"
|
|
0 commit comments