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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
<!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
|
End Sub
|
||||||
|
|
||||||
|
@ -25,9 +25,11 @@ Sub resetNotesStyle
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub createBidirectLink
|
Sub createBidirectLink
|
||||||
Dim oSelections 'Contains all of the selections
|
Dim oSelections As Object
|
||||||
Dim oAnchor1
|
Dim oAnchor1 As Object
|
||||||
Dim oAnchor2
|
Dim oAnchor2 As Object
|
||||||
|
Dim oAnchor1Name As String
|
||||||
|
Dim oAnchor2Name As String
|
||||||
|
|
||||||
If IsNull(ThisComponent) Then
|
If IsNull(ThisComponent) Then
|
||||||
MsgBox "Ничего не выбрано"
|
MsgBox "Ничего не выбрано"
|
||||||
|
@ -39,18 +41,9 @@ Sub createBidirectLink
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
objectsCount = oSelections.getCount() - 1
|
objectsCount = oSelections.getCount() - 1
|
||||||
If oSelections.getCount() = 0 Then
|
If objectsCount < 2 OR objectsCount > 2 Then
|
||||||
MsgBox "Ничего не выбрано"
|
MsgBox "Нужно выделить два объекта"
|
||||||
Exit Sub
|
Exit Sub End If
|
||||||
End If
|
|
||||||
If oSelections.getCount() <= 2 Then
|
|
||||||
MsgBox "Нужно выделить два объекта, а не " + objectsCount
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
If oSelections.getCount() > 3 Then
|
|
||||||
MsgBox "Нужно выделить только два объекта, а не " + objectsCount
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
oAnchor1 = oSelections.getByIndex(1)
|
oAnchor1 = oSelections.getByIndex(1)
|
||||||
oAnchor2 = oSelections.getByIndex(2)
|
oAnchor2 = oSelections.getByIndex(2)
|
||||||
|
@ -464,8 +457,13 @@ Sub replaceParaStyle
|
||||||
MsgBox "Стили не различаются"
|
MsgBox "Стили не различаются"
|
||||||
Exit sub
|
Exit sub
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
If oldStyleName <> "" Then
|
If oldStyleName <> "" Then
|
||||||
oldStyle = paraStyles.getByName(oldStyleName)
|
oldStyle = paraStyles.getByName(oldStyleName)
|
||||||
|
If NOT oldStyle.isUserDefined Then
|
||||||
|
MsgBox "Невозвожно заменять встроенные стили"
|
||||||
|
Exit sub
|
||||||
|
EndIf
|
||||||
oldStyle.ParentStyle = newStyleName
|
oldStyle.ParentStyle = newStyleName
|
||||||
paraStyles.removeByName(oldStyleName)
|
paraStyles.removeByName(oldStyleName)
|
||||||
EndIf
|
EndIf
|
||||||
|
|
|
@ -9,4 +9,5 @@
|
||||||
<library:element library:name="Album"/>
|
<library:element library:name="Album"/>
|
||||||
<library:element library:name="Archive"/>
|
<library:element library:name="Archive"/>
|
||||||
<library:element library:name="MakeUp"/>
|
<library:element library:name="MakeUp"/>
|
||||||
|
<library:element library:name="PageStyles"/>
|
||||||
</library:library>
|
</library:library>
|
Loading…
Add table
Reference in a new issue