Fixed bidirectional link macro
This commit is contained in:
parent
4c94a4486b
commit
aed6ba6300
2 changed files with 15 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark7
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark8
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -25,9 +25,11 @@ Sub resetNotesStyle
|
|||
End Sub
|
||||
|
||||
Sub createBidirectLink
|
||||
Dim oSelections 'Contains all of the selections
|
||||
Dim oAnchor1
|
||||
Dim oAnchor2
|
||||
Dim oSelections As Object
|
||||
Dim oAnchor1 As Object
|
||||
Dim oAnchor2 As Object
|
||||
Dim oAnchor1Name As String
|
||||
Dim oAnchor2Name As String
|
||||
|
||||
If IsNull(ThisComponent) Then
|
||||
MsgBox "Ничего не выбрано"
|
||||
|
@ -39,18 +41,9 @@ Sub createBidirectLink
|
|||
Exit Sub
|
||||
End If
|
||||
objectsCount = oSelections.getCount() - 1
|
||||
If oSelections.getCount() = 0 Then
|
||||
MsgBox "Ничего не выбрано"
|
||||
Exit Sub
|
||||
End If
|
||||
If oSelections.getCount() <= 2 Then
|
||||
MsgBox "Нужно выделить два объекта, а не " + objectsCount
|
||||
Exit Sub
|
||||
End If
|
||||
If oSelections.getCount() > 3 Then
|
||||
MsgBox "Нужно выделить только два объекта, а не " + objectsCount
|
||||
Exit Sub
|
||||
End If
|
||||
If objectsCount < 2 OR objectsCount > 2 Then
|
||||
MsgBox "Нужно выделить два объекта"
|
||||
Exit Sub End If
|
||||
|
||||
oAnchor1 = oSelections.getByIndex(1)
|
||||
oAnchor2 = oSelections.getByIndex(2)
|
||||
|
@ -464,8 +457,13 @@ Sub replaceParaStyle
|
|||
MsgBox "Стили не различаются"
|
||||
Exit sub
|
||||
EndIf
|
||||
|
||||
If oldStyleName <> "" Then
|
||||
oldStyle = paraStyles.getByName(oldStyleName)
|
||||
If NOT oldStyle.isUserDefined Then
|
||||
MsgBox "Невозвожно заменять встроенные стили"
|
||||
Exit sub
|
||||
EndIf
|
||||
oldStyle.ParentStyle = newStyleName
|
||||
paraStyles.removeByName(oldStyleName)
|
||||
EndIf
|
||||
|
|
|
@ -9,4 +9,5 @@
|
|||
<library:element library:name="Album"/>
|
||||
<library:element library:name="Archive"/>
|
||||
<library:element library:name="MakeUp"/>
|
||||
<library:element library:name="PageStyles"/>
|
||||
</library:library>
|
Loading…
Add table
Reference in a new issue