You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pe...@apache.org on 2026/06/18 14:48:58 UTC
(openoffice) 01/03: fix incorectly merged res files.
This is an automated email from the ASF dual-hosted git repository.
leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit c75bc54c1b1cc86e48bbebfb932b048988061383
Author: Peter Kovacs <pe...@apache.org>
AuthorDate: Thu Jun 18 04:30:23 2026 +0200
fix incorectly merged res files.
---
main/desktop/BUILD.bazel | 82 +++++++++++++++++++++++++++++++++++-------------
main/desktop/readme.md | 14 +++++++++
main/staging/BUILD.bazel | 1 +
3 files changed, 76 insertions(+), 21 deletions(-)
diff --git a/main/desktop/BUILD.bazel b/main/desktop/BUILD.bazel
index 0eba26c475..42c2622380 100644
--- a/main/desktop/BUILD.bazel
+++ b/main/desktop/BUILD.bazel
@@ -1,7 +1,7 @@
package(default_visibility = ["//visibility:public"])
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
-load("//build/rules:rsc_pipeline.bzl", "rsc_res", "rename_file")
+load("//build/rules:rsc_pipeline.bzl", "rsc_res")
# ── Common compile settings ───────────────────────────────────────────────────
_DEFINES = [
@@ -1074,33 +1074,73 @@ cc_binary(
visibility = ["//visibility:public"],
)
+# RSC resource libraries. Upstream's desktop module builds THREE separate
+# resource libraries (one .res per ResMgr name), NOT one merged .res. Each is
+# loaded at runtime by ResMgr::CreateResMgr("<name>") → <name>en-US.res:
+# * dkt (util/makefile.mk) desktop.src + wizard.src
+# * deployment (source/deployment/...) registry/manager/misc/unopkg
+# * deploymentgui (source/deployment/gui/...) dp_gui_*.src ← Extension Manager
+# A previous single glob(["source/**/*.src"]) merged everything into one .res
+# staged as both dkten-US and deploymenten-US, leaving deploymentguien-US.res
+# absent → ResMgr::CreateResMgr("deploymentgui") returned NULL → DeploymentGui-
+# ResMgr::get() NULL-deref in ResMgr::GetResource the moment Extension Manager
+# opened. Split here to match upstream; hdrs/includes/images are shared (a
+# strict partition of the same inputs that compiled as one).
+_DESKTOP_RES_HDRS = glob(["inc/**/*.hrc", "source/**/*.hrc"]) + [
+ "//main/svtools:svtools_hrc",
+ "//main/svl:svl_hrc",
+]
+
+_DESKTOP_RES_INCLUDES = [
+ "main/desktop/inc",
+ "main/desktop/source/app",
+ "main/desktop/source/inc",
+ "main/desktop/source/deployment/registry/inc",
+ "main/svtools/inc",
+ "main/svl/inc",
+]
+
+_DESKTOP_RES_IMAGES = [
+ "//main/default_images:desktop_res_images",
+ "//main/default_images:shared_images",
+]
+
+# dkt → dkten-US.res (app + migration wizard strings)
rsc_res(
name = "desktop_res",
- srcs = glob(["source/**/*.src"]),
- hdrs = glob(["inc/**/*.hrc", "source/**/*.hrc"]) + [
- "//main/svtools:svtools_hrc",
- "//main/svl:svl_hrc",
- ],
- includes = [
- "main/desktop/inc",
- "main/desktop/source/app",
- "main/desktop/source/inc",
- "main/desktop/source/deployment/registry/inc",
- "main/svtools/inc",
- "main/svl/inc",
- ],
- images = [
- "//main/default_images:desktop_res_images",
- "//main/default_images:shared_images",
+ srcs = [
+ "source/app/desktop.src",
+ "source/migration/wizard.src",
],
+ hdrs = _DESKTOP_RES_HDRS,
+ includes = _DESKTOP_RES_INCLUDES,
+ images = _DESKTOP_RES_IMAGES,
+ images_root = "main/default_images",
+ visibility = ["//visibility:public"],
+)
+
+# deployment → deploymenten-US.res (registry/manager/misc/unopkg, no gui)
+rsc_res(
+ name = "deployment_res",
+ srcs = glob(
+ ["source/deployment/**/*.src"],
+ exclude = ["source/deployment/gui/*.src"],
+ ),
+ hdrs = _DESKTOP_RES_HDRS,
+ includes = _DESKTOP_RES_INCLUDES,
+ images = _DESKTOP_RES_IMAGES,
images_root = "main/default_images",
visibility = ["//visibility:public"],
)
-rename_file(
- name = "deployment_res",
- src = ":desktop_res",
- out = "deploymenten-US.res",
+# deploymentgui → deploymentguien-US.res (Extension Manager dialogs)
+rsc_res(
+ name = "deploymentgui_res",
+ srcs = glob(["source/deployment/gui/*.src"]),
+ hdrs = _DESKTOP_RES_HDRS,
+ includes = _DESKTOP_RES_INCLUDES,
+ images = _DESKTOP_RES_IMAGES,
+ images_root = "main/default_images",
visibility = ["//visibility:public"],
)
diff --git a/main/desktop/readme.md b/main/desktop/readme.md
index 0bf57f325b..01fe802fb7 100644
--- a/main/desktop/readme.md
+++ b/main/desktop/readme.md
@@ -58,3 +58,17 @@
- **App launchers** (swriter/scalc/sdraw/simpress/sbase/smath/sweb): each links `launcher.cxx` +
`<app>.cxx`, uses `UNICODE`/`_UNICODE`, links only `shell32.lib`.
+
+- **RSC resource libraries — THREE separate `.res`, not one**: the desktop module's strings are
+ loaded at runtime by `ResMgr::CreateResMgr("<name>")` → `<name>en-US.res`, so each ResMgr name
+ needs its own `.res` file. Upstream builds three (`util/makefile.mk` → `dkt`,
+ `source/deployment/makefile.mk` → `deployment`, `source/deployment/gui/makefile.mk` →
+ `deploymentgui`). The three `rsc_res` targets are `:desktop_res` (→ `dkten-US.res`,
+ app `desktop.src` + migration `wizard.src`), `:deployment_res` (→ `deploymenten-US.res`,
+ registry/manager/misc/unopkg `.src`, gui excluded) and `:deploymentgui_res`
+ (→ `deploymentguien-US.res`, the `dp_gui_*.src` Extension Manager dialogs). `hdrs`/`includes`/
+ `images` are shared (a strict partition of the same inputs).
+ HISTORY: a single `glob(["source/**/*.src"])` once merged everything into one `.res` staged as
+ both `dkten-US` and `deploymenten-US`, so `deploymentguien-US.res` never existed →
+ `ResMgr::CreateResMgr("deploymentgui")` returned NULL → `DeploymentGuiResMgr::get()` NULL-deref
+ in `ResMgr::GetResource` (`[eax+20h]`, eax=0) the instant Extension Manager opened.
diff --git a/main/staging/BUILD.bazel b/main/staging/BUILD.bazel
index 59b69442f6..e7f2c1d6c8 100644
--- a/main/staging/BUILD.bazel
+++ b/main/staging/BUILD.bazel
@@ -422,6 +422,7 @@ res_stage(
"//main/dbaccess:dbui_res": "dbuien-US",
"//main/desktop:desktop_res": "dkten-US",
"//main/desktop:deployment_res": "deploymenten-US",
+ "//main/desktop:deploymentgui_res": "deploymentguien-US",
"//main/editeng:editeng_res": "editengen-US",
"//main/extensions:bib_res": "biben-US",
"//main/extensions:dbp_res": "dbpen-US",