@unieai/libreoffice-kit-wasm 0.0.0-stage → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/assets/dsoffice.cjs +26 -0
- package/assets/dsoffice.data +0 -0
- package/assets/dsoffice.data.js.metadata +1 -0
- package/assets/dsoffice.wasm +4 -0
- package/assets/manifest.json +1888 -0
- package/licenses/LICENSE +4666 -0
- package/licenses/NOTICE +63 -0
- package/licenses/Rabi-Harness-MIT.txt +28 -0
- package/package.json +22 -4
- package/prebuilds.json +128 -0
- package/sources/build-autogen.input +35 -0
- package/sources/core-source.json +4 -0
- package/sources/docs/ui-resources.md +123 -0
- package/sources/engine/build-identity.mjs +49 -0
- package/sources/engine/core-source.mjs +27 -0
- package/sources/engine/document-operations.hxx +51 -0
- package/sources/engine/ui-resource-policy.mjs +33 -0
- package/sources/engine/wasm-source/autogen.input +33 -0
- package/sources/engine/wasm-source/build.mjs +300 -0
- package/sources/engine/wasm-source/lok.cxx +428 -0
- package/sources/engine/wasm-source/patches/0001-macos-build-tools.patch +87 -0
- package/sources/engine/wasm-source/patches/0002-system-font-demand.patch +322 -0
- package/sources/engine/wasm-source/patches/0003-node-runtime.patch +99 -0
- package/sources/engine/wasm-source/patches/0004-system-fonts-only.patch +10 -0
- package/sources/engine/wasm-source/patches/0005-cross-build-rules.patch +46 -0
- package/sources/engine/wasm-source/patches/0006-wasm-external-platforms.patch +55 -0
- package/sources/engine/wasm-source/patches/0008-disable-link-updates.patch +30 -0
- package/sources/engine/wasm-source/patches/0009-disable-optional-curl.patch +11 -0
- package/sources/engine/wasm-source/patches/0010-refresh-component-registry.patch +11 -0
- package/sources/engine/wasm-source/patches/0011-preserve-optimization-with-prefix-maps.patch +21 -0
- package/sources/engine/wasm-source/patches/0012-anonymize-explicit-source-paths.patch +39 -0
- package/sources/engine/wasm-source/patches/0023-pdfium-for-embedded-graphics.patch +14 -0
- package/sources/engine/wasm-source/patches/0024-pdfium-emscripten-platform.patch +11 -0
- package/sources/engine/wasm-source/patches/0025-browser-editing.patch +18 -0
- package/sources/engine/wasm-source/patches/0028-synchronous-workbook-calculation.patch +64 -0
- package/sources/engine/wasm-source/patches/0029-unloaded-external-blip.patch +21 -0
- package/sources/engine/wasm-source/patches/0030-no-password-strength-ui.patch +117 -0
- package/sources/engine/wasm-source/patches/0031-size-optimization-lto.patch +26 -0
- package/sources/engine/wasm-source/patches/0047-defer-offscreen-canvas-output.patch +59 -0
- package/sources/engine/wasm-source/slim.mjs +74 -0
- package/sources/engine/wasm-source/source.json +16 -0
- package/sources/engine/wasm-source/source.mjs +12 -0
- package/sources/engine/wasm-source/stage.mjs +91 -0
- package/sources/scripts/checkout-wasm.mjs +24 -0
- package/sources/scripts/core-checkout.mjs +39 -0
- package/sources/scripts/minimize-ui-resources.py +198 -0
- package/sources/scripts/pack-utils.mjs +69 -0
- package/sources/scripts/platform-matrix.mjs +122 -0
- package/sources/scripts/verify-artifacts.mjs +261 -0
- package/sources/source-changes.patch +1081 -0
|
@@ -0,0 +1,1081 @@
|
|
|
1
|
+
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
|
|
2
|
+
index a4e46476c..6d4f51952 100644
|
|
3
|
+
--- a/canvas/source/vcl/spritecanvas.cxx
|
|
4
|
+
+++ b/canvas/source/vcl/spritecanvas.cxx
|
|
5
|
+
@@ -58,7 +58,16 @@ namespace vclcanvas
|
|
6
|
+
[this](css::uno::Any const& aAny) mutable { this->maCanvasHelper.enableUnsafeScrolling(aAny); } )
|
|
7
|
+
("SpriteBounds",
|
|
8
|
+
[this]() { return this->maCanvasHelper.isSpriteBounds(); },
|
|
9
|
+
- [this](css::uno::Any const& aAny) mutable { this->maCanvasHelper.enableSpriteBounds(aAny); } ));
|
|
10
|
+
+ [this](css::uno::Any const& aAny) mutable { this->maCanvasHelper.enableSpriteBounds(aAny); } )
|
|
11
|
+
+ ("LOKDeferredUpdate",
|
|
12
|
+
+ [this]() { return uno::Any(mbLOKDeferredUpdate); },
|
|
13
|
+
+ [this](const uno::Any& value) {
|
|
14
|
+
+ ENSURE_ARG_OR_THROW(value >>= mbLOKDeferredUpdate,
|
|
15
|
+
+ "LOKDeferredUpdate requires a boolean");
|
|
16
|
+
+ })
|
|
17
|
+
+ ("LOKUpdatePending",
|
|
18
|
+
+ [this]() { return uno::Any(mbLOKUpdatePending); },
|
|
19
|
+
+ {}));
|
|
20
|
+
|
|
21
|
+
SAL_INFO("canvas.vcl", "VCLSpriteCanvas::initialize called" );
|
|
22
|
+
|
|
23
|
+
@@ -135,11 +144,20 @@ namespace vclcanvas
|
|
24
|
+
{
|
|
25
|
+
SolarMutexGuard aGuard;
|
|
26
|
+
|
|
27
|
+
+ if (mbLOKDeferredUpdate)
|
|
28
|
+
+ {
|
|
29
|
+
+ mbLOKUpdatePending = true;
|
|
30
|
+
+ return true;
|
|
31
|
+
+ }
|
|
32
|
+
+
|
|
33
|
+
// avoid repaints on hidden window (hidden: not mapped to
|
|
34
|
+
// screen). Return failure, since the screen really has _not_
|
|
35
|
+
// been updated (caller should try again later)
|
|
36
|
+
- return mbIsVisible && maCanvasHelper.updateScreen(bUpdateAll,
|
|
37
|
+
- mbSurfaceDirty);
|
|
38
|
+
+ const bool updated = mbIsVisible && maCanvasHelper.updateScreen(bUpdateAll,
|
|
39
|
+
+ mbSurfaceDirty);
|
|
40
|
+
+ if (updated)
|
|
41
|
+
+ mbLOKUpdatePending = false;
|
|
42
|
+
+ return updated;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
OUString SAL_CALL SpriteCanvas::getServiceName( )
|
|
46
|
+
diff --git a/canvas/source/vcl/spritecanvas.hxx b/canvas/source/vcl/spritecanvas.hxx
|
|
47
|
+
index a5942c569..5685b6d4b 100644
|
|
48
|
+
--- a/canvas/source/vcl/spritecanvas.hxx
|
|
49
|
+
+++ b/canvas/source/vcl/spritecanvas.hxx
|
|
50
|
+
@@ -153,6 +153,9 @@ namespace vclcanvas
|
|
51
|
+
|
|
52
|
+
private:
|
|
53
|
+
css::uno::Sequence< css::uno::Any > maArguments;
|
|
54
|
+
+ // Offscreen owners defer output until a shared target is available.
|
|
55
|
+
+ bool mbLOKDeferredUpdate = false;
|
|
56
|
+
+ bool mbLOKUpdatePending = false;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
typedef ::rtl::Reference< SpriteCanvas > SpriteCanvasRef;
|
|
60
|
+
diff --git a/configure.ac b/configure.ac
|
|
61
|
+
index 32651cf64..4b2cc710b 100644
|
|
62
|
+
--- a/configure.ac
|
|
63
|
+
+++ b/configure.ac
|
|
64
|
+
@@ -3870,8 +3870,13 @@ if test $_os = Darwin; then
|
|
65
|
+
if test ! -d "$MACOSX_SDK_PATH"; then
|
|
66
|
+
AC_MSG_ERROR([Could not find an appropriate macOS SDK])
|
|
67
|
+
fi
|
|
68
|
+
- macosx_sdk=`xcodebuild -version -sdk "$MACOSX_SDK_PATH" SDKVersion`
|
|
69
|
+
- MACOSX_SDK_BUILD_VERSION=$(xcodebuild -version -sdk "$MACOSX_SDK_PATH" ProductBuildVersion)
|
|
70
|
+
+ if test "$libo_build_tools_only" = yes; then
|
|
71
|
+
+ macosx_sdk=$(xcrun --sdk macosx --show-sdk-version)
|
|
72
|
+
+ MACOSX_SDK_BUILD_VERSION=$(xcrun --sdk macosx --show-sdk-build-version)
|
|
73
|
+
+ else
|
|
74
|
+
+ macosx_sdk=`xcodebuild -version -sdk "$MACOSX_SDK_PATH" SDKVersion`
|
|
75
|
+
+ MACOSX_SDK_BUILD_VERSION=$(xcodebuild -version -sdk "$MACOSX_SDK_PATH" ProductBuildVersion)
|
|
76
|
+
+ fi
|
|
77
|
+
# format changed between 10.9 and 10.10 - up to 10.9 it was just four digits (1090), starting
|
|
78
|
+
# with macOS 10.10 it was switched to account for x.y.z with six digits, 10.10 is 101000,
|
|
79
|
+
# 10.10.2 is 101002
|
|
80
|
+
@@ -3910,27 +3915,39 @@ if test $_os = Darwin; then
|
|
81
|
+
FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
|
|
82
|
+
MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
|
|
83
|
+
|
|
84
|
+
- AC_MSG_CHECKING([whether Xcode is new enough])
|
|
85
|
+
- my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
|
|
86
|
+
- my_xcode_ver2=${my_xcode_ver1#Xcode }
|
|
87
|
+
- my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
|
|
88
|
+
- if test "$my_xcode_ver3" -ge 1403; then
|
|
89
|
+
- AC_MSG_RESULT([yes ($my_xcode_ver2)])
|
|
90
|
+
- if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 120000; then
|
|
91
|
+
- if test "$my_xcode_ver3" -eq 1500; then
|
|
92
|
+
- dnl the bug was already fixed on 15.1 and 15.2 still has the same OS requirements as 15.0
|
|
93
|
+
- dnl in other words all affected users could update to a working Xcode version
|
|
94
|
+
- AC_MSG_WARN([Use a current version of XCode or bump the minimum deployment target])
|
|
95
|
+
- AC_MSG_WARN([[see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking]])
|
|
96
|
+
- AC_MSG_ERROR([Xcode 15.0 has a bug in the new linker that causes runtime crashes on macOS 11 - aborting])
|
|
97
|
+
- fi
|
|
98
|
+
+ if test "$libo_build_tools_only" = yes; then
|
|
99
|
+
+ # Cross-build tools use the installed SDK and clang; they do not package a macOS app.
|
|
100
|
+
+ AC_MSG_CHECKING([whether the build-tools clang is new enough])
|
|
101
|
+
+ libo_build_clang=$(xcrun clang -dumpversion)
|
|
102
|
+
+ libo_build_clang_major=${libo_build_clang%%.*}
|
|
103
|
+
+ if test "$libo_build_clang_major" -lt 14; then
|
|
104
|
+
+ AC_MSG_ERROR([clang $libo_build_clang is too old for the macOS build tools])
|
|
105
|
+
fi
|
|
106
|
+
+ AC_MSG_RESULT([$libo_build_clang])
|
|
107
|
+
+ MACOSX_XCODE_BUILD_VERSION=
|
|
108
|
+
else
|
|
109
|
+
- AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 14.3])
|
|
110
|
+
- fi
|
|
111
|
+
+ AC_MSG_CHECKING([whether Xcode is new enough])
|
|
112
|
+
+ my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
|
|
113
|
+
+ my_xcode_ver2=${my_xcode_ver1#Xcode }
|
|
114
|
+
+ my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
|
|
115
|
+
+ if test "$my_xcode_ver3" -ge 1403; then
|
|
116
|
+
+ AC_MSG_RESULT([yes ($my_xcode_ver2)])
|
|
117
|
+
+ if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 120000; then
|
|
118
|
+
+ if test "$my_xcode_ver3" -eq 1500; then
|
|
119
|
+
+ dnl the bug was already fixed on 15.1 and 15.2 still has the same OS requirements as 15.0
|
|
120
|
+
+ dnl in other words all affected users could update to a working Xcode version
|
|
121
|
+
+ AC_MSG_WARN([Use a current version of XCode or bump the minimum deployment target])
|
|
122
|
+
+ AC_MSG_WARN([[see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking]])
|
|
123
|
+
+ AC_MSG_ERROR([Xcode 15.0 has a bug in the new linker that causes runtime crashes on macOS 11 - aborting])
|
|
124
|
+
+ fi
|
|
125
|
+
+ fi
|
|
126
|
+
+ else
|
|
127
|
+
+ AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 14.3])
|
|
128
|
+
+ fi
|
|
129
|
+
|
|
130
|
+
- my_xcode_ver1=$(xcrun xcodebuild -version | tail -n 1)
|
|
131
|
+
- MACOSX_XCODE_BUILD_VERSION=${my_xcode_ver1#Build version }
|
|
132
|
+
+ my_xcode_ver1=$(xcrun xcodebuild -version | tail -n 1)
|
|
133
|
+
+ MACOSX_XCODE_BUILD_VERSION=${my_xcode_ver1#Build version }
|
|
134
|
+
+ fi
|
|
135
|
+
|
|
136
|
+
LIBTOOL=/usr/bin/libtool
|
|
137
|
+
INSTALL_NAME_TOOL=install_name_tool
|
|
138
|
+
@@ -6358,7 +6375,7 @@ if test "$cross_compiling" = "yes"; then
|
|
139
|
+
$with_build_platform_configure_options \
|
|
140
|
+
--srcdir=$srcdir
|
|
141
|
+
|
|
142
|
+
- ./configure \
|
|
143
|
+
+ libo_build_tools_only=yes ./configure \
|
|
144
|
+
$sub_conf_defaults \
|
|
145
|
+
--with-parallelism="$with_parallelism" \
|
|
146
|
+
--with-theme="$with_theme" \
|
|
147
|
+
@@ -13213,8 +13230,9 @@ if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_
|
|
148
|
+
AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
-if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
|
|
152
|
+
- AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
|
|
153
|
+
+# PDFium also renders PDF graphics embedded in OOXML/EMF without the desktop PDF import filters.
|
|
154
|
+
+if test "$ENABLE_PDFIMPORT" != "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
|
|
155
|
+
+ AC_MSG_ERROR([Cannot enable Poppler when PDF importing is disabled; please enable PDF import first.])
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
|
|
159
|
+
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
|
|
160
|
+
index a3720b6d7..fd6ffac99 100644
|
|
161
|
+
--- a/cui/source/dialogs/passwdomdlg.cxx
|
|
162
|
+
+++ b/cui/source/dialogs/passwdomdlg.cxx
|
|
163
|
+
@@ -131,10 +131,15 @@ IMPL_LINK(PasswordToOpenModifyDialog, ChangeHdl, weld::Entry&, rEntry, void)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// if password doesn't meet policy cap the percentage at 70%
|
|
167
|
+
+#if defined(DISABLE_DYNLOADING)
|
|
168
|
+
+ if (pLevelBar)
|
|
169
|
+
+ pLevelBar->set_visible(false);
|
|
170
|
+
+#else
|
|
171
|
+
if (pLevelBar)
|
|
172
|
+
pLevelBar->set_percentage(
|
|
173
|
+
std::min(SvPasswordHelper::GetPasswordStrengthPercentage(aPasswordText),
|
|
174
|
+
bPasswordMeetsPolicy ? std::numeric_limits<double>::max() : 70.0));
|
|
175
|
+
+#endif
|
|
176
|
+
|
|
177
|
+
if (m_nMaxPasswdLen)
|
|
178
|
+
{
|
|
179
|
+
diff --git a/desktop/Executable_soffice_bin.mk b/desktop/Executable_soffice_bin.mk
|
|
180
|
+
index 5987a9a4d..a310cc5b5 100644
|
|
181
|
+
--- a/desktop/Executable_soffice_bin.mk
|
|
182
|
+
+++ b/desktop/Executable_soffice_bin.mk
|
|
183
|
+
@@ -29,6 +29,17 @@ $(eval $(call gb_Executable_add_cobjects,soffice_bin,\
|
|
184
|
+
))
|
|
185
|
+
|
|
186
|
+
ifeq ($(OS),EMSCRIPTEN)
|
|
187
|
+
+$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
|
|
188
|
+
+ -sMODULARIZE=1 \
|
|
189
|
+
+ -sEXPORT_NAME=createLibreOfficeModule \
|
|
190
|
+
+ -sENVIRONMENT=web$(COMMA)node$(COMMA)worker \
|
|
191
|
+
+ -sSTACK_SIZE=1048576 \
|
|
192
|
+
+ -sSTACK_OVERFLOW_CHECK=2 \
|
|
193
|
+
+ -sALLOW_MEMORY_GROWTH=1 \
|
|
194
|
+
+ -sINITIAL_MEMORY=402653184 \
|
|
195
|
+
+ -sMAXIMUM_MEMORY=4294967296 \
|
|
196
|
+
+))
|
|
197
|
+
+
|
|
198
|
+
$(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,soffice_bin)) : $(gb_CustomTarget_workdir)/static/emscripten_fs_image/soffice.data.js.link
|
|
199
|
+
|
|
200
|
+
# don't sort; later can override previous settings!
|
|
201
|
+
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
|
|
202
|
+
index 4e24628d9..72038d66f 100644
|
|
203
|
+
--- a/desktop/Library_sofficeapp.mk
|
|
204
|
+
+++ b/desktop/Library_sofficeapp.mk
|
|
205
|
+
@@ -155,4 +155,11 @@ $(eval $(call gb_Library_set_componentfile,sofficeapp,desktop/lokclipboard,servi
|
|
206
|
+
endif
|
|
207
|
+
endif
|
|
208
|
+
|
|
209
|
+
+ifeq ($(OS),EMSCRIPTEN)
|
|
210
|
+
+$(eval $(call gb_Library_add_defs,sofficeapp,-DDSH_LOK_HEADLESS))
|
|
211
|
+
+$(eval $(call gb_Library_add_exception_objects,sofficeapp, \
|
|
212
|
+
+ desktop/source/lib/rabi_wasm \
|
|
213
|
+
+))
|
|
214
|
+
+endif
|
|
215
|
+
+
|
|
216
|
+
# vim: set ts=4 sw=4 et:
|
|
217
|
+
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
|
|
218
|
+
index a605030eb..1ee11c171 100644
|
|
219
|
+
--- a/desktop/source/lib/init.cxx
|
|
220
|
+
+++ b/desktop/source/lib/init.cxx
|
|
221
|
+
@@ -98,6 +98,7 @@
|
|
222
|
+
|
|
223
|
+
#include <com/sun/star/connection/XConnection.hpp>
|
|
224
|
+
#include <com/sun/star/document/MacroExecMode.hpp>
|
|
225
|
+
+#include <com/sun/star/document/UpdateDocMode.hpp>
|
|
226
|
+
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
227
|
+
#include <com/sun/star/container/XNameAccess.hpp>
|
|
228
|
+
#include <com/sun/star/document/XTypeDetection.hpp>
|
|
229
|
+
@@ -106,6 +107,7 @@
|
|
230
|
+
#include <com/sun/star/frame/DispatchResultState.hpp>
|
|
231
|
+
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
|
232
|
+
#include <com/sun/star/frame/XDispatchResultListener.hpp>
|
|
233
|
+
+#include <com/sun/star/sheet/XCalculatable.hpp>
|
|
234
|
+
#include <com/sun/star/frame/XSynchronousDispatch.hpp>
|
|
235
|
+
#include <com/sun/star/frame/XStorable.hpp>
|
|
236
|
+
#include <com/sun/star/lang/Locale.hpp>
|
|
237
|
+
@@ -1215,6 +1217,7 @@ static void doc_setGraphicSelection (LibreOfficeKitDocument* pThis,
|
|
238
|
+
int nX,
|
|
239
|
+
int nY);
|
|
240
|
+
static void doc_resetSelection (LibreOfficeKitDocument* pThis);
|
|
241
|
+
+static int doc_calculateAll(LibreOfficeKitDocument* pThis);
|
|
242
|
+
static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand);
|
|
243
|
+
static void doc_setClientZoom(LibreOfficeKitDocument* pThis,
|
|
244
|
+
int nTilePixelWidth,
|
|
245
|
+
@@ -1535,6 +1538,7 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC
|
|
246
|
+
m_pDocumentClass->renderNextSlideLayer = doc_renderNextSlideLayer;
|
|
247
|
+
m_pDocumentClass->setViewOption = doc_setViewOption;
|
|
248
|
+
m_pDocumentClass->setColorPreviewState = doc_setColorPreviewState;
|
|
249
|
+
+ m_pDocumentClass->calculateAll = doc_calculateAll;
|
|
250
|
+
|
|
251
|
+
gDocumentClass = m_pDocumentClass;
|
|
252
|
+
}
|
|
253
|
+
@@ -2947,16 +2951,11 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
|
|
254
|
+
comphelper::makePropertyValue(u"FilterOptions"_ustr, aOptions),
|
|
255
|
+
comphelper::makePropertyValue(u"InteractionHandler"_ustr, uno::Reference<task::XInteractionHandler2>(pInteraction)),
|
|
256
|
+
comphelper::makePropertyValue(u"MacroExecutionMode"_ustr, nMacroExecMode),
|
|
257
|
+
+ comphelper::makePropertyValue(u"UpdateDocMode"_ustr, sal_Int16(document::UpdateDocMode::NO_UPDATE)),
|
|
258
|
+
comphelper::makePropertyValue(u"AsTemplate"_ustr, false),
|
|
259
|
+
comphelper::makePropertyValue(u"Silent"_ustr, !aBatch.isEmpty())
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
- /* TODO
|
|
263
|
+
- sal_Int16 nUpdateDoc = document::UpdateDocMode::ACCORDING_TO_CONFIG;
|
|
264
|
+
- aFilterOptions[3].Name = "UpdateDocMode";
|
|
265
|
+
- aFilterOptions[3].Value <<= nUpdateDoc;
|
|
266
|
+
- */
|
|
267
|
+
-
|
|
268
|
+
OutputDevice::StartTrackingFontMappingUse();
|
|
269
|
+
|
|
270
|
+
if (const char* pExemptVerifyHost = ::getenv("LOK_EXEMPT_VERIFY_HOST"))
|
|
271
|
+
@@ -5294,6 +5293,25 @@ static bool isCommandAllowed(std::u16string_view command)
|
|
272
|
+
return std::find(std::begin(denyList), std::end(denyList), command) == std::end(denyList);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
+// Calculation through the model does not require an interactive dispatcher or event loop.
|
|
276
|
+
+static int doc_calculateAll(LibreOfficeKitDocument* pThis)
|
|
277
|
+
+{
|
|
278
|
+
+ SolarMutexGuard aGuard;
|
|
279
|
+
+ SetLastExceptionMsg();
|
|
280
|
+
+ try
|
|
281
|
+
+ {
|
|
282
|
+
+ auto* pDocument = static_cast<LibLODocument_Impl*>(pThis);
|
|
283
|
+
+ uno::Reference<sheet::XCalculatable> xCalculatable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
|
|
284
|
+
+ xCalculatable->calculateAll();
|
|
285
|
+
+ return 1;
|
|
286
|
+
+ }
|
|
287
|
+
+ catch (const uno::Exception& exception)
|
|
288
|
+
+ {
|
|
289
|
+
+ SetLastExceptionMsg("exception: " + exception.Message);
|
|
290
|
+
+ }
|
|
291
|
+
+ return 0;
|
|
292
|
+
+}
|
|
293
|
+
+
|
|
294
|
+
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished)
|
|
295
|
+
{
|
|
296
|
+
comphelper::ProfileZone aZone("doc_postUnoCommand");
|
|
297
|
+
@@ -7689,7 +7707,7 @@ static bool initialize_uno(const OUString& aAppProgramURL)
|
|
298
|
+
xSFactory.set(xFactory, uno::UNO_QUERY_THROW);
|
|
299
|
+
comphelper::setProcessServiceFactory(xSFactory);
|
|
300
|
+
|
|
301
|
+
-#if defined __EMSCRIPTEN__
|
|
302
|
+
+#if defined __EMSCRIPTEN__ && !defined RABI_LOK_HEADLESS
|
|
303
|
+
initJsUnoScripting();
|
|
304
|
+
#endif
|
|
305
|
+
|
|
306
|
+
diff --git a/desktop/util/Executable_soffice_bin-emscripten-exports b/desktop/util/Executable_soffice_bin-emscripten-exports
|
|
307
|
+
index 2206ccccb..3016df5cb 100644
|
|
308
|
+
--- a/desktop/util/Executable_soffice_bin-emscripten-exports
|
|
309
|
+
+++ b/desktop/util/Executable_soffice_bin-emscripten-exports
|
|
310
|
+
@@ -12,3 +12,40 @@ _lok_preinit
|
|
311
|
+
_lok_preinit_2
|
|
312
|
+
_malloc
|
|
313
|
+
_free
|
|
314
|
+
+_rabi_lok_initialize
|
|
315
|
+
+_rabi_lok_document_load
|
|
316
|
+
+_rabi_lok_document_save_pdf
|
|
317
|
+
+_rabi_lok_document_export
|
|
318
|
+
+_rabi_lok_document_destroy
|
|
319
|
+
+_rabi_lok_error
|
|
320
|
+
+_rabi_lok_destroy
|
|
321
|
+
+_rabi_lok_document_initialize_rendering
|
|
322
|
+
+_rabi_lok_document_type
|
|
323
|
+
+_rabi_lok_document_parts
|
|
324
|
+
+_rabi_lok_document_page_rectangles
|
|
325
|
+
+_rabi_lok_document_size
|
|
326
|
+
+_rabi_lok_document_tile_mode
|
|
327
|
+
+_rabi_lok_document_paint
|
|
328
|
+
+_rabi_lok_document_save
|
|
329
|
+
+_rabi_lok_document_listen
|
|
330
|
+
+_rabi_lok_document_key
|
|
331
|
+
+_rabi_lok_document_mouse
|
|
332
|
+
+_rabi_lok_document_composition
|
|
333
|
+
+_rabi_lok_document_command
|
|
334
|
+
+_rabi_lok_document_command_values
|
|
335
|
+
+_rabi_lok_document_paste
|
|
336
|
+
+_rabi_lok_document_selection
|
|
337
|
+
+_rabi_lok_document_part
|
|
338
|
+
+_rabi_lok_document_part_name
|
|
339
|
+
+_rabi_lok_document_viewport
|
|
340
|
+
+_rabi_lok_pump
|
|
341
|
+
+_rabi_lok_document_part_info
|
|
342
|
+
+_rabi_lok_document_create_view
|
|
343
|
+
+_rabi_lok_document_get_view
|
|
344
|
+
+_rabi_lok_document_set_view
|
|
345
|
+
+_rabi_lok_document_destroy_view
|
|
346
|
+
+_rabi_pdf_open
|
|
347
|
+
+_rabi_pdf_page_count
|
|
348
|
+
+_rabi_pdf_page_size
|
|
349
|
+
+_rabi_pdf_paint
|
|
350
|
+
+_rabi_pdf_destroy
|
|
351
|
+
diff --git a/external/argon2/ExternalProject_argon2.mk b/external/argon2/ExternalProject_argon2.mk
|
|
352
|
+
index 80d6b0596..e9cf8a9cf 100644
|
|
353
|
+
--- a/external/argon2/ExternalProject_argon2.mk
|
|
354
|
+
+++ b/external/argon2/ExternalProject_argon2.mk
|
|
355
|
+
@@ -43,7 +43,7 @@ $(call gb_ExternalProject_get_state_target,argon2,build):
|
|
356
|
+
$(call gb_Trace_StartRange,argon2,EXTERNAL)
|
|
357
|
+
$(call gb_ExternalProject_run,build,\
|
|
358
|
+
CFLAGS="$(CFLAGS) $(if $(filter-out WNT MACOSX,$(OS)),-fvisibility=hidden) -fPIC" \
|
|
359
|
+
- MAKEFLAGS= $(MAKE) \
|
|
360
|
+
+ MAKEFLAGS= $(MAKE) $(if $(filter EMSCRIPTEN,$(OS)),libargon2.a) \
|
|
361
|
+
OPTTARGET=$(if $(filter X86_64,$(CPUNAME)),x86-64,forcefail) \
|
|
362
|
+
$(if $(CROSS_COMPILING),,&& $(MAKE) test) \
|
|
363
|
+
)
|
|
364
|
+
diff --git a/external/argon2/UnpackedTarball_argon2.mk b/external/argon2/UnpackedTarball_argon2.mk
|
|
365
|
+
index dc379cca9..9a7cc6443 100644
|
|
366
|
+
--- a/external/argon2/UnpackedTarball_argon2.mk
|
|
367
|
+
+++ b/external/argon2/UnpackedTarball_argon2.mk
|
|
368
|
+
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,argon2,\
|
|
369
|
+
external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch \
|
|
370
|
+
$(if $(filter WNT_AARCH64,$(OS)_$(CPUNAME)),external/argon2/0002-Add-WinARM64-vcxproj-config.patch) \
|
|
371
|
+
external/argon2/private-symbols.patch.0 \
|
|
372
|
+
+ external/argon2/use-configured-archiver.patch.0 \
|
|
373
|
+
))
|
|
374
|
+
|
|
375
|
+
# vim: set noet sw=4 ts=4:
|
|
376
|
+
diff --git a/external/libcdr/ExternalProject_libcdr.mk b/external/libcdr/ExternalProject_libcdr.mk
|
|
377
|
+
index 3a4be9d9c..ee093bcf7 100644
|
|
378
|
+
--- a/external/libcdr/ExternalProject_libcdr.mk
|
|
379
|
+
+++ b/external/libcdr/ExternalProject_libcdr.mk
|
|
380
|
+
@@ -38,7 +38,7 @@ $(call gb_ExternalProject_get_state_target,libcdr,build) :
|
|
381
|
+
--disable-weffc \
|
|
382
|
+
$(if $(gb_FULLDEPS),,--disable-dependency-tracking) \
|
|
383
|
+
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
|
|
384
|
+
- CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libcdr)" \
|
|
385
|
+
+ CXXFLAGS="$(CXXFLAGS) $(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libcdr)" \
|
|
386
|
+
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
|
|
387
|
+
LDFLAGS="$(call gb_ExternalProject_get_link_flags,libcdr)" \
|
|
388
|
+
$(gb_CONFIGURE_PLATFORMS) \
|
|
389
|
+
diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk
|
|
390
|
+
index a31945fab..d776766bb 100644
|
|
391
|
+
--- a/external/openssl/ExternalProject_openssl.mk
|
|
392
|
+
+++ b/external/openssl/ExternalProject_openssl.mk
|
|
393
|
+
@@ -52,7 +52,7 @@ OPENSSL_PLATFORM := \
|
|
394
|
+
$(if $(filter X86_64,$(CPUNAME)),darwin64-x86_64-cc)\
|
|
395
|
+
$(if $(filter AARCH64,$(CPUNAME)),darwin64-arm64-cc)\
|
|
396
|
+
,\
|
|
397
|
+
- $(if $(filter EMSCRIPTEN,$(OS)),no-engine no-dso no-dgram no-srtp no-err no-ocsp no-psk no-ts no-asm) \
|
|
398
|
+
+ $(if $(filter EMSCRIPTEN,$(OS)),gcc -pthread no-engine no-dso no-dgram no-srtp no-err no-ocsp no-psk no-ts no-asm) \
|
|
399
|
+
)\
|
|
400
|
+
)\
|
|
401
|
+
)\
|
|
402
|
+
@@ -79,7 +79,7 @@ $(call gb_ExternalProject_get_state_target,openssl,build):
|
|
403
|
+
$(call gb_Trace_StartRange,openssl,EXTERNAL)
|
|
404
|
+
$(call gb_ExternalProject_run,build,\
|
|
405
|
+
unset MAKEFLAGS && \
|
|
406
|
+
- $(if $(filter LINUX MACOSX FREEBSD ANDROID SOLARIS iOS,$(OS)), \
|
|
407
|
+
+ $(if $(filter LINUX MACOSX FREEBSD ANDROID SOLARIS iOS EMSCRIPTEN,$(OS)), \
|
|
408
|
+
./Configure, \
|
|
409
|
+
$(if $(filter WNT,$(OS)), \
|
|
410
|
+
$(PERL) Configure, \
|
|
411
|
+
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
|
|
412
|
+
index 3a69170bd..16393f387 100644
|
|
413
|
+
--- a/external/pdfium/Library_pdfium.mk
|
|
414
|
+
+++ b/external/pdfium/Library_pdfium.mk
|
|
415
|
+
@@ -713,7 +713,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
|
|
416
|
+
))
|
|
417
|
+
endif
|
|
418
|
+
|
|
419
|
+
-ifneq (,$(filter LINUX FREEBSD OPENBSD,$(OS)))
|
|
420
|
+
+ifneq (,$(filter LINUX FREEBSD OPENBSD EMSCRIPTEN,$(OS)))
|
|
421
|
+
# fxge
|
|
422
|
+
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
|
|
423
|
+
UnpackedTarball/pdfium/core/fxge/linux/fx_linux_impl \
|
|
424
|
+
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
|
|
425
|
+
index ade0ae67f..f0eb9e2cc 100644
|
|
426
|
+
--- a/include/LibreOfficeKit/LibreOfficeKit.h
|
|
427
|
+
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
|
|
428
|
+
@@ -570,6 +570,9 @@ struct LibreOfficeKitDocumentClassStruct
|
|
429
|
+
/// @see lok::Document::setColorPreviewState().
|
|
430
|
+
void (*setColorPreviewState) (LibreOfficeKitDocument* pThis, int nId, bool nEnabled);
|
|
431
|
+
|
|
432
|
+
+ // DeepSeek Kit: synchronously calculate every formula; return zero on failure.
|
|
433
|
+
+ int (*calculateAll)(LibreOfficeKitDocument* pThis);
|
|
434
|
+
+
|
|
435
|
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx
|
|
439
|
+
index 57a4e9705..90b535273 100644
|
|
440
|
+
--- a/oox/source/drawingml/misccontexts.cxx
|
|
441
|
+
+++ b/oox/source/drawingml/misccontexts.cxx
|
|
442
|
+
@@ -18,6 +18,7 @@
|
|
443
|
+
*/
|
|
444
|
+
|
|
445
|
+
#include <drawingml/misccontexts.hxx>
|
|
446
|
+
+#include <comphelper/lok.hxx>
|
|
447
|
+
#include <oox/helper/attributelist.hxx>
|
|
448
|
+
#include <oox/helper/graphichelper.hxx>
|
|
449
|
+
#include <oox/core/xmlfilterbase.hxx>
|
|
450
|
+
@@ -313,6 +314,9 @@ BlipContext::BlipContext(ContextHandler2Helper const & rParent, const AttributeL
|
|
451
|
+
}
|
|
452
|
+
else if( rAttribs.hasAttribute( R_TOKEN( link ) ) )
|
|
453
|
+
{
|
|
454
|
+
+ // Kit imports use cached embedded graphics and never load external picture data.
|
|
455
|
+
+ if (comphelper::LibreOfficeKit::isActive())
|
|
456
|
+
+ return;
|
|
457
|
+
// external URL
|
|
458
|
+
|
|
459
|
+
// we will embed this link, this is better than just doing nothing...
|
|
460
|
+
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
|
|
461
|
+
index eef90ebf4..35e447d4d 100644
|
|
462
|
+
--- a/sal/Library_sal.mk
|
|
463
|
+
+++ b/sal/Library_sal.mk
|
|
464
|
+
@@ -32,7 +32,7 @@ $(eval $(call gb_Library_add_defs,sal,\
|
|
465
|
+
-DSAL_DLLIMPLEMENTATION \
|
|
466
|
+
-DRTL_OS="\"$(RTL_OS)\"" \
|
|
467
|
+
-DRTL_ARCH="\"$(RTL_ARCH)\"" \
|
|
468
|
+
- -DSRCDIR="\"$(SRCDIR)\"" \
|
|
469
|
+
+ -DSRCDIR="\"/build/libreoffice-kit/source\"" \
|
|
470
|
+
$(call gb_CondLibSalTextenc,-DCOND_LIB_SAL_TEXTENC) \
|
|
471
|
+
))
|
|
472
|
+
|
|
473
|
+
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx
|
|
474
|
+
index a606ce46a..3caad9e49 100644
|
|
475
|
+
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
|
|
476
|
+
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
|
|
477
|
+
@@ -162,8 +162,12 @@ IMPL_LINK(ScTableProtectionDlg, PasswordModifyHdl, weld::Entry&, rEntry, void)
|
|
478
|
+
OUString aPass1 = m_xPassword1Edit->get_text();
|
|
479
|
+
if (&rEntry == m_xPassword1Edit.get())
|
|
480
|
+
{
|
|
481
|
+
+#if defined(DISABLE_DYNLOADING)
|
|
482
|
+
+ m_xPasswordStrengthBar->set_visible(false);
|
|
483
|
+
+#else
|
|
484
|
+
m_xPasswordStrengthBar->set_percentage(
|
|
485
|
+
SvPasswordHelper::GetPasswordStrengthPercentage(aPass1));
|
|
486
|
+
+#endif
|
|
487
|
+
}
|
|
488
|
+
OUString aPass2 = m_xPassword2Edit->get_text();
|
|
489
|
+
m_xBtnOk->set_sensitive(aPass1 == aPass2);
|
|
490
|
+
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
|
|
491
|
+
index 78d8743f6..3dccba10c 100644
|
|
492
|
+
--- a/sfx2/source/dialog/passwd.cxx
|
|
493
|
+
+++ b/sfx2/source/dialog/passwd.cxx
|
|
494
|
+
@@ -47,8 +47,12 @@ void SfxPasswordDialog::ModifyHdl()
|
|
495
|
+
// if there's a confirm entry, the dialog is being used for setting a password
|
|
496
|
+
if (m_xConfirm1ED->get_visible())
|
|
497
|
+
{
|
|
498
|
+
+#if defined(DISABLE_DYNLOADING)
|
|
499
|
+
+ m_xPassword1StrengthBar->set_visible(false);
|
|
500
|
+
+#else
|
|
501
|
+
m_xPassword1StrengthBar->set_percentage(
|
|
502
|
+
SvPasswordHelper::GetPasswordStrengthPercentage(aPassword1Text));
|
|
503
|
+
+#endif
|
|
504
|
+
bool bPasswordMeetsPolicy = SvPasswordHelper::PasswordMeetsPolicy(
|
|
505
|
+
aPassword1Text, moPasswordPolicy);
|
|
506
|
+
m_xPassword1ED->set_message_type(bPasswordMeetsPolicy ? weld::EntryMessageType::Normal
|
|
507
|
+
@@ -61,8 +65,12 @@ void SfxPasswordDialog::ModifyHdl()
|
|
508
|
+
{
|
|
509
|
+
OUString aPassword2Text = m_xPassword2ED->get_text();
|
|
510
|
+
|
|
511
|
+
+#if defined(DISABLE_DYNLOADING)
|
|
512
|
+
+ m_xPassword2StrengthBar->set_visible(false);
|
|
513
|
+
+#else
|
|
514
|
+
m_xPassword2StrengthBar->set_percentage(
|
|
515
|
+
SvPasswordHelper::GetPasswordStrengthPercentage(m_xPassword2ED->get_text()));
|
|
516
|
+
+#endif
|
|
517
|
+
|
|
518
|
+
// second password is optional, ignore policy if it is empty
|
|
519
|
+
bool bPasswordMeetsPolicy
|
|
520
|
+
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
|
|
521
|
+
index 844b8bbd3..b6a010beb 100644
|
|
522
|
+
--- a/solenv/bin/concat-deps.c
|
|
523
|
+
+++ b/solenv/bin/concat-deps.c
|
|
524
|
+
@@ -1091,7 +1091,7 @@ static int process(struct hash* dep_hash, char* fn)
|
|
525
|
+
created_line = generate_phony_line(src_relative, "o");
|
|
526
|
+
rc = generate_phony_file(fn, created_line);
|
|
527
|
+
}
|
|
528
|
+
- else if(strncmp(src_relative, "GenAsmObject/", 14) == 0)
|
|
529
|
+
+ else if(strncmp(src_relative, "GenAsmObject/", 13) == 0)
|
|
530
|
+
{
|
|
531
|
+
created_line = generate_phony_line(src_relative, "o");
|
|
532
|
+
rc = generate_phony_file(fn, created_line);
|
|
533
|
+
diff --git a/solenv/gbuild/Conditions.mk b/solenv/gbuild/Conditions.mk
|
|
534
|
+
index 0a7b88969..c334672c4 100644
|
|
535
|
+
--- a/solenv/gbuild/Conditions.mk
|
|
536
|
+
+++ b/solenv/gbuild/Conditions.mk
|
|
537
|
+
@@ -13,7 +13,7 @@
|
|
538
|
+
# or the $(2) multiple times.
|
|
539
|
+
|
|
540
|
+
define gb_CondExeLockfile
|
|
541
|
+
-$(if $(and $(filter-out ANDROID MACOSX iOS WNT,$(OS))),$(1),$(2))
|
|
542
|
+
+$(if $(or $(filter-out ANDROID MACOSX iOS WNT,$(OS)),$(and $(filter MACOSX,$(OS)),$(filter EMSCRIPTEN,$(BUILD_TYPE_FOR_HOST)))),$(1),$(2))
|
|
543
|
+
endef
|
|
544
|
+
|
|
545
|
+
define gb_CondExeRegistryTools
|
|
546
|
+
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
|
|
547
|
+
index 3550b856d..430702966 100644
|
|
548
|
+
--- a/solenv/gbuild/LinkTarget.mk
|
|
549
|
+
+++ b/solenv/gbuild/LinkTarget.mk
|
|
550
|
+
@@ -62,11 +62,13 @@ endif
|
|
551
|
+
|
|
552
|
+
# generic cflags/cxxflags to use (optimization flags, debug flags)
|
|
553
|
+
# user supplied CFLAGS/CXXFLAGS override default debug/optimization flags
|
|
554
|
+
+# Prefix maps change build metadata, not optimization or debug policy.
|
|
555
|
+
+gb_LinkTarget__get_userflags=$(if $(strip $(filter-out -ffile-prefix-map=% -fdebug-prefix-map=% /pathmap:% /experimental:deterministic,$(1))),$(1),$(call gb_LinkTarget__get_debugflags,$(2)) $(1))
|
|
556
|
+
# call gb_LinkTarget__get_cflags,linktargetmakefilename
|
|
557
|
+
-gb_LinkTarget__get_cflags=$(if $(CFLAGS),$(CFLAGS),$(call gb_LinkTarget__get_debugflags,$(1)))
|
|
558
|
+
-gb_LinkTarget__get_objcflags=$(if $(OBJCFLAGS),$(OBJCFLAGS),$(call gb_LinkTarget__get_debugflags,$(1)))
|
|
559
|
+
-gb_LinkTarget__get_cxxflags=$(if $(CXXFLAGS),$(CXXFLAGS),$(call gb_LinkTarget__get_debugflags,$(1)))
|
|
560
|
+
-gb_LinkTarget__get_objcxxflags=$(if $(OBJCXXFLAGS),$(OBJCXXFLAGS),$(call gb_LinkTarget__get_debugflags,$(1)))
|
|
561
|
+
+gb_LinkTarget__get_cflags=$(call gb_LinkTarget__get_userflags,$(CFLAGS),$(1))
|
|
562
|
+
+gb_LinkTarget__get_objcflags=$(call gb_LinkTarget__get_userflags,$(OBJCFLAGS),$(1))
|
|
563
|
+
+gb_LinkTarget__get_cxxflags=$(call gb_LinkTarget__get_userflags,$(CXXFLAGS),$(1))
|
|
564
|
+
+gb_LinkTarget__get_objcxxflags=$(call gb_LinkTarget__get_userflags,$(OBJCXXFLAGS),$(1))
|
|
565
|
+
gb_LinkTarget__get_cxxclrflags=$(call gb_LinkTarget__get_debugflags,$(1))
|
|
566
|
+
# call gb_LinkTarget__get_ldflags,linktargetmakefilename
|
|
567
|
+
gb_LinkTarget__get_ldflags=$(if $(LDFLAGS),$(LDFLAGS),$(call gb_LinkTarget__get_debugldflags,$(1)))
|
|
568
|
+
@@ -646,7 +648,7 @@ endif
|
|
569
|
+
gb_GenAsmObject_get_source = $(call gb_AsmObject_get_source,$(WORKDIR),$(1))
|
|
570
|
+
|
|
571
|
+
$(call gb_GenAsmObject_get_target,%) :
|
|
572
|
+
- $(call gb_AsmObject__command,$@,$*,$<,$(call gb_GenAsmObject_get_dep_target,$*))
|
|
573
|
+
+ $(call gb_AsmObject__command,$@,$*,$(call gb_GenAsmObject_get_source,$*),$(call gb_GenAsmObject_get_dep_target,$*))
|
|
574
|
+
|
|
575
|
+
ifeq ($(gb_FULLDEPS),$(true))
|
|
576
|
+
$(dir $(call gb_GenAsmObject_get_dep_target,%)).dir :
|
|
577
|
+
diff --git a/solenv/gbuild/Rdb.mk b/solenv/gbuild/Rdb.mk
|
|
578
|
+
index fff774dcb..21a92061a 100644
|
|
579
|
+
--- a/solenv/gbuild/Rdb.mk
|
|
580
|
+
+++ b/solenv/gbuild/Rdb.mk
|
|
581
|
+
@@ -42,7 +42,7 @@ define gb_Rdb__Rdb_impl
|
|
582
|
+
# specific even in the corner case of an empty Rdb with no gb_Rdb_add_component calls, so that the
|
|
583
|
+
# use of $(COMPONENTS) in gb_Rdb__command would not accidentally pick a global COMPONENTS variable:
|
|
584
|
+
$(call gb_Rdb_get_target,$(1)) : COMPONENTS ?=
|
|
585
|
+
-$(call gb_Rdb_get_target,$(1)) : $(gb_Module_CURRENTMAKEFILE)
|
|
586
|
+
+$(call gb_Rdb_get_target,$(1)) : $(gb_Module_CURRENTMAKEFILE) $(BUILDDIR)/config_host.mk
|
|
587
|
+
$$(eval $$(call gb_Module_register_target,$(2),$(call gb_Rdb_get_clean_target,$(1))))
|
|
588
|
+
$(call gb_Helper_make_userfriendly_targets,$(1),Rdb,$(2))
|
|
589
|
+
|
|
590
|
+
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
|
|
591
|
+
index 17bc0ba3f..b26fb40af 100644
|
|
592
|
+
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
|
|
593
|
+
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
|
|
594
|
+
@@ -9,6 +9,10 @@
|
|
595
|
+
|
|
596
|
+
include $(GBUILDDIR)/platform/unxgcc.mk
|
|
597
|
+
|
|
598
|
+
+ifeq ($(OS_FOR_BUILD),MACOSX)
|
|
599
|
+
+gb_Library_PLAINEXT_FOR_BUILD := .dylib
|
|
600
|
+
+endif
|
|
601
|
+
+
|
|
602
|
+
gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
|
|
603
|
+
# avoid -s SAFE_HEAP=1 - c.f. gh#8584 this breaks source maps
|
|
604
|
+
gb_EMSCRIPTEN_CPPFLAGS := -pthread -s USE_PTHREADS=1 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -s SUPPORT_LONGJMP=wasm
|
|
605
|
+
@@ -27,7 +31,7 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072 -sDEFAULT_PTHREAD_STACK_SIZE=65536
|
|
606
|
+
# To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
|
|
607
|
+
# See emscripten.py, finalize_wasm, modify_wasm = True
|
|
608
|
+
# So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
|
|
609
|
+
-gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError","ClassHandle","HEAPU16","HEAPU32"$(if $(ENABLE_QT6),$(COMMA)"FS"$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
|
|
610
|
+
+gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError","ClassHandle","HEAPU16","HEAPU32","FS","ENV","PThread"$(if $(ENABLE_QT6),$(COMMA)"FS"$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
|
|
611
|
+
gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
|
|
612
|
+
|
|
613
|
+
ifeq ($(ENABLE_EMSCRIPTEN_JSPI),TRUE)
|
|
614
|
+
@@ -69,7 +73,7 @@ endif
|
|
615
|
+
endif
|
|
616
|
+
|
|
617
|
+
# Linker and compiler optimize + debug flags are handled in LinkTarget.mk
|
|
618
|
+
-gb_LINKEROPTFLAGS :=
|
|
619
|
+
+gb_LINKEROPTFLAGS := -Oz
|
|
620
|
+
gb_LINKERSTRIPDEBUGFLAGS :=
|
|
621
|
+
# This maps to g3, no source maps, but DWARF with current emscripten!
|
|
622
|
+
# https://developer.chrome.com/blog/wasm-debugging-2020/
|
|
623
|
+
@@ -79,7 +83,13 @@ ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
|
|
624
|
+
gb_DEBUGINFO_FLAGS += -gseparate-dwarf -gsplit-dwarf -gpubnames
|
|
625
|
+
endif
|
|
626
|
+
|
|
627
|
+
-gb_COMPILEROPTFLAGS := -O3
|
|
628
|
+
+gb_COMPILEROPTFLAGS := -Oz
|
|
629
|
+
+
|
|
630
|
+
+ifeq ($(ENABLE_LTO),TRUE)
|
|
631
|
+
+# Emscripten's LLVM tools consume bitcode directly, without a native gold plugin.
|
|
632
|
+
+gb_LTOFLAGS := -flto
|
|
633
|
+
+gb_LTOPLUGINFLAGS :=
|
|
634
|
+
+endif
|
|
635
|
+
|
|
636
|
+
# We need at least code elimination, otherwise linking OOMs even with 64GB.
|
|
637
|
+
# So we "fake" -Og support to mean -O1 for Emscripten and always enable it for debug in configure.
|
|
638
|
+
diff --git a/static/CustomTarget_emscripten_fs_image.mk b/static/CustomTarget_emscripten_fs_image.mk
|
|
639
|
+
index 7e4057ec9..ee34164ef 100644
|
|
640
|
+
--- a/static/CustomTarget_emscripten_fs_image.mk
|
|
641
|
+
+++ b/static/CustomTarget_emscripten_fs_image.mk
|
|
642
|
+
@@ -1703,7 +1703,6 @@ gb_emscripten_fs_image_files += \
|
|
643
|
+
$(INSTROOT)/$(LIBO_SHARE_PRESETS_FOLDER)/config/autotbl.fmt \
|
|
644
|
+
$(INSTROOT)/$(LIBO_SHARE_PRESETS_FOLDER)/gallery/sg30.sdv \
|
|
645
|
+
$(INSTROOT)/$(LIBO_SHARE_PRESETS_FOLDER)/gallery/sg30.thm \
|
|
646
|
+
- $(INSTROOT)/$(LIBO_SHARE_RESOURCE_FOLDER)/common/fonts/opens___.ttf \
|
|
647
|
+
$(INSTROOT)/$(LIBO_URE_ETC_FOLDER)/$(call gb_Helper_get_rcfile,uno) \
|
|
648
|
+
$(INSTROOT)/$(LIBO_URE_MISC_FOLDER)/services.rdb \
|
|
649
|
+
$(SRCDIR)/android/default-document/example.odt \
|
|
650
|
+
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
|
|
651
|
+
index f8fe1a073..3339c34e9 100644
|
|
652
|
+
--- a/svl/Library_svl.mk
|
|
653
|
+
+++ b/svl/Library_svl.mk
|
|
654
|
+
@@ -29,7 +29,7 @@ $(eval $(call gb_Library_use_externals,svl,\
|
|
655
|
+
icuuc \
|
|
656
|
+
mdds_headers \
|
|
657
|
+
libxml2 \
|
|
658
|
+
- zxcvbn-c \
|
|
659
|
+
+ $(if $(DISABLE_DYNLOADING),,zxcvbn-c) \
|
|
660
|
+
))
|
|
661
|
+
|
|
662
|
+
$(eval $(call gb_Library_set_componentfile,svl,svl/util/svl,services))
|
|
663
|
+
diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx
|
|
664
|
+
index e7e187cee..fe41b44fb 100644
|
|
665
|
+
--- a/svl/source/misc/PasswordHelper.cxx
|
|
666
|
+
+++ b/svl/source/misc/PasswordHelper.cxx
|
|
667
|
+
@@ -25,7 +25,9 @@
|
|
668
|
+
#include <unicode/regex.h>
|
|
669
|
+
#include <unicode/unistr.h>
|
|
670
|
+
#include <unicode/errorcode.h>
|
|
671
|
+
+#if !defined(DISABLE_DYNLOADING)
|
|
672
|
+
#include <zxcvbn.h>
|
|
673
|
+
+#endif
|
|
674
|
+
#include <sal/log.hxx>
|
|
675
|
+
|
|
676
|
+
#include <com/sun/star/uno/Sequence.hxx>
|
|
677
|
+
@@ -136,6 +138,7 @@ bool SvPasswordHelper::CompareHashPassword(const uno::Sequence<sal_Int8>& rOldPa
|
|
678
|
+
return bResult;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
+#if !defined(DISABLE_DYNLOADING)
|
|
682
|
+
double SvPasswordHelper::GetPasswordStrengthPercentage(const char* pPassword)
|
|
683
|
+
{
|
|
684
|
+
// Entropy bits ≥ 112 are mapped to 100% password strength.
|
|
685
|
+
@@ -153,6 +156,8 @@ double SvPasswordHelper::GetPasswordStrengthPercentage(const OUString& aPassword
|
|
686
|
+
return GetPasswordStrengthPercentage(aPasswordUtf8.getStr());
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
+#endif
|
|
690
|
+
+
|
|
691
|
+
bool SvPasswordHelper::PasswordMeetsPolicy(const char* pPassword,
|
|
692
|
+
const std::optional<OUString>& oPasswordPolicy)
|
|
693
|
+
{
|
|
694
|
+
diff --git a/uui/Library_uui.mk b/uui/Library_uui.mk
|
|
695
|
+
index 0e82e131b..11dbe4c1c 100644
|
|
696
|
+
--- a/uui/Library_uui.mk
|
|
697
|
+
+++ b/uui/Library_uui.mk
|
|
698
|
+
@@ -17,7 +17,7 @@ $(eval $(call gb_Library_set_include,uui,\
|
|
699
|
+
$(eval $(call gb_Library_set_componentfile,uui,uui/util/uui,services))
|
|
700
|
+
|
|
701
|
+
$(eval $(call gb_Library_use_external,uui,boost_headers))
|
|
702
|
+
-$(eval $(call gb_Library_use_external,uui,curl))
|
|
703
|
+
+$(if $(ENABLE_CURL),$(eval $(call gb_Library_use_external,uui,curl)))
|
|
704
|
+
|
|
705
|
+
$(eval $(call gb_Library_use_custom_headers,uui,\
|
|
706
|
+
officecfg/registry \
|
|
707
|
+
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
|
|
708
|
+
index fa1061eb9..aa1d9cd02 100644
|
|
709
|
+
--- a/uui/source/masterpasscrtdlg.cxx
|
|
710
|
+
+++ b/uui/source/masterpasscrtdlg.cxx
|
|
711
|
+
@@ -35,8 +35,12 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, weld::Entry&, void)
|
|
712
|
+
{
|
|
713
|
+
OUString aPasswordText = m_xEDMasterPasswordCrt->get_text();
|
|
714
|
+
m_xOKBtn->set_sensitive(aPasswordText.getLength() >= 1);
|
|
715
|
+
+#if defined(DISABLE_DYNLOADING)
|
|
716
|
+
+ m_xPasswdStrengthBar->set_visible(false);
|
|
717
|
+
+#else
|
|
718
|
+
m_xPasswdStrengthBar->set_percentage(
|
|
719
|
+
SvPasswordHelper::GetPasswordStrengthPercentage(aPasswordText));
|
|
720
|
+
+#endif
|
|
721
|
+
|
|
722
|
+
if(m_oPasswordPolicy)
|
|
723
|
+
{
|
|
724
|
+
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
|
|
725
|
+
index 33f2ba9f8..e7ba8e26f 100644
|
|
726
|
+
--- a/vcl/headless/svpinst.cxx
|
|
727
|
+
+++ b/vcl/headless/svpinst.cxx
|
|
728
|
+
@@ -300,6 +300,15 @@ void SvpSalInstance::ProcessEvent( SalUserEvent aEvent )
|
|
729
|
+
|
|
730
|
+
#if defined __EMSCRIPTEN__
|
|
731
|
+
|
|
732
|
+
+// A browser-owned LibreOfficeKit instance yields between messages instead of
|
|
733
|
+
+// entering the application's Emscripten main loop. Never wait on the Worker.
|
|
734
|
+
+extern "C" bool rabi_lok_yield()
|
|
735
|
+
+{
|
|
736
|
+
+ SolarMutexGuard guard;
|
|
737
|
+
+ auto* instance = SvpSalInstance::s_pDefaultInstance;
|
|
738
|
+
+ return instance && instance->ImplYield(false, true);
|
|
739
|
+
+}
|
|
740
|
+
+
|
|
741
|
+
static void loop(void * arg) {
|
|
742
|
+
SolarMutexGuard g;
|
|
743
|
+
static_cast<SvpSalInstance *>(arg)->ImplYield(comphelper::LibreOfficeKit::isActive(), false);
|
|
744
|
+
diff --git a/vcl/inc/font/PhysicalFontCollection.hxx b/vcl/inc/font/PhysicalFontCollection.hxx
|
|
745
|
+
index b5509b8f6..81e195a49 100644
|
|
746
|
+
--- a/vcl/inc/font/PhysicalFontCollection.hxx
|
|
747
|
+
+++ b/vcl/inc/font/PhysicalFontCollection.hxx
|
|
748
|
+
@@ -29,6 +29,10 @@
|
|
749
|
+
|
|
750
|
+
#include <array>
|
|
751
|
+
#include <string_view>
|
|
752
|
+
+#if defined __EMSCRIPTEN__
|
|
753
|
+
+#include <unordered_set>
|
|
754
|
+
+#include <vector>
|
|
755
|
+
+#endif
|
|
756
|
+
|
|
757
|
+
#define MAX_GLYPHFALLBACK 16
|
|
758
|
+
|
|
759
|
+
@@ -81,6 +85,12 @@ public:
|
|
760
|
+
SAL_DLLPRIVATE std::unique_ptr<vcl::font::PhysicalFontFaceCollection> GetFontFaceCollection() const;
|
|
761
|
+
|
|
762
|
+
private:
|
|
763
|
+
+#if defined __EMSCRIPTEN__
|
|
764
|
+
+ mutable std::unordered_set<OUString> maDemandFontFiles;
|
|
765
|
+
+ mutable std::unordered_set<OUString> maDemandFontFamilies;
|
|
766
|
+
+ std::vector<OUString> EnsureSystemFonts(const vcl::font::FontSelectPattern&,
|
|
767
|
+
+ const OUString& rMissingCodes, bool& rAdded) const;
|
|
768
|
+
+#endif
|
|
769
|
+
mutable bool mbMatchData; // true if matching attributes are initialized
|
|
770
|
+
|
|
771
|
+
typedef std::unordered_map<OUString, std::unique_ptr<vcl::font::PhysicalFontFamily>> PhysicalFontFamilies;
|
|
772
|
+
diff --git a/vcl/inc/unx/freetypetextrender.hxx b/vcl/inc/unx/freetypetextrender.hxx
|
|
773
|
+
index e3bba325c..4b0a1d624 100644
|
|
774
|
+
--- a/vcl/inc/unx/freetypetextrender.hxx
|
|
775
|
+
+++ b/vcl/inc/unx/freetypetextrender.hxx
|
|
776
|
+
@@ -49,6 +49,9 @@ public:
|
|
777
|
+
virtual bool AddTempDevFont( vcl::font::PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
|
|
778
|
+
virtual bool RemoveTempDevFont( const OUString& rFileURL, const OUString& rFontName ) override;
|
|
779
|
+
|
|
780
|
+
+ static bool RegisterFontFile(vcl::font::PhysicalFontCollection*, const OUString& rFileURL,
|
|
781
|
+
+ const OUString& rFontName);
|
|
782
|
+
+
|
|
783
|
+
virtual std::unique_ptr<GenericSalLayout>
|
|
784
|
+
GetTextLayout(int nFallbackLevel) override;
|
|
785
|
+
};
|
|
786
|
+
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
|
|
787
|
+
index 5ce7a60cb..2f0a0d3ea 100644
|
|
788
|
+
--- a/vcl/source/font/PhysicalFontCollection.cxx
|
|
789
|
+
+++ b/vcl/source/font/PhysicalFontCollection.cxx
|
|
790
|
+
@@ -31,6 +31,15 @@
|
|
791
|
+
#include <font/PhysicalFontCollection.hxx>
|
|
792
|
+
#include <font/fontsubstitution.hxx>
|
|
793
|
+
|
|
794
|
+
+#if defined __EMSCRIPTEN__
|
|
795
|
+
+#include <cstdlib>
|
|
796
|
+
+#include <stdexcept>
|
|
797
|
+
+#include <emscripten.h>
|
|
798
|
+
+#include <osl/file.hxx>
|
|
799
|
+
+#include <rtl/ustrbuf.hxx>
|
|
800
|
+
+#include <unx/freetypetextrender.hxx>
|
|
801
|
+
+#endif
|
|
802
|
+
+
|
|
803
|
+
static ImplFontAttrs lcl_IsCJKFont( std::u16string_view rFontName )
|
|
804
|
+
{
|
|
805
|
+
// Test, if Fontname includes CJK characters --> In this case we
|
|
806
|
+
@@ -68,6 +77,110 @@ static ImplFontAttrs lcl_IsCJKFont( std::u16string_view rFontName )
|
|
807
|
+
namespace vcl::font
|
|
808
|
+
{
|
|
809
|
+
|
|
810
|
+
+#if defined __EMSCRIPTEN__
|
|
811
|
+
+std::vector<OUString> PhysicalFontCollection::EnsureSystemFonts(
|
|
812
|
+
+ const FontSelectPattern& rPattern, const OUString& rMissingCodes, bool& rAdded) const
|
|
813
|
+
+{
|
|
814
|
+
+ rAdded = false;
|
|
815
|
+
+ const OUString aLanguage = LanguageTag(rPattern.meLanguage).getBcp47();
|
|
816
|
+
+ char aError[4096] = {};
|
|
817
|
+
+ int nFatal = 0;
|
|
818
|
+
+ // The resolver runs on the runtime's JS thread, including when layout runs in a pthread.
|
|
819
|
+
+ // It may read host files and write MEMFS, but must not reenter LibreOffice.
|
|
820
|
+
+ auto* pPaths = static_cast<char*>(MAIN_THREAD_EM_ASM_PTR({
|
|
821
|
+
+ try {
|
|
822
|
+
+ const resolver = Module['rabiResolveSystemFonts'];
|
|
823
|
+
+ const faceResolver = Module['rabiResolveSystemFontFaces'];
|
|
824
|
+
+ if (typeof faceResolver !== 'function' && typeof resolver !== 'function')
|
|
825
|
+
+ throw new Error('LibreOffice system font resolver is not configured');
|
|
826
|
+
+ const request = ({
|
|
827
|
+
+ family: UTF16ToString($0),
|
|
828
|
+
+ style: UTF16ToString($1),
|
|
829
|
+
+ weight: $2,
|
|
830
|
+
+ italic: $3,
|
|
831
|
+
+ width: $4,
|
|
832
|
+
+ pitch: $5,
|
|
833
|
+
+ language: UTF16ToString($6),
|
|
834
|
+
+ codePoints: Array.from(UTF16ToString($7), char => char.codePointAt(0))
|
|
835
|
+
+ });
|
|
836
|
+
+ const faces = typeof faceResolver === 'function' ? faceResolver(request)
|
|
837
|
+
+ : resolver(request).map(path => ({ path, family: "" }));
|
|
838
|
+
+ const invalid = value => typeof value !== 'string' || ([0, 9, 10, 13]).some(code =>
|
|
839
|
+
+ value.includes(String.fromCharCode(code)));
|
|
840
|
+
+ if (!Array.isArray(faces) || faces.some(face => !face || invalid(face.path)
|
|
841
|
+
+ || !face.path.startsWith('/') || invalid(face.family)))
|
|
842
|
+
+ throw new TypeError('LibreOffice font resolver must return MEMFS face records synchronously');
|
|
843
|
+
+ if (faces.length === 0)
|
|
844
|
+
+ return 0;
|
|
845
|
+
+ const records = faces.map(face => face.path + String.fromCharCode(9) + face.family);
|
|
846
|
+
+ const bytes = new TextEncoder().encode(records.join(String.fromCharCode(10)) + String.fromCharCode(0));
|
|
847
|
+
+ const pointer = Module['_malloc'](bytes.length);
|
|
848
|
+
+ if (!pointer)
|
|
849
|
+
+ throw new Error('LibreOffice system font response allocation failed');
|
|
850
|
+
+ HEAPU8.set(bytes, pointer);
|
|
851
|
+
+ return pointer;
|
|
852
|
+
+ } catch (error) {
|
|
853
|
+
+ if (error instanceof WebAssembly.RuntimeError) {
|
|
854
|
+
+ if (typeof Module['onAbort'] === 'function')
|
|
855
|
+
+ Module['onAbort'](error);
|
|
856
|
+
+ HEAP32[$10 >> 2] = 1;
|
|
857
|
+
+ return 0;
|
|
858
|
+
+ }
|
|
859
|
+
+ stringToUTF8('LibreOffice system font callback failed: ' + String(error), $8, $9);
|
|
860
|
+
+ return 0;
|
|
861
|
+
+ }
|
|
862
|
+
+ }, rPattern.GetFamilyName().getStr(), rPattern.GetStyleName().getStr(),
|
|
863
|
+
+ static_cast<int>(rPattern.GetWeight()), static_cast<int>(rPattern.GetItalic()),
|
|
864
|
+
+ static_cast<int>(rPattern.GetWidthType()), static_cast<int>(rPattern.GetPitch()),
|
|
865
|
+
+ aLanguage.getStr(), rMissingCodes.getStr(), aError, sizeof(aError), &nFatal));
|
|
866
|
+
+ // WASM traps bypass C++ unwinding; an aborted engine cannot safely allocate an exception.
|
|
867
|
+
+ if (nFatal)
|
|
868
|
+
+ __builtin_trap();
|
|
869
|
+
+ // EM_ASM imports are nothrow; construct the C++ exception only after returning from JS.
|
|
870
|
+
+ if (aError[0] != '\0')
|
|
871
|
+
+ throw std::runtime_error(aError);
|
|
872
|
+
+ std::unique_ptr<char, decltype(&std::free)> aOwnedPaths(pPaths, std::free);
|
|
873
|
+
+ if (!pPaths)
|
|
874
|
+
+ return {};
|
|
875
|
+
+
|
|
876
|
+
+ std::vector<OUString> aFamilies;
|
|
877
|
+
+ const OUString aPaths = OUString::fromUtf8(pPaths);
|
|
878
|
+
+ sal_Int32 nPosition = 0;
|
|
879
|
+
+ do
|
|
880
|
+
+ {
|
|
881
|
+
+ const OUString aRecord = aPaths.getToken(0, '\n', nPosition);
|
|
882
|
+
+ const sal_Int32 nSeparator = aRecord.indexOf('\t');
|
|
883
|
+
+ if (nSeparator < 0)
|
|
884
|
+
+ throw std::runtime_error("LibreOffice received an invalid font face record");
|
|
885
|
+
+ const OUString aPath = aRecord.copy(0, nSeparator);
|
|
886
|
+
+ const OUString aFamily = aRecord.copy(nSeparator + 1);
|
|
887
|
+
+ if (!aFamily.isEmpty())
|
|
888
|
+
+ {
|
|
889
|
+
+ aFamilies.push_back(aFamily);
|
|
890
|
+
+ maDemandFontFamilies.insert(GetEnglishSearchFontName(aFamily));
|
|
891
|
+
+ }
|
|
892
|
+
+ if (maDemandFontFiles.find(aPath) != maDemandFontFiles.end())
|
|
893
|
+
+ continue;
|
|
894
|
+
+ OUString aFileURL;
|
|
895
|
+
+ if (osl::FileBase::getFileURLFromSystemPath(aPath, aFileURL) != osl::FileBase::E_None
|
|
896
|
+
+ || !FreeTypeTextRenderImpl::RegisterFontFile(
|
|
897
|
+
+ const_cast<PhysicalFontCollection*>(this), aFileURL, aFamily))
|
|
898
|
+
+ throw std::runtime_error("LibreOffice could not register a supplied system font");
|
|
899
|
+
+ maDemandFontFiles.insert(aPath);
|
|
900
|
+
+ rAdded = true;
|
|
901
|
+
+ } while (nPosition >= 0);
|
|
902
|
+
+
|
|
903
|
+
+ if (rAdded)
|
|
904
|
+
+ {
|
|
905
|
+
+ // Active layout objects keep their font faces; only derived matching data becomes stale.
|
|
906
|
+
+ mbMatchData = false;
|
|
907
|
+
+ mpFallbackList.reset();
|
|
908
|
+
+ mnFallbackCount = -1;
|
|
909
|
+
+ }
|
|
910
|
+
+ return aFamilies;
|
|
911
|
+
+}
|
|
912
|
+
+#endif
|
|
913
|
+
+
|
|
914
|
+
PhysicalFontCollection::PhysicalFontCollection()
|
|
915
|
+
: mbMatchData( false )
|
|
916
|
+
, mpPreMatchHook( nullptr )
|
|
917
|
+
@@ -92,6 +205,10 @@ void PhysicalFontCollection::SetFallbackHook(GlyphFallbackFontSubstitution* pHoo
|
|
918
|
+
|
|
919
|
+
void PhysicalFontCollection::Clear()
|
|
920
|
+
{
|
|
921
|
+
+#if defined __EMSCRIPTEN__
|
|
922
|
+
+ maDemandFontFiles.clear();
|
|
923
|
+
+ maDemandFontFamilies.clear();
|
|
924
|
+
+#endif
|
|
925
|
+
// remove fallback lists
|
|
926
|
+
mpFallbackList.reset();
|
|
927
|
+
mnFallbackCount = -1;
|
|
928
|
+
@@ -185,6 +302,60 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont(FontSelectPatte
|
|
929
|
+
OUString& rMissingCodes,
|
|
930
|
+
int nFallbackLevel) const
|
|
931
|
+
{
|
|
932
|
+
+#if defined __EMSCRIPTEN__
|
|
933
|
+
+ bool bAdded = false;
|
|
934
|
+
+ const auto aFamilies = EnsureSystemFonts(rFontSelData, rMissingCodes, bAdded);
|
|
935
|
+
+ if (bAdded)
|
|
936
|
+
+ {
|
|
937
|
+
+ for (sal_Int32 nIndex = 0; nIndex < rMissingCodes.getLength();)
|
|
938
|
+
+ {
|
|
939
|
+
+ const sal_UCS4 nCode = rMissingCodes.iterateCodePoints(&nIndex);
|
|
940
|
+
+ OUString aFamily;
|
|
941
|
+
+ bool bEmbolden;
|
|
942
|
+
+ ItalicMatrix aMatrix;
|
|
943
|
+
+ if (pFontInstance->GetFallbackForUnicode(nCode, rFontSelData.GetWeight(),
|
|
944
|
+
+ &aFamily, &bEmbolden, &aMatrix))
|
|
945
|
+
+ pFontInstance->IgnoreFallbackForUnicode(nCode, rFontSelData.GetWeight(), aFamily);
|
|
946
|
+
+ }
|
|
947
|
+
+ }
|
|
948
|
+
+ // Script subsets have distinct families. Choose by cmap instead of asking
|
|
949
|
+
+ // Fontconfig to choose among the original font's identically named files.
|
|
950
|
+
+ for (const auto& rFamily : aFamilies)
|
|
951
|
+
+ {
|
|
952
|
+
+ auto* pFamily = FindFontFamily(rFamily);
|
|
953
|
+
+ auto* pFace = pFamily ? pFamily->FindBestFontFace(rFontSelData) : nullptr;
|
|
954
|
+
+ const FontCharMapRef pMap = pFace ? pFace->GetFontCharMap() : nullptr;
|
|
955
|
+
+ if (!pMap)
|
|
956
|
+
+ continue;
|
|
957
|
+
+ const OUString aSearchName = GetEnglishSearchFontName(rFamily);
|
|
958
|
+
+ OUStringBuffer aRemaining;
|
|
959
|
+
+ bool bCovered = false;
|
|
960
|
+
+ for (sal_Int32 nIndex = 0; nIndex < rMissingCodes.getLength();)
|
|
961
|
+
+ {
|
|
962
|
+
+ const sal_UCS4 nCode = rMissingCodes.iterateCodePoints(&nIndex);
|
|
963
|
+
+ if (!pMap->HasChar(nCode))
|
|
964
|
+
+ {
|
|
965
|
+
+ aRemaining.appendUtf32(nCode);
|
|
966
|
+
+ continue;
|
|
967
|
+
+ }
|
|
968
|
+
+ bCovered = true;
|
|
969
|
+
+ OUString aOldFamily;
|
|
970
|
+
+ bool bOldEmbolden;
|
|
971
|
+
+ ItalicMatrix aOldMatrix;
|
|
972
|
+
+ if (pFontInstance->GetFallbackForUnicode(nCode, rFontSelData.GetWeight(),
|
|
973
|
+
+ &aOldFamily, &bOldEmbolden, &aOldMatrix))
|
|
974
|
+
+ pFontInstance->IgnoreFallbackForUnicode(nCode, rFontSelData.GetWeight(), aOldFamily);
|
|
975
|
+
+ pFontInstance->AddFallbackForUnicode(nCode, rFontSelData.GetWeight(), aSearchName,
|
|
976
|
+
+ rFontSelData.mbEmbolden, rFontSelData.maItalicMatrix);
|
|
977
|
+
+ }
|
|
978
|
+
+ if (bCovered)
|
|
979
|
+
+ {
|
|
980
|
+
+ rFontSelData.maSearchName = aSearchName;
|
|
981
|
+
+ rMissingCodes = aRemaining.makeStringAndClear();
|
|
982
|
+
+ return pFamily;
|
|
983
|
+
+ }
|
|
984
|
+
+ }
|
|
985
|
+
+#endif
|
|
986
|
+
PhysicalFontFamily* pFallbackData = nullptr;
|
|
987
|
+
|
|
988
|
+
// find a matching font candidate for platform specific glyph fallback
|
|
989
|
+
@@ -941,6 +1112,10 @@ std::shared_ptr<PhysicalFontCollection> PhysicalFontCollection::Clone() const
|
|
990
|
+
auto xClonedCollection = std::make_shared<PhysicalFontCollection>();
|
|
991
|
+
xClonedCollection->mpPreMatchHook = mpPreMatchHook;
|
|
992
|
+
xClonedCollection->mpFallbackHook = mpFallbackHook;
|
|
993
|
+
+#if defined __EMSCRIPTEN__
|
|
994
|
+
+ xClonedCollection->maDemandFontFiles = maDemandFontFiles;
|
|
995
|
+
+ xClonedCollection->maDemandFontFamilies = maDemandFontFamilies;
|
|
996
|
+
+#endif
|
|
997
|
+
|
|
998
|
+
// TODO: clone the config-font attributes too?
|
|
999
|
+
xClonedCollection->mbMatchData = false;
|
|
1000
|
+
@@ -1008,6 +1183,20 @@ static bool FindMetricCompatibleFont_impl(FontSelectPattern& rFontSelData)
|
|
1001
|
+
|
|
1002
|
+
PhysicalFontFamily* PhysicalFontCollection::FindFontFamily(FontSelectPattern& rFSD) const
|
|
1003
|
+
{
|
|
1004
|
+
+#if defined __EMSCRIPTEN__
|
|
1005
|
+
+ const OUString aRequested = GetEnglishSearchFontName(rFSD.GetFamilyName());
|
|
1006
|
+
+ if (maDemandFontFamilies.find(aRequested) != maDemandFontFamilies.end())
|
|
1007
|
+
+ return FindFontFamily(aRequested);
|
|
1008
|
+
+ bool bAdded = false;
|
|
1009
|
+
+ for (const auto& rFamily : EnsureSystemFonts(rFSD, OUString(), bAdded))
|
|
1010
|
+
+ {
|
|
1011
|
+
+ if (auto* pFamily = FindFontFamily(rFamily))
|
|
1012
|
+
+ {
|
|
1013
|
+
+ rFSD.maSearchName = GetEnglishSearchFontName(rFamily);
|
|
1014
|
+
+ return pFamily;
|
|
1015
|
+
+ }
|
|
1016
|
+
+ }
|
|
1017
|
+
+#endif
|
|
1018
|
+
// give up if no fonts are available
|
|
1019
|
+
if( !Count() )
|
|
1020
|
+
return nullptr;
|
|
1021
|
+
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
|
|
1022
|
+
index a883b13c5..6a07650b0 100644
|
|
1023
|
+
--- a/vcl/source/image/ImplImageTree.cxx
|
|
1024
|
+
+++ b/vcl/source/image/ImplImageTree.cxx
|
|
1025
|
+
@@ -499,9 +499,9 @@ void ImplImageTree::createStyle()
|
|
1026
|
+
if (isVclDemo())
|
|
1027
|
+
{
|
|
1028
|
+
if (maCurrentStyle == "default")
|
|
1029
|
+
- sThemeUrl = "file://" SRC_ROOT "/icon-themes/colibre-svg";
|
|
1030
|
+
+ sThemeUrl = "file:///build/libreoffice-kit/source/icon-themes/colibre-svg";
|
|
1031
|
+
else
|
|
1032
|
+
- sThemeUrl = "file://" SRC_ROOT "/icon-themes/" + maCurrentStyle;
|
|
1033
|
+
+ sThemeUrl = "file:///build/libreoffice-kit/source/icon-themes/" + maCurrentStyle;
|
|
1034
|
+
}
|
|
1035
|
+
else if (maCurrentStyle != "default")
|
|
1036
|
+
{
|
|
1037
|
+
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
|
|
1038
|
+
index 8a71a2ef0..bdc2dbacf 100644
|
|
1039
|
+
--- a/vcl/source/outdev/font.cxx
|
|
1040
|
+
+++ b/vcl/source/outdev/font.cxx
|
|
1041
|
+
@@ -50,6 +50,7 @@
|
|
1042
|
+
#include <font/PhysicalFontFaceCollection.hxx>
|
|
1043
|
+
#include <font/PhysicalFontCollection.hxx>
|
|
1044
|
+
#include <font/FeatureCollector.hxx>
|
|
1045
|
+
+#include <font/FontSelectPattern.hxx>
|
|
1046
|
+
#include <impglyphitem.hxx>
|
|
1047
|
+
#include <sallayout.hxx>
|
|
1048
|
+
#include <salgdi.hxx>
|
|
1049
|
+
@@ -650,6 +651,15 @@ void OutputDevice::ImplInitFontList() const
|
|
1050
|
+
SAL_INFO( "vcl.gdi", "OutputDevice::ImplInitFontList()" );
|
|
1051
|
+
mpGraphics->GetDevFontList(mxFontCollection.get());
|
|
1052
|
+
|
|
1053
|
+
+#ifdef __EMSCRIPTEN__
|
|
1054
|
+
+ if (!mxFontCollection->Count())
|
|
1055
|
+
+ {
|
|
1056
|
+
+ vcl::font::FontSelectPattern aPattern(maFont, maFont.GetFamilyName(), maFont.GetFontSize(),
|
|
1057
|
+
+ static_cast<float>(maFont.GetFontSize().Height()));
|
|
1058
|
+
+ mxFontCollection->FindFontFamily(aPattern);
|
|
1059
|
+
+ }
|
|
1060
|
+
+#endif
|
|
1061
|
+
+
|
|
1062
|
+
// There is absolutely no way there should be no fonts available on the device
|
|
1063
|
+
if( !mxFontCollection->Count() )
|
|
1064
|
+
{
|
|
1065
|
+
diff --git a/vcl/unx/generic/gdi/freetypetextrender.cxx b/vcl/unx/generic/gdi/freetypetextrender.cxx
|
|
1066
|
+
index 2af043a48..4786ce5cc 100644
|
|
1067
|
+
--- a/vcl/unx/generic/gdi/freetypetextrender.cxx
|
|
1068
|
+
+++ b/vcl/unx/generic/gdi/freetypetextrender.cxx
|
|
1069
|
+
@@ -95,6 +95,12 @@ FreeTypeTextRenderImpl::SetTextColor( Color nColor )
|
|
1070
|
+
|
|
1071
|
+
bool FreeTypeTextRenderImpl::AddTempDevFont(vcl::font::PhysicalFontCollection* pFontCollection,
|
|
1072
|
+
const OUString& rFileURL, const OUString& rFontName)
|
|
1073
|
+
+{
|
|
1074
|
+
+ return RegisterFontFile(pFontCollection, rFileURL, rFontName);
|
|
1075
|
+
+}
|
|
1076
|
+
+
|
|
1077
|
+
+bool FreeTypeTextRenderImpl::RegisterFontFile(vcl::font::PhysicalFontCollection* pFontCollection,
|
|
1078
|
+
+ const OUString& rFileURL, const OUString& rFontName)
|
|
1079
|
+
{
|
|
1080
|
+
// inform PSP font manager
|
|
1081
|
+
psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
|