Problem with measure lines

Hello there,
maybe you can help me:
In my macro I use measure lines. In OpenOffice it works fine, in LibreOffice there is a problem.
In OpenOffice it looks like the left screenshot, in LibreOffice it looks like the right one
both
:

just when I check “Save” the Text is shown.
Here is the code:

sub main
dim oDoc as object, oPunkte as object, oPoly as object, oPage as object, oMass as object
oDoc=ThisComponent
ZeichnungLoeschen

x1=40
y1=20

x2=75
y2=65

oPage=oDoc.drawpages(0)
oPoly=ThisComponent.createInstance(“com.sun.star.drawing.PolyPolygonShape”)

oPunkte=array(erzeugePunkt(x1100, y1100), erzeugePunkt(x2100, y1100), erzeugePunkt(x2100, y2100), erzeugePunkt(x1100, y2100))
oPoly.LineWidth=50
oPage.add(oPoly)
oPoly.PolyPolygon=array(oPunkte())

oPoly.fillColor=rgb(255,255,0)

flag=false

oMass=oDoc.createInstance(“com.sun.star.drawing.MeasureShape”)
oPage.add(oMass)
With oMass
.StartPosition=erzeugePunkt(x1100, y1100)
.endPosition=erzeugePunkt(x2100, y1100)
.MeasureDecimalPlaces=1
.MeasureUnit=2
if flag then .MeasureBelowReferenceEdge=true
End With

flag=true

oMass=oDoc.createInstance(“com.sun.star.drawing.MeasureShape”)
oPage.add(oMass)
With oMass
.StartPosition=erzeugePunkt(x1100, y1100)
.endPosition=erzeugePunkt(x1100, y2100)
.MeasureDecimalPlaces=1
.MeasureUnit=2
if flag then .MeasureBelowReferenceEdge=true
End With
end sub
'************************************************************************************************************************
'************************************************************************************************************************
sub ZeichnungLoeschen
oPage=ThisComponent.drawpages(0)
do while oPage.count>0
oGrafik=opage.getbyindex(oPage.count-1)
oPage.remove(oGrafik)
loop
end sub
'************************************************************************************************************************
'************************************************************************************************************************
'************************************************************************************************************************
Function erzeugePunkt (ByVal x as Long, ByVal y as long) as com.sun.star.awt.Point
dim oPunkt as new com.sun.star.awt.Point
oPunkt.X=x
oPunkt.Y=y
erzeugePunkt=oPunkt
End Function
'************************************************************************************************************************
Function erzeugeSize (ByVal Breite as Long, ByVal Hoehe as Long) as com.sun.star.awt.Size
Dim oSize as new com.sun.star.awt.Size
oSize.Width=Breite
oSize.Height=Hoehe
erzeugeSize=oSize
end function

attached is an example
MasslinienTest.ods (10.9 KB)

If there is any interest for the solution - have a look here:
https://www.libreoffice-forum.de/posting.php?mode=edit&f=12&p=94305