Skip to content

Commit d7b6afd

Browse files
committed
HoriOrientRelation
1 parent 59f9e69 commit d7b6afd

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

extension/OOoLilyPond/OOoLilyPond.xba

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,12 @@ Sub InsertOOoLilyPondObjectViaClipboard (sIdentifier As String, sNumber As Strin
768768
oGraphic.TopMargin = 0
769769
oGraphic.BottomMargin = 0
770770
oGraphic.VertOrient = 0
771+
oGraphic.HoriOrient = com.sun.star.text.HoriOrientation.NONE
772+
if iAnchor = com.sun.star.text.TextContentAnchorType.AT_CHARACTER Then
773+
oGraphic.HoriOrientRelation = com.sun.star.text.RelOrientation.CHAR
774+
Else
775+
oGraphic.HoriOrientRelation = com.sun.star.text.RelOrientation.PRINT_AREA
776+
End If
771777

772778
if bShapeIsSelected And (iAnchor = iOriginalAnchor) And Not IsNull (oShapePosition) Then oGraphic.position = oShapePosition
773779

@@ -824,6 +830,7 @@ Sub InsertOOoLilyPondObject (sIdentifier As String, sNumber As String, sAddition
824830
Else ' should never be the case
825831
oGraphic = ImportBitmapIntoWriter (ConvertToURL (sTmpPath & constOLyFileName & sNumber & sAddition & "." & sExtension), oCurrentGraphicObject(0), true)
826832
End If
833+
oGraphic.VertOrient = 0
827834
if bShapeIsSelected And (iAnchor = iOriginalAnchor) And Not IsNull (oShapePosition) Then
828835
oGraphic.HoriOrientPosition = oShapePosition.X
829836
oGraphic.VertOrientPosition = oShapePosition.Y
@@ -845,9 +852,11 @@ Sub InsertOOoLilyPondObject (sIdentifier As String, sNumber As String, sAddition
845852
oGraphic = ImportBitmapIntoWriter (ConvertToURL (sTmpPath & constOLyFileName & sNumber & sAddition & "." & sExtension), oCurrentGraphicObject, true)
846853
End If
847854
End If
855+
oGraphic.VertOrient = 0
848856

849857
Case "SwXTextRanges" ' Nothing or normal text selection in Writer
850858
oGraphic = ImportBitmapIntoWriter (ConvertToURL (sTmpPath & constOLyFileName & sNumber & sAddition & "." & sExtension), oCurrentCursor, false)
859+
oGraphic.VertOrient = 0
851860

852861
End Select
853862

@@ -857,7 +866,12 @@ Sub InsertOOoLilyPondObject (sIdentifier As String, sNumber As String, sAddition
857866

858867
oGraphic.TopMargin = 0
859868
oGraphic.BottomMargin = 0
860-
oGraphic.VertOrient = 0
869+
oGraphic.HoriOrient = com.sun.star.text.HoriOrientation.NONE
870+
if iAnchor = com.sun.star.text.TextContentAnchorType.AT_CHARACTER Then
871+
oGraphic.HoriOrientRelation = com.sun.star.text.RelOrientation.CHAR
872+
Else
873+
oGraphic.HoriOrientRelation = com.sun.star.text.RelOrientation.PRINT_AREA
874+
End If
861875

862876
Else 'We are in Impress or Draw
863877

0 commit comments

Comments
 (0)