Repository.mk | 1 cui/inc/strings.hrc | 1 cui/source/options/optpath.cxx | 4 ++ include/unotools/pathoptions.hxx | 2 + officecfg/registry/data/org/openoffice/Office/Paths.xcu | 9 ++++++ officecfg/registry/schema/org/openoffice/Office/Common.xcs | 12 ++++++-- svx/Module_svx.mk | 1 svx/Package_document_themes.mk | 16 +++++++++++ svx/uiconfig/themes/libreoffice.theme | 18 +++++++++++++ unotools/source/config/defaultoptions.cxx | 2 + unotools/source/config/pathoptions.cxx | 10 ++++++- 11 files changed, 72 insertions(+), 4 deletions(-)
New commits: commit a8e0de1b5d6dfc03a9fc4ed13cb7ec8a691a6772 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Jan 17 23:13:55 2025 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon Jan 20 01:40:41 2025 +0100 doctheme: add LibreOffice theme file to LO share folder Change-Id: Ifa38b69739d82d1f2efdfca58a2e0d6f9ff69008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180416 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/Repository.mk b/Repository.mk index 8ee7e623a7dd..0357827b13d5 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1049,6 +1049,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\ Pyuno/mailmerge \ ) \ sfx2_classification \ + svx_document_themes \ $(if $(filter OPENCL,$(BUILD_TYPE)),sc_opencl_runtimetest) \ $(if $(ENABLE_HTMLHELP),\ helpcontent2_html_dynamic \ diff --git a/svx/Module_svx.mk b/svx/Module_svx.mk index ddf824cdf4bc..d89aaad42994 100644 --- a/svx/Module_svx.mk +++ b/svx/Module_svx.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Module_Module,svx)) $(eval $(call gb_Module_add_targets,svx,\ Library_svx \ Library_svxcore \ + Package_document_themes \ )) ifeq ($(gb_Side),host) diff --git a/svx/Package_document_themes.mk b/svx/Package_document_themes.mk new file mode 100644 index 000000000000..254292d9c45d --- /dev/null +++ b/svx/Package_document_themes.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Package_Package,svx_document_themes,$(SRCDIR)/svx/uiconfig/themes)) + +$(eval $(call gb_Package_add_files_with_dir,svx_document_themes,$(LIBO_SHARE_FOLDER)/themes,\ + libreoffice.theme \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/svx/uiconfig/themes/libreoffice.theme b/svx/uiconfig/themes/libreoffice.theme new file mode 100644 index 000000000000..79bafcb486f6 --- /dev/null +++ b/svx/uiconfig/themes/libreoffice.theme @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<theme name="LibreOffice"> + <theme-colors name="LibreOffice"> + <color name="dark1" color="#000000" /> + <color name="light1" color="#ffffff" /> + <color name="dark2" color="#000000" /> + <color name="light2" color="#ffffff" /> + <color name="accent1" color="#18a303" /> + <color name="accent2" color="#0369a3" /> + <color name="accent3" color="#a33e03" /> + <color name="accent4" color="#8e03a3" /> + <color name="accent5" color="#c99c00" /> + <color name="accent6" color="#c9211e" /> + <color name="hyperlink" color="#0000ee" /> + <color name="followed-hyperlink" color="#551a8b" /> + </theme-colors> +</theme> commit 24754a9270dcb8b26b9e772b849eed6e3ecb42dc Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Jan 17 18:08:55 2025 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon Jan 20 01:40:34 2025 +0100 doctheme: Add document themes folder as a config. path Currently the document themes are hardcoded and the new ones will be only used in the current document. This is the first of the series to make document theme user defined and stored in the user and shared folders (just like other resources). This change adds the configuration of the folder which will be used to search for the document themes. By default the folders are located in the user and shared profile folders. Change-Id: I1388983804d012cd7f8575dfc96830451821f56e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180379 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 9d1687b72596..a6d08758a626 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -29,6 +29,7 @@ #define RID_CUISTR_KEY_GALLERY_DIR NC_("RID_SVXSTR_KEY_GALLERY_DIR", "Gallery") #define RID_CUISTR_KEY_TEMP_PATH NC_("RID_SVXSTR_KEY_TEMP_PATH", "Temporary files") #define RID_CUISTR_KEY_CLASSIFICATION_PATH NC_("RID_SVXSTR_KEY_CLASSIFICATION_PATH", "Classification") +#define RID_CUISTR_KEY_DOCUMENT_THEME_PATH NC_("RID_CUISTR_KEY_DOCUMENT_THEME_PATH", "Document Theme") #define RID_CUISTR_KEY_AUTOCORRECT_DIR NC_("RID_SVXSTR_KEY_AUTOCORRECT_DIR", "AutoCorrect") #define RID_CUISTR_KEY_LINGUISTIC_DIR NC_("RID_SVXSTR_KEY_LINGUISTIC_DIR", "Writing aids") /* %n will be replaced at runtime by a number starting with 1 and increasing as necessary */ diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 29c554fe8ffb..0ec4b206913f 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -109,6 +109,7 @@ constexpr Handle2CfgNameMapping_Impl Hdl2CfgMap_Impl[] { SvtPathOptions::Paths::Work, u"Work"_ustr }, { SvtPathOptions::Paths::Dictionary, u"Dictionary"_ustr }, { SvtPathOptions::Paths::Classification, u"Classification"_ustr }, + { SvtPathOptions::Paths::DocumentTheme, u"DocumentTheme"_ustr }, #if OSL_DEBUG_LEVEL > 1 { SvtPathOptions::Paths::Linguistic, u"Linguistic"_ustr }, #endif @@ -281,6 +282,9 @@ void SvxPathTabPage::Reset( const SfxItemSet* ) case SvtPathOptions::Paths::Classification: pId = RID_CUISTR_KEY_CLASSIFICATION_PATH; break; + case SvtPathOptions::Paths::DocumentTheme: + pId = RID_CUISTR_KEY_DOCUMENT_THEME_PATH; + break; #if OSL_DEBUG_LEVEL > 1 case SvtPathOptions::Paths::Linguistic: pId = RID_CUISTR_KEY_LINGUISTIC_DIR; diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx index 6c1f63713143..1bbb84502587 100644 --- a/include/unotools/pathoptions.hxx +++ b/include/unotools/pathoptions.hxx @@ -61,6 +61,7 @@ public: Storage, Temp, Template, + DocumentTheme, UserConfig, Work, Classification, @@ -101,6 +102,7 @@ public: const OUString& GetFingerprintPath() const; const OUString& GetNumbertextPath() const; const OUString& GetClassificationPath() const; + const OUString& GetDocumentThemePath() const; // set the paths void SetAutoTextPath( const OUString& rPath ); diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu index fa25191be2a4..519c8db763ee 100644 --- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu @@ -217,6 +217,15 @@ <value>$(work)</value> </prop> </node> + <node oor:name="DocumentTheme" oor:op="fuse" oor:mandatory="true"> + <node oor:name="InternalPaths"> + <node oor:name="$(insturl)/@LIBO_SHARE_FOLDER@/themes" oor:op="fuse"/> + </node> + <prop oor:name="UserPaths" oor:finalized="true"/> + <prop oor:name="WritePath"> + <value>$(userurl)/themes</value> + </prop> + </node> <node oor:name="Classification" oor:op="fuse" oor:mandatory="true"> <prop oor:name="IsSinglePath" oor:finalized="true"> <value>true</value> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index be596df8e308..2b309219bf10 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -1583,6 +1583,12 @@ </info> <value>$(insturl)/@LIBO_SHARE_FOLDER@/config/symbol</value> </prop> + <prop oor:name="DocumentTheme" oor:type="xs:string" oor:nillable="false"> + <info> + <desc>Specifies the default directory where the document themes files.</desc> + </info> + <value>$(insturl)/@LIBO_SHARE_FOLDER@/themes</value> + </prop> <prop oor:name="Config" oor:type="xs:string" oor:nillable="false"> <info> <desc>Specifies the default directory where the configuration files @@ -6315,7 +6321,7 @@ </info> <value>true</value> </prop> - <prop oor:name="TextSpaces" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="TextSpaces" oor:type="xs:boolean" oor:nillable="false"> <info> <desc> Enables accessibility check of extra spaces for formattings, inside the document @@ -6325,7 +6331,7 @@ </info> <value>true</value> </prop> - <prop oor:name="TextTabs" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="TextTabs" oor:type="xs:boolean" oor:nillable="false"> <info> <desc> Enables accessibility check of extra tabs for formattings, inside the document @@ -6335,7 +6341,7 @@ </info> <value>true</value> </prop> - <prop oor:name="TextEmptyNums" oor:type="xs:boolean" oor:nillable="false"> + <prop oor:name="TextEmptyNums" oor:type="xs:boolean" oor:nillable="false"> <info> <desc> Enables accessibility check of empty new line between numberings, inside the document diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index 127cc685801d..9d868461d3f1 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -93,6 +93,8 @@ OUString GetDefaultPath( SvtPathOptions::Paths nId ) aRet = aPathOpt.SubstituteVariable(officecfg::Office::Common::Path::Default::Work::get()); break; case SvtPathOptions::Paths::Classification: aRet = aPathOpt.SubstituteVariable(officecfg::Office::Common::Path::Default::Classification::get()); break; + case SvtPathOptions::Paths::DocumentTheme: + aRet = aPathOpt.SubstituteVariable(officecfg::Office::Common::Path::Default::DocumentTheme::get()); break; default: assert(false); } diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 5447056f8457..f88894d51690 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -109,6 +109,7 @@ class SvtPathOptions_Impl const OUString& GetFingerprintPath() { return GetPath( SvtPathOptions::Paths::Fingerprint ); } const OUString& GetNumbertextPath() { return GetPath( SvtPathOptions::Paths::NumberText ); } const OUString& GetClassificationPath() { return GetPath( SvtPathOptions::Paths::Classification ); } + const OUString& GetDocumentThemePath() { return GetPath( SvtPathOptions::Paths::DocumentTheme ); } // set the paths void SetPath( SvtPathOptions::Paths, const OUString& rNewPath ); @@ -170,7 +171,8 @@ constexpr PropertyStruct aPropNames[] = { u"UIConfig"_ustr, SvtPathOptions::Paths::UIConfig }, { u"Fingerprint"_ustr, SvtPathOptions::Paths::Fingerprint }, { u"Numbertext"_ustr, SvtPathOptions::Paths::NumberText }, - { u"Classification"_ustr, SvtPathOptions::Paths::Classification } + { u"Classification"_ustr, SvtPathOptions::Paths::Classification }, + { u"DocumentTheme"_ustr, SvtPathOptions::Paths::DocumentTheme }, }; // Supported variables by the old SvtPathOptions implementation @@ -568,6 +570,11 @@ const OUString& SvtPathOptions::GetClassificationPath() const return pImpl->GetClassificationPath(); } +const OUString& SvtPathOptions::GetDocumentThemePath() const +{ + return pImpl->GetDocumentThemePath(); +} + void SvtPathOptions::SetAutoTextPath( const OUString& rPath ) { pImpl->SetAutoTextPath( rPath ); @@ -675,6 +682,7 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, SvtPathOptions::Paths ePath case SvtPathOptions::Paths::Fingerprint: aPath = GetFingerprintPath(); break; case SvtPathOptions::Paths::NumberText: aPath = GetNumbertextPath(); break; case SvtPathOptions::Paths::Classification: aPath = GetClassificationPath(); break; + case SvtPathOptions::Paths::DocumentTheme: aPath = GetDocumentThemePath(); break; // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case SvtPathOptions::Paths::UserConfig: case SvtPathOptions::Paths::LAST: