You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extension/OOoLilyPond/LilyPond.xba
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -190,7 +190,8 @@ End Sub
190
190
Function DeleteTempFilesOfType (sFileType As String) As Integer ' 0: success, 1: error
191
191
Dim sDirEntry As String
192
192
Dim sCurrentFile As String
193
-
193
+
194
+
On Error GoTo ErrorHandler
194
195
sDirEntry = Dir (sTmpPath & constOLyFileName &"*."& sFileType)
195
196
Do While sDirEntry <>""
196
197
' If oFileAccess.exists (sTmpPath & sDirEntry) Then
@@ -230,11 +231,11 @@ Sub CleanUpAfterwards()
230
231
Exit Sub
231
232
232
233
ErrorHandler:
233
-
'If Err <> 1 Then
234
+
If Err <> 1 Then
234
235
MsgBox (Err & Chr(10) & Error, iMsgBox_E, oMessages.getPropertyValue ("sCaptionError"))
235
-
'Else ' Error 1: "A file or directory could not be deleted"
236
+
Else ' Error 1: "A file or directory could not be deleted"
236
237
' Nothing. This can happen in old-fashioned OpenOffice if you use the "direct" method to insert images. Apparently, it works anyway, don't know why...
if bShapeIsSelected And (iAnchor = iOriginalAnchor) And Not IsNull (oShapePosition) Then oGraphic.position = oShapePosition
773
781
@@ -824,10 +832,15 @@ Sub InsertOOoLilyPondObject (sIdentifier As String, sNumber As String, sAddition
824
832
Else ' should never be the case
825
833
oGraphic = ImportBitmapIntoWriter (ConvertToURL (sTmpPath & constOLyFileName & sNumber & sAddition &"."& sExtension), oCurrentGraphicObject(0), true)
826
834
End If
835
+
oGraphic.VertOrient = 0
827
836
if bShapeIsSelected And (iAnchor = iOriginalAnchor) And Not IsNull (oShapePosition) Then
828
837
oGraphic.HoriOrientPosition = oShapePosition.X
829
838
oGraphic.VertOrientPosition = oShapePosition.Y
830
-
oGraphic.AnchorPageNo = iAnchorPageNo
839
+
If iAnchor = 2 Then ' AT_PAGE
840
+
oGraphic.AnchorPageNo = iAnchorPageNo
841
+
' OpenOffice was crashed by this when iAnchor was AS_CHARACTER
842
+
' No problem with LibreOffice
843
+
End If
831
844
End If
832
845
833
846
Case "SwXTextGraphicObject"' Graphic is selected in Writer
@@ -841,9 +854,11 @@ Sub InsertOOoLilyPondObject (sIdentifier As String, sNumber As String, sAddition
841
854
oGraphic = ImportBitmapIntoWriter (ConvertToURL (sTmpPath & constOLyFileName & sNumber & sAddition &"."& sExtension), oCurrentGraphicObject, true)
842
855
End If
843
856
End If
857
+
oGraphic.VertOrient = 0
844
858
845
859
Case "SwXTextRanges"' Nothing or normal text selection in Writer
846
860
oGraphic = ImportBitmapIntoWriter (ConvertToURL (sTmpPath & constOLyFileName & sNumber & sAddition &"."& sExtension), oCurrentCursor, false)
861
+
oGraphic.VertOrient = 0
847
862
848
863
End Select
849
864
@@ -853,7 +868,14 @@ Sub InsertOOoLilyPondObject (sIdentifier As String, sNumber As String, sAddition
0 commit comments