Code cleaning
This commit is contained in:
parent
efd45c1c6d
commit
20b7f57087
4 changed files with 41 additions and 39 deletions
|
@ -102,7 +102,7 @@ End Sub
|
|||
|
||||
Private Sub quietCleaning
|
||||
Dim description As String
|
||||
Dim statusIndicator as Object
|
||||
Dim statusIndicator As Object
|
||||
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
||||
description = "Вы уверены, что хотите выполнить чистку документа?"
|
||||
If NOT confirm(description) Then
|
||||
|
@ -305,13 +305,13 @@ Private Sub removeUserPageStyles
|
|||
count = oStyles.count - 1
|
||||
|
||||
For i = 0 to count
|
||||
oStyle = oStyles.getByIndex(i)
|
||||
If oStyle.isUserDefined Then
|
||||
oStyles.removeByName(oStyle.getName)
|
||||
count = oStyles.count - 1
|
||||
'restart if style removed as sorting is unreliable
|
||||
i = -1
|
||||
EndIf
|
||||
oStyle = oStyles.getByIndex(i)
|
||||
If oStyle.isUserDefined Then
|
||||
oStyles.removeByName(oStyle.getName)
|
||||
count = oStyles.count - 1
|
||||
'restart if style removed as sorting is unreliable
|
||||
i = -1
|
||||
EndIf
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
|
@ -432,22 +432,21 @@ Private Function DocHasCharStyle(oDoc, sName$) As Boolean
|
|||
End Function
|
||||
|
||||
Private Function getTemplatePath() as String
|
||||
Dim path as String
|
||||
Dim settings As Object
|
||||
Dim configProvider As Object
|
||||
Dim params(0) As new com.sun.star.beans.PropertyValue
|
||||
Dim convService As Object
|
||||
Dim path as String
|
||||
Dim settings As Object
|
||||
Dim configProvider As Object
|
||||
Dim params(0) As new com.sun.star.beans.PropertyValue
|
||||
Dim convService As Object
|
||||
|
||||
configProvider = createUnoService( "com.sun.star.configuration.ConfigurationProvider" )
|
||||
params(0).Name = "nodepath"
|
||||
params(0).Value = "/org.openoffice.Office.Paths/Paths"
|
||||
settings = configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", params() )
|
||||
|
||||
path = settings.Template.WritePath
|
||||
convService = CreateUnoService("com.sun.star.util.PathSubstitution")
|
||||
path = convService.substituteVariables(path, true)
|
||||
path = ConvertToUrl(path)
|
||||
getTemplatePath = path
|
||||
configProvider = createUnoService( "com.sun.star.configuration.ConfigurationProvider" )
|
||||
params(0).Name = "nodepath"
|
||||
params(0).Value = "/org.openoffice.Office.Paths/Paths"
|
||||
settings = configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", params() )
|
||||
path = settings.Template.WritePath
|
||||
convService = CreateUnoService("com.sun.star.util.PathSubstitution")
|
||||
path = convService.substituteVariables(path, true)
|
||||
path = ConvertToUrl(path)
|
||||
getTemplatePath = path
|
||||
|
||||
End Function
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue