Check if no textranges selected

This commit is contained in:
Georgy Litvinov 2021-06-04 16:40:15 +02:00
parent 71f52c5c01
commit f912e831a0

View file

@ -19,8 +19,9 @@ Sub convertEndnotesExecution
Exit Sub Exit Sub
End If End If
oSelections = ThisComponent.getCurrentSelection() oSelections = ThisComponent.getCurrentSelection()
If IsNull(oSelections) Then
MsgBox getTranslation("something weird happened error text") If NOT oSelections.supportsService("com.sun.star.text.TextRanges") Then
MsgBox getTranslation("EndnotesNotFound")
Exit Sub Exit Sub
End If End If
objectsCount = oSelections.getCount() objectsCount = oSelections.getCount()