diff options
70 files changed, 793 insertions, 694 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 0982c591de6c..f39b45f9bc37 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2015,31 +2015,21 @@ void SbRtl_TimeValue(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Day(StarBASIC *, SbxArray & rPar, bool) { - if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - SbxVariableRef pArg = rPar.Get(1); - double aDate = pArg->GetDate(); + if (rPar.Count() != 2) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + SbxVariableRef pArg = rPar.Get(1); + double aDate = pArg->GetDate(); - sal_Int16 nDay = implGetDateDay( aDate ); - rPar.Get(0)->PutInteger(nDay); - } + sal_Int16 nDay = implGetDateDay( aDate ); + rPar.Get(0)->PutInteger(nDay); } void SbRtl_Year(StarBASIC *, SbxArray & rPar, bool) { - if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - sal_Int16 nYear = implGetDateYear(rPar.Get(1)->GetDate()); - rPar.Get(0)->PutInteger(nYear); - } + if (rPar.Count() != 2) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + sal_Int16 nYear = implGetDateYear(rPar.Get(1)->GetDate()); + rPar.Get(0)->PutInteger(nYear); } sal_Int16 implGetHour( double dDate ) @@ -2052,16 +2042,11 @@ sal_Int16 implGetHour( double dDate ) void SbRtl_Hour(StarBASIC *, SbxArray & rPar, bool) { - if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - double nArg = rPar.Get(1)->GetDate(); - sal_Int16 nHour = implGetHour( nArg ); - rPar.Get(0)->PutInteger(nHour); - } + if (rPar.Count() != 2) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + double nArg = rPar.Get(1)->GetDate(); + sal_Int16 nHour = implGetHour( nArg ); + rPar.Get(0)->PutInteger(nHour); } void SbRtl_Minute(StarBASIC *, SbxArray & rPar, bool) @@ -2075,15 +2060,10 @@ void SbRtl_Minute(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Month(StarBASIC *, SbxArray & rPar, bool) { - if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - sal_Int16 nMonth = implGetDateMonth(rPar.Get(1)->GetDate()); - rPar.Get(0)->PutInteger(nMonth); - } + if (rPar.Count() != 2) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + sal_Int16 nMonth = implGetDateMonth(rPar.Get(1)->GetDate()); + rPar.Get(0)->PutInteger(nMonth); } sal_Int16 implGetSecond( double dDate ) @@ -2105,16 +2085,11 @@ sal_Int32 implGetNanoSecond(double dDate) void SbRtl_Second(StarBASIC *, SbxArray & rPar, bool) { - if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - double nArg = rPar.Get(1)->GetDate(); - sal_Int16 nSecond = implGetSecond( nArg ); - rPar.Get(0)->PutInteger(nSecond); - } + if (rPar.Count() != 2) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + double nArg = rPar.Get(1)->GetDate(); + sal_Int16 nSecond = implGetSecond( nArg ); + rPar.Get(0)->PutInteger(nSecond); } double Now_Impl() diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index 88521ebb455e..cd1333711e4d 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -40,6 +40,9 @@ static Compat g_eCompatFlags(Compat::none); static std::function<bool(void*)> g_pAnyInputCallback; static void* g_pAnyInputCallbackData; +static std::function<void(int)> g_pViewSetter; +static std::function<int()> g_pViewGetter; + namespace { @@ -337,6 +340,36 @@ bool anyInput() return bRet; } +void setViewSetter(std::function<void(int)> pViewSetter) +{ + g_pViewSetter = pViewSetter; +} + +void setView(int nView) +{ + if (!g_pViewSetter) + { + return; + } + + g_pViewSetter(nView); +} + +void setViewGetter(std::function<int()> pViewGetter) +{ + g_pViewGetter = pViewGetter; +} + +int getView() +{ + if (!g_pViewGetter) + { + return -1; + } + + return g_pViewGetter(); +} + } // namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/windows/windows_process.cxx b/comphelper/source/windows/windows_process.cxx index fc91145bbbf2..12c14dff1ec3 100644 --- a/comphelper/source/windows/windows_process.cxx +++ b/comphelper/source/windows/windows_process.cxx @@ -126,17 +126,14 @@ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) /** * Creates a command line from a list of arguments. The returned * string is allocated with "malloc" and should be "free"d. - * - * argv is UTF8 */ -wchar_t* -MakeCommandLine(int argc, wchar_t **argv) +static wchar_t* MakeCommandLine(wchar_t **argv) { int i; int len = 0; // The + 1 of the last argument handles the allocation for null termination - for (i = 0; i < argc && argv[i]; ++i) + for (i = 0; argv[i]; ++i) len += ArgStrLen(argv[i]) + 1; // Protect against callers that pass 0 arguments @@ -148,10 +145,10 @@ MakeCommandLine(int argc, wchar_t **argv) return nullptr; wchar_t *c = s; - for (i = 0; i < argc && argv[i]; ++i) + for (i = 0; argv[i]; ++i) { c = ArgToString(c, argv[i]); - if (i + 1 != argc) + if (argv[i + 1]) { *c = ' '; ++c; @@ -165,7 +162,6 @@ MakeCommandLine(int argc, wchar_t **argv) BOOL WinLaunchChild(const wchar_t *exePath, - int argc, wchar_t **argv, HANDLE userToken, HANDLE *hProcess) @@ -173,7 +169,7 @@ WinLaunchChild(const wchar_t *exePath, wchar_t *cl; bool ok; - cl = MakeCommandLine(argc, argv); + cl = MakeCommandLine(argv); if (!cl) { return FALSE; diff --git a/configure.ac b/configure.ac index cf3bb8eaa054..6da72c76b577 100644 --- a/configure.ac +++ b/configure.ac @@ -10437,8 +10437,8 @@ fi if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_python" = internal; then SYSTEM_PYTHON= PYTHON_VERSION_MAJOR=3 - PYTHON_VERSION_MINOR=10 - PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.16 + PYTHON_VERSION_MINOR=11 + PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.11 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst]) fi @@ -14188,6 +14188,11 @@ if test "$ENABLE_ONLINE_UPDATE_MAR" = TRUE -o "$enable_python" = internal; then else AC_MSG_RESULT([no]) BUILD_TYPE="$BUILD_TYPE BZIP2" + if test "$COM" = "MSC"; then + BZIP2_LIBS="${WORKDIR}/UnpackedTarball/bzip2/libbz2.lib" + else + BZIP2_LIBS="-L${WORKDIR}/UnpackedTarball/bzip2 -lbz2" + fi fi fi AC_SUBST(SYSTEM_BZIP2) diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index a82743627d4a..ce0836b6511b 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -175,7 +175,7 @@ void createStr(const OUString& rStr, CharT** pArgs, size_t i) pArgs[i] = pStr; } -CharT** createCommandLine(OUString const & argv0, int * argc) +CharT** createCommandLine(OUString const & argv0) { OUString aInstallDir = Updater::getInstallationPath(); @@ -238,7 +238,6 @@ CharT** createCommandLine(OUString const & argv0, int * argc) pArgs[nArgs - 1] = nullptr; - *argc = nArgs - 1; return pArgs; } @@ -305,8 +304,7 @@ bool update() OUString aUpdaterPath = getPathFromURL(aTempDirURL + "/" + OUString::fromUtf8(pUpdaterName)); Updater::log("Calling the updater with parameters: "); - int argc; - CharT** pArgs = createCommandLine(aUpdaterPath, &argc); + CharT** pArgs = createCommandLine(aUpdaterPath); bool bSuccess = true; const char* pUpdaterTestReplace = std::getenv("LIBO_UPDATER_TEST_REPLACE"); @@ -320,7 +318,7 @@ bool update() bSuccess = false; } #elif defined(_WIN32) - bSuccess = WinLaunchChild((wchar_t*)aUpdaterPath.getStr(), argc, pArgs); + bSuccess = WinLaunchChild(o3tl::toW(aUpdaterPath.getStr()), pArgs); #endif } else diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dc0f4fdd5e89..6a6cffd57e95 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7794,6 +7794,7 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/, SolarMutexGuard aGuard; vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData); + SfxLokHelper::registerViewCallbacks(); Application::UpdateMainThread(); soffice_main(); } diff --git a/dictionaries b/dictionaries -Subproject 259e906688a224e25ce12c48efb5ca7037a8476 +Subproject 7951da9434fc16d2d69e2cc0653236619eb03bd diff --git a/download.lst b/download.lst index c9e848a7e52e..719d30b49879 100644 --- a/download.lst +++ b/download.lst @@ -590,8 +590,8 @@ POSTGRESQL_TARBALL := postgresql-14.15.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -PYTHON_SHA256SUM := bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 -PYTHON_TARBALL := Python-3.10.16.tar.xz +PYTHON_SHA256SUM := 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +PYTHON_TARBALL := Python-3.11.11.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/python3/0001-bpo-45898-Remove-duplicate-symbols-from-_ctypes-cfie.patch.1 b/external/python3/0001-bpo-45898-Remove-duplicate-symbols-from-_ctypes-cfie.patch.1 deleted file mode 100644 index 15887ef6735a..000000000000 --- a/external/python3/0001-bpo-45898-Remove-duplicate-symbols-from-_ctypes-cfie.patch.1 +++ /dev/null @@ -1,299 +0,0 @@ -From 38f331d4656394ae0f425568e26790ace778e076 Mon Sep 17 00:00:00 2001 -From: Christian Heimes <christian@python.org> -Date: Thu, 24 Feb 2022 21:51:57 +0200 -Subject: [PATCH] bpo-45898: Remove duplicate symbols from _ctypes/cfield.c - (GH-29791) - ---- - .../2021-11-26-10-46-09.bpo-45898.UIfhsb.rst | 2 + - Modules/_ctypes/cfield.c | 227 ++++++++---------- - PCbuild/_ctypes.vcxproj | 2 +- - 3 files changed, 106 insertions(+), 125 deletions(-) - create mode 100644 Misc/NEWS.d/next/Library/2021-11-26-10-46-09.bpo-45898.UIfhsb.rst - -diff --git a/Misc/NEWS.d/next/Library/2021-11-26-10-46-09.bpo-45898.UIfhsb.rst b/Misc/NEWS.d/next/Library/2021-11-26-10-46-09.bpo-45898.UIfhsb.rst -new file mode 100644 -index 0000000000..9da5c258ab ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2021-11-26-10-46-09.bpo-45898.UIfhsb.rst -@@ -0,0 +1,2 @@ -+:mod:`ctypes` no longer defines ``ffi_type_*`` symbols in ``cfield.c``. The -+symbols have been provided by libffi for over a decade. -diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c -index 515b280182..2992d34934 100644 ---- a/Modules/_ctypes/cfield.c -+++ b/Modules/_ctypes/cfield.c -@@ -1481,55 +1481,40 @@ P_get(void *ptr, Py_ssize_t size) - } - - static struct fielddesc formattable[] = { -- { 's', s_set, s_get, &ffi_type_pointer}, -- { 'b', b_set, b_get, &ffi_type_schar}, -- { 'B', B_set, B_get, &ffi_type_uchar}, -- { 'c', c_set, c_get, &ffi_type_schar}, -- { 'd', d_set, d_get, &ffi_type_double, d_set_sw, d_get_sw}, -- { 'g', g_set, g_get, &ffi_type_longdouble}, -- { 'f', f_set, f_get, &ffi_type_float, f_set_sw, f_get_sw}, -- { 'h', h_set, h_get, &ffi_type_sshort, h_set_sw, h_get_sw}, -- { 'H', H_set, H_get, &ffi_type_ushort, H_set_sw, H_get_sw}, -- { 'i', i_set, i_get, &ffi_type_sint, i_set_sw, i_get_sw}, -- { 'I', I_set, I_get, &ffi_type_uint, I_set_sw, I_get_sw}, --/* XXX Hm, sizeof(int) == sizeof(long) doesn't hold on every platform */ --/* As soon as we can get rid of the type codes, this is no longer a problem */ --#if SIZEOF_LONG == 4 -- { 'l', l_set, l_get, &ffi_type_sint32, l_set_sw, l_get_sw}, -- { 'L', L_set, L_get, &ffi_type_uint32, L_set_sw, L_get_sw}, --#elif SIZEOF_LONG == 8 -- { 'l', l_set, l_get, &ffi_type_sint64, l_set_sw, l_get_sw}, -- { 'L', L_set, L_get, &ffi_type_uint64, L_set_sw, L_get_sw}, --#else --# error --#endif --#if SIZEOF_LONG_LONG == 8 -- { 'q', q_set, q_get, &ffi_type_sint64, q_set_sw, q_get_sw}, -- { 'Q', Q_set, Q_get, &ffi_type_uint64, Q_set_sw, Q_get_sw}, --#else --# error --#endif -- { 'P', P_set, P_get, &ffi_type_pointer}, -- { 'z', z_set, z_get, &ffi_type_pointer}, -- { 'u', u_set, u_get, NULL}, /* ffi_type set later */ -- { 'U', U_set, U_get, &ffi_type_pointer}, -- { 'Z', Z_set, Z_get, &ffi_type_pointer}, -+ { 's', s_set, s_get, NULL}, -+ { 'b', b_set, b_get, NULL}, -+ { 'B', B_set, B_get, NULL}, -+ { 'c', c_set, c_get, NULL}, -+ { 'd', d_set, d_get, NULL, d_set_sw, d_get_sw}, -+ { 'g', g_set, g_get, NULL}, -+ { 'f', f_set, f_get, NULL, f_set_sw, f_get_sw}, -+ { 'h', h_set, h_get, NULL, h_set_sw, h_get_sw}, -+ { 'H', H_set, H_get, NULL, H_set_sw, H_get_sw}, -+ { 'i', i_set, i_get, NULL, i_set_sw, i_get_sw}, -+ { 'I', I_set, I_get, NULL, I_set_sw, I_get_sw}, -+ { 'l', l_set, l_get, NULL, l_set_sw, l_get_sw}, -+ { 'L', L_set, L_get, NULL, L_set_sw, L_get_sw}, -+ { 'q', q_set, q_get, NULL, q_set_sw, q_get_sw}, -+ { 'Q', Q_set, Q_get, NULL, Q_set_sw, Q_get_sw}, -+ { 'P', P_set, P_get, NULL}, -+ { 'z', z_set, z_get, NULL}, -+ { 'u', u_set, u_get, NULL}, -+ { 'U', U_set, U_get, NULL}, -+ { 'Z', Z_set, Z_get, NULL}, - #ifdef MS_WIN32 -- { 'X', BSTR_set, BSTR_get, &ffi_type_pointer}, -+ { 'X', BSTR_set, BSTR_get, NULL}, - #endif -- { 'v', vBOOL_set, vBOOL_get, &ffi_type_sshort}, --#if SIZEOF__BOOL == 1 -- { '?', bool_set, bool_get, &ffi_type_uchar}, /* Also fallback for no native _Bool support */ --#elif SIZEOF__BOOL == SIZEOF_SHORT -- { '?', bool_set, bool_get, &ffi_type_ushort}, --#elif SIZEOF__BOOL == SIZEOF_INT -- { '?', bool_set, bool_get, &ffi_type_uint, I_set_sw, I_get_sw}, -+ { 'v', vBOOL_set, vBOOL_get, NULL}, -+#if SIZEOF__BOOL == SIZEOF_INT -+ { '?', bool_set, bool_get, NULL, I_set_sw, I_get_sw}, - #elif SIZEOF__BOOL == SIZEOF_LONG -- { '?', bool_set, bool_get, &ffi_type_ulong, L_set_sw, L_get_sw}, -+ { '?', bool_set, bool_get, NULL, L_set_sw, L_get_sw}, - #elif SIZEOF__BOOL == SIZEOF_LONG_LONG -- { '?', bool_set, bool_get, &ffi_type_ulong, Q_set_sw, Q_get_sw}, -+ { '?', bool_set, bool_get, NULL, Q_set_sw, Q_get_sw}, -+#else -+ { '?', bool_set, bool_get, NULL}, - #endif /* SIZEOF__BOOL */ -- { 'O', O_set, O_get, &ffi_type_pointer}, -+ { 'O', O_set, O_get, NULL}, - { 0, NULL, NULL, NULL}, - }; - -@@ -1538,6 +1523,79 @@ static struct fielddesc formattable[] = { - Use '?' as code for BOOL. - */ - -+/* Delayed initialization. Windows cannot statically reference dynamically -+ loaded addresses from DLLs. */ -+void -+_ctypes_init_fielddesc(void) -+{ -+ struct fielddesc *fd = formattable; -+ for (; fd->code; ++fd) { -+ switch (fd->code) { -+ case 's': fd->pffi_type = &ffi_type_pointer; break; -+ case 'b': fd->pffi_type = &ffi_type_schar; break; -+ case 'B': fd->pffi_type = &ffi_type_uchar; break; -+ case 'c': fd->pffi_type = &ffi_type_schar; break; -+ case 'd': fd->pffi_type = &ffi_type_double; break; -+ case 'g': fd->pffi_type = &ffi_type_longdouble; break; -+ case 'f': fd->pffi_type = &ffi_type_float; break; -+ case 'h': fd->pffi_type = &ffi_type_sshort; break; -+ case 'H': fd->pffi_type = &ffi_type_ushort; break; -+ case 'i': fd->pffi_type = &ffi_type_sint; break; -+ case 'I': fd->pffi_type = &ffi_type_uint; break; -+ /* XXX Hm, sizeof(int) == sizeof(long) doesn't hold on every platform */ -+ /* As soon as we can get rid of the type codes, this is no longer a problem */ -+ #if SIZEOF_LONG == 4 -+ case 'l': fd->pffi_type = &ffi_type_sint32; break; -+ case 'L': fd->pffi_type = &ffi_type_uint32; break; -+ #elif SIZEOF_LONG == 8 -+ case 'l': fd->pffi_type = &ffi_type_sint64; break; -+ case 'L': fd->pffi_type = &ffi_type_uint64; break; -+ #else -+ #error -+ #endif -+ #if SIZEOF_LONG_LONG == 8 -+ case 'q': fd->pffi_type = &ffi_type_sint64; break; -+ case 'Q': fd->pffi_type = &ffi_type_uint64; break; -+ #else -+ #error -+ #endif -+ case 'P': fd->pffi_type = &ffi_type_pointer; break; -+ case 'z': fd->pffi_type = &ffi_type_pointer; break; -+ case 'u': -+ if (sizeof(wchar_t) == sizeof(short)) -+ fd->pffi_type = &ffi_type_sshort; -+ else if (sizeof(wchar_t) == sizeof(int)) -+ fd->pffi_type = &ffi_type_sint; -+ else if (sizeof(wchar_t) == sizeof(long)) -+ fd->pffi_type = &ffi_type_slong; -+ else -+ Py_UNREACHABLE(); -+ break; -+ case 'U': fd->pffi_type = &ffi_type_pointer; break; -+ case 'Z': fd->pffi_type = &ffi_type_pointer; break; -+ #ifdef MS_WIN32 -+ case 'X': fd->pffi_type = &ffi_type_pointer; break; -+ #endif -+ case 'v': fd->pffi_type = &ffi_type_sshort; break; -+ #if SIZEOF__BOOL == 1 -+ case '?': fd->pffi_type = &ffi_type_uchar; break; /* Also fallback for no native _Bool support */ -+ #elif SIZEOF__BOOL == SIZEOF_SHORT -+ case '?': fd->pffi_type = &ffi_type_ushort; break; -+ #elif SIZEOF__BOOL == SIZEOF_INT -+ case '?': fd->pffi_type = &ffi_type_uint; break; -+ #elif SIZEOF__BOOL == SIZEOF_LONG -+ case '?': fd->pffi_type = &ffi_type_ulong; break; -+ #elif SIZEOF__BOOL == SIZEOF_LONG_LONG -+ case '?': fd->pffi_type = &ffi_type_ulong; break; -+ #endif /* SIZEOF__BOOL */ -+ case 'O': fd->pffi_type = &ffi_type_pointer; break; -+ default: -+ Py_UNREACHABLE(); -+ } -+ } -+ -+} -+ - struct fielddesc * - _ctypes_get_fielddesc(const char *fmt) - { -@@ -1545,13 +1603,7 @@ _ctypes_get_fielddesc(const char *fmt) - struct fielddesc *table = formattable; - - if (!initialized) { -- initialized = 1; -- if (sizeof(wchar_t) == sizeof(short)) -- _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sshort; -- else if (sizeof(wchar_t) == sizeof(int)) -- _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sint; -- else if (sizeof(wchar_t) == sizeof(long)) -- _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_slong; -+ _ctypes_init_fielddesc(); - } - - for (; table->code; ++table) { -@@ -1561,77 +1613,4 @@ _ctypes_get_fielddesc(const char *fmt) - return NULL; - } - --typedef struct { char c; char x; } s_char; --typedef struct { char c; short x; } s_short; --typedef struct { char c; int x; } s_int; --typedef struct { char c; long x; } s_long; --typedef struct { char c; float x; } s_float; --typedef struct { char c; double x; } s_double; --typedef struct { char c; long double x; } s_long_double; --typedef struct { char c; char *x; } s_char_p; --typedef struct { char c; void *x; } s_void_p; -- --/* --#define CHAR_ALIGN (sizeof(s_char) - sizeof(char)) --#define SHORT_ALIGN (sizeof(s_short) - sizeof(short)) --#define LONG_ALIGN (sizeof(s_long) - sizeof(long)) --*/ --#define INT_ALIGN (sizeof(s_int) - sizeof(int)) --#define FLOAT_ALIGN (sizeof(s_float) - sizeof(float)) --#define DOUBLE_ALIGN (sizeof(s_double) - sizeof(double)) --#define LONGDOUBLE_ALIGN (sizeof(s_long_double) - sizeof(long double)) -- --/* #define CHAR_P_ALIGN (sizeof(s_char_p) - sizeof(char*)) */ --#define VOID_P_ALIGN (sizeof(s_void_p) - sizeof(void*)) -- --/* --#ifdef HAVE_USABLE_WCHAR_T --typedef struct { char c; wchar_t x; } s_wchar; --typedef struct { char c; wchar_t *x; } s_wchar_p; -- --#define WCHAR_ALIGN (sizeof(s_wchar) - sizeof(wchar_t)) --#define WCHAR_P_ALIGN (sizeof(s_wchar_p) - sizeof(wchar_t*)) --#endif --*/ -- --typedef struct { char c; long long x; } s_long_long; --#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(long long)) -- --/* from ffi.h: --typedef struct _ffi_type --{ -- size_t size; -- unsigned short alignment; -- unsigned short type; -- struct _ffi_type **elements; --} ffi_type; --*/ -- --/* align and size are bogus for void, but they must not be zero */ --ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID }; -- --ffi_type ffi_type_uint8 = { 1, 1, FFI_TYPE_UINT8 }; --ffi_type ffi_type_sint8 = { 1, 1, FFI_TYPE_SINT8 }; -- --ffi_type ffi_type_uint16 = { 2, 2, FFI_TYPE_UINT16 }; --ffi_type ffi_type_sint16 = { 2, 2, FFI_TYPE_SINT16 }; -- --ffi_type ffi_type_uint32 = { 4, INT_ALIGN, FFI_TYPE_UINT32 }; --ffi_type ffi_type_sint32 = { 4, INT_ALIGN, FFI_TYPE_SINT32 }; -- --ffi_type ffi_type_uint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_UINT64 }; --ffi_type ffi_type_sint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_SINT64 }; -- --ffi_type ffi_type_float = { sizeof(float), FLOAT_ALIGN, FFI_TYPE_FLOAT }; --ffi_type ffi_type_double = { sizeof(double), DOUBLE_ALIGN, FFI_TYPE_DOUBLE }; -- --#ifdef ffi_type_longdouble --#undef ffi_type_longdouble --#endif -- /* This is already defined on OSX */ --ffi_type ffi_type_longdouble = { sizeof(long double), LONGDOUBLE_ALIGN, -- FFI_TYPE_LONGDOUBLE }; -- --ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER }; -- - /*---------------- EOF ----------------*/ -diff --git a/PCbuild/_ctypes.vcxproj b/PCbuild/_ctypes.vcxproj -index 69e4271a9b..6ac26f1916 100644 ---- a/PCbuild/_ctypes.vcxproj -+++ b/PCbuild/_ctypes.vcxproj -@@ -94,7 +94,7 @@ - </PropertyGroup>
- <ItemDefinitionGroup>
- <ClCompile>
-- <PreprocessorDefinitions>FFI_BUILDING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+ <PreprocessorDefinitions>USING_MALLOC_CLOSURE_DOT_C=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
--- -2.43.0 - diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index 4c8d7c17b3ca..4cc771aba68d 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -186,7 +186,7 @@ endif $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ Lib/__future__.py \ - Lib/__phello__.foo.py \ + Lib/__hello__.py \ Lib/_aix_support.py \ Lib/_bootsubprocess.py \ Lib/_collections_abc.py \ @@ -210,7 +210,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/asyncore.py \ Lib/base64.py \ Lib/bdb.py \ - Lib/binhex.py \ Lib/bisect.py \ Lib/bz2.py \ Lib/cProfile.py \ @@ -297,7 +296,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/queue.py \ Lib/quopri.py \ Lib/random.py \ - Lib/re.py \ Lib/reprlib.py \ Lib/rlcompleter.py \ Lib/runpy.py \ @@ -356,6 +354,16 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/zipimport.py \ )) +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/__phello__,\ + Lib/__phello__/__init__.py \ + Lib/__phello__/spam.py \ +)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/__phello__/ham,\ + Lib/__phello__/ham/__init__.py \ + Lib/__phello__/ham/eggs.py \ +)) + $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/asyncio,\ Lib/asyncio/__init__.py \ Lib/asyncio/__main__.py \ @@ -381,8 +389,10 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/asyncio/staggered.py \ Lib/asyncio/streams.py \ Lib/asyncio/subprocess.py \ + Lib/asyncio/taskgroups.py \ Lib/asyncio/tasks.py \ Lib/asyncio/threads.py \ + Lib/asyncio/timeouts.py \ Lib/asyncio/transports.py \ Lib/asyncio/trsock.py \ Lib/asyncio/unix_events.py \ @@ -460,7 +470,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/distutils/command/__init__.py \ Lib/distutils/command/bdist.py \ Lib/distutils/command/bdist_dumb.py \ - Lib/distutils/command/bdist_msi.py \ Lib/distutils/command/bdist_rpm.py \ Lib/distutils/command/build.py \ Lib/distutils/command/build_clib.py \ @@ -650,8 +659,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/ensurepip/_bundled,\ - Lib/ensurepip/_bundled/__init__.py \ - Lib/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl \ + Lib/ensurepip/_bundled/pip-24.0-py3-none-any.whl \ Lib/ensurepip/_bundled/setuptools-65.5.0-py3-none-any.whl \ )) @@ -672,14 +680,12 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/importlib,\ Lib/importlib/__init__.py \ Lib/importlib/_abc.py \ - Lib/importlib/_adapters.py \ Lib/importlib/_bootstrap.py \ Lib/importlib/_bootstrap_external.py \ - Lib/importlib/_common.py \ Lib/importlib/abc.py \ Lib/importlib/machinery.py \ Lib/importlib/readers.py \ - Lib/importlib/resources.py \ + Lib/importlib/simple.py \ Lib/importlib/util.py \ )) @@ -693,6 +699,17 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/importlib/metadata/_text.py \ )) +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/importlib/resources,\ + Lib/importlib/resources/__init__.py \ + Lib/importlib/resources/_adapters.py \ + Lib/importlib/resources/_common.py \ + Lib/importlib/resources/_itertools.py \ + Lib/importlib/resources/_legacy.py \ + Lib/importlib/resources/abc.py \ + Lib/importlib/resources/readers.py \ + Lib/importlib/resources/simple.py \ +)) + $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/json,\ Lib/json/__init__.py \ Lib/json/decoder.py \ @@ -835,10 +852,25 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/pydoc_data/topics.py \ )) +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/re,\ + Lib/re/__init__.py \ + Lib/re/_casefix.py \ + Lib/re/_compiler.py \ + Lib/re/_constants.py \ + Lib/re/_parser.py \ +)) + $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/site-packages,\ Lib/site-packages/README.txt \ )) +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/tomllib,\ + Lib/tomllib/__init__.py \ + Lib/tomllib/_parser.py \ + Lib/tomllib/_re.py \ + Lib/tomllib/_types.py \ +)) + $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest,\ Lib/unittest/__init__.py \ Lib/unittest/__main__.py \ @@ -869,6 +901,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/wsgiref/handlers.py \ Lib/wsgiref/headers.py \ Lib/wsgiref/simple_server.py \ + Lib/wsgiref/types.py \ Lib/wsgiref/util.py \ Lib/wsgiref/validate.py \ )) diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk index 5bafc38e5260..2d7660e84fb1 100644 --- a/external/python3/ExternalProject_python3.mk +++ b/external/python3/ExternalProject_python3.mk @@ -33,9 +33,15 @@ ifeq ($(OS),WNT) # at least for MSVC 2008 it is necessary to clear MAKEFLAGS because # nmake is invoked +# +# Since Python 3.11, _freeze_module.vcxproj needs python.exe to build +# deepfreeze.c. At the moment target _RebuildDeepFrozen is called, python.exe +# doesn't exist yet so it needs to be downloaded using nuget. +# Call find_python.bat first to have nuget.exe and python.exe ready before building $(call gb_ExternalProject_get_state_target,python3,build) : $(call gb_Trace_StartRange,python3,EXTERNAL) $(call gb_ExternalProject_run,build,\ + cmd /c $(gb_UnpackedTarball_workdir)/python3/PCbuild/find_python.bat -q && \ MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build $(gb_MSBUILD_CONFIG_AND_PLATFORM) \ /p:bz2Dir=$(gb_UnpackedTarball_workdir)/bzip2 \ /p:opensslIncludeDir=$(gb_UnpackedTarball_workdir)/openssl/include \ diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 5a9cf9f03fde..360d49971341 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -21,14 +21,11 @@ ifneq ($(MSYSTEM),) $(eval $(call gb_UnpackedTarball_set_patchflags,python3,--binary)) endif -# external/python3/0001-bpo-45898-Remove-duplicate-symbols-from-_ctypes-cfie.patch.1: -# backport from https://github.com/python/cpython/commit/38f331d4656394ae0f425568e26790ace778e076 $(eval $(call gb_UnpackedTarball_add_patches,python3,\ - external/python3/0001-bpo-45898-Remove-duplicate-symbols-from-_ctypes-cfie.patch.1 \ external/python3/i100492-freebsd.patch.1 \ external/python3/python-3.3.0-darwin.patch.1 \ - external/python3/python-3.8-msvc-libffi.patch.1 \ external/python3/python-3.7.6-msvc-ssl.patch.1 \ + external/python3/replace-powershell-with-wget.patch.1 \ external/python3/python-3.5.4-msvc-disable.patch.1 \ external/python3/ubsan.patch.0 \ external/python3/python-3.5.tweak.strip.soabi.patch \ diff --git a/external/python3/internal-zlib.patch.0 b/external/python3/internal-zlib.patch.0 index d4305c6df95d..6cbb26c5b467 100644 --- a/external/python3/internal-zlib.patch.0 +++ b/external/python3/internal-zlib.patch.0 @@ -1,9 +1,9 @@ --- configure +++ configure -@@ -12333,13 +12333,13 @@ - ;; - esac - +@@ -16356,13 +16356,13 @@ + ZLIB_CFLAGS=${ZLIB_CFLAGS-""} + ZLIB_LIBS=${ZLIB_LIBS-"-lz"} + py_check_lib_save_LIBS=$LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 -$as_echo_n "checking for inflateCopy in -lz... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lzlib" >&5 @@ -17,39 +17,3 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ ---- setup.py -+++ setup.py -@@ -1483,7 +1483,7 @@ - # - # You can upgrade zlib to version 1.1.4 yourself by going to - # http://www.gzip.org/zlib/ -- zlib_inc = find_file('zlib.h', [], self.inc_dirs) -+ zlib_inc = [os.environ.get('ZLIB_INCDIR')] - have_zlib = False - if zlib_inc is not None: - zlib_h = zlib_inc[0] + '/zlib.h' -@@ -1500,13 +1500,13 @@ - version = line.split()[2] - break - if version >= version_req: -- if (self.compiler.find_library_file(self.lib_dirs, 'z')): -+ if (self.compiler.find_library_file(self.lib_dirs, 'zlib')): - if MACOS: - zlib_extra_link_args = ('-Wl,-search_paths_first',) - else: - zlib_extra_link_args = () - self.add(Extension('zlib', ['zlibmodule.c'], -- libraries=['z'], -+ libraries=['zlib'], - extra_link_args=zlib_extra_link_args)) - have_zlib = True - else: -@@ -1520,7 +1520,7 @@ - # crc32 if we have it. Otherwise binascii uses its own. - if have_zlib: - extra_compile_args = ['-DUSE_ZLIB_CRC32'] -- libraries = ['z'] -+ libraries = ['zlib'] - extra_link_args = zlib_extra_link_args - else: - extra_compile_args = [] diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1 index b2e443659cf9..c4ce3cc78318 100644 --- a/external/python3/python-3.3.3-elf-rpath.patch.1 +++ b/external/python3/python-3.3.3-elf-rpath.patch.1 @@ -5,14 +5,14 @@ set RPATH (only to be used on ELF platforms) diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in --- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200 +++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200 -@@ -586,7 +586,7 @@ +@@ -706,7 +706,7 @@ # Build the interpreter - $(BUILDPYTHON): Programs/python.o $(LIBRARY_DEPS) -- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -+ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -Wl,-rpath,\$$ORIGIN + $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) +- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) ++ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) -Wl,-rpath,\$$ORIGIN - platform: $(BUILDPYTHON) pybuilddir.txt + platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform @@ -628,7 +628,7 @@ fi diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 b/external/python3/python-3.5.4-msvc-disable.patch.1 index 5ba33a7f8ab3..023856055447 100644 --- a/external/python3/python-3.5.4-msvc-disable.patch.1 +++ b/external/python3/python-3.5.4-msvc-disable.patch.1 @@ -3,9 +3,9 @@ Disable some stuff LO does not need, especially stuff with external dependencies diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln --- python3.orig/PCbuild/pcbuild.sln 2023-08-25 04:36:32.000000000 +0900 +++ python3/PCbuild/pcbuild.sln 2023-09-20 17:43:05.442089400 +0900 -@@ -15,8 +15,6 @@ - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" +@@ -18,8 +18,6 @@ + {19C0C13F-47CA-4432-AFF3-799A296A4DDC} = {19C0C13F-47CA-4432-AFF3-799A296A4DDC} + EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcxproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}" -EndProject diff --git a/external/python3/python-3.7.6-msvc-ssl.patch.1 b/external/python3/python-3.7.6-msvc-ssl.patch.1 index 50b1c65645df..f09a8fdcd328 100644 --- a/external/python3/python-3.7.6-msvc-ssl.patch.1 +++ b/external/python3/python-3.7.6-msvc-ssl.patch.1 @@ -12,16 +12,3 @@ No use for applink.c OPENSSL_Applink, everything is compiled with the same MSVC </ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\PC\python_nt.rc" />
---- python3/PCbuild/openssl.props.orig 2019-12-23 16:20:34.588135900 +0100 -+++ python3/PCbuild/openssl.props 2019-12-23 16:20:51.074001300 +0100 -@@ -10,9 +10,7 @@ - </Link>
- </ItemDefinitionGroup>
- <PropertyGroup>
-- <_DLLSuffix>-1_1</_DLLSuffix>
-- <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
-- <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
-+ <_DLLSuffix>-3</_DLLSuffix>
- </PropertyGroup>
- <ItemGroup>
- <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
diff --git a/external/python3/python-3.8-msvc-libffi.patch.1 b/external/python3/python-3.8-msvc-libffi.patch.1 deleted file mode 100644 index 674043a7dca6..000000000000 --- a/external/python3/python-3.8-msvc-libffi.patch.1 +++ /dev/null @@ -1,16 +0,0 @@ ---- python3/PCbuild/libffi.props.orig 2023-08-25 04:36:32.000000000 +0900 -+++ python3/PCbuild/libffi.props 2023-10-14 15:13:24.850511531 +0900 -@@ -6,11 +6,11 @@ - </ClCompile> - <Link> - <AdditionalLibraryDirectories>$(libffiOutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> -- <AdditionalDependencies>libffi-7.lib;%(AdditionalDependencies)</AdditionalDependencies> -+ <AdditionalDependencies>libffi-8.lib;%(AdditionalDependencies)</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemGroup> -- <_LIBFFIDLL Include="$(libffiOutDir)\libffi-7.dll" /> -+ <_LIBFFIDLL Include="$(libffiOutDir)\libffi-8.dll" /> - </ItemGroup> - <Target Name="_CopyLIBFFIDLL" Inputs="@(_LIBFFIDLL)" Outputs="@(_LIBFFIDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build"> - <Copy SourceFiles="@(_LIBFFIDLL)" DestinationFolder="$(OutDir)" /> diff --git a/external/python3/replace-powershell-with-wget.patch.1 b/external/python3/replace-powershell-with-wget.patch.1 new file mode 100644 index 000000000000..2e9b4fc38a55 --- /dev/null +++ b/external/python3/replace-powershell-with-wget.patch.1 @@ -0,0 +1,11 @@ +--- python3/PCbuild/find_python.bat 2025-01-03 11:53:41.867445033 +0100 ++++ python3/PCbuild/find_python.bat 2025-01-03 11:54:25.018865518 +0100 +@@ -56,7 +56,7 @@ + @rem NB: Must use single quotes around NUGET here, NOT double!
+ @rem Otherwise, a space in the path would break things
+ @rem If it fails, retry with any available copy of Python
+- @powershell.exe -Command Invoke-WebRequest %_Py_NUGET_URL% -OutFile '%_Py_NUGET%'
++ @wget -O '%_Py_NUGET%' %_Py_NUGET_URL%
+ @if errorlevel 1 (
+ @%_Py_HOST_PYTHON% -E "%_Py_D%\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%"
+ )
diff --git a/external/python3/tsan.patch.0 b/external/python3/tsan.patch.0 index d599ec046109..6f0d36818769 100644 --- a/external/python3/tsan.patch.0 +++ b/external/python3/tsan.patch.0 @@ -1,7 +1,7 @@ --- Python/ceval_gil.h +++ Python/ceval_gil.h -@@ -135,6 +135,7 @@ - +@@ -136,6 +136,7 @@ + #ifdef HAVE_FORK static void recreate_gil(struct _gil_runtime_state *gil) { + _Py_ANNOTATE_RWLOCK_RELEASED(&gil->locked, 1); diff --git a/extras/source/templates/presnt/Focus/styles.xml b/extras/source/templates/presnt/Focus/styles.xml index 7373970930c3..29b81e1a9b61 100644 --- a/extras/source/templates/presnt/Focus/styles.xml +++ b/extras/source/templates/presnt/Focus/styles.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <office:document-styles xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" office:version="1.2"> <office:font-face-decls> <style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu Sans'" style:font-adornments="Book" style:font-family-generic="swiss" style:font-pitch="variable"/> @@ -933,6 +933,10 @@ <style:graphic-properties draw:fill="solid" draw:fill-color="#f10d0c"/> <style:text-properties fo:color="#dddddd" loext:opacity="100%"/> </style:style> + <style:style style:name="Mgr4" style:family="graphic" style:parent-style-name="Filled_20_Orange"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#ea7500" draw:stroke="none"/> + <style:text-properties fo:color="#dddddd" loext:opacity="100%"/> + </style:style> <style:style style:name="Mgr5" style:family="graphic" style:parent-style-name="Filled_20_Yellow"> <style:graphic-properties draw:fill="solid" draw:fill-color="#e8a202"/> <style:text-properties fo:color="#dddddd" loext:opacity="100%"/> @@ -945,6 +949,10 @@ <style:graphic-properties draw:fill="solid" draw:fill-color="#3465a4"/> <style:text-properties fo:color="#dddddd" loext:opacity="100%"/> </style:style> + <style:style style:name="Mgr8" style:family="graphic" style:parent-style-name="Filled_20_Purple"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#780373" draw:stroke="none"/> + <style:text-properties fo:color="#dddddd" loext:opacity="100%"/> + </style:style> <style:style style:name="Mpr8" style:family="presentation" style:parent-style-name="Focus-backgroundobjects"> <style:graphic-properties draw:stroke="none" draw:fill="none" draw:fill-color="#ffffff" draw:auto-grow-height="false" fo:min-height="1.397cm"/> </style:style> @@ -1036,11 +1044,11 @@ </style:handout-master> <style:master-page style:name="Focus" style:page-layout-name="PM1" draw:style-name="Mdp1"> <draw:polygon draw:style-name="Mgr3" draw:layer="backgroundobjects" svg:width="13.5cm" svg:height="8cm" svg:x="0cm" svg:y="0cm" svg:viewBox="0 0 13500 8000" draw:points="0,0 0,500 10404,8000 13500,0"/> - <draw:polygon draw:style-name="Filled_20_Orange" draw:layer="backgroundobjects" svg:width="16cm" svg:height="6cm" svg:x="12cm" svg:y="0cm" svg:viewBox="0 0 16000 6000" draw:points="16000,0 2500,0 0,6000 16000,2500"/> + <draw:polygon draw:style-name="Mgr4" draw:layer="backgroundobjects" svg:width="16cm" svg:height="6cm" svg:x="12cm" svg:y="0cm" svg:viewBox="0 0 16000 6000" draw:points="16000,0 2500,0 0,6000 16000,2500"/> <draw:polygon draw:style-name="Mgr5" draw:layer="backgroundobjects" svg:width="12.5cm" svg:height="10.5cm" svg:x="15.5cm" svg:y="3.5cm" svg:viewBox="0 0 12500 10500" draw:points="12500,10500 12500,0 0,2500"/> <draw:polygon draw:style-name="Mgr6" draw:layer="backgroundobjects" svg:width="12.5cm" svg:height="7.25cm" svg:x="15.5cm" svg:y="8.5cm" svg:viewBox="0 0 12500 7250" draw:points="12500,7250 12500,6500 2000,0 0,7250"/> <draw:polygon draw:style-name="Mgr7" draw:layer="backgroundobjects" svg:width="16cm" svg:height="5.3cm" svg:x="0cm" svg:y="10.45cm" svg:viewBox="0 0 16000 5292" draw:points="0,5292 14500,5292 16000,0 0,2542"/> - <draw:polygon draw:style-name="Filled_20_Purple" draw:layer="backgroundobjects" svg:width="12cm" svg:height="10.5cm" svg:x="0cm" svg:y="1.5cm" svg:viewBox="0 0 12000 10500" draw:points="0,0 0,10500 12000,8500"/> + <draw:polygon draw:style-name="Mgr8" draw:layer="backgroundobjects" svg:width="12cm" svg:height="10.5cm" svg:x="0cm" svg:y="1.5cm" svg:viewBox="0 0 12000 10500" draw:points="0,0 0,10500 12000,8500"/> <draw:frame presentation:style-name="Focus-backgroundobjects" draw:text-style-name="MP2" draw:layer="backgroundobjects" svg:width="6.5cm" svg:height="1cm" svg:x="1cm" svg:y="14.5cm" presentation:class="date-time"> <draw:text-box> <text:p> diff --git a/extras/source/templates/presnt/Lights/styles.xml b/extras/source/templates/presnt/Lights/styles.xml index 7ca0dc23f6db..6a76485d4547 100644 --- a/extras/source/templates/presnt/Lights/styles.xml +++ b/extras/source/templates/presnt/Lights/styles.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <office:document-styles xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.2"> <office:font-face-decls> <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> @@ -761,7 +761,25 @@ <style:style style:name="Mgr2" style:family="graphic" style:parent-style-name="standard"> <style:graphic-properties draw:stroke="none" draw:fill="none" draw:fill-color="#ffffff" draw:textarea-vertical-align="bottom" draw:auto-grow-height="false" fo:min-height="1.485cm"/> </style:style> - <style:style style:name="Mpr13" style:family="presentation" style:parent-style-name="Lights-backgroundobjects"> + <style:style style:name="Mgr3" style:family="graphic" style:parent-style-name="Gradient_20_6"> + <style:graphic-properties draw:fill="gradient" draw:fill-gradient-name="Gradient_20_6" draw:gradient-step-count="0"/> + </style:style> + <style:style style:name="Mgr10" style:family="graphic" style:parent-style-name="Lights_20_10"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#ffffff" draw:stroke="none" draw:opacity="10%"/> + </style:style> + <style:style style:name="Mgr15" style:family="graphic" style:parent-style-name="Lights_20_15"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#ffffff" draw:stroke="none" draw:opacity="15%"/> + </style:style> + <style:style style:name="Mgr20" style:family="graphic" style:parent-style-name="Lights_20_20"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#ffffff" draw:stroke="none" draw:opacity="20%"/> + </style:style> + <style:style style:name="Mgr25" style:family="graphic" style:parent-style-name="Lights_20_25"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#ffffff" draw:stroke="none" draw:opacity="25%"/> + </style:style> + <style:style style:name="Mgr30" style:family="graphic" style:parent-style-name="Lights_20_30"> + <style:graphic-properties draw:fill="solid" draw:fill-color="#ffffff" draw:stroke="none" draw:opacity="30%"/> + </style:style> + <style:style style:name="Mpr13" style:family="presentation" style:parent-style-name="Lights-backgroundobjects"> <style:graphic-properties draw:stroke="none" draw:fill="none" draw:fill-color="#ffffff" draw:textarea-vertical-align="top" draw:auto-grow-height="false" fo:min-height="1.485cm"/> </style:style> <style:style style:name="Mpr27" style:family="presentation" style:parent-style-name="Lights1-backgroundobjects"> @@ -841,7 +859,7 @@ <draw:page-thumbnail draw:layer="backgroundobjects" svg:width="8.999cm" svg:height="5.061cm" svg:x="11cm" svg:y="20.894cm"/> </style:handout-master> <style:master-page style:name="Lights" style:page-layout-name="PM1" draw:style-name="Mdp3"> - <draw:custom-shape draw:style-name="Gradient_20_6" draw:layer="backgroundobjects" svg:width="28cm" svg:height="15.75cm" svg:x="0cm" svg:y="0cm"> + <draw:custom-shape draw:style-name="Mgr3" draw:layer="backgroundobjects" svg:width="28cm" svg:height="15.75cm" svg:x="0cm" svg:y="0cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/> </draw:custom-shape> <draw:frame presentation:style-name="Lights-title" draw:layer="backgroundobjects" svg:width="25cm" svg:height="2.75cm" svg:x="1.5cm" svg:y="4cm" presentation:class="title" presentation:placeholder="true"> @@ -871,37 +889,37 @@ </text:p> </draw:text-box> </draw:frame> - <draw:custom-shape draw:style-name="Lights_20_30" draw:layer="backgroundobjects" svg:width="4cm" svg:height="3.5cm" svg:x="4cm" svg:y="3cm"> + <draw:custom-shape draw:style-name="Mgr30" draw:layer="backgroundobjects" svg:width="4cm" svg:height="3.5cm" svg:x="4cm" svg:y="3cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_30" draw:layer="backgroundobjects" svg:width="4cm" svg:height="3.5cm" svg:x="20.5cm" svg:y="11cm"> + <draw:custom-shape draw:style-name="Mgr30" draw:layer="backgroundobjects" svg:width="4cm" svg:height="3.5cm" svg:x="20.5cm" svg:y="11cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_20" draw:layer="backgroundobjects" svg:width="3.5cm" svg:height="3cm" svg:x="25cm" svg:y="7.5cm"> + <draw:custom-shape draw:style-name="Mgr20" draw:layer="backgroundobjects" svg:width="3.5cm" svg:height="3cm" svg:x="25cm" svg:y="7.5cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_20" draw:layer="backgroundobjects" svg:width="4cm" svg:height="3.75cm" svg:x="-0.5cm" svg:y="6.75cm"> + <draw:custom-shape draw:style-name="Mgr20" draw:layer="backgroundobjects" svg:width="4cm" svg:height="3.75cm" svg:x="-0.5cm" svg:y="6.75cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_20" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="1.5cm" svg:y="3cm"> + <draw:custom-shape draw:style-name="Mgr20" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="1.5cm" svg:y="3cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_10" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="0cm" svg:y="3.5cm"> + <draw:custom-shape draw:style-name="Mgr10" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="0cm" svg:y="3.5cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_15" draw:layer="backgroundobjects" svg:width="4.5cm" svg:height="3.5cm" svg:x="0cm" svg:y="14.5cm"> + <draw:custom-shape draw:style-name="Mgr15" draw:layer="backgroundobjects" svg:width="4.5cm" svg:height="3.5cm" svg:x="0cm" svg:y="14.5cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_30" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="27cm" svg:y="13cm"> + <draw:custom-shape draw:style-name="Mgr30" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="27cm" svg:y="13cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_10" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="26.5cm" svg:y="9.5cm"> + <draw:custom-shape draw:style-name="Mgr10" draw:layer="backgroundobjects" svg:width="2cm" svg:height="2cm" svg:x="26.5cm" svg:y="9.5cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_20" draw:layer="backgroundobjects" svg:width="3cm" svg:height="2.34cm" svg:x="22.5cm" svg:y="13cm"> + <draw:custom-shape draw:style-name="Mgr20" draw:layer="backgroundobjects" svg:width="3cm" svg:height="2.34cm" svg:x="22.5cm" svg:y="13cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> - <draw:custom-shape draw:style-name="Lights_20_25" draw:layer="backgroundobjects" svg:width="2.5cm" svg:height="2.5cm" svg:x="22cm" svg:y="15cm"> + <draw:custom-shape draw:style-name="Mgr25" draw:layer="backgroundobjects" svg:width="2.5cm" svg:height="2.5cm" svg:x="22cm" svg:y="15cm"> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/> </draw:custom-shape> <presentation:notes style:page-layout-name="PM0"> diff --git a/formula/inc/bitmaps.hlst b/formula/inc/bitmaps.hlst index 259499f46f33..a99ff98f5acc 100644 --- a/formula/inc/bitmaps.hlst +++ b/formula/inc/bitmaps.hlst @@ -15,5 +15,7 @@ inline constexpr OUString BMP_STR_ERROR = u"formula/res/faperror.png"_ustr; inline constexpr OUString RID_BMP_REFBTN1 = u"formula/res/refinp1.png"_ustr; inline constexpr OUString RID_BMP_REFBTN2 = u"formula/res/refinp2.png"_ustr; inline constexpr OUString BMP_FX = u"formula/res/fx.png"_ustr; +inline constexpr OUString BMP_STAR_EMPTY = u"sc/res/icon-set-stars-empty.png"_ustr; +inline constexpr OUString BMP_STAR_FULL = u"sc/res/icon-set-stars-full.png"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/formula/inc/strings.hrc b/formula/inc/strings.hrc index 63551e6deb25..cbb59c6a8efc 100644 --- a/formula/inc/strings.hrc +++ b/formula/inc/strings.hrc @@ -29,5 +29,7 @@ #define STR_END NC_("STR_END", "~End") #define RID_STR_SHRINK NC_("RID_STR_SHRINK", "Shrink") #define RID_STR_EXPAND NC_("RID_STR_EXPAND", "Expand") +#define FAV_ENABLED NC_("FAV_ENABLED", "Add or remove function from favourites") +#define FAV_DISABLED NC_("FAV_DISABLED", "Extention functions can not be added to favourites") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 1d1b3c6c624e..2fd606b89029 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -45,11 +45,13 @@ #include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp> #include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp> #include <com/sun/star/sheet/XFormulaParser.hpp> +#include <bitmaps.hlst> #include <map> // For tab page #define TOKEN_OPEN 0 #define TOKEN_CLOSE 1 + namespace formula { @@ -117,6 +119,7 @@ public: DECL_LINK( FormulaHdl, weld::TextView&, void); DECL_LINK( FormulaCursorHdl, weld::TextView&, void ); DECL_LINK( BtnHdl, weld::Button&, void ); + DECL_LINK( FavToggleHdl, weld::Button&, void ); DECL_LINK( DblClkHdl, FuncPage&, void ); DECL_LINK( FuncSelHdl, FuncPage&, void ); DECL_LINK( StructSelHdl, StructPage&, void ); @@ -167,6 +170,8 @@ public: std::unique_ptr<weld::Label> m_xFtFuncName; std::unique_ptr<weld::Label> m_xFtFuncDesc; + std::unique_ptr<weld::Button> m_xBtnFavorites; + std::unique_ptr<weld::Label> m_xFtEditName; std::unique_ptr<weld::Label> m_xFtResult; @@ -230,6 +235,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(weld::Dialog& rDialog, , m_xFtHeadLine(rBuilder.weld_label(u"headline"_ustr)) , m_xFtFuncName(rBuilder.weld_label(u"funcname"_ustr)) , m_xFtFuncDesc(rBuilder.weld_label(u"funcdesc"_ustr)) + , m_xBtnFavorites(rBuilder.weld_button(u"favorites"_ustr)) , m_xFtEditName(rBuilder.weld_label(u"editname"_ustr)) , m_xFtResult(rBuilder.weld_label(u"label2"_ustr)) , m_xWndResult(rBuilder.weld_entry(u"result"_ustr)) @@ -287,6 +293,9 @@ FormulaDlg_Impl::FormulaDlg_Impl(weld::Dialog& rDialog, m_aOldHelp = m_rDialog.get_help_id(); // HelpId from resource always for "Page 1" + m_xBtnFavorites->connect_clicked(LINK(this, FormulaDlg_Impl, FavToggleHdl)); + m_xBtnFavorites->hide(); + m_xFtResult->set_visible( _bSupportResult ); m_xWndResult->set_visible( _bSupportResult ); @@ -863,6 +872,7 @@ void FormulaDlg_Impl::FillControls( bool &rbNext, bool &rbPrev) const bool bTestFlag = (pOldFuncDesc != m_pFuncDesc); if (bTestFlag) { + m_xBtnFavorites->hide(); m_xFtHeadLine->hide(); m_xFtFuncName->hide(); m_xFtFuncDesc->hide(); @@ -965,6 +975,7 @@ void FormulaDlg_Impl::ClearAllParas() m_xParaWinBox->hide(); m_xBtnForward->set_sensitive(true); //@new + m_xBtnFavorites->show(); m_xFtHeadLine->show(); m_xFtFuncName->show(); m_xFtFuncDesc->show(); @@ -1058,6 +1069,27 @@ IMPL_LINK(FormulaDlg_Impl, BtnHdl, weld::Button&, rBtn, void) } } +IMPL_LINK_NOARG(FormulaDlg_Impl, FavToggleHdl, weld::Button&, void) +{ + const IFunctionDescription* pDesc = m_xFuncPage->GetFuncDesc(); + if (!pDesc) + return; + + if (m_xFuncPage->IsFavourite(m_xFuncPage->GetFuncIndex())) + { + m_pHelper->insertOrEraseFavouritesListEntry(pDesc, false); + m_xBtnFavorites->set_from_icon_name(BMP_STAR_EMPTY); + } + else + { + m_pHelper->insertOrEraseFavouritesListEntry(pDesc, true); + m_xBtnFavorites->set_from_icon_name(BMP_STAR_FULL); + } + m_xFuncPage->UpdateFavouritesList(); + if (m_xFuncPage->GetCategory() == FAVOURITES_CATEGORY) + m_xFuncPage->UpdateFunctionList(u""_ustr); +} + // Functions for 1. Page // Handler for Listboxes @@ -1667,23 +1699,25 @@ IMPL_LINK_NOARG( FormulaDlg_Impl, MatrixHdl, weld::Toggleable&, void) IMPL_LINK_NOARG( FormulaDlg_Impl, FuncSelHdl, FuncPage&, void) { - if ( (m_xFuncPage->GetFunctionEntryCount() > 0) - && (m_xFuncPage->GetFunction() != -1) ) - { - const IFunctionDescription* pDesc = m_xFuncPage->GetFuncDesc(); + const IFunctionDescription* pDesc = m_xFuncPage->GetFuncDesc(); + const sal_uInt16 nFIndex = m_xFuncPage->GetFuncIndex(); + m_xBtnFavorites->set_sensitive(true); + if (pDesc) + { if (pDesc != m_pFuncDesc) m_xBtnForward->set_sensitive(true); //new - if (pDesc) - { - pDesc->initArgumentInfo(); // full argument info is needed + pDesc->initArgumentInfo(); // full argument info is needed + OUString aSig = pDesc->getSignature(); + m_xFtHeadLine->set_label( pDesc->getFunctionName() ); + m_xFtFuncName->set_label( aSig ); + m_xFtFuncDesc->set_label( pDesc->getDescription() ); - OUString aSig = pDesc->getSignature(); - m_xFtHeadLine->set_label( pDesc->getFunctionName() ); - m_xFtFuncName->set_label( aSig ); - m_xFtFuncDesc->set_label( pDesc->getDescription() ); - } + if (m_xFuncPage->IsFavourite(nFIndex)) + m_xBtnFavorites->set_from_icon_name(BMP_STAR_FULL); + else + m_xBtnFavorites->set_from_icon_name(BMP_STAR_EMPTY); } else { @@ -1691,6 +1725,12 @@ IMPL_LINK_NOARG( FormulaDlg_Impl, FuncSelHdl, FuncPage&, void) m_xFtFuncName->set_label( OUString() ); m_xFtFuncDesc->set_label( OUString() ); } + + m_xBtnFavorites->set_visible(m_xFtHeadLine->is_visible() + && m_xFtHeadLine->get_label() != u""_ustr); + m_xBtnFavorites->set_sensitive(nFIndex != 0); + m_xBtnFavorites->set_tooltip_text(nFIndex == 0 ? ForResId(FAV_DISABLED) + : ForResId(FAV_ENABLED)); } void FormulaDlg_Impl::UpdateParaWin( const Selection& _rSelection, const OUString& _sRefStr) diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 60d1e5adf2a0..315899926680 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -40,7 +40,7 @@ IMPL_LINK(FuncPage, KeyInputHdl, const KeyEvent&, rKEvt, bool) } // tdf#104487 - remember last used function category - set default to All category -sal_Int32 FuncPage::m_nRememberedFunctionCategory = 1; +sal_Int32 FuncPage::m_nRememberedFunctionCategory = ALL_CATEGORY; FuncPage::FuncPage(weld::Container* pParent, const IFunctionManager* _pFunctionManager) : m_xBuilder(Application::CreateBuilder(pParent, u"formula/ui/functionpage.ui"_ustr)) @@ -56,6 +56,7 @@ FuncPage::FuncPage(weld::Container* pParent, const IFunctionManager* _pFunctionM m_aHelpId = m_xLbFunction->get_help_id(); m_pFunctionManager->fillLastRecentlyUsedFunctions(aLRUList); + m_pFunctionManager->fillFavouriteFunctions(aFavouritesList); const sal_uInt32 nCategoryCount = m_pFunctionManager->getCount(); for (sal_uInt32 j = 0; j < nCategoryCount; ++j) @@ -100,6 +101,24 @@ weld::TreeIter* FuncPage::FillCategoriesMap(const OUString& aCategory, bool bFil return mCategories[aCategory].get(); } +bool FuncPage::IsFavourite(sal_uInt16 nFIndex) const +{ + return aFavouritesList.find(nFIndex) != aFavouritesList.end(); +} + +bool FuncPage::UpdateFavouritesList() +{ + sal_uInt16 nFIndex = GetFuncIndex(); + if (nFIndex == 0) + return false; + + if (IsFavourite(nFIndex)) + aFavouritesList.erase(nFIndex); + else + aFavouritesList.insert(nFIndex); + return true; +} + void FuncPage::impl_addFunctions(const IFunctionCategory* _pCategory, bool bFillCategories) { weld::TreeIter* pCategoryIter = FillCategoriesMap(_pCategory->getName(), bFillCategories); @@ -141,17 +160,17 @@ void FuncPage::UpdateFunctionList(const OUString& aStr) sFuncScores.clear(); const sal_Int32 nSelPos = m_xLbCategory->get_active(); - bool bCollapse = nSelPos == 1; + bool bCollapse = nSelPos == ALL_CATEGORY; bool bFilter = !aStr.isEmpty(); // tdf#104487 - remember last used function category m_nRememberedFunctionCategory = nSelPos; - if (!bFilter || nSelPos == 0) + if (!bFilter || nSelPos == LRU_CATEGORY || nSelPos == FAVOURITES_CATEGORY) { const IFunctionCategory* pCategory = weld::fromId<const IFunctionCategory*>(m_xLbCategory->get_id(nSelPos)); - if (nSelPos > 0) + if (nSelPos >= ALL_CATEGORY) { if (pCategory == nullptr) { @@ -166,7 +185,7 @@ void FuncPage::UpdateFunctionList(const OUString& aStr) impl_addFunctions(pCategory, false); } } - else // LRU-List + else if (nSelPos == LRU_CATEGORY) // LRU-List { for (auto const& elem : aLRUList) { @@ -180,6 +199,24 @@ void FuncPage::UpdateFunctionList(const OUString& aStr) } } } + else // Favourites-List + { + for (const auto& elem : aFavouritesList) + { + if (m_pFunctionManager->Get(elem)) + { + TFunctionDesc pDesc(m_pFunctionManager->Get(elem)); + if (pDesc && !pDesc->isHidden()) + { + OUString aFunction(pDesc->getFunctionName()); + OUString sId(weld::toId(pDesc)); + + m_xLbFunction->insert(nullptr, -1, &aFunction, &sId, nullptr, nullptr, + false, m_xScratchIter.get()); + } + } + } + } } else { @@ -249,11 +286,12 @@ void FuncPage::UpdateFunctionList(const OUString& aStr) IMPL_LINK_NOARG(FuncPage, SelComboBoxHdl, weld::ComboBox&, void) { - if (m_xLbCategory->get_active() == 0) + if (m_xLbCategory->get_active() == LRU_CATEGORY + || m_xLbCategory->get_active() == FAVOURITES_CATEGORY) m_xLbFunctionSearchString->set_text(u""_ustr); m_xHelpButton->set_sensitive(false); - OUString searchStr = m_xLbFunctionSearchString->get_text(); m_xLbFunction->set_help_id(m_aHelpId); + OUString searchStr = m_xLbFunctionSearchString->get_text(); UpdateFunctionList(searchStr); } @@ -290,9 +328,10 @@ IMPL_LINK_NOARG(FuncPage, DblClkHdl, weld::TreeView&, bool) IMPL_LINK_NOARG(FuncPage, ModifyHdl, weld::Entry&, void) { - if (m_xLbCategory->get_active() == 0) + if (m_xLbCategory->get_active() == LRU_CATEGORY + || m_xLbCategory->get_active() == FAVOURITES_CATEGORY) { - m_xLbCategory->set_active(1); + m_xLbCategory->set_active(ALL_CATEGORY); m_xHelpButton->set_sensitive(false); } OUString searchStr = m_xLbFunctionSearchString->get_text(); @@ -354,6 +393,11 @@ sal_Int32 FuncPage::GetFunctionEntryCount() const { return m_xLbFunction->n_chil OUString FuncPage::GetSelFunctionName() const { return m_xLbFunction->get_selected_text(); } +sal_uInt16 FuncPage::GetFuncIndex() const +{ + return m_pFunctionManager->getFunctionIndex(GetFuncDesc()); +} + const IFunctionDescription* FuncPage::GetFuncDesc() const { if (GetFunction() == -1) diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index 010bca872832..9fcd1c0b02c6 100644 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -23,6 +23,7 @@ #include <vector> #include <set> #include <unordered_map> +#include <unordered_set> namespace formula { @@ -51,6 +52,7 @@ private: const IFunctionManager* m_pFunctionManager; ::std::vector< TFunctionDesc > aLRUList; + ::std::unordered_set<sal_uInt16> aFavouritesList; ::std::unordered_map<OUString, std::unique_ptr<weld::TreeIter>> mCategories; ::std::set<std::pair<std::pair<sal_Int32, sal_Int32>, std::pair<OUString, TFunctionDesc>>> sFuncScores; @@ -70,8 +72,6 @@ private: DECL_LINK(SelHelpClickHdl, weld::Button&, void); DECL_LINK(SimilarityToggleHdl, weld::Toggleable&, void); - void UpdateFunctionList(const OUString&); - public: FuncPage(weld::Container* pContainer, const IFunctionManager* _pFunctionManager); @@ -91,6 +91,7 @@ public: sal_Int32 GetFuncPos(const IFunctionDescription* _pDesc); const IFunctionDescription* GetFuncDesc() const; OUString GetSelFunctionName() const; + sal_uInt16 GetFuncIndex() const; void SetDoubleClickHdl( const Link<FuncPage&,void>& rLink ) { aDoubleClickLink = rLink; } @@ -98,6 +99,11 @@ public: bool IsVisible() const { return m_xContainer->get_visible(); } + bool IsFavourite(sal_uInt16) const; + + bool UpdateFavouritesList(); + void UpdateFunctionList(const OUString&); + void SearchFunction(const OUString&, const OUString&, TFunctionDesc, const bool); }; diff --git a/formula/uiconfig/ui/formuladialog.ui b/formula/uiconfig/ui/formuladialog.ui index 1bb11eefe9ba..d43ec78daa6c 100644 --- a/formula/uiconfig/ui/formuladialog.ui +++ b/formula/uiconfig/ui/formuladialog.ui @@ -183,7 +183,7 @@ </object> <packing> <property name="resize">False</property> - <property name="shrink">True</property> + <property name="shrink">False</property> </packing> </child> <child> @@ -285,18 +285,55 @@ <property name="vexpand">True</property> <property name="row-spacing">12</property> <child> - <object class="GtkLabel" id="headline"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="wrap">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <property name="vexpand">False</property> + <property name="orientation">horizontal</property> + <property name="spacing">2</property> + <child> + <object class="GtkButton" id="favorites"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="tooltip-text" translatable="yes" context="formuladialog|favorites|tooltip_text">Add or remove function from favourites</property> + <property name="hexpand">False</property> + <property name="vexpand">False</property> + <property name="halign">start</property> + <property name="valign">center</property> + <property name="relief">none</property> + <property name="border-width">6</property> + <property name="focus-on-click">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="headline"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="wrap">True</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="left-attach">0</property> <property name="top-attach">0</property> </packing> diff --git a/formula/uiconfig/ui/functionpage.ui b/formula/uiconfig/ui/functionpage.ui index c48beb6918ac..c867539ce6e9 100644 --- a/formula/uiconfig/ui/functionpage.ui +++ b/formula/uiconfig/ui/functionpage.ui @@ -93,6 +93,7 @@ <property name="can-focus">False</property> <items> <item translatable="yes" context="functionpage|category">Last Used</item> + <item translatable="yes" context="functionpage|category">Favourites</item> <item translatable="yes" context="functionpage|category">All</item> </items> <child internal-child="accessible"> diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx index d1aa6804f534..0565fa78d6da 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -137,6 +137,13 @@ COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char* blockedCommandList); COMPHELPER_DLLPUBLIC void setAnyInputCallback(const std::function<bool(void*)>& pAnyInputCallback, void* pData); COMPHELPER_DLLPUBLIC bool anyInput(); + +// These allow setting callbacks, so that set/get of a LOK view is possible even in code that is +// below sfx2. +COMPHELPER_DLLPUBLIC void setViewSetter(std::function<void(int)> pViewSetter); +COMPHELPER_DLLPUBLIC void setView(int nView); +COMPHELPER_DLLPUBLIC void setViewGetter(std::function<int()> pViewGetter); +COMPHELPER_DLLPUBLIC int getView(); } #endif // INCLUDED_COMPHELPER_LOK_HXX diff --git a/include/comphelper/windowsStart.hxx b/include/comphelper/windowsStart.hxx index a727733d92a3..112a0b3250e2 100644 --- a/include/comphelper/windowsStart.hxx +++ b/include/comphelper/windowsStart.hxx @@ -15,13 +15,12 @@ /** * Launch a child process with the specified arguments. + * argv must be terminated by a null pointer, similar to execv. * @note argv[0] is ignored */ BOOL -WinLaunchChild(const wchar_t *exePath, int argc, +WinLaunchChild(const wchar_t *exePath, wchar_t **argv, HANDLE userToken = nullptr, HANDLE *hProcess = nullptr); -wchar_t* MakeCommandLine(int argc, wchar_t **argv); - #endif diff --git a/include/formula/IFunctionDescription.hxx b/include/formula/IFunctionDescription.hxx index d511089a274b..70a4ca052f35 100644 --- a/include/formula/IFunctionDescription.hxx +++ b/include/formula/IFunctionDescription.hxx @@ -22,12 +22,18 @@ #include <memory> #include <vector> +#include <unordered_set> +#include <unordered_map> #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/uno/Reference.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> +#define LRU_CATEGORY 0 +#define FAVOURITES_CATEGORY 1 +#define ALL_CATEGORY 2 + namespace com::sun::star { namespace sheet { struct FormulaToken; } namespace sheet { class XFormulaOpCodeMapper; } @@ -57,13 +63,18 @@ namespace formula eTableRefOpen, eTableRefClose }; + + virtual const IFunctionDescription* Get(sal_uInt16 nFIndex) const = 0; virtual sal_uInt32 getCount() const = 0; virtual const IFunctionCategory* getCategory(sal_uInt32 nPos) const = 0; + virtual sal_uInt16 getFunctionIndex(const IFunctionDescription* _pDesc) const = 0; virtual void fillLastRecentlyUsedFunctions(::std::vector< const IFunctionDescription*>& _rLastRUFunctions) const = 0; + virtual void fillFavouriteFunctions(::std::unordered_set<sal_uInt16>& rFavouriteFunctions) const = 0; virtual sal_Unicode getSingleToken(const EToken _eToken) const = 0; protected: + bool changeFavouriteList; ~IFunctionManager() {} }; @@ -150,6 +161,7 @@ namespace formula virtual void dispatch(bool _bOK, bool _bMatrixChecked) = 0; virtual void doClose(bool _bOk) = 0; virtual void insertEntryToLRUList(const IFunctionDescription* pDesc) = 0; + virtual void insertOrEraseFavouritesListEntry(const IFunctionDescription* pDesc, bool bInsert) = 0; virtual void showReference(const OUString& _sFormula) = 0; protected: diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index ec73f7c597f0..2f87faf82e78 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -255,6 +255,8 @@ public: static void getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view rCommand); /// Parses key-value parameters of rCommand. static std::map<OUString, OUString> parseCommandParameters(std::u16string_view rCommand); + /// Registers function pointers in comphelper/ to set/get of the current LOK view. + static void registerViewCallbacks(); private: static int createView(SfxViewFrame& rViewFrame, ViewShellDocId docId); diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 22e14c4421fe..854b480bc424 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -762,6 +762,13 @@ </constraints> <value>224 226 222 223 6</value> </prop> + <prop oor:name="FavouriteFunctions" oor:type="oor:int-list" oor:nillable="false"> + <info> + <desc>Specifies the favourite functions.</desc> + <label>Favourite Functions</label> + </info> + <value></value> + </prop> <prop oor:name="AutoInput" oor:type="xs:boolean" oor:nillable="false"> <!-- UIHints: Tools Cell Contents AutoInput --> <info> diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx index ec1fc754549b..83a358d5495d 100644 --- a/reportdesign/source/ui/dlg/Formula.cxx +++ b/reportdesign/source/ui/dlg/Formula.cxx @@ -126,6 +126,9 @@ void FormulaDialog::doClose(bool _bOk) void FormulaDialog::insertEntryToLRUList(const IFunctionDescription* /*_pDesc*/) { } +void FormulaDialog::insertOrEraseFavouritesListEntry(const IFunctionDescription* /*_pDesc*/, bool) +{ +} void FormulaDialog::showReference(const OUString& /*_sFormula*/) { } diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx index 9271d68e5a15..48d163e1a054 100644 --- a/reportdesign/source/ui/inc/Formula.hxx +++ b/reportdesign/source/ui/inc/Formula.hxx @@ -77,6 +77,7 @@ public: virtual std::unique_ptr<formula::FormulaCompiler> createCompiler( formula::FormulaTokenArray& rArray ) const override; virtual void doClose(bool _bOk) override; virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc) override; + virtual void insertOrEraseFavouritesListEntry(const formula::IFunctionDescription* pDesc, bool bInsert) override; virtual void showReference(const OUString& _sFormula) override; virtual void dispatch(bool _bOK, bool _bMatrixChecked) override; virtual void setDispatcherLock( bool bLock ) override; diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx index 2d9fbed18cbd..7288d99df6e0 100644 --- a/reportdesign/source/ui/inc/FunctionHelper.hxx +++ b/reportdesign/source/ui/inc/FunctionHelper.hxx @@ -45,9 +45,12 @@ class FunctionManager : public formula::IFunctionManager public: FunctionManager(css::uno::Reference< css::report::meta::XFunctionManager> _xMgr); virtual ~FunctionManager(); + virtual const formula::IFunctionDescription* Get(sal_uInt16 nFIndex) const override; virtual sal_uInt32 getCount() const override; virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const override; + virtual sal_uInt16 getFunctionIndex(const formula::IFunctionDescription* _pDesc) const override; virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const override; + virtual void fillFavouriteFunctions(::std::unordered_set<sal_uInt16>& rFavouriteFunctions) const override; virtual sal_Unicode getSingleToken(const EToken _eToken) const override; std::shared_ptr< FunctionDescription > get(const css::uno::Reference< css::report::meta::XFunctionDescription>& _xFunctionDescription) const; diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index ec3a2650cb33..e4ec31aad8e2 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -59,6 +59,11 @@ sal_Unicode FunctionManager::getSingleToken(const formula::IFunctionManager::ETo return 0; } +const formula::IFunctionDescription* FunctionManager::Get(sal_uInt16 /*nFIndex*/) const +{ + return nullptr; +} + sal_uInt32 FunctionManager::getCount() const { return m_xMgr->getCount(); @@ -75,10 +80,19 @@ const formula::IFunctionCategory* FunctionManager::getCategory(sal_uInt32 _nPos) return m_aCategoryIndex[_nPos]->second.get(); } +sal_uInt16 FunctionManager::getFunctionIndex(const formula::IFunctionDescription* /*_pDesc*/) const +{ + return 0; +} + void FunctionManager::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& /*_rLastRUFunctions*/) const { } +void FunctionManager::fillFavouriteFunctions(::std::unordered_set<sal_uInt16>& /*rFavouriteFunctions*/) const +{ +} + std::shared_ptr< FunctionDescription > FunctionManager::get(const uno::Reference< report::meta::XFunctionDescription>& _xFunctionDescription) const { std::shared_ptr< FunctionDescription > pDesc; diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx index d9e22c9cba78..af637c5dbdef 100644 --- a/sc/inc/appoptio.hxx +++ b/sc/inc/appoptio.hxx @@ -48,6 +48,8 @@ public: sal_uInt16* GetLRUFuncList() const { return pLRUList.get(); } void SetLRUFuncList( const sal_uInt16* pList, const sal_uInt16 nCount ); + std::unordered_set<sal_uInt16> GetFavouritesList() const { return sFavouritesList; } + void SetFavouritesList(const std::unordered_set<sal_uInt16>& rList) { sFavouritesList = rList; } void SetStatusFunc( sal_uInt32 nNew ) { nStatusFunc = nNew; } sal_uInt32 GetStatusFunc() const { return nStatusFunc; } void SetAutoComplete( bool bNew ) { bAutoComplete = bNew; } @@ -87,6 +89,7 @@ private: sal_uInt16 nLRUFuncCount; std::unique_ptr<sal_uInt16[]> pLRUList; + std::unordered_set<sal_uInt16> sFavouritesList; SvxZoomType eZoomType; sal_uInt16 nZoom; bool bSynchronizeZoom; diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx index 49b718dbd1ae..21026a401828 100644 --- a/sc/inc/funcdesc.hxx +++ b/sc/inc/funcdesc.hxx @@ -28,6 +28,7 @@ #include <rtl/ustring.hxx> #include <optional> #include <map> +#include <unordered_set> #include <memory> #define MAX_FUNCCAT 12 /* maximum number of categories for functions */ @@ -336,7 +337,7 @@ public: @return pointer to function with the index nFIndex, null if no such function was found. */ - const ScFuncDesc* Get( sal_uInt16 nFIndex ) const; + const formula::IFunctionDescription* Get( sal_uInt16 nFIndex ) const override; /** Returns the first function in category nCategory. @@ -375,6 +376,16 @@ public: virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const override; /** + Returns the index of the function. + + @param _pDesc + Pointer to function description + + @return The index of the function if not null, 0 otherwise. + */ + virtual sal_uInt16 getFunctionIndex(const formula::IFunctionDescription* _pDesc) const override; + + /** Appends the last recently used functions. Takes the last recently used functions, but maximal LRU_MAX, and appends them to the given vector _rLastRUFunctions. @@ -385,6 +396,14 @@ public: virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const override; /** + Appends favourite functions to the given vector. + + @param rFavouriteFunctions + a vector of pointer to IFunctionDescription, by reference. + */ + virtual void fillFavouriteFunctions(std::unordered_set<sal_uInt16>& rFavouriteFunctions) const override; + + /** Maps Etoken to character Used for retrieving characters for parentheses and separators. diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 3811a9334fa6..fd19d67df5d9 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -173,6 +173,7 @@ public: SC_DLLPUBLIC void SetInputOptions ( const ScInputOptions& rOpt ); void SetPrintOptions ( const ScPrintOptions& rOpt ); void InsertEntryToLRUList(sal_uInt16 nFIndex); + void InsertOrEraseFavouritesListEntry(sal_uInt16 nFIndex, bool bInsert); static void GetSpellSettings( LanguageType& rDefLang, LanguageType& rCjkLang, LanguageType& rCtlLang ); static void SetAutoSpellProperty( bool bSet ); diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 6ca1b262792c..f3eae4ea07ab 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -1081,7 +1081,7 @@ ScFunctionMgr::~ScFunctionMgr() } -const ScFuncDesc* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const +const formula::IFunctionDescription* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const { const ScFuncDesc* pDesc; for (pDesc = First(); pDesc; pDesc = Next()) @@ -1137,6 +1137,12 @@ const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32 nCategor return nullptr; } +sal_uInt16 ScFunctionMgr::getFunctionIndex(const formula::IFunctionDescription* _pDesc) const +{ + const ScFuncDesc* pDesc = dynamic_cast<const ScFuncDesc*>(_pDesc); + return pDesc ? pDesc->nFIndex : 0; +} + void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const { const ScAppOptions& rAppOpt = ScModule::get()->GetAppOptions(); @@ -1153,6 +1159,13 @@ void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula:: } } +void ScFunctionMgr::fillFavouriteFunctions(std::unordered_set<sal_uInt16>& rFavouriteFunctions) const +{ + const ScAppOptions& rAppOpt = ScModule::get()->GetAppOptions(); + rFavouriteFunctions.clear(); + rFavouriteFunctions = rAppOpt.GetFavouritesList(); +} + OUString ScFunctionMgr::GetCategoryName(sal_uInt32 _nCategoryNumber ) { if (_nCategoryNumber >= SC_FUNCGROUP_COUNT) diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 0115be53db76..e6137341094d 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -26,6 +26,7 @@ #include <miscuno.hxx> #include <vector> #include <osl/diagnose.h> +#include <comphelper/sequence.hxx> using namespace utl; using namespace com::sun::star::uno; @@ -90,6 +91,7 @@ ScAppOptions& ScAppOptions::operator=( const ScAppOptions& rCpy ) bSynchronizeZoom = rCpy.bSynchronizeZoom; nZoom = rCpy.nZoom; SetLRUFuncList( rCpy.pLRUList.get(), rCpy.nLRUFuncCount ); + SetFavouritesList(rCpy.sFavouritesList); nStatusFunc = rCpy.nStatusFunc; bAutoComplete = rCpy.bAutoComplete; bDetectiveAuto = rCpy.bDetectiveAuto; @@ -139,6 +141,11 @@ static void lcl_GetLastFunctions( Any& rDest, const ScAppOptions& rOpt ) rDest <<= Sequence<sal_Int32>(0); // empty } +static void lcl_GetFavouriteFunctions(Any& rDest, const ScAppOptions& rOpt) +{ + rDest <<= comphelper::containerToSequence<sal_Int32>(rOpt.GetFavouritesList()); +} + static void lcl_GetSortList( Any& rDest ) { const ScUserList& rUserList = ScGlobal::GetUserList(); @@ -162,8 +169,9 @@ constexpr OUStringLiteral CFGPATH_LAYOUT = u"Office.Calc/Layout"; constexpr OUStringLiteral CFGPATH_INPUT = u"Office.Calc/Input"; #define SCINPUTOPT_LASTFUNCS 0 -#define SCINPUTOPT_AUTOINPUT 1 -#define SCINPUTOPT_DET_AUTO 2 +#define SCINPUTOPT_FAVOURITEFUNCS 1 +#define SCINPUTOPT_AUTOINPUT 2 +#define SCINPUTOPT_DET_AUTO 3 constexpr OUStringLiteral CFGPATH_REVISION = u"Office.Calc/Revision/Color"; @@ -225,6 +233,7 @@ Sequence<OUString> ScAppCfg::GetLayoutPropertyNames() Sequence<OUString> ScAppCfg::GetInputPropertyNames() { return {u"LastFunctions"_ustr, // SCINPUTOPT_LASTFUNCS + u"FavouriteFunctions"_ustr, // SCINPUTOPT_FAVOURITEFUNCS u"AutoInput"_ustr, // SCINPUTOPT_AUTOINPUT u"DetectiveAuto"_ustr}; // SCINPUTOPT_DET_AUTO } @@ -363,6 +372,19 @@ void ScAppCfg::ReadInputCfg() SetLRUFuncList(pUShorts.data(), nLRUCount); } } + + if (Sequence<sal_Int32> aSeq; aValues[SCINPUTOPT_FAVOURITEFUNCS] >>= aSeq) + { + sal_Int32 nCount = aSeq.getLength(); + if (nCount < SAL_MAX_UINT16) + { + sal_uInt16 nFavouritesCount = nCount; + std::unordered_set<sal_uInt16> sFavouriteFunctions; + for (sal_uInt16 i = 0; i < nFavouritesCount; ++i) + sFavouriteFunctions.insert(aSeq[i]); + SetFavouritesList(sFavouriteFunctions); + } + } SetAutoComplete(ScUnoHelpFunctions::GetBoolFromAny(aValues[SCINPUTOPT_AUTOINPUT])); SetDetectiveAuto(ScUnoHelpFunctions::GetBoolFromAny(aValues[SCINPUTOPT_DET_AUTO])); } @@ -515,6 +537,9 @@ IMPL_LINK_NOARG(ScAppCfg, InputCommitHdl, ScLinkConfigItem&, void) case SCINPUTOPT_DET_AUTO: pValues[nProp] <<= GetDetectiveAuto(); break; + case SCINPUTOPT_FAVOURITEFUNCS: + lcl_GetFavouriteFunctions(pValues[nProp], *this); + break; } } aInputItem.PutProperties(aNames, aValues); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index e5f940bbbe34..84238486fa6b 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -785,6 +785,21 @@ void ScModule::InsertEntryToLRUList(sal_uInt16 nFIndex) SetAppOptions(aNewOpts); } +void ScModule::InsertOrEraseFavouritesListEntry(sal_uInt16 nFIndex, bool bInsert) +{ + const ScAppOptions& rAppOpt = GetAppOptions(); + std::unordered_set<sal_uInt16> sFavouriteFunctions = rAppOpt.GetFavouritesList(); + + if (bInsert) + sFavouriteFunctions.insert(nFIndex); + else + sFavouriteFunctions.erase(nFIndex); + + ScAppOptions aNewOpts(rAppOpt); + aNewOpts.SetFavouritesList(sFavouriteFunctions); + SetAppOptions(aNewOpts); +} + void ScModule::SetAppOptions( const ScAppOptions& rOpt ) { if ( !m_pAppCfg ) diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 3345e1f83f95..e46a4edd582c 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -64,6 +64,7 @@ ScFunctionWin::ScFunctionWin(weld::Widget* pParent) , pFuncDesc(nullptr) { InitLRUList(); + UpdateFavouritesList(); nArgs=0; m_aListHelpId = xFuncList->get_help_id(); @@ -141,6 +142,14 @@ void ScFunctionWin::InitLRUList() UpdateFunctionList(u""_ustr); } +void ScFunctionWin::UpdateFavouritesList() +{ + ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr(); + pFuncMgr->fillFavouriteFunctions(aFavouritesList); + + if (xCatBox->get_active() == 0) + UpdateFunctionList(u""_ustr); +} /************************************************************************* #* Member: FillCategoriesMap @@ -263,16 +272,16 @@ void ScFunctionWin::UpdateFunctionList(const OUString& rSearchString) { sal_Int32 nSelPos = xCatBox->get_active(); sal_Int32 nCategory = ( -1 != nSelPos ) - ? (nSelPos-1) : 0; + ? (nSelPos-ALL_CATEGORY) : 0; xFuncList->clear(); xFuncList->freeze(); mCategories.clear(); sFuncScores.clear(); - bool bCollapse = nCategory == 0; + bool bCollapse = nSelPos == ALL_CATEGORY; bool bFilter = !rSearchString.isEmpty(); - if ( nSelPos > 0 ) + if (nSelPos >= ALL_CATEGORY) { ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr(); @@ -314,7 +323,7 @@ void ScFunctionWin::UpdateFunctionList(const OUString& rSearchString) xScratchIter.get()); } } - else // LRU list + else if (nSelPos == LRU_CATEGORY) // LRU list { for (const formula::IFunctionDescription* pDesc : aLRUList) { @@ -328,6 +337,22 @@ void ScFunctionWin::UpdateFunctionList(const OUString& rSearchString) } } } + else // Favourites List + { + ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr(); + for (const auto& elem : aFavouritesList) + { + const formula::IFunctionDescription* pDesc(pFuncMgr->Get(elem)); + if (pDesc) + { + OUString aFunction(pDesc->getFunctionName()); + OUString aFuncDescId(weld::toId(pDesc)); + + xFuncList->insert(nullptr, -1, &aFunction, &aFuncDescId, nullptr, nullptr, false, + xScratchIter.get()); + } + } + } xFuncList->thaw(); @@ -487,9 +512,9 @@ void ScFunctionWin::DoEnter(bool bDoubleOrEnter) IMPL_LINK_NOARG(ScFunctionWin, ModifyHdl, weld::Entry&, void) { - if (xCatBox->get_active() == 0) + if (xCatBox->get_active() == LRU_CATEGORY || xCatBox->get_active() == FAVOURITES_CATEGORY) { - xCatBox->set_active(1); + xCatBox->set_active(ALL_CATEGORY); xHelpButton->set_sensitive(false); } OUString searchStr = m_xSearchString->get_text(); @@ -591,10 +616,11 @@ IMPL_LINK(ScFunctionWin, KeyInputHdl, const KeyEvent&, rEvent, bool) IMPL_LINK_NOARG(ScFunctionWin, SelComboHdl, weld::ComboBox&, void) { - if (xCatBox->get_active() == 0) + if (xCatBox->get_active() == LRU_CATEGORY || xCatBox->get_active() == FAVOURITES_CATEGORY) m_xSearchString->set_text(u""_ustr); - xHelpButton->set_sensitive(xCatBox->get_active() != 1); + xHelpButton->set_sensitive(xCatBox->get_active() != ALL_CATEGORY); OUString searchStr = m_xSearchString->get_text(); + UpdateFavouritesList(); UpdateFunctionList(searchStr); SetDescription(); } diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 9af2adbe7472..a2cd6b4e568a 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -512,6 +512,16 @@ void ScFormulaDlg::insertEntryToLRUList(const formula::IFunctionDescription* const ScFuncDesc* pDesc = dynamic_cast<const ScFuncDesc*>(_pDesc); SaveLRUEntry(pDesc); } + +void ScFormulaDlg::insertOrEraseFavouritesListEntry(const formula::IFunctionDescription* _pDesc, bool bInsert) +{ + const ScFuncDesc* pDesc = dynamic_cast<const ScFuncDesc*>(_pDesc); + if (pDesc && pDesc->nFIndex != 0) + { + ScModule::get()->InsertOrEraseFavouritesListEntry(pDesc->nFIndex, bInsert); + } +} + void ScFormulaDlg::showReference(const OUString& _sFormula) { ShowReference(_sFormula); diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx index 9c05491dac2d..e66b02270cbe 100644 --- a/sc/source/ui/inc/dwfunctr.hxx +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -63,9 +63,11 @@ private: ::std::set<std::pair<std::pair<sal_Int32, sal_Int32>, std::pair<OUString, const ScFuncDesc*>>> sFuncScores; ::std::vector< const formula::IFunctionDescription*> aLRUList; + ::std::unordered_set<sal_uInt16> aFavouritesList; ::std::unordered_map<OUString, std::unique_ptr<weld::TreeIter>> mCategories; void UpdateLRUList(); + void UpdateFavouritesList(); void DoEnter(bool bDouble_or_Enter = false); void SetDescription(); weld::TreeIter* FillCategoriesMap(const OUString&, bool); diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index 02ee866c1bc9..db6ef49f6b45 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -57,6 +57,7 @@ public: virtual std::unique_ptr<formula::FormulaCompiler> createCompiler( formula::FormulaTokenArray& rArray ) const override; virtual void doClose(bool _bOk) override; virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc) override; + virtual void insertOrEraseFavouritesListEntry(const formula::IFunctionDescription* pDesc, bool bInsert) override; virtual void showReference(const OUString& _sFormula) override; virtual void dispatch(bool _bOK, bool _bMatrixChecked) override; virtual void setDispatcherLock( bool bLock ) override; diff --git a/sc/uiconfig/scalc/ui/functionpanel.ui b/sc/uiconfig/scalc/ui/functionpanel.ui index f2bade14020e..d9c68d35f4cf 100644 --- a/sc/uiconfig/scalc/ui/functionpanel.ui +++ b/sc/uiconfig/scalc/ui/functionpanel.ui @@ -67,6 +67,7 @@ <property name="hexpand">True</property> <items> <item translatable="yes" context="functionpanel|category">Last Used</item> + <item translatable="yes" context="functionpanel|category">Favourites</item> <item translatable="yes" context="functionpanel|category">All</item> <item translatable="yes" context="functionpanel|category">Database</item> <item translatable="yes" context="functionpanel|category">Date&Time</item> diff --git a/sd/uiconfig/sdraw/popupmenu/table.xml b/sd/uiconfig/sdraw/popupmenu/table.xml index 71ae6f2bd562..7ada41804675 100644 --- a/sd/uiconfig/sdraw/popupmenu/table.xml +++ b/sd/uiconfig/sdraw/popupmenu/table.xml @@ -49,6 +49,11 @@ <menu:menuitem menu:id=".uno:FontDialog"/> <menu:menuitem menu:id=".uno:ParagraphDialog"/> <menu:menuseparator/> + <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/> + <menu:menuitem menu:id=".uno:EditHyperlink"/> + <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/> + <menu:menuitem menu:id=".uno:RemoveHyperlink"/> + <menu:menuseparator/> <menu:menu menu:id=".uno:ObjectAlign"/> <menu:menu menu:id=".uno:ArrangeMenu"> <menu:menupopup> diff --git a/sd/uiconfig/simpress/popupmenu/table.xml b/sd/uiconfig/simpress/popupmenu/table.xml index 71ae6f2bd562..7ada41804675 100644 --- a/sd/uiconfig/simpress/popupmenu/table.xml +++ b/sd/uiconfig/simpress/popupmenu/table.xml @@ -49,6 +49,11 @@ <menu:menuitem menu:id=".uno:FontDialog"/> <menu:menuitem menu:id=".uno:ParagraphDialog"/> <menu:menuseparator/> + <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/> + <menu:menuitem menu:id=".uno:EditHyperlink"/> + <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/> + <menu:menuitem menu:id=".uno:RemoveHyperlink"/> + <menu:menuseparator/> <menu:menu menu:id=".uno:ObjectAlign"/> <menu:menu menu:id=".uno:ArrangeMenu"> <menu:menupopup> diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 5eec80fba576..0ea04c16238f 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -1105,6 +1105,16 @@ void SfxLokHelper::notifyOtherViewsUpdatePerViewId(SfxViewShell const* pThisView } } +void SfxLokHelper::registerViewCallbacks() +{ + comphelper::LibreOfficeKit::setViewSetter([](int nView) { + SfxLokHelper::setView(nView); + }); + comphelper::LibreOfficeKit::setViewGetter([]() -> int { + return SfxLokHelper::getView(); + }); +} + namespace { struct LOKAsyncEventData diff --git a/shell/Library_syssh.mk b/shell/Library_syssh.mk index 72ff73842dc3..27657c4456aa 100644 --- a/shell/Library_syssh.mk +++ b/shell/Library_syssh.mk @@ -25,6 +25,10 @@ $(eval $(call gb_Library_use_system_win32_libs,syssh,\ shell32 \ )) +$(eval $(call gb_Library_use_libraries,syssh,\ + tl \ +)) + $(eval $(call gb_Library_set_componentfile,syssh,shell/source/win32/syssh,services)) $(eval $(call gb_Library_add_exception_objects,syssh,\ diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 65e2e0bfd172..79310d131e72 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -38,6 +38,7 @@ #include <o3tl/runtimetooustring.hxx> #include <o3tl/safeCoInitUninit.hxx> #include <o3tl/string_view.hxx> +#include <tools/urlobj.hxx> #include <prewin.h> #include <Shlobj.h> @@ -342,6 +343,14 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa {}, 0); } preprocessed_command = checkFile(pathname, aCommand); + } else { + // Filter out input that technically is a non-file URI, but could be interpreted by + // ShellExecuteExW as a file system pathname. + if (INetURLObject(aCommand, INetProtocol::File).GetProtocol() == INetProtocol::File) { + throw css::lang::IllegalArgumentException( + "XSystemShellExecute.execute URIS_ONLY with non-URI pathname " + aCommand, + getXWeak(), 0); + } } } diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 6ef5c8123cd7..3dc8464b6f21 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1830,7 +1830,7 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDi See sdrmasterpagedescriptor.cxx: e.g. the Notes MasterPage has no StyleSheet set (and there maybe others). */ - // This is a notes page. Try to get itemset from standart page's master. + // This is a notes page. Try to get itemset from standard page's master. if (getSdrModelFromSdrPage().GetPage(GetPageNum() - 1)) pBackgroundFill = &getSdrModelFromSdrPage().GetPage(GetPageNum() - 1)->TRG_GetMasterPage().getSdrPageProperties().GetItemSet(); else diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index ee32304f2d93..b7215921fc12 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -292,7 +292,12 @@ bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* } if( rMEvt.IsRight() && eHit != TableHitKind::NONE ) + { + OutlinerView* pOLV = mrView.GetTextEditOutlinerView(); + if( pOLV ) + pOLV->MouseButtonDown(rMEvt); return true; // right click will become context menu + } // for cell selection with the mouse remember our first hit if( mbLeftButtonDown ) diff --git a/sw/qa/extras/tiledrendering/tiledrendering2.cxx b/sw/qa/extras/tiledrendering/tiledrendering2.cxx index eedd023388ca..5464257a388c 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering2.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering2.cxx @@ -300,6 +300,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPDFExportViewSwitch) { // Given a document with 2 views: SwXTextDocument* pXTextDocument = createDoc("to-pdf.odt"); + SfxLokHelper::registerViewCallbacks(); SwDoc* pDoc = pXTextDocument->GetDocShell()->GetDoc(); SwTestViewCallback aView1; SfxLokHelper::createView(); diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index ee105beab1f0..6d4c5df1b84d 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -822,8 +822,8 @@ bool SwTransferable::WriteObject( SvStream& rOStream, xWrt->SetShowProgress(false); #if defined(DEBUGPASTE) - SvFileStream aPasteDebug(OUString( - "PASTEBUFFER.debug"), StreamMode::WRITE|StreamMode::TRUNC); + SvFileStream aPasteDebug( + u"PASTEBUFFER.debug"_ustr, StreamMode::WRITE|StreamMode::TRUNC); SwWriter aDbgWrt( aPasteDebug, *pDoc ); aDbgWrt.Write( xWrt ); #endif diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx index 0aefd50cd5ab..bb5ba7ad6278 100644 --- a/vcl/inc/qt5/QtBuilder.hxx +++ b/vcl/inc/qt5/QtBuilder.hxx @@ -95,7 +95,8 @@ private: static void deleteObject(QObject* pObject); // remove pOldWidget from the widget hierarchy and set (child widget) pNewWidget in its place static void replaceWidget(QWidget* pOldWidget, QWidget* pNewWidget); - void setProperties(QObject* obj, stringmap& rProps); + static void setProperties(QObject* obj, stringmap& rProps); + void setButtonProperties(QPushButton& rButton, stringmap& rProps); static void setLabelProperties(QLabel& rLabel, stringmap& rProps); void setScaleProperties(QSlider& rSlider, stringmap& rProps); void setSpinButtonProperties(QDoubleSpinBox& rSpinBox, stringmap& rProps); diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index f8107a4a2a00..d210dd22bb68 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -171,9 +171,11 @@ private: void DeInitGraphics(); public: - // Return HFONT, and whether the font is for vertical writing ( prefixed with '@' ) + // Returns base HFONT, an optional HFONT for non-rotated CJK glyphs, // and tmDescent value for adjusting offset in vertical writing mode. - std::tuple<HFONT,bool,sal_Int32> ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const & i_rFont, const vcl::font::PhysicalFontFace * i_pFontFace, HFONT& o_rOldFont); + std::tuple<HFONT, HFONT, sal_Int32> + ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const& i_rFont, + const vcl::font::PhysicalFontFace* i_pFontFace, HFONT& o_rOldFont); HDC getHDC() const { return mhLocalDC; } // NOTE: this doesn't transfer ownership! See class comment. diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 6e536d0a8dd8..f03547035e80 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -42,9 +42,10 @@ public: WinSalGraphics* GetGraphics() const { return m_pGraphics; } HFONT GetHFONT() const { return m_hFont; } + HFONT GetVerticalHFONT() const { return m_hVerticalFont; } + // Return true if the font is for vertical writing. - // I.e. the font name of the LOGFONT is prefixed with '@'. - bool IsCJKVerticalFont() const { return m_bIsCJKVerticalFont; } + bool IsCJKVerticalFont() const { return m_hVerticalFont != nullptr; } sal_Int32 GetTmDescent() const { return m_nTmDescent; } const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); } @@ -61,7 +62,7 @@ private: WinSalGraphics *m_pGraphics; HFONT m_hFont; - bool m_bIsCJKVerticalFont; + HFONT m_hVerticalFont = nullptr; sal_Int32 m_nTmDescent; mutable sal::systools::COMReference<IDWriteFontFace> mxDWFontFace; }; diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index 44835875cba8..8b1b4293c8ff 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -184,9 +184,10 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: } else if (sName == u"GtkButton") { + QPushButton* pButton = nullptr; if (QDialogButtonBox* pButtonBox = qobject_cast<QDialogButtonBox*>(pParentWidget)) { - pObject = pButtonBox->addButton("", QDialogButtonBox::NoRole); + pButton = pButtonBox->addButton("", QDialogButtonBox::NoRole); // for message boxes, avoid implicit standard buttons in addition to those explicitly added if (QMessageBox* pMessageBox = qobject_cast<QMessageBox*>(pParentWidget->window())) @@ -194,14 +195,17 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: } else { - pObject = new QPushButton(pParentWidget); + pButton = new QPushButton(pParentWidget); } + + setButtonProperties(*pButton, rMap); + pObject = pButton; } else if (sName == u"GtkCheckButton") { pObject = new QCheckBox(pParentWidget); } - else if (sName == u"GtkComboBoxText") + else if (sName == u"GtkComboBox" || sName == u"GtkComboBoxText") { QComboBox* pComboBox = new QComboBox(pParentWidget); pComboBox->setEditable(extractEntry(rMap)); @@ -801,28 +805,29 @@ void QtBuilder::setProperties(QObject* pObject, stringmap& rProps) pTextEdit->setTabChangesFocus(!toBool(rValue)); } } - else if (QPushButton* pButton = qobject_cast<QPushButton*>(pObject)) +} + +void QtBuilder::setButtonProperties(QPushButton& rButton, stringmap& rProps) +{ + for (auto const & [ rKey, rValue ] : rProps) { - for (auto const & [ rKey, rValue ] : rProps) + if (rKey == u"image") { - if (rKey == u"image") - { - QLabel* pImageLabel = get<QLabel>(rValue); - assert(pImageLabel && "Button has non-existent image set"); + QLabel* pImageLabel = get<QLabel>(rValue); + assert(pImageLabel && "Button has non-existent image set"); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - pButton->setIcon(QIcon(pImageLabel->pixmap())); + rButton.setIcon(QIcon(pImageLabel->pixmap())); #else - pButton->setIcon(QIcon(pImageLabel->pixmap(Qt::ReturnByValue))); + rButton.setIcon(QIcon(pImageLabel->pixmap(Qt::ReturnByValue))); #endif - // parentless GtkImage in .ui file is only used for setting button - // image, so the object is no longer needed after doing so - if (!pImageLabel->parent()) - deleteObject(pImageLabel); - } - else if (rKey == u"label") - { - pButton->setText(convertAccelerator(rValue)); - } + // parentless GtkImage in .ui file is only used for setting button + // image, so the object is no longer needed after doing so + if (!pImageLabel->parent()) + deleteObject(pImageLabel); + } + else if (rKey == u"label") + { + rButton.setText(convertAccelerator(rValue)); } } } diff --git a/vcl/qt5/QtInstanceComboBox.cxx b/vcl/qt5/QtInstanceComboBox.cxx index b573edad0126..087073c3558d 100644 --- a/vcl/qt5/QtInstanceComboBox.cxx +++ b/vcl/qt5/QtInstanceComboBox.cxx @@ -33,9 +33,6 @@ QtInstanceComboBox::QtInstanceComboBox(QComboBox* pComboBox) void QtInstanceComboBox::insert(int nPos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) { - if (pIconName || pImageSurface) - assert(false && "Handling for these not implemented yet"); - SolarMutexGuard g; GetQtInstance().RunInMainThread([&] { QVariant aUserData; @@ -43,6 +40,12 @@ void QtInstanceComboBox::insert(int nPos, const OUString& rStr, const OUString* aUserData = QVariant::fromValue(toQString(*pId)); m_pComboBox->insertItem(nPos, toQString(rStr), aUserData); + + if (pIconName) + m_pComboBox->setItemIcon(nPos, loadQPixmapIcon(*pIconName)); + else if (pImageSurface) + m_pComboBox->setItemIcon(nPos, toQPixmap(*pImageSurface)); + if (m_bSorted) sortItems(); }); diff --git a/vcl/qt5/QtInstanceDrawingArea.cxx b/vcl/qt5/QtInstanceDrawingArea.cxx index 9a6368d35024..a68d2b906d53 100644 --- a/vcl/qt5/QtInstanceDrawingArea.cxx +++ b/vcl/qt5/QtInstanceDrawingArea.cxx @@ -10,6 +10,8 @@ #include <QtInstanceDrawingArea.hxx> #include <QtInstanceDrawingArea.moc> +#include <QtData.hxx> + #include <vcl/qt/QtUtils.hxx> QtInstanceDrawingArea::QtInstanceDrawingArea(QLabel* pLabel) @@ -39,7 +41,12 @@ void QtInstanceDrawingArea::enable_drag_source(rtl::Reference<TransferDataContai assert(false && "Not implemented yet"); } -void QtInstanceDrawingArea::set_cursor(PointerStyle) { assert(false && "Not implemented yet"); } +void QtInstanceDrawingArea::set_cursor(PointerStyle ePointerStyle) +{ + SolarMutexGuard g; + GetQtInstance().RunInMainThread( + [&] { getQWidget()->setCursor(GetQtData()->getCursor(ePointerStyle)); }); +} Point QtInstanceDrawingArea::get_pointer_position() const { diff --git a/vcl/qt5/QtTransferable.cxx b/vcl/qt5/QtTransferable.cxx index 266e9b49c341..099ce3645c84 100644 --- a/vcl/qt5/QtTransferable.cxx +++ b/vcl/qt5/QtTransferable.cxx @@ -273,6 +273,21 @@ QStringList QtMimeData::formats() const if (!m_aMimeTypeList.isEmpty()) return m_aMimeTypeList; + // For the Qt6 Wasm backend, as a hack report only a single format for now: "text/plain" if + // aFormats contains any "text/plain" entries, or else (randomly) the first entry (if any) of + // aFormats. This is for two reasons: For one, + // <https://github.com/qt/qtbase/commit/f0be152896471aa392bb1b2b649b66feb31480cc> "wasm: improve + // clipboard support" has a commented-out "break;" ("Clipboard write is only supported with one + // ClipboardItem at the moment but somehow this still works?") in the loop in + // QWasmClipboard::writeToClipboardApi, and multiple formats would make that not work and would + // indeed cause a NotAllowedError ("Failed to execute 'write' on 'Clipboard': Support for + // multiple ClipboardItems is not implemented.") at least with Chrome 131. And for another, + // <https://github.com/qt/qtbase/commit/f0be152896471aa392bb1b2b649b66feb31480cc> "wasm: improve + // clipboard support" also has code to "prefer html over text" in + // QWasmClipboard::writeToClipboardApi, so if we reported both "text/plain" and "text/html", + // that code would pick "text/html", but the HTML provided by LO apparently always contains a + // trailing "</p>", so would always add a newline when pasted. + const css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = m_aContents->getTransferDataFlavors(); QStringList aList; @@ -280,20 +295,32 @@ QStringList QtMimeData::formats() const for (const auto& rFlavor : aFormats) { +#if !(QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && defined EMSCRIPTEN) aList << toQString(rFlavor.MimeType); +#endif lcl_textMimeInfo(rFlavor.MimeType, m_bHaveNoCharset, bHaveUTF16, m_bHaveUTF8); } // we provide a locale encoded and a UTF-8 variant, if missing if (m_bHaveNoCharset || bHaveUTF16 || m_bHaveUTF8) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && defined EMSCRIPTEN + aList << QStringLiteral("text/plain"); +#else // if there is a text representation from LO point of view, it'll be UTF-16 assert(bHaveUTF16); if (!m_bHaveUTF8) aList << QStringLiteral("text/plain;charset=utf-8"); if (!m_bHaveNoCharset) aList << QStringLiteral("text/plain"); +#endif } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && defined EMSCRIPTEN + else if (aFormats.hasElements()) + { + aList << toQString(aFormats[0].MimeType); + } +#endif m_aMimeTypeList = aList; return m_aMimeTypeList; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 06a21d733177..8de62eb4c5d1 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -401,7 +401,22 @@ bool Application::Reschedule( bool i_bAllEvents ) SAL_WARN("vcl.schedule", "Application::Reschedule(" << i_bAllEvents << ")"); return false; } - return ImplYield(false, i_bAllEvents); + int nOldView = -1; + if (comphelper::LibreOfficeKit::isActive()) + { + nOldView = comphelper::LibreOfficeKit::getView(); + } + bool bRet = ImplYield(false, i_bAllEvents); + if (comphelper::LibreOfficeKit::isActive()) + { + int nNewView = comphelper::LibreOfficeKit::getView(); + if (nOldView != -1 && nNewView != -1 && nOldView != nNewView) + { + // Yield changed the current view, restore the old value. + comphelper::LibreOfficeKit::setView(nOldView); + } + } + return bRet; } bool Application::IsUseSystemEventLoop() diff --git a/vcl/source/bitmap/BlendFrameCache.cxx b/vcl/source/bitmap/BlendFrameCache.cxx index 190dbf3d9e44..f233591f0abe 100644 --- a/vcl/source/bitmap/BlendFrameCache.cxx +++ b/vcl/source/bitmap/BlendFrameCache.cxx @@ -37,100 +37,100 @@ BlendFrameCache::BlendFrameCache(Size const& rSize, sal_uInt8 nAlpha, Color cons const tools::Long nW(rSize.Width()); const tools::Long nH(rSize.Height()); - if (nW > 1 && nH > 1) + if (nW <= 1 || nH <= 1) + return; + + sal_uInt8 aEraseTrans(0xff); + Bitmap aContent(rSize, vcl::PixelFormat::N24_BPP); + AlphaMask aAlpha(rSize, &aEraseTrans); + + aContent.Erase(COL_BLACK); + + BitmapScopedWriteAccess pContent(aContent); + BitmapScopedWriteAccess pAlpha(aAlpha); + + if (!pContent || !pAlpha) + return; + + tools::Long x(0); + tools::Long y(0); + Scanline pScanContent = pContent->GetScanline(0); + Scanline pScanAlpha = pContent->GetScanline(0); + + // x == 0, y == 0, top-left corner + pContent->SetPixelOnData(pScanContent, 0, rColorTopLeft); + pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); + + // y == 0, top line left to right + for (x = 1; x < nW - 1; x++) + { + Color aMix(rColorTopLeft); + + aMix.Merge(rColorTopRight, 255 - sal_uInt8((x * 255) / nW)); + pContent->SetPixelOnData(pScanContent, x, aMix); + pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); + } + + // x == nW - 1, y == 0, top-right corner + // #i123690# Caution! When nW is 1, x == nW is possible (!) + if (x < nW) + { + pContent->SetPixelOnData(pScanContent, x, rColorTopRight); + pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); + } + + // x == 0 and nW - 1, left and right line top-down + for (y = 1; y < nH - 1; y++) { - sal_uInt8 aEraseTrans(0xff); - Bitmap aContent(rSize, vcl::PixelFormat::N24_BPP); - AlphaMask aAlpha(rSize, &aEraseTrans); + pScanContent = pContent->GetScanline(y); + pScanAlpha = pContent->GetScanline(y); + Color aMixA(rColorTopLeft); + + aMixA.Merge(rColorBottomLeft, 255 - sal_uInt8((y * 255) / nH)); + pContent->SetPixelOnData(pScanContent, 0, aMixA); + pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); - aContent.Erase(COL_BLACK); + // #i123690# Caution! When nW is 1, x == nW is possible (!) + if (x < nW) + { + Color aMixB(rColorTopRight); - BitmapScopedWriteAccess pContent(aContent); - BitmapScopedWriteAccess pAlpha(aAlpha); + aMixB.Merge(rColorBottomRight, 255 - sal_uInt8((y * 255) / nH)); + pContent->SetPixelOnData(pScanContent, x, aMixB); + pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); + } + } + + // #i123690# Caution! When nH is 1, y == nH is possible (!) + if (y < nH) + { + // x == 0, y == nH - 1, bottom-left corner + pContent->SetPixelOnData(pScanContent, 0, rColorBottomLeft); + pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); - if (pContent && pAlpha) + // y == nH - 1, bottom line left to right + for (x = 1; x < nW - 1; x++) { - tools::Long x(0); - tools::Long y(0); - Scanline pScanContent = pContent->GetScanline(0); - Scanline pScanAlpha = pContent->GetScanline(0); - - // x == 0, y == 0, top-left corner - pContent->SetPixelOnData(pScanContent, 0, rColorTopLeft); - pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); - - // y == 0, top line left to right - for (x = 1; x < nW - 1; x++) - { - Color aMix(rColorTopLeft); - - aMix.Merge(rColorTopRight, 255 - sal_uInt8((x * 255) / nW)); - pContent->SetPixelOnData(pScanContent, x, aMix); - pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); - } - - // x == nW - 1, y == 0, top-right corner - // #i123690# Caution! When nW is 1, x == nW is possible (!) - if (x < nW) - { - pContent->SetPixelOnData(pScanContent, x, rColorTopRight); - pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); - } - - // x == 0 and nW - 1, left and right line top-down - for (y = 1; y < nH - 1; y++) - { - pScanContent = pContent->GetScanline(y); - pScanAlpha = pContent->GetScanline(y); - Color aMixA(rColorTopLeft); - - aMixA.Merge(rColorBottomLeft, 255 - sal_uInt8((y * 255) / nH)); - pContent->SetPixelOnData(pScanContent, 0, aMixA); - pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); - - // #i123690# Caution! When nW is 1, x == nW is possible (!) - if (x < nW) - { - Color aMixB(rColorTopRight); - - aMixB.Merge(rColorBottomRight, 255 - sal_uInt8((y * 255) / nH)); - pContent->SetPixelOnData(pScanContent, x, aMixB); - pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); - } - } - - // #i123690# Caution! When nH is 1, y == nH is possible (!) - if (y < nH) - { - // x == 0, y == nH - 1, bottom-left corner - pContent->SetPixelOnData(pScanContent, 0, rColorBottomLeft); - pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); - - // y == nH - 1, bottom line left to right - for (x = 1; x < nW - 1; x++) - { - Color aMix(rColorBottomLeft); - - aMix.Merge(rColorBottomRight, 255 - sal_uInt8(((x - 0) * 255) / nW)); - pContent->SetPixelOnData(pScanContent, x, aMix); - pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); - } - - // x == nW - 1, y == nH - 1, bottom-right corner - // #i123690# Caution! When nW is 1, x == nW is possible (!) - if (x < nW) - { - pContent->SetPixelOnData(pScanContent, x, rColorBottomRight); - pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); - } - } - - pContent.reset(); - pAlpha.reset(); - - m_aLastResult = BitmapEx(aContent, aAlpha); + Color aMix(rColorBottomLeft); + + aMix.Merge(rColorBottomRight, 255 - sal_uInt8(((x - 0) * 255) / nW)); + pContent->SetPixelOnData(pScanContent, x, aMix); + pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); + } + + // x == nW - 1, y == nH - 1, bottom-right corner + // #i123690# Caution! When nW is 1, x == nW is possible (!) + if (x < nW) + { + pContent->SetPixelOnData(pScanContent, x, rColorBottomRight); + pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); } } + + pContent.reset(); + pAlpha.reset(); + + m_aLastResult = BitmapEx(aContent, aAlpha); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/win/dtrans/WinClipboard.cxx b/vcl/win/dtrans/WinClipboard.cxx index 6fb07aaa6bb4..0cc55a23b6f0 100644 --- a/vcl/win/dtrans/WinClipboard.cxx +++ b/vcl/win/dtrans/WinClipboard.cxx @@ -328,12 +328,13 @@ void CWinClipboard::handleClipboardContentChanged() rXTransf); maClipboardListeners.notifyEach( aGuard, &datatransfer::clipboard::XClipboardListener::changedContents, aClipbEvent); + aGuard.unlock(); // for XTransferable dtor, that may delegate to another thread } catch (const lang::DisposedException&) { OSL_FAIL("Service Manager disposed"); - - aGuard.unlock(); + if (aGuard.owns_lock()) + aGuard.unlock(); // no further clipboard changed notifications unregisterClipboardViewer(); } diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 28a6dcf4dba5..06a90a361f18 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -719,36 +719,15 @@ void ImplGetLogFontFromFontSelect( const vcl::font::FontSelectPattern& rFont, rLogFont.lfQuality = bAntiAliased ? ANTIALIASED_QUALITY : NONANTIALIASED_QUALITY; } -std::tuple<HFONT,bool,sal_Int32> WinSalGraphics::ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const & i_rFont, - const vcl::font::PhysicalFontFace * i_pFontFace, - HFONT& o_rOldFont) +std::tuple<HFONT, HFONT, sal_Int32> +WinSalGraphics::ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const& i_rFont, + const vcl::font::PhysicalFontFace* i_pFontFace, HFONT& o_rOldFont) { HFONT hNewFont = nullptr; LOGFONTW aLogFont; ImplGetLogFontFromFontSelect( i_rFont, i_pFontFace, aLogFont, getAntiAlias()); - bool bIsCJKVerticalFont = false; - // select vertical mode for printing if requested and available - if ( i_rFont.mbVertical && mbPrinter ) - { - constexpr size_t nLen = sizeof(aLogFont.lfFaceName) - sizeof(aLogFont.lfFaceName[0]); - // vertical fonts start with an '@' - memmove( &aLogFont.lfFaceName[1], &aLogFont.lfFaceName[0], nLen ); - aLogFont.lfFaceName[0] = '@'; - aLogFont.lfFaceName[LF_FACESIZE - 1] = 0; - - // check availability of vertical mode for this font - EnumFontFamiliesExW( getHDC(), &aLogFont, SalEnumQueryFontProcExW, - reinterpret_cast<LPARAM>(&bIsCJKVerticalFont), 0 ); - if( !bIsCJKVerticalFont ) - { - // restore non-vertical name if not vertical mode isn't available - memcpy( &aLogFont.lfFaceName[0], &aLogFont.lfFaceName[1], nLen ); - aLogFont.lfFaceName[LF_FACESIZE - 1] = 0; - } - } - hNewFont = ::CreateFontIndirectW( &aLogFont ); o_rOldFont = ::SelectFont(hDC, hNewFont); @@ -763,10 +742,19 @@ std::tuple<HFONT,bool,sal_Int32> WinSalGraphics::ImplDoSetFont(HDC hDC, vcl::fon SelectFont(hDC, hNewFont2); DeleteFont( hNewFont ); hNewFont = hNewFont2; - bIsCJKVerticalFont = false; } - return std::make_tuple(hNewFont, bIsCJKVerticalFont, static_cast<sal_Int32>(aTextMetricW.tmDescent)); + // Optionally create a secondary font for non-rotated CJK glyphs in vertical context + HFONT hNewVerticalFont = nullptr; + if (i_rFont.mbVertical && mbPrinter) + { + aLogFont.lfEscapement = 0; + aLogFont.lfOrientation = 0; + hNewVerticalFont = ::CreateFontIndirectW(&aLogFont); + } + + return std::make_tuple(hNewFont, hNewVerticalFont, + static_cast<sal_Int32>(aTextMetricW.tmDescent)); } void WinSalGraphics::SetFont(LogicalFontInstance* pFont, int nFallbackLevel) diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 83c3a653b1ae..6f5538140a2e 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -88,36 +88,27 @@ bool ExTextOutRenderer::operator()(GenericSalLayout const& rLayout, SalGraphics& basegfx::B2DPoint aPos; const GlyphItem* pGlyph; const WinFontInstance* pWinFont = static_cast<const WinFontInstance*>(&rLayout.GetFont()); - UINT nTextAlign = GetTextAlign(hDC); - UINT nCurTextAlign = nTextAlign; - sal_Int32 nGlyphOffset = -pWinFont->GetTmDescent(); - while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) - { - wchar_t glyphWStr = pGlyph->glyphId(); - UINT32 nNewTextAlign = nCurTextAlign; - sal_Int32 nYOffset = 0; - - if (pWinFont->IsCJKVerticalFont() && pGlyph->IsVertical()) + bool bVertFontSelected = false; + auto fnUseVertFont = [&](bool bValue) { + if (bVertFontSelected != bValue) { - nNewTextAlign = VTA_CENTER | TA_BOTTOM; - nYOffset = nGlyphOffset; + bVertFontSelected = bValue; + SelectFont(hDC, + bVertFontSelected ? pWinFont->GetVerticalHFONT() : pWinFont->GetHFONT()); } - else - nNewTextAlign = nTextAlign; + }; - if (nCurTextAlign != nNewTextAlign) - SetTextAlign(hDC, nNewTextAlign); + while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) + { + wchar_t glyphWStr = pGlyph->glyphId(); - ExtTextOutW(hDC, aPos.getX(), aPos.getY() + nYOffset, ETO_GLYPH_INDEX, nullptr, &glyphWStr, - 1, nullptr); + fnUseVertFont(pWinFont->IsCJKVerticalFont() && pGlyph->IsVertical()); - nCurTextAlign = nNewTextAlign; + ExtTextOutW(hDC, aPos.getX(), aPos.getY(), ETO_GLYPH_INDEX, nullptr, &glyphWStr, 1, + nullptr); } - if (nCurTextAlign != nTextAlign) - SetTextAlign(hDC, nTextAlign); - return true; } @@ -137,7 +128,7 @@ WinFontInstance::WinFontInstance(const WinFontFace& rPFF, const vcl::font::FontS : LogicalFontInstance(rPFF, rFSP) , m_pGraphics(nullptr) , m_hFont(nullptr) - , m_bIsCJKVerticalFont(false) + , m_hVerticalFont(nullptr) , m_nTmDescent(0) { } @@ -146,6 +137,11 @@ WinFontInstance::~WinFontInstance() { if (m_hFont) ::DeleteFont(m_hFont); + + if (m_hVerticalFont) + { + ::DeleteFont(m_hVerticalFont); + } } float WinFontInstance::getHScale() const @@ -191,7 +187,7 @@ void WinFontInstance::SetGraphics(WinSalGraphics* pGraphics) return; HFONT hOrigFont; HDC hDC = m_pGraphics->getHDC(); - std::tie(m_hFont, m_bIsCJKVerticalFont, m_nTmDescent) + std::tie(m_hFont, m_hVerticalFont, m_nTmDescent) = m_pGraphics->ImplDoSetFont(hDC, GetFontSelectPattern(), GetFontFace(), hOrigFont); SelectObject(hDC, hOrigFont); } diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing2.mk b/xmlsecurity/CppunitTest_xmlsecurity_signing2.mk index 0cd450121979..a396a4e2ce23 100644 --- a/xmlsecurity/CppunitTest_xmlsecurity_signing2.mk +++ b/xmlsecurity/CppunitTest_xmlsecurity_signing2.mk @@ -42,6 +42,7 @@ ifneq ($(OS),WNT) ifneq (,$(ENABLE_NSS)) $(eval $(call gb_CppunitTest_use_externals,xmlsecurity_signing2,\ nssutil3 \ + nss3 \ )) endif endif |