Added more info about cleaning environment

This commit is contained in:
Georgy Litvinov 2020-11-07 21:20:08 +01:00
parent 876008a5c5
commit 90352a2110
4 changed files with 22 additions and 6 deletions

View file

@ -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="Clean" script:language="StarBasic">Sub mark65
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark66
End Sub
@ -1413,6 +1413,13 @@ Function getVersion As String
getVersion=oProduct.getByName(&quot;ooSetupVersion&quot;)
End Function
Function getFullVersion As String
GlobalScope.BasicLibraries.LoadLibrary(&quot;Tools&quot;)
Dim oProduct As Object
oProduct=GetRegistryKeyContent(&quot;org.openoffice.Setup/Product&quot;)
getFullVersion=oProduct.getByName(&quot;ooSetupVersionAboutBox&quot;)
End Function
Private Sub convertFormatToUserFields(identifier As String, styleNames, styleValues)
@ -1801,12 +1808,21 @@ Sub addTimeStampToProperties
curTime = Now()
docProps = ThisComponent.getDocumentProperties()
userProps = docProps.UserDefinedProperties()
userProps.addProperty(curTime ,128,&quot;Cleaned &quot; &amp; redactionExtensionVersion)
userProps.addProperty(curTime ,128,&quot;Cleaned by &quot; &amp; getUserName() &amp; &quot; with &quot; &amp; redactionExtensionVersion &amp; &quot; LO&quot; &amp; getFullVersion() )
exceptionHandlerProps:
Resume Next
End Sub
Function getUserName() As String
Dim oCP As Object
Dim oCUA As Object
Dim aProps(0) As New com.sun.star.beans.PropertyValue
oCP = GetProcessServiceManager().createInstance( &quot;com.sun.star.configuration.ConfigurationProvider&quot; )
aProps(0).Name = &quot;nodepath&quot;
aProps(0).Value = &quot;/org.openoffice.UserProfile/Data&quot;
oCUA = oCP.createInstanceWithArguments( &quot;com.sun.star.configuration.ConfigurationUpdateAccess&quot;, aProps )
getUserName = &quot; &quot; &amp; oCUA.getByName(&quot;givenname&quot;) &amp; &quot; &quot; &amp; oCUA.getByName(&quot;sn&quot;)
End Function
sub saveCleanedVersion(comment)
dim document as object