wizards/source/sfdocuments/SF_Document.xba | 15 +++++++++++++-- wizards/source/sfdocuments/script.xlb | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-)
New commits: commit a656c736ec13a2223f221c4157b619f3b0601a9a Author: Jean-Pierre Ledure <j...@ledure.be> AuthorDate: Sun May 11 17:56:37 2025 +0200 Commit: Jean-Pierre Ledure <j...@ledure.be> CommitDate: Mon May 12 11:51:43 2025 +0200 ScriptForge (Document) all document properties The Document service proposes already to access the document properties as a dictionary (Basic or Python). New entries have been added in recent releases of LO. They have been added in ScriptForge too. They are: Coverage EditingCycles Identifier Publisher Relation Rights Source Type The user documentation does not need any update. Change-Id: Id5e449e307e7f394f5b5f0375320ab51afd9c250 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185188 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <j...@ledure.be> diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index 4f69c9cb3986..aa05a67581a6 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -2113,12 +2113,14 @@ Private Sub _LoadDocumentProperties() ''' Special values: ''' Only valid dates are taken ''' Statistics are exploded in subitems. Subitems are specific to document type -''' Keywords are joined +''' Arrays of strings are joined ''' Language is aligned on L10N convention la-CO Dim oProperties As Object ' Document properties Dim vNamedValue As Variant ' com.sun.star.beans.NamedValue +Const cstJoin = ", " + If IsNull(_DocumentProperties) Then Set oProperties = _Component.getDocumentProperties Set _DocumentProperties = CreateScriptService("Dictionary") @@ -2127,20 +2129,29 @@ Dim vNamedValue As Variant ' com.sun.star.beans.NamedValue .Add("AutoloadSecs", oProperties.AutoloadSecs) .Add("AutoloadURL", oProperties.AutoloadURL) If oProperties.CreationDate.Year > 0 Then .Add("CreationDate", CDateFromUnoDateTime(oProperties.CreationDate)) + .Add("Contributor", Join(oProperties.Contributor, cstJoin)) + .Add("Coverage", oProperties.Coverage) .Add("DefaultTarget", oProperties.DefaultTarget) .Add("Description", oProperties.Description) ' The description can be multiline ' DocumentStatistics : number and names of statistics depend on document type For Each vNamedValue In oProperties.DocumentStatistics .Add(vNamedValue.Name, vNamedValue.Value) Next vNamedValue + .Add("EditingCycles", oProperties.EditingCycles) .Add("EditingDuration", oProperties.EditingDuration) .Add("Generator", oProperties.Generator) - .Add("Keywords", Join(oProperties.Keywords, ", ")) + .Add("Identifier", oProperties.Identifier) + .Add("Keywords", Join(oProperties.Keywords, cstJoin)) .Add("Language", oProperties.Language.Language & Iif(Len(oProperties.Language.Country) > 0, "-" & oProperties.Language.Country, "")) If oProperties.ModificationDate.Year > 0 Then .Add("ModificationDate", CDateFromUnoDateTime(oProperties.ModificationDate)) If oProperties.PrintDate.Year > 0 Then .Add("PrintDate", CDateFromUnoDateTime(oProperties.PrintDate)) .Add("PrintedBy", oProperties.PrintedBy) + .Add("Publisher", Join(oProperties.Publisher, cstJoin)) + .Add("Relation", Join(oProperties.Relation, cstJoin)) + .Add("Rights", oProperties.Rights) + .Add("Source", oProperties.Source) .Add("Subject", oProperties.Subject) + .Add("Type", oProperties.Type) If oProperties.TemplateDate.Year > 0 Then .Add("TemplateDate", CDateFromUnoDateTime(oProperties.TemplateDate)) .Add("TemplateName", oProperties.TemplateName) .Add("TemplateURL", oProperties.TemplateURL) diff --git a/wizards/source/sfdocuments/script.xlb b/wizards/source/sfdocuments/script.xlb index 8188fd53bb1f..3d2264bd3f6d 100644 --- a/wizards/source/sfdocuments/script.xlb +++ b/wizards/source/sfdocuments/script.xlb @@ -1,15 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> <library:library xmlns:library="http://openoffice.org/2000/library" library:name="SFDocuments" library:readonly="false" library:passwordprotected="false"> - <library:element library:name="SF_Chart"/> - <library:element library:name="SF_FormDocument"/> - <library:element library:name="SF_FormControl"/> - <library:element library:name="SF_Base"/> - <library:element library:name="SF_Register"/> - <library:element library:name="SF_Writer"/> - <library:element library:name="SF_Calc"/> - <library:element library:name="SF_Document"/> - <library:element library:name="SF_DocumentListener"/> - <library:element library:name="SF_Form"/> <library:element library:name="__License"/> + <library:element library:name="SF_Form"/> + <library:element library:name="SF_DocumentListener"/> + <library:element library:name="SF_Document"/> + <library:element library:name="SF_Calc"/> + <library:element library:name="SF_Writer"/> + <library:element library:name="SF_Register"/> + <library:element library:name="SF_Base"/> + <library:element library:name="SF_FormControl"/> + <library:element library:name="SF_FormDocument"/> + <library:element library:name="SF_Chart"/> </library:library> \ No newline at end of file