core.git: desktop/source static/emscripten static/README.wasm.md unotest/source
desktop/source/app/appinit.cxx |2 + static/README.wasm.md | 49 static/emscripten/uno.js| 11 +++ unotest/source/embindtest/embindtest.js |3 - 4 files changed, 35 insertions(+), 30 deletions(-) New commits: commit 91bedcab61424cdfb2f3ba9e48481406fe141ceb Author: Stephan Bergmann AuthorDate: Thu Jul 18 11:44:45 2024 +0200 Commit: Stephan Bergmann CommitDate: Thu Jul 18 15:55:12 2024 +0200 Change from Module.intiUno() to Module.uno_init promise ...that is resolved from within C++ Desktop::InitApplicationServiceManager once UNO is fully initialized, so client code can trigger on Module.uno_init.then(...) Change-Id: I2d4c542d9729d09f434502e3f966e9ee474e926c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170683 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 633ebde2d967..f2b7edba1c8e 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -45,6 +45,7 @@ #include #if defined EMSCRIPTEN +#include #include #endif @@ -86,6 +87,7 @@ void Desktop::InitApplicationServiceManager() comphelper::setProcessServiceFactory(sm); #if defined EMSCRIPTEN init_unoembind_uno(); +EM_ASM(Module.uno_init$resolve();); #endif } diff --git a/static/README.wasm.md b/static/README.wasm.md index 7d69716e7173..523658868e58 100644 --- a/static/README.wasm.md +++ b/static/README.wasm.md @@ -210,33 +210,36 @@ improvement! ;) Some usage examples through javascript of the current implementation: ```js // inserts a string at the start of the Writer document. -Module.initUno(); -const css = Module.uno.com.sun.star; -const xModel = Module.getCurrentModelFromViewSh(); -const xTextDocument = css.text.XTextDocument.query(xModel); -const xText = xTextDocument.getText(); -const xTextCursor = xText.createTextCursor(); -xTextCursor.setString("string here!"); +Module.uno_init.then(function() { +const css = Module.uno.com.sun.star; +const xModel = Module.getCurrentModelFromViewSh(); +const xTextDocument = css.text.XTextDocument.query(xModel); +const xText = xTextDocument.getText(); +const xTextCursor = xText.createTextCursor(); +xTextCursor.setString("string here!"); +}); ``` ```js // changes each paragraph of the Writer document to a random color. -Module.initUno(); -const css = Module.uno.com.sun.star; -const xModel = Module.getCurrentModelFromViewSh(); -const xTextDocument = css.text.XTextDocument.query(xModel); -const xText = xTextDocument.getText(); -const xEnumAccess = css.container.XEnumerationAccess.query(xText); -const xParaEnumeration = xEnumAccess.createEnumeration(); -while (xParaEnumeration.hasMoreElements()) { -const next = xParaEnumeration.nextElement(); -const xParagraph = css.text.XTextRange.query(next.get()); -const xParaProps = css.beans.XPropertySet.query(xParagraph); -const color = new Module.uno_Any(Module.uno_Type.Long(), Math.floor(Math.random() * 0xFF)); -xParaProps.setPropertyValue("CharColor", color); -next.delete(); -color.delete(); -} +Module.uno_init.then(function() { +const css = Module.uno.com.sun.star; +const xModel = Module.getCurrentModelFromViewSh(); +const xTextDocument = css.text.XTextDocument.query(xModel); +const xText = xTextDocument.getText(); +const xEnumAccess = css.container.XEnumerationAccess.query(xText); +const xParaEnumeration = xEnumAccess.createEnumeration(); +while (xParaEnumeration.hasMoreElements()) { +const next = xParaEnumeration.nextElement(); +const xParagraph = css.text.XTextRange.query(next.get()); +const xParaProps = css.beans.XPropertySet.query(xParagraph); +const color = new Module.uno_Any( +Module.uno_Type.Long(), Math.floor(Math.random() * 0xFF)); +xParaProps.setPropertyValue("CharColor", color); +next.delete(); +color.delete(); +} +}); ``` diff --git a/static/emscripten/uno.js b/static/emscripten/uno.js index 6a9c4cd5cb6e..7d051a24a84b 100644 --- a/static/emscripten/uno.js +++ b/static/emscripten/uno.js @@ -11,11 +11,13 @@ Module.unoTagSymbol = Symbol('unoTag'); -Module.initUno = function() { -if (Module.uno === undefined) { +Module.uno_init = new Promise(function (resolve, reject) { +Module.uno_init$resolve = function() { Module.uno = init_unoembind_uno(Module, Module.unoTagSymbol); -} -}; +resolve(); +}; +Module.uno_init$reject = reject; +}); Module.catchUnoException = function(exception) { // Rethrow non-C++ exceptions (non-UNO C++ exceptions are mapped to css.uno.RuntimeException in @@ -30,7 +32,6 @@ Module.catchUnoException = function(exception) { } Module.unoObject = function(interfaces, obj) { -Module.initUno(); interfaces =
core.git: desktop/source
desktop/source/lib/init.cxx |8 1 file changed, 8 insertions(+) New commits: commit 7635a5eefdca16d40c4d78cfe9e102cacec96977 Author: Michael Meeks AuthorDate: Mon May 20 14:03:51 2024 +0100 Commit: Miklos Vajna CommitDate: Thu Jul 18 13:51:19 2024 +0200 lok: joinThreads - take down configmgr's write-thread. Change-Id: I1f9b6b88ef7e97da02fecf2035f953584cd28c16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170674 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 48b771c9f7f3..7d4b9d5041f6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -106,6 +106,8 @@ #include #include #include +#include +#include #include #include #include @@ -3441,6 +3443,12 @@ static int lo_joinThreads(LibreOfficeKit* /* pThis */) if (joinable && !joinable->joinThreads()) return 0; +// Ensure configmgr's write thread is down +css::uno::Reference< css::util::XFlushable >( +css::configuration::theDefaultProvider::get( +comphelper::getProcessComponentContext()), +css::uno::UNO_QUERY_THROW)->flush(); + return 1; }
core.git: desktop/source include/systools sal/cppunittester
desktop/source/app/sofficemain.cxx | 10 ++ include/systools/win32/test_desktop.hxx | 31 +++ sal/cppunittester/cppunittester.cxx |8 ++-- 3 files changed, 43 insertions(+), 6 deletions(-) New commits: commit 69586e8381037417d106d8474d9f73638c5b9c55 Author: Mike Kaganski AuthorDate: Wed Jul 17 14:45:22 2024 +0500 Commit: Mike Kaganski CommitDate: Wed Jul 17 18:13:19 2024 +0200 UI tests: use a dedicated desktop on Windows Similar to commit 1f24d35033c2f02335ce254bbcf6ba89e1b7565e (cppunittester: use a dedicated desktop on Windows, 2023-07-09), this change allows to run UI tests on Windows without them interferring with what you are doing. The code testing LIBO_TEST_DEFAULT_DESKTOP environment variable to avoid the separate desktop, and creating it, is extracted to a new function in systools. Change-Id: I6df3cb4ae581ae289e49b47d3135d01f632fbd95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170615 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 33881784d45c..7e38ac2b2807 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -29,6 +29,10 @@ // needed before sal/main.h to avoid redefinition of macros #include +#if defined _WIN32 +#include +#endif + #include #include #include @@ -51,6 +55,12 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() { +#if defined _WIN32 +// If this is a UI test, we may need to switch to a dedicated desktop +if (getenv("LO_RUNNING_UI_TEST") != nullptr) +sal::systools::maybeCreateTestDesktop(); +#endif + sal_detail_initialize(sal::detail::InitializeSoffice, nullptr); #if HAVE_FEATURE_BREAKPAD diff --git a/include/systools/win32/test_desktop.hxx b/include/systools/win32/test_desktop.hxx new file mode 100644 index ..fdd8640deb28 --- /dev/null +++ b/include/systools/win32/test_desktop.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +namespace sal::systools +{ +// Create a desktop, to avoid popups interferring with active user session, because we don't use svp +// vcl plugin on Windows for unit testing. Set LIBO_TEST_DEFAULT_DESKTOP environment variable to any +// value when running the unit test process, to avoid use of a separate desktop. +void maybeCreateTestDesktop() +{ +if (getenv("LIBO_TEST_DEFAULT_DESKTOP") == nullptr) +{ +if (HDESK hDesktop += CreateDesktopW(L"LIBO_TEST_DESKTOP", nullptr, nullptr, 0, GENERIC_ALL, nullptr)) +SetThreadDesktop(hDesktop); +} +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index 854c0999c911..610f8a8155ef 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -22,6 +22,7 @@ # define WIN32_LEAN_AND_MEAN #endif #include +#include #endif #if defined(_WIN32) && defined(_DEBUG) #include @@ -401,12 +402,7 @@ static bool main2() #endif // Create a desktop, to avoid popups interfering with active user session, // because on Windows, we don't use svp vcl plugin for unit testing -if (getenv("CPPUNIT_DEFAULT_DESKTOP") == nullptr) -{ -if (HDESK hDesktop -= CreateDesktopW(L"LO_CPPUNIT_DESKTOP", nullptr, nullptr, 0, GENERIC_ALL, nullptr)) -SetThreadDesktop(hDesktop); -} +sal::systools::maybeCreateTestDesktop(); #endif std::vector protectors;
core.git: desktop/source include/LibreOfficeKit sw/inc sw/source
desktop/source/lib/init.cxx | 17 ++- include/LibreOfficeKit/LibreOfficeKit.h |3 include/LibreOfficeKit/LibreOfficeKit.hxx|4 sw/inc/unoprnms.hxx |1 sw/source/core/unocore/unocontentcontrol.cxx | 13 +++ sw/source/uibase/shells/textsh1.cxx | 116 --- sw/source/uibase/uno/loktxdoc.cxx| 82 +++ sw/source/uibase/wrtsh/wrtsh1.cxx| 22 + 8 files changed, 221 insertions(+), 37 deletions(-) New commits: commit 84d63cfccf7af8f2b3b689ab0e622f8b408eb470 Author: Attila Szűcs AuthorDate: Thu Jul 11 11:24:28 2024 +0200 Commit: Miklos Vajna CommitDate: Wed Jul 17 10:52:38 2024 +0200 Sw: extract/transform document structure 2 inserting a ContentControl, now generate a unique ID for it... search the lowest possible non used (non negative) number added a GetType() function for SwXContentControl that get it from SwContentControl, and used it for extract and transform. Added some support for all other types.. some are not really usable yet. Fixed a problem when setting checkbox check, did not changed its content. If content is set to “”. It now set as placeholder, and reset its content to the initial placeholder value, like: “Choose an item” or “Click here to enter text” (work for checkbox, and picture CntentControl.) Change-Id: I0fc696f73734bdfb9ac5b8fdc6891168b8d4ed5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170600 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2769c47bf9b0..48b771c9f7f3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2588,7 +2588,8 @@ static void lo_setOption(LibreOfficeKit* pThis, const char* pOption, const char* static void lo_dumpState(LibreOfficeKit* pThis, const char* pOptions, char** pState); -static char* lo_extractDocumentStructureRequest(LibreOfficeKit* pThis, const char* pFilePath); +static char* lo_extractDocumentStructureRequest(LibreOfficeKit* pThis, const char* pFilePath, +const char* pFilter); LibLibreOffice_Impl::LibLibreOffice_Impl() : m_pOfficeClass( gOfficeClass.lock() ) @@ -3147,7 +3148,8 @@ static char* lo_extractRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) return strdup("{ }"); } -static char* lo_extractDocumentStructureRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) +static char* lo_extractDocumentStructureRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath, +const char* pFilter) { uno::Reference xComponentLoader = frame::Desktop::create(xContext); uno::Reference< css::lang::XComponent > xComp; @@ -3194,9 +3196,14 @@ static char* lo_extractDocumentStructureRequest(LibreOfficeKit* /*pThis*/, const { tools::JsonWriter aJson; { -pDoc->getCommandValues(aJson, ".uno:ExtractDocumentStructure"); -//auto aNode = aJson.startNode("Controls"); -//extractLinks(xLTS->getLinks(), false, aJson); +OString aCommand = ".uno:ExtractDocumentStructure"_ostr; +if (pFilter && pFilter[0]) +{ +aCommand += OString::Concat(aCommand) + "?filter="_ostr + pFilter; +} + +pDoc->getCommandValues(aJson, aCommand); } return convertOString(aJson.finishAndGetAsOString()); } diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 168e1203123e..da1ddbe13d7f 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -149,7 +149,8 @@ struct _LibreOfficeKitClass /** @see lok::Office::extractDocumentStructureRequest. */ -char* (*extractDocumentStructureRequest) (LibreOfficeKit* pThis, const char* pFilePath); +char* (*extractDocumentStructureRequest)(LibreOfficeKit* pThis, const char* pFilePath, + const char* pFilter); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 9ce39d9e7d34..3f165c3e5363 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -1259,9 +1259,9 @@ public: return mpThis->pClass->setForkedChild(mpThis, bIsChild); } -char* extractDocumentStructureRequest(const char* pFilePath) +
core.git: desktop/source
desktop/source/deployment/registry/configuration/dp_configuration.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 884dd38e57c6c655f0ecf3014a86e06fce366e83 Author: Caolán McNamara AuthorDate: Sat Jul 13 19:57:31 2024 +0100 Commit: Caolán McNamara CommitDate: Sun Jul 14 15:14:09 2024 +0200 cid#1608572 silence Overflowed integer argument try to convince coverity of the errors of its ways Change-Id: I4e847f3773931dccaff1724166072bfde0b97941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170438 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index e8f9cf607b9d..e3789008306f 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -588,6 +588,8 @@ OUString replaceOrigin( index = nBytes; } +assert(index >= 0); + if ((write_pos + index) > filtered.size()) filtered.resize( (filtered.size() + index) * 2 ); memcpy( filtered.data() + write_pos, pBytes, index );
core.git: desktop/source
desktop/source/deployment/gui/dp_gui_dialog2.cxx | 32 ++- desktop/source/deployment/gui/dp_gui_dialog2.hxx |1 2 files changed, 15 insertions(+), 18 deletions(-) New commits: commit 406a7e9d452201f3fd53abc770da6eb9589fff92 Author: Noel Grandin AuthorDate: Wed Jul 10 12:46:50 2024 +0200 Commit: Caolán McNamara CommitDate: Thu Jul 11 20:56:03 2024 +0200 fix locking in UpdateRequiredDialog Ever since commit 838036c304d474fc4c19e2fc59cadc6ba457c9ee Author: Noel Grandin Date: Tue Mar 7 13:46:29 2023 +0200 osl::Mutex->std::mutex in UpdateRequiredDialog Calling from disableAllEntries, which takes a mutex, to hasActiveEntries, would deadlock. Noticing that this class is trying to use a mix of the SolarMutex and its own mutex, rather just use the SolarMutex everywhere, which is much safer, and not a problem in a place where performance is not an issue Change-Id: Id241c3b811f314d75de03c4c647c0594b8d498bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170283 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 99e1ccd489c2..4fe7a9622545 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -1079,7 +1079,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCancelBtn, weld::Button&, void) IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface, void ) { -std::unique_lock aGuard( m_aMutex ); +SolarMutexGuard aGuard; bool bLockInterface = static_cast(_bLockInterface); if ( m_bStartProgress && !m_bHasProgress ) @@ -1105,7 +1105,7 @@ IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface, void ) void UpdateRequiredDialog::showProgress( bool _bStart ) { -std::unique_lock aGuard( m_aMutex ); +SolarMutexGuard aGuard; bool bStart = _bStart; @@ -1129,9 +1129,9 @@ void UpdateRequiredDialog::showProgress( bool _bStart ) void UpdateRequiredDialog::updateProgress( const tools::Long nProgress ) { +SolarMutexGuard aGuard; if ( m_nProgress != nProgress ) { -std::unique_lock aGuard( m_aMutex ); m_nProgress = nProgress; m_aIdle.Start(); } @@ -1141,7 +1141,7 @@ void UpdateRequiredDialog::updateProgress( const tools::Long nProgress ) void UpdateRequiredDialog::updateProgress( const OUString , const uno::Reference< task::XAbortChannel > ) { -std::unique_lock aGuard( m_aMutex ); +SolarMutexGuard aGuard; m_xAbortChannel = xAbortChannel; m_sProgressText = rText; @@ -1171,18 +1171,18 @@ void UpdateRequiredDialog::updatePackageInfo( const uno::Reference< deployment:: IMPL_LINK_NOARG(UpdateRequiredDialog, HandleUpdateBtn, weld::Button&, void) { -std::unique_lock aGuard( m_aMutex ); - std::vector< uno::Reference< deployment::XPackage > > vUpdateEntries; -sal_Int32 nCount = m_xExtensionBox->GetEntryCount(); - -for ( sal_Int32 i = 0; i < nCount; ++i ) { -TEntry_Impl pEntry = m_xExtensionBox->GetEntryData( i ); -vUpdateEntries.push_back( pEntry->m_xPackage ); -} +SolarMutexGuard aGuard; -aGuard.unlock(); +sal_Int32 nCount = m_xExtensionBox->GetEntryCount(); + +for ( sal_Int32 i = 0; i < nCount; ++i ) +{ +TEntry_Impl pEntry = m_xExtensionBox->GetEntryData( i ); +vUpdateEntries.push_back( pEntry->m_xPackage ); +} +} m_pManager->getCmdQueue()->checkForUpdates( std::move(vUpdateEntries) ); } @@ -1190,7 +1190,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleUpdateBtn, weld::Button&, void) IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCloseBtn, weld::Button&, void) { -std::unique_lock aGuard( m_aMutex ); +SolarMutexGuard aGuard; if ( !isBusy() ) { @@ -1301,8 +1301,6 @@ bool UpdateRequiredDialog::checkDependencies( const uno::Reference< deployment:: bool UpdateRequiredDialog::hasActiveEntries() { -std::unique_lock aGuard( m_aMutex ); - bool bRet = false; tools::Long nCount = m_xExtensionBox->GetEntryCount(); for ( tools::Long nIndex = 0; nIndex < nCount; nIndex++ ) @@ -1322,7 +1320,7 @@ bool UpdateRequiredDialog::hasActiveEntries() void UpdateRequiredDialog::disableAllEntries() { -std::unique_lock aGuard( m_aMutex ); +SolarMutexGuard aGuard; incBusy(); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index b235aed18589..e7910535cad3 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -184,7 +184,6 @@ class UpdateRequiredDialog : public weld::GenericDialogController { const OUString
core.git: desktop/source include/LibreOfficeKit libreofficekit/source sw/source
desktop/source/lib/init.cxx |2 ++ include/LibreOfficeKit/LibreOfficeKitEnums.h | 21 - libreofficekit/source/gtk/lokdocview.cxx |3 +++ sw/source/uibase/inc/swruler.hxx |2 ++ sw/source/uibase/misc/swruler.cxx| 14 +++--- sw/source/uibase/uiview/view.cxx | 14 +- 6 files changed, 47 insertions(+), 9 deletions(-) New commits: commit 40ddb619cfc88d161cb74a1f516dd39196658d50 Author: Darshan-upadhyay1110 AuthorDate: Fri May 10 20:04:01 2024 +0530 Commit: Tomaž Vajngerl CommitDate: Mon Jun 17 10:23:27 2024 +0200 Add new LOK CALLBACK for vertical ruler - We're adding a new LOK callback LOK_CALLBACK_VERTICAL_RULER_UPDATE. - The reason is that we currently override the existing callback. - Using the same callback for both vertical and horizontal rulers causes an issue. - override will create problem like it will only send any one of the ruler orientation update. - It results in online updates being limited to just one ruler orientation. - By introducing a new callback, we ensure updates for both vertical and horizontal rulers both are captured correctly in online. Change-Id: I02d0e3e7e4ac8a07a83644460aa0ba36e0f3c013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167481 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit 11b936629dd4ef9308d63b312900b8b7c8ff19b4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167464 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c8af7f847ee5..2519f2d985c6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1526,6 +1526,7 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL"_ostr); m_states.emplace(LOK_CALLBACK_TAB_STOP_LIST, "NIL"_ostr); m_states.emplace(LOK_CALLBACK_RULER_UPDATE, "NIL"_ostr); +m_states.emplace(LOK_CALLBACK_VERTICAL_RULER_UPDATE, "NIL"_ostr); m_states.emplace(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE, "NIL"_ostr); } @@ -1834,6 +1835,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_SET_PART: case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE: case LOK_CALLBACK_RULER_UPDATE: +case LOK_CALLBACK_VERTICAL_RULER_UPDATE: case LOK_CALLBACK_A11Y_FOCUS_CHANGED: case LOK_CALLBACK_A11Y_CARET_CHANGED: case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED: diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 9a6f34bbd846..516622722bb9 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -581,7 +581,7 @@ typedef enum */ LOK_CALLBACK_CELL_ADDRESS = 34, /** - * The key ruler related properties on change are reported by this. + * The key horizontal ruler related properties on change are reported by this. * * The payload format is: * @@ -1051,6 +1051,23 @@ typedef enum * Payload contains the rectangle details */ LOK_CALLBACK_SHAPE_INNER_TEXT = 72, +/** + * The key vertical ruler related properties on change are reported by this. + * + * The payload format is: + * + * { + * "margin1": "...", + * "margin2": "...", + * "leftOffset": "...", + * "pageOffset": "...", + * "pageWidth": "...", + * "unit": "..." + * } + * + * Here all aproperties are same as described in svxruler. + */ +LOK_CALLBACK_VERTICAL_RULER_UPDATE = 73 } LibreOfficeKitCallbackType; @@ -1152,6 +1169,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_COMMENT"; case LOK_CALLBACK_RULER_UPDATE: return "LOK_CALLBACK_RULER_UPDATE"; +case LOK_CALLBACK_VERTICAL_RULER_UPDATE: +return "LOK_CALLBACK_VERTICAL_RULER_UPDATE"; case LOK_CALLBACK_WINDOW: return "LOK_CALLBACK_WINDOW"; case LOK_CALLBACK_VALIDITY_LIST_BUTTON: diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 60c3435ac28d..5dddaa2d0e37 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1376,6 +1376,9 @@ callback (gpointer pData) case LOK_CALLBACK_RULER_UPDATE: g_signal_emit(pCallback->m_pDocView, doc_view_signals[RULER], 0, pCallback->m_aPayload.c_str()); break; +case LOK_CALLBACK_VERTICAL_RULER_UPDATE: +g_signal_emit(pCallback->m_pDocView, doc_view_signals[RULER], 0, pCallback->m_aPayload.c_str()); +break; case LOK_CALLBACK_WINDOW: g_signal_emit(pCallback->m_pDocView,
core.git: desktop/source unotools/source
desktop/source/app/app.cxx | 21 ++--- unotools/source/misc/VersionConfig.cxx |6 -- 2 files changed, 10 insertions(+), 17 deletions(-) New commits: commit f1e4a97b03e1eacd679c3ef1dcb7ab4b577dd928 Author: Mike Kaganski AuthorDate: Sat Jun 15 11:36:29 2024 +0500 Commit: Mike Kaganski CommitDate: Sat Jun 15 13:19:13 2024 +0200 tdf#35568 Repeat "first run" procedure on upgrade 1. In isProductVersionUpgraded, if it was upgraded, set FirstRun. This will run in runGraphicsRenderTests, early enough in Desktop::Main(). 2. This will make sure that Desktop::CheckFirstRun() will do its tasks, including creation of the quickstart shortcut. It is simplified a bit, to use a better WinAPI. 3. Setting FirstRun to false is moved to m_firstRunTimer's handler, to make sure that it gets run eventually, even if the first launch was terminated before the timer fired. This will not make installer itself create the quickstart shortcut: it will happen on the program's first run after an upgrade. But users now won't have to enable the option manually each time. Change-Id: Ica6cc41f1e56b8970db27d14e2be3c47910293e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168902 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index b00dd75a39e6..d30bd0e582f3 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2540,6 +2540,9 @@ IMPL_STATIC_LINK_NOARG(Desktop, AsyncInitFirstRun, Timer *, void) { Reference< XJobExecutor > xExecutor = theJobExecutor::get( ::comphelper::getProcessComponentContext() ); xExecutor->trigger( u"onFirstRunInitialization"_ustr ); +auto batch(comphelper::ConfigurationChanges::create()); +officecfg::Office::Common::Misc::FirstRun::set(false, batch); +batch->commit(); } catch(const css::uno::Exception&) { @@ -2608,24 +2611,12 @@ void Desktop::CheckFirstRun( ) #ifdef _WIN32 // Check if Quickstarter should be started (on Windows only) OUString sRootKey = ReplaceStringHookProc("Software\%OOOVENDOR\%PRODUCTNAME\%PRODUCTVERSION"); -WCHAR szValue[8192]; -DWORD nValueSize = sizeof(szValue); -HKEY hKey; -if (ERROR_SUCCESS == RegOpenKeyW(HKEY_LOCAL_MACHINE, o3tl::toW(sRootKey.getStr()), )) +if (ERROR_SUCCESS == RegGetValueW(HKEY_LOCAL_MACHINE, o3tl::toW(sRootKey.getStr()), L"RunQuickstartAtFirstStart", RRF_RT_ANY, nullptr, nullptr, nullptr)) { -if ( ERROR_SUCCESS == RegQueryValueExW( hKey, L"RunQuickstartAtFirstStart", nullptr, nullptr, reinterpret_cast(szValue), ) ) -{ -css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); -css::office::Quickstart::createAutoStart(xContext, true/*Quickstart*/, true/*bAutostart*/); -RegCloseKey( hKey ); -} +css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); +css::office::Quickstart::createAutoStart(xContext, true/*Quickstart*/, true/*bAutostart*/); } #endif - -std::shared_ptr< comphelper::ConfigurationChanges > batch( -comphelper::ConfigurationChanges::create()); -officecfg::Office::Common::Misc::FirstRun::set(false, batch); -batch->commit(); } } diff --git a/unotools/source/misc/VersionConfig.cxx b/unotools/source/misc/VersionConfig.cxx index f24451f6913d..80373ce73430 100644 --- a/unotools/source/misc/VersionConfig.cxx +++ b/unotools/source/misc/VersionConfig.cxx @@ -11,6 +11,7 @@ #include +#include #include #include @@ -35,9 +36,10 @@ bool isProductVersionUpgraded() //update lastversion try { -std::shared_ptr batch( -comphelper::ConfigurationChanges::create()); +auto batch(comphelper::ConfigurationChanges::create()); officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch); +// tdf#35568: an upgrade must repeat the first run routine +officecfg::Office::Common::Misc::FirstRun::set(true, batch); batch->commit(); } catch (css::lang::IllegalArgumentException&)
core.git: desktop/source
desktop/source/lib/init.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 719958306782ef7e79c2f0e07f621ba9a050a623 Author: Andras Timar AuthorDate: Fri Jun 7 10:56:45 2024 +0200 Commit: Andras Timar CommitDate: Tue Jun 11 06:37:01 2024 +0200 LOK: do not use deprecated .uno:BackColor .uno:BackColor was deprecated in be3d34b5d6b97c3eb12ab3f84ce2da2ef965a928 which changed the label to "Character Highlighting Color (deprecated - use CharBackColor)" We do not want this label to appear in LOK based product. The corresponding online patch set: https://github.com/CollaboraOnline/online/pull/9225 Change-Id: Ieb780d278cd45bf82a2b4acee0abd17af2dc71eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168519 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna (cherry picked from commit db27cd2246cfc54abd94885ce5edbdca69688af0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168616 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 464c2498cf9f..c8af7f847ee5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3635,7 +3635,6 @@ static void doc_iniUnoCommands () u".uno:AlignLeft"_ustr, u".uno:AlignHorizontalCenter"_ustr, u".uno:AlignRight"_ustr, -u".uno:BackColor"_ustr, u".uno:BackgroundColor"_ustr, u".uno:TableCellBackgroundColor"_ustr, u".uno:Bold"_ustr,
core.git: desktop/source
desktop/source/app/updater.cxx | 34 +- desktop/source/app/updater.hxx |2 -- 2 files changed, 9 insertions(+), 27 deletions(-) New commits: commit 253bd05e95ae5093e61a4685a9d28f31edc6f585 Author: Stephan Bergmann AuthorDate: Thu May 30 13:36:49 2024 +0200 Commit: Stephan Bergmann CommitDate: Fri May 31 07:59:17 2024 +0200 Consolidate on a single Updater::log overload Change-Id: Id812788f30ac4a327d450255cfe19181c69ae81e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168257 Reviewed-by: Stephan Bergmann Tested-by: Jenkins diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 12bb4969a68c..676cc54f148e 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -553,7 +555,7 @@ size_t WriteCallbackFile(void *ptr, size_t size, std::string download_content(const OString& rURL, bool bFile, OUString& rHash) { -Updater::log("Download: " + rURL); +Updater::log("Download: " + OStringToOUString(rURL, osl_getThreadTextEncoding())); std::unique_ptr> curl( curl_easy_init(), [](CURL * p) { curl_easy_cleanup(p); }); @@ -729,7 +731,7 @@ void update_checker() OUString aDownloadCheckURL = aDownloadCheckBaseURL + "update/check/1/" + aProductName + "/" + aBuildID + "/" + aBuildTarget + "/" + aChannel; OString aURL = OUStringToOString(aDownloadCheckURL, RTL_TEXTENCODING_UTF8); -Updater::log("Update check: " + aURL); +Updater::log("Update check: " + OStringToOUString(aURL, osl_getThreadTextEncoding())); try { @@ -779,27 +781,27 @@ void update_checker() catch (const invalid_update_info&) { SAL_WARN("desktop.updater", "invalid update information"); -Updater::log(OString("warning: invalid update info")); +Updater::log("warning: invalid update info"); } catch (const error_updater& e) { SAL_WARN("desktop.updater", "error during the update check: " << e.what()); -Updater::log(OString("warning: error by the updater") + e.what()); +Updater::log("warning: error by the updater" + o3tl::runtimeToOUString(e.what())); } catch (const invalid_size& e) { SAL_WARN("desktop.updater", e.what()); -Updater::log(OString("warning: invalid size")); +Updater::log("warning: invalid size"); } catch (const invalid_hash& e) { SAL_WARN("desktop.updater", e.what()); -Updater::log(OString("warning: invalid hash")); +Updater::log("warning: invalid hash"); } catch (...) { SAL_WARN("desktop.updater", "unknown error during the update check"); -Updater::log(OString("warning: unknown exception")); +Updater::log("warning: unknown exception"); } } @@ -849,24 +851,6 @@ void Updater::log(const OUString& rMessage) aLog.WriteLine(OUStringToOString(rMessage, RTL_TEXTENCODING_UTF8)); } -void Updater::log(const OString& rMessage) -{ -SAL_INFO("desktop.updater", rMessage); -OUString aUpdateLog = getUpdateInfoLog(); -SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); -aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end -aLog.WriteLine(rMessage); -} - -void Updater::log(const char* pMessage) -{ -SAL_INFO("desktop.updater", pMessage); -OUString aUpdateLog = getUpdateInfoLog(); -SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); -aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end -aLog.WriteOString(pMessage); -} - OUString Updater::getBuildID() { OUString aBuildID("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"); diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx index 7f1ea920fbe9..2ab4d4ea8eae 100644 --- a/desktop/source/app/updater.hxx +++ b/desktop/source/app/updater.hxx @@ -28,8 +28,6 @@ public: static OUString getUpdateChannel(); static void log(const OUString& rMessage); -static void log(const OString& rMessage); -static void log(const char* pMessage); static void removeUpdateFiles(); };
core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |1 + sfx2/source/control/unoctitm.cxx |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit f67e7fc5c71308e1866c78a1c48c9a6c070886cc Author: Hubert Figuière AuthorDate: Tue May 28 17:08:07 2024 -0400 Commit: Caolán McNamara CommitDate: Thu May 30 10:10:06 2024 +0200 cool#9174 - Enable .uno:ChangeBezier This allow Convert to Curve in COOL Signed-off-by: Hubert Figuière Change-Id: Id1aa0bc68238ac29221edb1c1ec7dda6e16ce103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168170 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice (cherry picked from commit c5a7ff366fd9094c3ee1aba4c016b59c5635ea9b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168194 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4e484cf71a34..464c2498cf9f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3853,6 +3853,7 @@ static void doc_iniUnoCommands () u".uno:CellProtection"_ustr, u".uno:MoveKeepInsertMode"_ustr, u".uno:ToggleSheetGrid"_ustr, +u".uno:ChangeBezier"_ustr, }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index b267c6157b57..6dd55fc06a2d 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1117,7 +1117,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "InsertDateContentControl" || aEvent.FeatureURL.Path == "InsertDropdownContentControl" || aEvent.FeatureURL.Path == "InsertPlainTextContentControl" || - aEvent.FeatureURL.Path == "InsertPictureContentControl") + aEvent.FeatureURL.Path == "InsertPictureContentControl" || + aEvent.FeatureURL.Path == "ChangeBezier") { aBuffer.append(aEvent.IsEnabled ? std::u16string_view(u"enabled") : std::u16string_view(u"disabled")); }
core.git: desktop/source static/README.wasm.md
desktop/source/app/sofficemain.cxx |6 ++ static/README.wasm.md |6 +- 2 files changed, 11 insertions(+), 1 deletion(-) New commits: commit 77129fbb74bcefde4551d494f029169e7c6026e3 Author: Stephan Bergmann AuthorDate: Wed May 15 15:24:48 2024 +0200 Commit: Stephan Bergmann CommitDate: Tue May 28 15:14:12 2024 +0200 Emscripten: Add hack to prepare for --enable-wasm-exceptions (...which will be beneficial, in turn, to implement exception handling in the work-in-progress bridges/source/cpp_uno/gcc3_wasm UNO bridge). Once setting --enable-wasm-exceptions, plus the corresponding -sSUPPORT_LONGJMP=wasm in qt5, I indeed started to see the "RuntimeError: null function or function signature mismatch" that was already mentioned in static/README.wasm.md. I could track it down to the early destruction of the aDesktop local variable in soffice_main, as I now explain there. However, it beats me why that variable gets destroyed early. The desktop::Desktop::~Desktop dtor claims to be called from within main -> soffice_main -> desktop::Desktop::~Desktop, but at a time when the call to main -> soffice_main -> SVMain has not yet returned. There also does not appear to be any C++ exception handling stack unwinding going on. (It could be related somehow to -sSUPPORT_LONGJMP=wasm, I don't know.) And everything appears to just work fine after turning that aDesktop local variable into a (leaked) heap instance instead, so go with that hack for now... Change-Id: I8e00c988ee9a44fd3befbe41c844eec050f0e509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167694 Reviewed-by: Stephan Bergmann Tested-by: Jenkins diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 73ac6e24cfe4..33881784d45c 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -63,7 +63,13 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() #endif tools::extendApplicationEnvironment(); +#if defined EMSCRIPTEN +//TODO, see "Experimental (AKA currently broken) WASM exception + SjLj build" in +// static/README.wasm.md: +new desktop::Desktop(); +#else desktop::Desktop aDesktop; +#endif // This string is used during initialization of the Gtk+ VCL module Application::SetAppName( u"soffice"_ustr ); diff --git a/static/README.wasm.md b/static/README.wasm.md index 5397e2124d16..97be5a14123b 100644 --- a/static/README.wasm.md +++ b/static/README.wasm.md @@ -122,7 +122,11 @@ You can build LO with WASM exceptions, which should be "much" faster then the JS based Emscripten EH handling. For setjmp / longjmp (SjLj) used by the PNG and JPEG libraries error handling, this needs Emscripten 3.1.3+. That builds, but execution still fails early with a signature mismatch call to Task::UpdateMinPeriod in LO's -job scheduler code. Unfortunately the build also needs a Qt build with +job scheduler code (concretely: the call to `pSchedulerData->mpTask->UpdateMinPeriod` in +`Scheduler::CallbackTaskScheduling` in vcl/source/app/scheduler.cxx being a pure virtual call on a +destroyed `desktop::Desktop::m_firstRunTimer` instance, because `desktop::Desktop aDesktop` in +`soffice_main` in desktop/source/app/sofficemain.cxx gets destroyed early, for unclear reasons). +Unfortunately the build also needs a Qt build with "-s SUPPORT_LONGJMP=wasm", which is incompatible with the JS EH + SjLj. The LO configure flag is simply an additional --enable-wasm-exceptions. Qt5 can
core.git: desktop/source
desktop/source/lib/init.cxx | 79 +--- 1 file changed, 53 insertions(+), 26 deletions(-) New commits: commit aaf4613a0aeb9cf7c27c731f2391de14bdcff880 Author: Michael Meeks AuthorDate: Fri May 17 21:25:29 2024 +0100 Commit: Michael Meeks CommitDate: Thu May 23 12:31:46 2024 +0200 lok: stop amazing waste of repeated font sizes in each font element. These days all sensible fonts are scalable, so anything else is madness. With the compact_fonts option we go from: INCOMING: commandvalues: {"commandName":".uno:CharFontName","commandValues": {"Albany AMT":["6","7","8","9","10","10.5","11","12","13","14","15","16", "18","20","21","22","24","26","28","32","36","40","42","44","48","54", "60","66","72","80","88","96"],"Amiri":["6","7" INCOMING: commandvalues: { "commandName": ".uno:CharFontName", "FontNames": [ "Albany AMT", "Amiri", "Amiri Quran", "Amiri Quran Colored", "Andale Mono", "Andale Sans", "Andy MT", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", "Arial", An 8x size win. Change-Id: I3dc9f5de876def6e4afc09a43105b1740f7c621f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167799 Tested-by: Jenkins CollaboraOffice Reviewed-by: Noel Grandin (cherry picked from commit 628f56a1802ad76cbe84a9a5590b04ed81a57a9e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167962 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7730614d6a49..4e484cf71a34 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -252,11 +252,12 @@ extern "C" { #endif - using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool; + static LibLibreOffice_Impl *gImpl = nullptr; static bool lok_preinit_2_called = false; +static bool gUseCompactFonts = false; static std::weak_ptr< LibreOfficeKitClass > gOfficeClass; static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass; @@ -6036,7 +6037,7 @@ static char* getLanguages(const char* pCommand) return pJson; } -static char* getFonts (const char* pCommand) +static char* getFonts (const char* pCommand, const bool bBloatWithRepeatedSizes) { SfxObjectShell* pDocSh = SfxObjectShell::Current(); if (!pDocSh) @@ -6045,36 +6046,60 @@ static char* getFonts (const char* pCommand) pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr; -boost::property_tree::ptree aTree; -aTree.put("commandName", pCommand); -boost::property_tree::ptree aValues; -if ( pList ) +if (!bBloatWithRepeatedSizes) { -sal_uInt16 nFontCount = pList->GetFontNameCount(); -for (sal_uInt16 i = 0; i < nFontCount; ++i) +tools::JsonWriter aJson; +aJson.put("commandName", pCommand); +if (pList) +{ +auto aFontNames = aJson.startArray("FontNames"); + +sal_uInt16 nFontCount = pList->GetFontNameCount(); +for (sal_uInt16 i = 0; i < nFontCount; ++i) +aJson.putSimpleValue(pList->GetFontName(i).GetFamilyName()); +} { -boost::property_tree::ptree aChildren; -const FontMetric& rFontMetric = pList->GetFontName(i); +auto aFontSizes = aJson.startArray("FontSizes"); const int* pAry = FontList::GetStdSizeAry(); -sal_uInt16 nSizeCount = 0; -while (pAry[nSizeCount]) +for (sal_uInt16 i = 0; pAry[i]; ++i) + aJson.putSimpleValue(OUString::number(static_cast(pAry[i]) / 10)); +} + +return convertOString(aJson.finishAndGetAsOString()); +} +else // FIXME: remove nonsensical legacy version +{ +boost::property_tree::ptree aTree; +aTree.put("commandName", pCommand); +boost::property_tree::ptree aValues; +if ( pList ) +{ +sal_uInt16 nFontCount = pList->GetFontNameCount(); +for (sal_uInt16 i = 0; i < nFontCount; ++i) { -boost::property_tree::ptree aChild; -aChild.put("", static_cast(pAry[nSizeCount]) / 10); -aChildren.push_back(std::make_pair("", aChild)); -nSizeCount++; +boost::property_tree::ptree aChildren; +const FontMetric& rFontMetric = pList->GetFontName(i); +const int* pAry = FontList::GetStdSizeAry(); +sal_uInt16 nSizeCount = 0; +while (pAry[nSizeCount]) +{ +boost::property_tree::ptree aChild; +aChild.put("", static_cast(pAry[nSizeCount]) / 10); +aChildren.push_back(std::make_pair("", aChild)); +
core.git: desktop/source
desktop/source/lib/init.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 9d1956031ed326e3d377800530993dcd2571f99a Author: Michael Meeks AuthorDate: Fri May 17 17:49:32 2024 +0100 Commit: Michael Meeks CommitDate: Thu May 23 10:29:28 2024 +0200 lok: stop amazing waste of pretty-printed JSON sent over the API. before: INCOMING: commandvalues: { "commandName": ".uno:CharFontName", "commandValues": { "Albany AMT": [ "6", "7", "8", "9", "10", "10.5", "11", "12", after: INCOMING: commandvalues: {"commandName":".uno:CharFontName","commandValues": {"Albany AMT":["6","7","8","9","10","10.5","11","12","13","14","15","16", "18","20","21","22","24","26","28","32","36","40","42","44","48","54", "60","66","72","80","88","96"],"Amiri":["6","7" A 3x size saving. Change-Id: I574b8bdf790078c61b7605137a47a531dee16f1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167685 Reviewed-by: Michael Meeks Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3b4b9f11a4d4..7730614d6a49 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5969,7 +5969,7 @@ static char* getDocReadOnly(LibreOfficeKitDocument* pThis) aTree.put("success", pObjectShell->IsLoadReadonly()); std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); +boost::property_tree::write_json(aStream, aTree, false /* pretty */); char* pJson = static_cast(malloc(aStream.str().size() + 1)); if (!pJson) return nullptr; @@ -6028,7 +6028,7 @@ static char* getLanguages(const char* pCommand) addLocale(aValues, rLocale); aTree.add_child("commandValues", aValues); std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); +boost::property_tree::write_json(aStream, aTree, false /* pretty */); char* pJson = static_cast(malloc(aStream.str().size() + 1)); assert(pJson); // Don't handle OOM conditions strcpy(pJson, aStream.str().c_str()); @@ -6069,7 +6069,7 @@ static char* getFonts (const char* pCommand) } aTree.add_child("commandValues", aValues); std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); +boost::property_tree::write_json(aStream, aTree, false /* pretty */); char* pJson = static_cast(malloc(aStream.str().size() + 1)); assert(pJson); // Don't handle OOM conditions strcpy(pJson, aStream.str().c_str()); @@ -6104,7 +6104,7 @@ static char* getFontSubset (std::string_view aFontName) aTree.add_child("commandValues", aValues); std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); +boost::property_tree::write_json(aStream, aTree, false /* pretty */); char* pJson = static_cast(malloc(aStream.str().size() + 1)); assert(pJson); // Don't handle OOM conditions strcpy(pJson, aStream.str().c_str()); @@ -6227,7 +6227,7 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) aTree.add_child("commandValues", aValues); std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); +boost::property_tree::write_json(aStream, aTree, false /* pretty */); char* pJson = static_cast(malloc(aStream.str().size() + 1)); assert(pJson); // Don't handle OOM conditions strcpy(pJson, aStream.str().c_str());
core.git: desktop/source
desktop/source/deployment/manager/dp_manager.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit 9851311055da1a050405f7bc0b7e12ad7cff3cbe Author: Mike Kaganski AuthorDate: Mon May 20 16:00:39 2024 +0200 Commit: Mike Kaganski CommitDate: Mon May 20 17:31:19 2024 +0200 Drop remnants of a long-obsolete hack In commits 6dd5a96e1e3a6bb307f8f2d43cce2b5f2cde659d (INTEGRATION: CWS unopkg1 (1.1.2); FILE ADDED, 2004-04-14), 19a10039a59002b68291e7f200f85fd962592d75 (INTEGRATION: CWS unopkg2 (1.2.4); FILE MERGED, 2004-06-11), and 886715b6b6f30fed36d50a4ddf84ed5984f4f993 (INTEGRATION: CWS scriptingf7 (1.3.4); FILE MERGED, 2004-07-23), a hack was introduced to allow empty substorages. Later, in commits 0d6b24a721f05fedef9cd32b596a0fec71a5089f (INTEGRATION: CWS tdoc3 (1.7.24); FILE MERGED, 2004-11-09) and 5f4d17724f7323077191114486edff8cdce05b2f (INTEGRATION: CWS scriptingf9 (1.6.2); FILE MERGED, 2004-12-23), that hack was removed, but one place was kept, which is removed now. Change-Id: Iaaf46421ddbe942878ebe17ca1e585be9db5999d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167823 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index c2c8c621df1f..574470068da1 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -130,9 +130,6 @@ void PackageManagerImpl::initActivationLayer( { Reference xRow( xResultSet, UNO_QUERY_THROW ); OUString title( xRow->getString( 1 /* Title */ ) ); -// xxx todo: remove workaround for tdoc -if ( title == "this_is_a_dummy_stream_just_there_as_a_workaround_for_a_temporary_limitation_of_the_storage_api_implementation" ) -continue; if ( title == "META-INF" ) continue;
core.git: desktop/source
desktop/source/app/cmdlinehelp.cxx |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 3d4a3b30aea603b98da447ec6587b5d3eb20da66 Author: Justin Luth AuthorDate: Tue May 14 09:20:49 2024 -0400 Commit: Justin Luth CommitDate: Mon May 20 15:42:36 2024 +0200 tdf#69192 fix cmdlinehelp: --show[=slide_number], etc. I had skimmed the help file earlier, and concluded that { } are used elsewhere to indicate optional paramaters. However, there is --quickstart[=no], and -env:[=] which exactly match my optional addition. Thanks Stéphane for pointing this out. Also included are some other changes we made to clarify the help wording in general, so the documentation and the cmdline help are in sync. We dropped Files other than Impress documents are opened in default mode, regardless of previous mode. because: -from an initial reading it doesn't convey any useful meaning. -searching for other uses of "mode" in the file suggests it means that prior --print/--convert-to/--view modes no longer apply. This override of prior modes is true for all modes, but only this argument tries to spell this out. -it seems rather inconceivable that any user would attempt to mix --show with any other arguments or more than one file. Change-Id: I191e572506cf2b39ed6c9ff4ebaf66f258a176a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167633 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 10b3e5c48cbb..7fb0b3d48a1e 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -145,11 +145,10 @@ namespace desktop " not appear. If the file name contains spaces, then it " " must be enclosed in quotation marks. " " --view Opens following files in viewer mode (read-only). " -" --show{=slide#} Opens and starts the following presentation documents " -" of each immediately. Files are closed after the showing. " -" If a slide # is provided, they start at that slide. " -" Files other than Impress documents are opened in " -" default mode , regardless of previous mode. " +" --show[=slide_number] Opens and starts the slideshow of the following " +" presentation documents immediately. " +" Files are closed after the showing. " +" If a slide_number is provided, they start at that slide. " " --convert-to OutputFileExtension[:OutputFilterName] \ " " [--outdir output_dir] [--convert-images-to] " " Batch convert files (implies --headless). If --outdir "
core.git: desktop/source include/sfx2 include/vcl sfx2/source vcl/source
desktop/source/lib/init.cxx |2 +- include/sfx2/viewsh.hxx |1 + include/vcl/IDialogRenderable.hxx |3 +++ include/vcl/svapp.hxx |2 +- sfx2/source/view/lokhelper.cxx|3 ++- sfx2/source/view/viewsh.cxx | 23 +++ vcl/source/app/svapp.cxx | 16 7 files changed, 47 insertions(+), 3 deletions(-) New commits: commit e2aab0d02e7be66881f2ac0f08b6ac5007f65648 Author: Michael Meeks AuthorDate: Thu May 16 19:35:51 2024 +0100 Commit: Michael Meeks CommitDate: Sat May 18 12:34:59 2024 +0200 lok: dump more SfxViewShell state, and LOK notifier state on Windows. This should help to associate the right view-ids, with the right windows, and help to catch any stray / lingering windows from closed sessions - hopefully. Change-Id: I197a3280d5d2aeddd356ee037c51e4887f43278b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167765 Reviewed-by: Miklos Vajna Tested-by: Jenkins CollaboraOffice (cherry picked from commit 8d979fae0c435b820302c76fcfdc2642b4820360) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167684 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2ab701cae3d2..3b4b9f11a4d4 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1637,7 +1637,7 @@ void CallbackFlushHandler::libreOfficeKitViewUpdatedCallbackPerViewId(int nType, void CallbackFlushHandler::dumpState(rtl::OStringBuffer ) { // NB. no locking -rState.append(" View: "); +rState.append(" View: "); rState.append(static_cast(m_viewId)); rState.append(" DisableCallbacks: "); rState.append(static_cast(m_nDisableCallbacks)); diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index b7461b160af1..71380213b9c9 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -274,6 +274,7 @@ public: // ILibreOfficeKitNotifier virtual voidnotifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const std::vector& rPayload = std::vector()) const override; +virtual OString dumpNotifyState() const override; // Focus, KeyInput, Cursor virtual voidShowCursor( bool bOn = true ); diff --git a/include/vcl/IDialogRenderable.hxx b/include/vcl/IDialogRenderable.hxx index 386ed1e865c8..d92eb88ed25c 100644 --- a/include/vcl/IDialogRenderable.hxx +++ b/include/vcl/IDialogRenderable.hxx @@ -41,6 +41,9 @@ public: /// Emits a LOK_CALLBACK_INVALIDATE_TILES. virtual void notifyInvalidation(tools::Rectangle const *) const = 0; + +/// Debugging +virtual OString dumpNotifyState() const = 0; }; } // namespace vcl diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index d5f1739be1ae..2725642763c0 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1326,7 +1326,7 @@ public: const std::vector& rPayload = std::vector()) const override; virtual void libreOfficeKitViewCallback(int nType, const OString& pPayload) const override; virtual void notifyInvalidation(tools::Rectangle const *) const override; - +virtual OString dumpNotifyState() const override; private: DECL_DLLPRIVATE_STATIC_LINK( Application, PostEventHandler, void*, void ); diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 756fda428273..549f43906908 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -735,7 +735,8 @@ void SfxLokHelper::notifyPartSizeChangedAllViews(vcl::ITiledRenderable* pDoc, in SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while (pViewShell) { -if (pViewShell->getPart() == nPart) +if (// FIXME should really filter on pViewShell->GetDocId() too +pViewShell->getPart() == nPart) SfxLokHelper::notifyDocumentSizeChanged(pViewShell, ""_ostr, pDoc, false); pViewShell = SfxViewShell::GetNext(*pViewShell); } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index df122f41054f..b5f010e9b0be 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -3173,6 +3173,20 @@ SfxLokCallbackInterface* SfxViewShell::getLibreOfficeKitViewCallback() const void SfxViewShell::dumpLibreOfficeKitViewState(rtl::OStringBuffer ) { +rState.append(" SfxViewShell: "); +rState.append(OString::number(reinterpret_cast(this), 16)); +rState.append(" DocId: "); +auto nDocId = static_cast(GetDocId()); +rState.append(static_cast(nDocId)); +rState.append(" ViewId: "); +rState.append(static_cast(GetViewShellId())); +rState.append(" Part: "); +rState.append(static_cast(getPart())); +rState.append(" Lang: "); +
core.git: desktop/source
desktop/source/lib/init.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 7c25b9c2a0770a66c18b4cd2f5d09d47fa7e057e Author: Caolán McNamara AuthorDate: Fri May 17 11:57:19 2024 +0100 Commit: Caolán McNamara CommitDate: Fri May 17 14:55:04 2024 +0200 WaE: C6011 Dereferencing NULL pointer warnings Change-Id: Ic67e88417620acb6d43bafc28e8291720913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167770 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 549319a7946c..2ab701cae3d2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5113,8 +5113,8 @@ void LibLibreOffice_Impl::dumpState(rtl::OStringBuffer ) rState.append(" CallbackData: 0x"); rState.append(reinterpret_cast(mpCallback), 16); rState.append(" IsModified: "); -if (SfxObjectShell::Current()) -rState.append(SfxObjectShell::Current()->IsModified() ? "modified" : "unmodified"); +if (const SfxObjectShell* pObjSh = SfxObjectShell::Current()) +rState.append(pObjSh->IsModified() ? "modified" : "unmodified"); else rState.append("noshell"); // TODO: dump mInteractionMap
core.git: desktop/source
desktop/source/minidump/minidump.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit bdb47881a214b659b6102c78e5e082197ecf15c7 Author: Thorsten Behrens AuthorDate: Thu May 16 17:43:38 2024 +0200 Commit: Thorsten Behrens CommitDate: Fri May 17 13:27:54 2024 +0200 Revert "tdf#109347: don't verify SSL certificate for crashreport upload" With recent improvements in libcurl CA usage on Linux, this workaround is no longer needed. See also 11f439b861922b9286b2e47ed326f3508a48d44e This reverts commit ec4229bc49a315f3f17664bb43e61d3b2e13fb87. Change-Id: I09124691687297f3b6ae0b9ca64652809caf3a11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167752 Reviewed-by: Thorsten Behrens Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 90d23f51acf3..6e0b0141869d 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -119,7 +119,6 @@ static bool uploadContent(std::map& parameters, std::s curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent); -curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // Set proxy information if necessary. if (!proxy.empty()) {
core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |5 + sfx2/source/doc/objmisc.cxx | 11 ++- 2 files changed, 15 insertions(+), 1 deletion(-) New commits: commit 113dabb58dcab72ad17d5c2ab21a86e6825d90dc Author: Michael Meeks AuthorDate: Tue May 14 16:13:43 2024 +0100 Commit: Michael Meeks CommitDate: Wed May 15 18:16:00 2024 +0200 lok: get faster ModifiedStatus from the core. Gives a more responsive UI, closes a number of races, and helps us to make better decisions, more quickly on whether to save. Change-Id: I6e2548f06f715ba56ba75fd746273bdd57dc20dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167635 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 44e79f02241fbc213462df03a37b621cb72f9d05) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167469 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 635bca3b5de9..549319a7946c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5112,6 +5112,11 @@ void LibLibreOffice_Impl::dumpState(rtl::OStringBuffer ) rState.append(static_cast(mOptionalFeatures), 16); rState.append(" CallbackData: 0x"); rState.append(reinterpret_cast(mpCallback), 16); +rState.append(" IsModified: "); +if (SfxObjectShell::Current()) +rState.append(SfxObjectShell::Current()->IsModified() ? "modified" : "unmodified"); +else +rState.append("noshell"); // TODO: dump mInteractionMap SfxLokHelper::dumpState(rState); vcl::lok::dumpState(rState); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index c1d19b268adb..6d60e683770a 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -51,6 +51,7 @@ #include #include +#include #include #include @@ -102,6 +103,7 @@ #include #include #include +#include #include #include #include "objstor.hxx" @@ -324,7 +326,6 @@ void SfxObjectShell::ModifyChanged() // SetModified dispose of the models! return; - SfxViewFrame* pViewFrame = SfxViewFrame::Current(); if ( pViewFrame ) pViewFrame->GetBindings().Invalidate( SID_SAVEDOCS ); @@ -334,6 +335,14 @@ void SfxObjectShell::ModifyChanged() Broadcast( SfxHint( SfxHintId::TitleChanged ) );// xmlsec05, signed state might change in title... SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::ModifyChanged, GlobalEventConfig::GetEventName(GlobalEventId::MODIFYCHANGED), this ) ); + +// Don't wait to get this important state via binding notification timeout. +if ( comphelper::LibreOfficeKit::isActive() ) +{ +OString aStatus = ".uno:ModifiedStatus="_ostr; +aStatus += IsModified() ? "true" : "false"; +SfxLokHelper::notifyAllViews(LOK_CALLBACK_STATE_CHANGED, aStatus); +} }
core.git: desktop/source include/sal
desktop/source/app/app.cxx | 42 +- include/sal/log-areas.dox |1 + 2 files changed, 42 insertions(+), 1 deletion(-) New commits: commit a82aaae3686daa7f40b4ba41e837d2e47408153c Author: Venetia AuthorDate: Mon Feb 26 09:18:18 2024 -0700 Commit: Stephan Bergmann CommitDate: Wed May 15 08:26:57 2024 +0200 tdf#70526 Provide start up time measurements Added support for measuring the start up time between each Splashscreen update. Change-Id: Id38058c89c8524d782bf15cd956c8fba5de056de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163965 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index eff8b46d069f..7075d6afcb89 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1259,9 +1259,29 @@ struct ExecuteGlobals } static ExecuteGlobals* pExecGlobals = nullptr; - +static std::chrono::high_resolution_clock::time_point startFuncTp; int Desktop::Main() { +std::chrono::high_resolution_clock::time_point startT; + +#ifdef SAL_LOG_INFO +startFuncTp = std::chrono::high_resolution_clock::now(); +startT = std::chrono::high_resolution_clock::now(); + +auto recordTime = [](std::chrono::high_resolution_clock::time_point& startTp, const char* message) +{ +const auto endTp = std::chrono::high_resolution_clock::now(); +auto tMs = std::chrono::duration_cast(endTp - startTp); +SAL_INFO("desktop.startuptime", message << tMs.count() << " ms"); +startTp = std::chrono::high_resolution_clock::now(); +}; +#else +auto recordTime = [](...) +{ +}; +#endif + + pExecGlobals = new ExecuteGlobals(); // Remember current context object @@ -1300,6 +1320,7 @@ int Desktop::Main() #endif SetSplashScreenProgress(10); +recordTime(startT, "SetSplashScreenProgress(10): time = "); userinstall::Status inst_fin = userinstall::finalize(); if (inst_fin != userinstall::EXISTED && inst_fin != userinstall::CREATED) @@ -1318,6 +1339,8 @@ int Desktop::Main() utl::Bootstrap::reloadData(); SetSplashScreenProgress(20); +recordTime(startT, "SetSplashScreenProgress(20): time = "); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XRestartManager > xRestartManager( OfficeRestartManager::get(xContext) ); @@ -1328,6 +1351,8 @@ int Desktop::Main() SetSplashScreenProgress(25); +recordTime(startT, "SetSplashScreenProgress(25): time = "); + #if HAVE_FEATURE_DESKTOP && !defined(EMSCRIPTEN) // check user installation directory for lockfile so we can be sure // there is no other instance using our data files from a remote host @@ -1363,6 +1388,8 @@ int Desktop::Main() SetSplashScreenProgress(30); +recordTime(startT, "SetSplashScreenProgress(30): time = "); + // create title string OUString aTitle(ReplaceStringHookProc(RID_APPTITLE)); #ifdef DBG_UTIL @@ -1372,8 +1399,12 @@ int Desktop::Main() SetDisplayName( aTitle ); SetSplashScreenProgress(35); + +recordTime(startT, "SetSplashScreenProgress(35): time = "); + pExecGlobals->pPathOptions.reset( new SvtPathOptions); SetSplashScreenProgress(40); +recordTime(startT, "SetSplashScreenProgress(40): time = "); xDesktop = css::frame::Desktop::create( xContext ); @@ -1492,6 +1523,7 @@ int Desktop::Main() pExecGlobals->xGlobalBroadcaster->documentEventOccured(aEvent); SetSplashScreenProgress(50); +recordTime(startT, "SetSplashScreenProgress(50): time = "); // Backing Component bool bCrashed= false; @@ -1546,6 +1578,7 @@ int Desktop::Main() } SetSplashScreenProgress(55); +recordTime(startT, "SetSplashScreenProgress(55): time = "); svtools::ApplyFontSubstitutionsToVcl(); @@ -1553,6 +1586,7 @@ int Desktop::Main() SvtTabAppearanceCfg::SetApplicationDefaults( this ); SvtAccessibilityOptions::SetVCLSettings(); SetSplashScreenProgress(60); +recordTime(startT, "SetSplashScreenProgress(60): time = "); if ( !pExecGlobals->bRestartRequested ) { @@ -1560,11 +1594,13 @@ int Desktop::Main() // Preload function depends on an initialized sfx application! SetSplashScreenProgress(75); +recordTime(startT, "SetSplashScreenProgress(75): time = "); // use system window dialogs Application::SetSystemWindowMode( SystemWindowFlags::DIALOG ); SetSplashScreenProgress(80); +recordTime(startT, "SetSplashScreenProgress(80): time = "); if ( !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() ) @@ -1573,6 +1609,7 @@ int Desktop::Main() if ( xDesktop.is() ) xDesktop->addTerminateListener( new RequestHandlerController ); SetSplashScreenProgress(100); +recordTime(startT,
core.git: desktop/source
desktop/source/deployment/misc/dp_platform.cxx | 28 ++--- desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 19 2 files changed, 26 insertions(+), 21 deletions(-) New commits: commit b1432ad59d6210da49e8c5c113ef2585d2203ca9 Author: Noel Grandin AuthorDate: Tue May 7 20:47:41 2024 +0200 Commit: Noel Grandin CommitDate: Tue May 7 22:38:50 2024 +0200 workaround compiler crash on macos-intel Change-Id: I779785c068fd04e314b4d6c22d9fe66d9aa88736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167294 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx index bd22a8a788b4..77239ec4e4b9 100644 --- a/desktop/source/deployment/misc/dp_platform.cxx +++ b/desktop/source/deployment/misc/dp_platform.cxx @@ -31,25 +31,29 @@ namespace dp_misc { namespace { +OUString StrOperatingSystemInit() +{ +OUString os( u"$_OS"_ustr ); +::rtl::Bootstrap::expandMacros( os ); +return os; +} + const OUString & StrOperatingSystem() { -static const OUString theOS = []() -{ -OUString os( u"$_OS"_ustr ); -::rtl::Bootstrap::expandMacros( os ); -return os; -}(); +static const OUString theOS = StrOperatingSystemInit(); return theOS; }; +OUString StrCPUInit() +{ +OUString arch( u"$_ARCH"_ustr ); +::rtl::Bootstrap::expandMacros( arch ); +return arch; +} + const OUString & StrCPU() { -static const OUString theCPU = []() -{ -OUString arch( u"$_ARCH"_ustr ); -::rtl::Bootstrap::expandMacros( arch ); -return arch; -}(); +static const OUString theCPU = StrCPUInit(); return theCPU; }; diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 5577a840faf6..c0b7058b2206 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -155,17 +155,18 @@ bool readArgument( } +static OUString getExecutableDirInit() +{ +OUString path; +if (osl_getExecutableFile( ) != osl_Process_E_None) { +throw RuntimeException(u"cannot locate executable directory!"_ustr,nullptr); +} +return path.copy( 0, path.lastIndexOf( '/' ) ); +} + OUString const & getExecutableDir() { -static const OUString EXEC = -[]() -{ -OUString path; -if (osl_getExecutableFile( ) != osl_Process_E_None) { -throw RuntimeException(u"cannot locate executable directory!"_ustr,nullptr); -} -return path.copy( 0, path.lastIndexOf( '/' ) ); -}(); +static const OUString EXEC = getExecutableDirInit(); return EXEC; }
core.git: desktop/source include/sfx2 sfx2/source
desktop/source/lib/init.cxx| 10 -- include/sfx2/lokhelper.hxx |4 sfx2/source/view/lokhelper.cxx | 30 ++ 3 files changed, 38 insertions(+), 6 deletions(-) New commits: commit 1ac07d2c9d45cc5db3f689d287ad9be939ef1124 Author: Gökay Şatır AuthorDate: Tue Apr 23 14:40:14 2024 +0300 Commit: Gökay ŞATIR CommitDate: Wed May 1 16:16:52 2024 +0200 Use a for loop for setting view properties. Since there may be no view with the given id, checking the list first is safer. Signed-off-by: Gökay Şatır Change-Id: I4c305e0a0f6ce7cccdfea9889c414a6054ed3a88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166531 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks (cherry picked from commit 4d8c4a60105488be84ea80775dc04a24582752fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166720 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 22a0abd3a6e3..a857dec6f3f5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7232,26 +7232,24 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p } } -static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, const bool readOnly) +static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const bool readOnly) { comphelper::ProfileZone aZone("doc_setViewReadOnly"); SolarMutexGuard aGuard; SetLastExceptionMsg(); -doc_setView(pThis, nId); -SfxViewShell::Current()->SetLokReadOnlyView(readOnly); +SfxLokHelper::setViewReadOnly(nId, readOnly); } -static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, const bool allow) +static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const bool allow) { comphelper::ProfileZone aZone("doc_setAllowChangeComments"); SolarMutexGuard aGuard; SetLastExceptionMsg(); -doc_setView(pThis, nId); -SfxViewShell::Current()->SetAllowChangeComments(allow); +SfxLokHelper::setAllowChangeComments(nId, allow); } static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, bool nEnabled) diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index c4e88035fd96..3820558d6500 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -119,6 +119,10 @@ public: static void setDefaultLanguage(const OUString& rBcp47LanguageTag); /// Enable/Disable AT support for the given view. static void setAccessibilityState(int nId, bool nEnabled); +// Set the readonly state of the view. +static void setViewReadOnly(int nId, bool readOnly); +// In readonly view, can user add / modify comments or not. +static void setAllowChangeComments(int nId, bool allow); /// Get the language used by the loading view (used for all save operations). static const LanguageTag & getLoadLanguage(); /// Set the language used by the loading view (used for all save operations). diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index ff9f1a8175bf..145484fce9e7 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -342,6 +342,36 @@ void SfxLokHelper::setViewLanguage(int nId, const OUString& rBcp47LanguageTag) } } +void SfxLokHelper::setViewReadOnly(int nId, bool readOnly) +{ +std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl(); + +for (SfxViewShell* pViewShell : rViewArr) +{ +if (pViewShell && pViewShell->GetViewShellId() == ViewShellId(nId)) +{ +LOK_INFO("lok.readonlyview", "SfxLokHelper::setViewReadOnly: view id: " << nId << ", readOnly: " << readOnly); +pViewShell->SetLokReadOnlyView(readOnly); +return; +} +} +} + +void SfxLokHelper::setAllowChangeComments(int nId, bool allow) +{ +std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl(); + +for (SfxViewShell* pViewShell : rViewArr) +{ +if (pViewShell && pViewShell->GetViewShellId() == ViewShellId(nId)) +{ +LOK_INFO("lok.readonlyview", "SfxLokHelper::setAllowChangeComments: view id: " << nId << ", allow: " << allow); +pViewShell->SetAllowChangeComments(allow); +return; +} +} +} + void SfxLokHelper::setAccessibilityState(int nId, bool nEnabled) { std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();
core.git: desktop/source
desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 17 +++- desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx | 21 +++ desktop/source/deployment/registry/help/dp_help.cxx | 18 + desktop/source/deployment/registry/package/dp_package.cxx|9 +--- 4 files changed, 20 insertions(+), 45 deletions(-) New commits: commit 55eb79f8f52ef20198aeba04578a1be4d100b126 Author: Mike Kaganski AuthorDate: Mon Apr 29 15:11:54 2024 +0500 Commit: Mike Kaganski CommitDate: Tue Apr 30 15:12:14 2024 +0200 Drop uses of css::uno::Sequence::getConstArray in deployment where it was obsoleted by commits 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code 2021-11-05). Change-Id: I3b2cb267010e7b654291fa866b28c7cc272f0ea1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166911 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index c91ec4a0b132..fe7194405576 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -507,27 +507,24 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & } else { +assert(approve != abort); // select: -uno::Sequence< uno::Reference< task::XInteractionContinuation > > conts( -xRequest->getContinuations() ); -uno::Reference< task::XInteractionContinuation > const * pConts = conts.getConstArray(); -sal_Int32 len = conts.getLength(); -for ( sal_Int32 pos = 0; pos < len; ++pos ) +for (auto& cont : xRequest->getContinuations()) { if (approve) { -uno::Reference< task::XInteractionApprove > xInteractionApprove( pConts[ pos ], uno::UNO_QUERY ); +uno::Reference xInteractionApprove(cont, uno::UNO_QUERY); if (xInteractionApprove.is()) { xInteractionApprove->select(); // don't query again for ongoing continuations: -approve = false; +break; } } -else if (abort) { -uno::Reference< task::XInteractionAbort > xInteractionAbort( pConts[ pos ], uno::UNO_QUERY ); +else /*if (abort)*/ { +uno::Reference xInteractionAbort(cont, uno::UNO_QUERY); if (xInteractionAbort.is()) { xInteractionAbort->select(); // don't query again for ongoing continuations: -abort = false; +break; } } } diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx index 0248a1537fa1..e15c72c9caac 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx @@ -623,21 +623,14 @@ void UpdateCommandEnv::handle( else { // select: -css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > conts( -xRequest->getContinuations() ); -css::uno::Reference< css::task::XInteractionContinuation > const * pConts = -conts.getConstArray(); -sal_Int32 len = conts.getLength(); -for ( sal_Int32 pos = 0; pos < len; ++pos ) +for (auto& cont : xRequest->getContinuations()) { -if (approve) { -css::uno::Reference< css::task::XInteractionApprove > xInteractionApprove( -pConts[ pos ], css::uno::UNO_QUERY ); -if (xInteractionApprove.is()) { -xInteractionApprove->select(); -// don't query again for ongoing continuations: -approve = false; -} +css::uno::Reference< css::task::XInteractionApprove > xInteractionApprove( +cont, css::uno::UNO_QUERY ); +if (xInteractionApprove.is()) { +xInteractionApprove->select(); +// don't query again for ongoing continuations: +break; } } } diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index a84bc2809544..b0db2acd200e 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -396,12 +396,8 @@ void BackendImpl::implProcessHelp( } // Scan languages -Sequence<
core.git: desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8b145fc3f83b5b38ff36c4986aec1f3e09863a55 Author: Caolán McNamara AuthorDate: Wed Apr 24 16:25:34 2024 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 30 09:51:18 2024 +0200 line break "Preloading breakiterator: Preload icons" so "Preloading breakiterator" is on its own line Change-Id: If2dfb6e9c636346b8b425187c4faab311cf32131 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166589 Reviewed-by: Miklos Vajna Tested-by: Jenkins CollaboraOffice (cherry picked from commit e2cbe31915c3ee98ae433894c8e08c3afe5f3bb8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166866 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f06151be6cfa..22a0abd3a6e3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7585,7 +7585,7 @@ static void preloadData() } std::cerr << " "; -std::cerr << "Preloading breakiterator: "; +std::cerr << "Preloading breakiterator "; if (aLocales.getLength()) { css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = css::i18n::BreakIterator::create(xContext);
core.git: desktop/source extensions/source i18npool/source include/comphelper scripting/source sd/qa slideshow/source stoc/source sw/source testtools/source
desktop/source/deployment/manager/dp_commandenvironments.cxx | 21 +-- desktop/source/deployment/registry/component/dp_component.cxx |4 extensions/source/abpilot/datasourcehandling.cxx | 14 -- extensions/source/abpilot/fieldmappingimpl.cxx| 24 +--- extensions/source/bibliography/bibconfig.cxx | 31 ++--- extensions/source/bibliography/bibload.cxx|2 extensions/source/bibliography/datman.cxx | 54 -- extensions/source/bibliography/framectr.cxx | 12 -- extensions/source/bibliography/toolbar.cxx| 16 -- extensions/source/dbpilots/controlwizard.cxx | 21 +-- extensions/source/dbpilots/gridwizard.cxx | 19 +-- i18npool/source/localedata/saxparser.cxx |2 include/comphelper/namedvaluecollection.hxx |8 - scripting/source/basprov/baslibnode.cxx |3 scripting/source/basprov/basscript.cxx|3 sd/qa/unit/import-tests.cxx |2 slideshow/source/engine/opengl/TransitionerImpl.cxx | 43 +++ stoc/source/implementationregistration/implreg.cxx| 32 ++--- stoc/source/implementationregistration/mergekeys.cxx |5 stoc/source/security/permissions.cxx |3 stoc/source/servicemanager/servicemanager.cxx |7 - sw/source/core/unocore/unostyle.cxx | 26 +--- testtools/source/bridgetest/bridgetest.cxx|4 23 files changed, 136 insertions(+), 220 deletions(-) New commits: commit ea9367037232054a576f1e6aabffeb3a62ffa44b Author: Mike Kaganski AuthorDate: Mon Apr 29 01:31:19 2024 +0500 Commit: Mike Kaganski CommitDate: Tue Apr 30 06:20:50 2024 +0200 Drop some uses of css::uno::Sequence::getConstArray ... where it was obsoleted by commits 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code 2021-11-05). Change-Id: I4ccc647bb794515c8c11f8dfd9a26563f4aa094b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166819 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx index 2b98ff971908..4a0a88f42432 100644 --- a/desktop/source/deployment/manager/dp_commandenvironments.cxx +++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx @@ -82,21 +82,14 @@ void BaseCommandEnv::handle_(bool approve, else { // select: -uno::Sequence< Reference< task::XInteractionContinuation > > conts( -xRequest->getContinuations() ); -Reference< task::XInteractionContinuation > const * pConts = -conts.getConstArray(); -sal_Int32 len = conts.getLength(); -for ( sal_Int32 pos = 0; pos < len; ++pos ) +for (auto& xContinuation : xRequest->getContinuations()) { -if (approve) { -Reference< task::XInteractionApprove > xInteractionApprove( -pConts[ pos ], uno::UNO_QUERY ); -if (xInteractionApprove.is()) { -xInteractionApprove->select(); -// don't query again for ongoing continuations: -approve = false; -} +Reference xInteractionApprove(xContinuation, uno::UNO_QUERY); +if (xInteractionApprove.is()) +{ +xInteractionApprove->select(); +// don't query again for ongoing continuations: +break; } } } diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 7a692ec8c6c5..7efa1ba854e6 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -1279,13 +1279,11 @@ BackendImpl::ComponentPackageImpl::isRegistered_( Sequence implNames; if (xImplKey.is() && xImplKey->isValid()) implNames = xImplKey->getKeyNames(); -OUString const * pImplNames = implNames.getConstArray(); sal_Int32 pos = implNames.getLength(); for ( ; pos--; ) { checkAborted( abortChannel ); -const OUString key( -pImplNames[ pos ] + "/UNO/LOCATION" ); +const OUString key(implNames[pos] + "/UNO/LOCATION"); const Reference xKey( xRootKey->openKey(key) ); if
core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |3 ++- sfx2/source/control/unoctitm.cxx |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit 9648f81f98d07cd4aef8611a50a77f11fb7ba86e Author: Hubert Figuière AuthorDate: Thu Apr 25 14:01:11 2024 -0400 Commit: Caolán McNamara CommitDate: Mon Apr 29 09:31:06 2024 +0200 cool#8066: calc: enable .uno:ToggleSheetGrid Signed-off-by: Hubert Figuière Change-Id: Ibe5bca4d0622c4015030a21d4ecccd41d5e9f483 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166529 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f13bc1f48e26..f06151be6cfa 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3847,7 +3847,8 @@ static void doc_iniUnoCommands () u".uno:InsertPictureContentControl"_ustr, u".uno:DataFilterAutoFilter"_ustr, u".uno:CellProtection"_ustr, -u".uno:MoveKeepInsertMode"_ustr +u".uno:MoveKeepInsertMode"_ustr, +u".uno:ToggleSheetGrid"_ustr, }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 0691a6bad444..c6250e27d170 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -940,7 +940,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "SpacePara15" || aEvent.FeatureURL.Path == "SpacePara2" || aEvent.FeatureURL.Path == "DataFilterAutoFilter" || -aEvent.FeatureURL.Path == "CellProtection") +aEvent.FeatureURL.Path == "CellProtection" || +aEvent.FeatureURL.Path == "ToggleSheetGrid") { bool bTemp = false; aEvent.State >>= bTemp;
core.git: desktop/source
desktop/source/lib/init.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 278828dce69d3fc143a81d7d40f9e9368f8e2c89 Author: Caolán McNamara AuthorDate: Mon Apr 22 17:17:05 2024 +0100 Commit: Noel Grandin CommitDate: Mon Apr 22 22:02:07 2024 +0200 thesauri list can be empty at preload if none of the dictionaries are installed, seen in a bare bones docker image, giving a backtrace of: /usr/bin/coolforkit(_ZN7SigUtil13dumpBacktraceEv+0x73)[0x632d83] /usr/bin/coolforkit[0x6331a5] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f48788b4980] /opt/collaboraoffice/program/libuno_sal.so.3(rtl_uString_assign+0xc)[0x7f487070582c] /opt/collaboraoffice/program/libmergedlo.so(+0x20f9478)[0x7f4873cbc478] /opt/collaboraoffice/program/libmergedlo.so(+0x20fa3c4)[0x7f4873cbd3c4] /opt/collaboraoffice/program/libmergedlo.so(+0x27e6d82)[0x7f48743a9d82] /opt/collaboraoffice/program/libmergedlo.so(+0x27e8eac)[0x7f48743abeac] /opt/collaboraoffice/program/libmergedlo.so(lok_preinit_2+0x1c)[0x7f48743ad31c] /usr/bin/coolforkit(_Z13globalPreinitRKSs+0x1e8)[0x5dfdd8] /usr/bin/coolforkit(_Z11forkit_mainiPPc+0x1582)[0x5aa482] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f48784d2c87] /usr/bin/coolforkit[0x56c392] Change-Id: Ib3a8ada7c22611e04e9db8dfa7cb0e227ece0f84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166432 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c3afbf741a37..f13bc1f48e26 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7585,10 +7585,13 @@ static void preloadData() std::cerr << " "; std::cerr << "Preloading breakiterator: "; -css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = css::i18n::BreakIterator::create(xContext); -css::i18n::LineBreakUserOptions aUserOptions; -css::i18n::LineBreakHyphenationOptions aHyphOptions( LinguMgr::GetHyphenator(), css::uno::Sequence(), 1 ); -xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], /*nMinBreakPos*/0, aHyphOptions, aUserOptions); +if (aLocales.getLength()) +{ +css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = css::i18n::BreakIterator::create(xContext); +css::i18n::LineBreakUserOptions aUserOptions; +css::i18n::LineBreakHyphenationOptions aHyphOptions( LinguMgr::GetHyphenator(), css::uno::Sequence(), 1 ); +xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], /*nMinBreakPos*/0, aHyphOptions, aUserOptions); +} css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create( comphelper::getProcessComponentContext());
core.git: desktop/source
desktop/source/lib/init.cxx |8 1 file changed, 8 insertions(+) New commits: commit 14ae46251d44282feba222e3c24815f6d24e78ca Author: Noel Grandin AuthorDate: Mon Apr 15 16:10:54 2024 +0200 Commit: Noel Grandin CommitDate: Tue Apr 16 18:34:35 2024 +0200 preload BreakIterator for LOK Change-Id: I22bea46d224f4020bb18d2826f23985fc2d8e492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166129 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f1ca1291aed0..c3afbf741a37 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -127,6 +128,7 @@ #include #include #include +#include #include #include @@ -7582,6 +7584,12 @@ static void preloadData() } std::cerr << " "; +std::cerr << "Preloading breakiterator: "; +css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = css::i18n::BreakIterator::create(xContext); +css::i18n::LineBreakUserOptions aUserOptions; +css::i18n::LineBreakHyphenationOptions aHyphOptions( LinguMgr::GetHyphenator(), css::uno::Sequence(), 1 ); +xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], /*nMinBreakPos*/0, aHyphOptions, aUserOptions); + css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create( comphelper::getProcessComponentContext()); xGlobalCfg->getAllKeyEvents();
core.git: desktop/source
desktop/source/minidump/minidump.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 6a4031ec8338b005682493f65744ebcbc30a5f81 Author: Stephan Bergmann AuthorDate: Fri Apr 12 17:42:45 2024 +0200 Commit: Stephan Bergmann CommitDate: Fri Apr 12 23:36:48 2024 +0200 At least capture (English-only) cURL error when something goes wrong ...so that svx/source/dialog/crashreportdlg.cxx can at least present that, instead of confusingly being silent about the error Change-Id: I5e8af5f8df4cbcad84f8b60c2de4c55621b28890 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166037 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 0a31fff6f285..90d23f51acf3 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -184,7 +184,13 @@ static bool uploadContent(std::map& parameters, std::s response = response_body; if( CURLE_OK != cc ) +{ +if (response.empty()) +{ +response = curl_easy_strerror(cc); +} return false; +} return true; }
core.git: desktop/source
desktop/source/deployment/registry/package/dp_package.cxx | 17 +- 1 file changed, 16 insertions(+), 1 deletion(-) New commits: commit cab028121bd9b620529b6492b3247ac48ac2082b Author: Patrick Luby AuthorDate: Wed Apr 3 17:34:49 2024 -0400 Commit: Noel Grandin CommitDate: Thu Apr 4 08:01:19 2024 +0200 tdf#159790 temporarily release mutex for child packages This code is normally run on a separate thread so if a child package tries to acquire the solar mutex, a deadlock can occur if the main thread calls isRegistered() on this package or any of its parents. So, temporarily release this package's mutex while registering the child package. Change-Id: I45b534c44d5946637a5441927ed01a68aad4c448 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165766 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 6af2fb5515f5..d5c1feeb4992 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -781,7 +781,7 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool void BackendImpl::PackageImpl::processPackage_( -::osl::ResettableMutexGuard &, +::osl::ResettableMutexGuard & guard, bool doRegisterPackage, bool startup, ::rtl::Reference const & abortChannel, @@ -802,10 +802,20 @@ void BackendImpl::PackageImpl::processPackage_( xPackage->createAbortChannel() ); AbortChannel::Chain chain( abortChannel, xSubAbortChannel ); try { +// tdf#159790 temporarily release mutex for child packages +// This code is normally run on a separate thread so if a +// child package tries to acquire the solar mutex, a deadlock +// can occur if the main thread calls isRegistered() on this +// package or any of its parents. So, temporarily release +// this package's mutex while registering the child package. +guard.clear(); xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv ); +guard.reset(); } catch (const Exception &) { +guard.reset(); + //We even try a rollback if the user cancelled the action (CommandAbortedException) //in order to prevent invalid database entries. Any exc( ::cppu::getCaughtException() ); @@ -856,6 +866,11 @@ void BackendImpl::PackageImpl::processPackage_( ::cppu::throwException(exc); } } +catch (...) { +guard.reset(); +throw; +} + data.items.emplace_back(xPackage->getURL(), xPackage->getPackageType()->getMediaType()); }
core.git: desktop/source
desktop/source/app/app.cxx |4 1 file changed, 4 insertions(+) New commits: commit 374ac88c2cab8065eca3b9479c0039f6893fedf0 Author: Xisco Fauli AuthorDate: Wed Apr 3 10:50:11 2024 +0200 Commit: Xisco Fauli CommitDate: Wed Apr 3 18:51:18 2024 +0200 desktop: fix build with enable-online-update Regression from 75706c003c3e224047e2f5b079aebde4e3d40d74 "tdf#146619 Remove unused #includes from C/C++ files" See https://ci.libreoffice.org/job/lo_daily_tb_win/1718/console Change-Id: I32f406aa44dfe37c472cf4de7805141daf37ab66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165738 Tested-by: Jenkins Reviewed-by: Gabor Kelemen diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index d02041c220a2..0e529e071427 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -127,6 +127,10 @@ #include "langselect.hxx" #include +#if HAVE_FEATURE_UPDATE_MAR +#include +#endif + #if defined MACOSX #include #include
core.git: desktop/source
desktop/source/deployment/registry/configuration/dp_configuration.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 89e23bb599104d3bde30878148e15cf4deb1593f Author: Patrick Luby AuthorDate: Tue Apr 2 10:38:58 2024 -0400 Commit: Noel Grandin CommitDate: Tue Apr 2 21:10:19 2024 +0200 tdf#159790 eliminate deadlock on main thread A separate thread may have already acquired m_aMutex and that thread will then try to acquire the solar mutex. However, when the main thread calls this method, the main thread has already acquired the solar mutex. So, drop the desktop mutex before calling out. Change-Id: Ic87063266ac5101b866df9f24067a403e1417745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165682 Reviewed-by: Patrick Luby Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 3bfac940bce6..9ef3cc969432 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -653,7 +653,7 @@ OUString replaceOrigin( void BackendImpl::PackageImpl::processPackage_( -::osl::ResettableMutexGuard &, +::osl::ResettableMutexGuard & guard, bool doRegisterPackage, bool startup, ::rtl::Reference const &, @@ -688,7 +688,10 @@ void BackendImpl::PackageImpl::processPackage_( if ((that->m_eContext != Context::Bundled && !startup) || comphelper::LibreOfficeKit::isActive()) { -if (m_isSchema) +bool bIsSchema = m_isSchema; +// tdf#159790 prevent lock-ordering deadlock, the code below might acquire the solar mutex +guard.clear(); +if (bIsSchema) { css::configuration::Update::get( that->m_xComponentContext)->insertExtensionXcsFile( @@ -700,6 +703,7 @@ void BackendImpl::PackageImpl::processPackage_( that->m_xComponentContext)->insertExtensionXcuFile( that->m_eContext == Context::Shared, expandUnoRcUrl(url)); } +guard.reset(); } that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv ); data.iniEntry = dp_misc::makeRcTerm(url);
core.git: desktop/source
desktop/source/app/app.cxx |1 - desktop/source/app/appinit.cxx |2 -- desktop/source/deployment/misc/dp_resource.cxx |1 - 3 files changed, 4 deletions(-) New commits: commit 9f3d3cec7cd3b8c6e79f52028c89e0abd9b5eec0 Author: Gabor Kelemen AuthorDate: Fri Mar 29 14:05:52 2024 +0100 Commit: Gabor Kelemen CommitDate: Mon Apr 1 20:47:52 2024 +0200 tdf#146619 Drop unused 'using namespace' in: desktop/ Change-Id: I120471364834dfd0702b6ce15f79a8327cac26b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165534 Tested-by: Jenkins Reviewed-by: Gabor Kelemen diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index d59855e58b03..0a893b9adc28 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -157,7 +157,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::document; -using namespace ::com::sun::star::view; using namespace ::com::sun::star::task; using namespace ::com::sun::star::system; using namespace ::com::sun::star::ui; diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 1a0681f0d163..76bd04347ad6 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -51,8 +51,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::registry; using namespace ::com::sun::star::ucb; namespace desktop diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx index 682c90e52458..30caef8d9a7d 100644 --- a/desktop/source/deployment/misc/dp_resource.cxx +++ b/desktop/source/deployment/misc/dp_resource.cxx @@ -22,7 +22,6 @@ #include using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; namespace dp_misc {
core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |3 +++ sfx2/source/control/unoctitm.cxx | 15 ++- 2 files changed, 17 insertions(+), 1 deletion(-) New commits: commit c15b872784c8fc0f5e5e813d38c7722f034034d2 Author: Gökay Şatır AuthorDate: Fri Mar 8 13:51:01 2024 +0300 Commit: Miklos Vajna CommitDate: Tue Mar 26 16:48:51 2024 +0100 Allow enabling saving when comment edit is allowed in readonly. Change-Id: I88d535a5b23fb6d5de8e72eec61bdf3550bc757d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165334 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6eba39cc32f3..99c533c20598 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5079,6 +5079,9 @@ static bool isCommandAllowed(OUString& command) { return true; else { +if (command == u".uno:Save"_ustr && SfxViewShell::Current() && SfxViewShell::Current()->IsAllowChangeComments()) +return true; + for (size_t i = 0; i < std::size(nonAllowedList); i++) { if (nonAllowedList[i] == command) diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 24beba448818..1068b28e0ac8 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -547,7 +547,20 @@ static bool isCommandAllowedForViewType(const OUString& command) u"CopyHyperlinkLocation"_ustr }; -return std::find(std::begin(allowedCommandList), std::end(allowedCommandList), command) != std::end(allowedCommandList); +bool allowed = std::find(std::begin(allowedCommandList), std::end(allowedCommandList), command) != std::end(allowedCommandList); + +if (!allowed && SfxViewShell::Current() && SfxViewShell::Current()->IsAllowChangeComments()) +{ +constexpr OUString allowedCommentCommandList[] = { +u"InsertAnnotation"_ustr, +u"DeleteComment"_ustr, +u"DeleteAnnotation"_ustr, +u"EditAnnotation"_ustr +}; +allowed = std::find(std::begin(allowedCommentCommandList), std::end(allowedCommentCommandList), command) != std::end(allowedCommentCommandList); +} + +return allowed; } return true;
core.git: desktop/source editeng/source include/sfx2 sc/source sfx2/inc sfx2/source svx/sdi svx/source sw/source
desktop/source/lib/init.cxx | 28 editeng/source/editeng/editview.cxx |3 - editeng/source/editeng/impedit2.cxx | 81 +++- include/sfx2/viewsh.hxx |1 sc/source/ui/app/inputhdl.cxx |6 +- sc/source/ui/view/gridwin.cxx |2 sfx2/inc/unoctitm.hxx |1 sfx2/source/control/dispatch.cxx| 13 - sfx2/source/control/unoctitm.cxx| 39 + sfx2/source/doc/objmisc.cxx |3 - sfx2/source/view/viewsh.cxx |7 +++ svx/sdi/svx.sdi |2 svx/source/svdraw/svdedtv.cxx |3 - sw/source/uibase/docvw/edtwin.cxx | 68 -- sw/source/uibase/inc/edtwin.hxx |2 sw/source/uibase/uiview/srcview.cxx |2 16 files changed, 179 insertions(+), 82 deletions(-) New commits: commit 1de1c47471278db2344c986e9d597d6a05e559e9 Author: Gökay Şatır AuthorDate: Thu Feb 22 13:54:06 2024 +0300 Commit: Miklos Vajna CommitDate: Thu Mar 21 16:32:09 2024 +0100 Moving parts of readonly checks from model to view. Summary for what's done with this commit: init.cxx * Add guards for modify commands. viewsh: * Add "IsCurrentLokViewReadOnly" for ease of use. unocitm: * Add guard for modify comamnds dispatch.cxx * Implement readonlyview. objmisc: * Modify IsReadOnlyUI check for LokReadOnly view. svx.sdi: * Disable TableChangeCurrentBorderPosition command for readOnly views. sw-editwin: * Treat mouse moves as readonly when the view is LokReadOnly. gridwin: * For autofilter. impedit2, inputhdl: * For text input. svdedtc: * For sdr object dragging. Change-Id: I71fc353976256bce22042bbb6042ee464b65cc13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165093 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 25ba3ade88c4..6eba39cc32f3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4686,6 +4686,10 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, int nCharBefore, int nCharAfter) { SolarMutexGuard aGuard; + +if (SfxViewShell::IsCurrentLokViewReadOnly()) +return; + VclPtr pWindow; if (nLOKWindowId == 0) { @@ -5067,6 +5071,23 @@ void LibLibreOffice_Impl::dumpState(rtl::OStringBuffer ) vcl::lok::dumpState(rState); } +// We have special handling for some uno commands and it seems we need to check for readonly state. +static bool isCommandAllowed(OUString& command) { +static constexpr OUString nonAllowedList[] = { u".uno:Save"_ustr, u".uno:TransformDialog"_ustr, u".uno:SidebarShow"_ustr, u".uno:SidebarHide"_ustr }; + +if (!SfxViewShell::IsCurrentLokViewReadOnly()) +return true; +else +{ +for (size_t i = 0; i < std::size(nonAllowedList); i++) +{ +if (nonAllowedList[i] == command) +return false; +} +return true; +} +} + static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished) { comphelper::ProfileZone aZone("doc_postUnoCommand"); @@ -5076,6 +5097,10 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma SfxObjectShell* pDocSh = SfxObjectShell::Current(); OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8); + +if (!isCommandAllowed(aCommand)) +return; + LibLODocument_Impl* pDocument = static_cast(pThis); std::vector aPropertyValuesVector(jsonToPropertyValuesVector(pArguments)); @@ -7133,6 +7158,9 @@ static void doc_sendContentControlEvent(LibreOfficeKitDocument* pThis, const cha return; } +if (SfxViewShell::IsCurrentLokViewReadOnly()) +return; + StringMap aMap(jsdialog::jsonToStringMap(pArguments)); ITiledRenderable* pDoc = getTiledRenderable(pThis); if (!pDoc) diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 7f20f65cb0bb..81fbd2d10b39 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -156,6 +156,7 @@ EditView::EditView(EditEngine* pEditEngine, vcl::Window* pWindow) : mpImpEditView(new ImpEditView(this, pEditEngine, pWindow)) { assert(pEditEngine); +getImpl().mbReadOnly = getImpl().mbReadOnly || SfxViewShell::IsCurrentLokViewReadOnly(); } EditView::~EditView() @@ -253,7 +254,7 @@ void EditView::Invalidate() void EditView::SetReadOnly( bool bReadOnly ) { -getImpl().mbReadOnly = bReadOnly; +getImpl().mbReadOnly = bReadOnly ||
core.git: desktop/source include/sfx2 sd/qa sfx2/source
desktop/source/lib/init.cxx | 54 --- include/sfx2/sidebar/Sidebar.hxx |2 + sd/qa/unit/tiledrendering/tiledrendering.cxx | 41 sfx2/source/sidebar/Sidebar.cxx | 46 +++ sfx2/source/sidebar/SidebarController.cxx| 10 - 5 files changed, 107 insertions(+), 46 deletions(-) New commits: commit 55feb670ca28e0a48ac82a65b5559598704d993e Author: Miklos Vajna AuthorDate: Wed Mar 20 12:08:42 2024 +0100 Commit: Miklos Vajna CommitDate: Thu Mar 21 01:40:11 2024 +0100 cool#8278 sfx2 lok: fix unexpected non-json sidebar status update Open an Impress document via LOK, open the slide layout sidebar, click the toggle icon so it gets closed: the toggle icon will signal that the sidebar is open, when it's closed already. This is a regression from commit aaf6ce108e91b1504befe19afcee471e3316ae7a (cool#7492 sfx2 lok: set language/locale on async sidebar update, 2024-01-11), previously we always emitted LOK_CALLBACK_STATE_CHANGED callbacks with plain text payloads for the sidebar, where the locale with implicit (with all its issues), but the above scenario worked fine. Fix the problem by making SidebarController::disposeDecks() consistent with SwitchToDeck(), so now we always emit JSON payloads for the sidebar deck changes. An alternative would be to improve the code around extractUnoCommand() in online.git to handle a mix of plain text and JSON payloads, but the plain text payload is tricky to extend, so using more JSON payloads sounds like a better fix. Change-Id: I5b75c2987c230c6720181a1e95ae579727943235 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165055 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8550b9d91b1b..25ba3ade88c4 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -150,6 +150,7 @@ #include #include #include +#include #include #include #include @@ -986,49 +987,6 @@ void ExecuteOrientationChange() mxUndoManager->leaveUndoContext(); } -void setupSidebar(std::u16string_view sidebarDeckId = u"") -{ -SfxViewShell* pViewShell = SfxViewShell::Current(); -SfxViewFrame* pViewFrame = pViewShell ? >GetViewFrame() : nullptr; -if (pViewFrame) -{ -if (!pViewFrame->GetChildWindow(SID_SIDEBAR)) -pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, true /* focus */); - -pViewFrame->ShowChildWindow(SID_SIDEBAR, true); - -// Force synchronous population of panels -SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR); -if (!pChild) -return; - -auto pDockingWin = dynamic_cast(pChild->GetWindow()); -if (!pDockingWin) -return; - -pViewFrame->ShowChildWindow( SID_SIDEBAR ); - -const rtl::Reference& xController -= pDockingWin->GetOrCreateSidebarController(); - -xController->FadeIn(); -xController->RequestOpenDeck(); - -if (!sidebarDeckId.empty()) -{ -xController->SwitchToDeck(sidebarDeckId); -} -else -{ -xController->SwitchToDefaultDeck(); -} - -pDockingWin->SyncUpdate(); -} -else -SetLastExceptionMsg(u"No view shell or sidebar"_ustr); -} - void hideSidebar() { SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -5269,12 +5227,18 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma } else if (gImpl && aCommand == ".uno:LOKSidebarWriterPage") { -setupSidebar(u"WriterPageDeck"); +if (!sfx2::sidebar::Sidebar::Setup(u"WriterPageDeck")) +{ +SetLastExceptionMsg(u"failed to set up sidebar"_ustr); +} return; } else if (gImpl && aCommand == ".uno:SidebarShow") { -setupSidebar(); +if (!sfx2::sidebar::Sidebar::Setup(u"")) +{ +SetLastExceptionMsg(u"failed to set up sidebar"_ustr); +} return; } else if (gImpl && aCommand == ".uno:SidebarHide") diff --git a/include/sfx2/sidebar/Sidebar.hxx b/include/sfx2/sidebar/Sidebar.hxx index f4d0c1cc9bcb..93212a8ed557 100644 --- a/include/sfx2/sidebar/Sidebar.hxx +++ b/include/sfx2/sidebar/Sidebar.hxx @@ -61,6 +61,8 @@ public: static bool IsPanelVisible( std::u16string_view rsPanelId, const css::uno::Reference& rxFrame); + +static bool Setup(std::u16string_view sidebarDeckId = u""); }; } // end of namespace sfx2::sidebar diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 31d61c1fb1a0..8f0fd9cfc4ae 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++
core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |2 ++ sfx2/source/control/unoctitm.cxx |2 ++ 2 files changed, 4 insertions(+) New commits: commit d3ae37902ee2ded2926b1a41816b33404f1cda1d Author: Aron Budea AuthorDate: Tue Mar 12 18:20:24 2024 +1030 Commit: Aron Budea CommitDate: Tue Mar 12 19:24:12 2024 +0100 lok: Send Accept / RejectTrackedChangedToNext state change Change-Id: I194c0c3260fe90273f5b5f50c18a63e48ae85449 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164699 Tested-by: Jenkins CollaboraOffice Reviewed-by: Aron Budea (cherry picked from commit 9358d70f57ffd2ea40a3ae71db14b26307fce92e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164685 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d2525bcddcb3..90bddb4fb899 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3781,6 +3781,8 @@ static void doc_iniUnoCommands () u".uno:ParaspaceDecrease"_ustr, u".uno:AcceptTrackedChange"_ustr, u".uno:RejectTrackedChange"_ustr, +u".uno:AcceptTrackedChangeToNext"_ustr, +u".uno:RejectTrackedChangeToNext"_ustr, u".uno:ShowResolvedAnnotations"_ustr, u".uno:InsertBreak"_ustr, u".uno:InsertEndnote"_ustr, diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 9ab895887033..28097661bb7e 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1021,6 +1021,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "RejectAllTrackedChanges" || aEvent.FeatureURL.Path == "AcceptTrackedChange" || aEvent.FeatureURL.Path == "RejectTrackedChange" || + aEvent.FeatureURL.Path == "AcceptTrackedChangeToNext" || + aEvent.FeatureURL.Path == "RejectTrackedChangeToNext" || aEvent.FeatureURL.Path == "NextTrackedChange" || aEvent.FeatureURL.Path == "PreviousTrackedChange" || aEvent.FeatureURL.Path == "FormatGroup" ||
core.git: desktop/source include/LibreOfficeKit include/svx libreofficekit/source svx/source
desktop/source/lib/init.cxx |1 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 include/svx/svdmrkv.hxx |2 libreofficekit/source/gtk/lokdocview.cxx |1 svx/source/svdraw/svdedxv.cxx|6 ++ svx/source/svdraw/svdmrkv.cxx| 55 ++- 6 files changed, 57 insertions(+), 17 deletions(-) New commits: commit 34daf30c7a02208408b83a8ff872736b98a732e0 Author: Pranam Lashkari AuthorDate: Thu Mar 7 23:08:24 2024 +0530 Commit: Caolán McNamara CommitDate: Fri Mar 8 10:55:26 2024 +0100 LOK: send inner text boundry information of shapes/textbox on change instroduced new callback for LOK LOK_CALLBACK_SHAPE_INNER_TEXT now if innert text is changed LOK is instantly updated about new textarea Change-Id: I0a88e1dd77556e47f14359ce0a98701a327aceda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164497 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6d221ec84418..d2525bcddcb3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1871,6 +1871,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: case LOK_CALLBACK_TOOLTIP: +case LOK_CALLBACK_SHAPE_INNER_TEXT: { if (removeAll(type)) SAL_INFO("lok", "Removed dups of [" << type << "]: [" << aCallbackData.getPayload() << "]."); diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 2b499b091105..9a6f34bbd846 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -1045,6 +1045,13 @@ typedef enum */ LOK_CALLBACK_TOOLTIP = 71, +/** + * Used for sending the rectangle for text inside a shape/textbox + * + * Payload contains the rectangle details + */ +LOK_CALLBACK_SHAPE_INNER_TEXT = 72, + } LibreOfficeKitCallbackType; @@ -1217,6 +1224,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_CORE_LOG"; case LOK_CALLBACK_TOOLTIP: return "LOK_CALLBACK_TOOLTIP"; +case LOK_CALLBACK_SHAPE_INNER_TEXT: +return "LOK_CALLBACK_SHAPE_INNER_TEXT"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index 162581fc5def..6421b51b0dba 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -150,6 +150,7 @@ private: void UndirtyMrkPnt() const; void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const SfxViewShell* pOtherShell); +OString CreateInnerTextRectString() const; bool dumpGluePointsToJSON(boost::property_tree::ptree& rTree); protected: @@ -246,6 +247,7 @@ public: /// whether all x coordinates in use are negated or not void SetNegativeX(bool bOn) { mbNegativeX = bOn; } bool IsNegativeX() const { return mbNegativeX; } +void SetInnerTextAreaForLOKit() const; // migrate selections diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index f025cf99a140..60c3435ac28d 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1498,6 +1498,7 @@ callback (gpointer pData) case LOK_CALLBACK_A11Y_SELECTION_CHANGED: case LOK_CALLBACK_CORE_LOG: case LOK_CALLBACK_TOOLTIP: +case LOK_CALLBACK_SHAPE_INNER_TEXT: { // TODO: Implement me break; diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index c0e1b715ea31..f60baf1b64fe 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2051,7 +2051,10 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) if (mpTextEditOutlinerView->PostKeyEvent(rKEvt, pWin)) { if (mpTextEditOutliner && mpTextEditOutliner->IsModified()) +{ GetModel().SetChanged(); +SetInnerTextAreaForLOKit(); +} /* Start chaining processing */ ImpChainingEventHdl(); @@ -2242,7 +2245,10 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin) // It could execute CommandEventId::ExtTextInput, while SdrObjEditView::KeyInput // isn't called if (mpTextEditOutliner && mpTextEditOutliner->IsModified()) +{ GetModel().SetChanged(); +SetInnerTextAreaForLOKit(); +} } return true; } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index
core.git: desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a9386139613735c45765a540ce8fac98f5639d49 Author: Andrea Gelmini AuthorDate: Mon Feb 26 21:49:12 2024 +0100 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Tue Feb 27 09:13:58 2024 +0100 Fix typo Change-Id: I48f1487f11ba35b61327b148d51f8ecb4f36b78e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163992 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a53a228ada06..83a547d3e211 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4826,7 +4826,7 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n // // Typically a problem arises when double clicking a shape in calc. The 1st // click selects the shape, triggering generation of a preview, but the second -// shape engers into edit mode before doc_renderShapeSelection has a chance to +// shape enters into edit mode before doc_renderShapeSelection has a chance to // fire, at which point the shape is no longer selected. Rather than generate // an error just return a 0 length result if there is no shape selected, so we // continue to generate an error if a shape is selected, but could not provide
core.git: desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a507daadb1e033eaccc24f0d0115f5010c58873b Author: Andrea Gelmini AuthorDate: Mon Feb 26 21:48:13 2024 +0100 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Tue Feb 27 09:12:58 2024 +0100 Fix typo Change-Id: Id1e21804fb2bc93887892192e38b655c8654ed7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163991 Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> Tested-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f2382e05952d..a53a228ada06 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4826,7 +4826,7 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n // // Typically a problem arises when double clicking a shape in calc. The 1st // click selects the shape, triggering generation of a preview, but the second -// shape engers into edit mode befoce doc_renderShapeSelection has a chance to +// shape engers into edit mode before doc_renderShapeSelection has a chance to // fire, at which point the shape is no longer selected. Rather than generate // an error just return a 0 length result if there is no shape selected, so we // continue to generate an error if a shape is selected, but could not provide
core.git: desktop/source
desktop/source/lib/init.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit c279cad9484cce44cf11473478c6059d69013fd2 Author: Andrea Gelmini AuthorDate: Mon Feb 26 21:47:45 2024 +0100 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Tue Feb 27 00:10:29 2024 +0100 Remove duplicated include Change-Id: Id0e2c58678499fdda5d7bc61800d9586f06bb411 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163990 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4bc426ecd83c..f2382e05952d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -133,7 +133,6 @@ #include #include #include -#include #include #include
core.git: desktop/source
desktop/source/lib/init.cxx | 36 1 file changed, 36 insertions(+) New commits: commit 4ac24a6b7ea3af2fa5fe82f779cfaa294bbc6b6d Author: Caolán McNamara AuthorDate: Mon Feb 26 11:57:43 2024 + Commit: Caolán McNamara CommitDate: Mon Feb 26 14:56:20 2024 +0100 return early without error if no shape it selected on generating preview of current selection. Which can arise in calc on repeatedly double-clicking on a shape and pressing esc. Eventually there will be a case where the shape isn't selected by the time the preview generation is attempted. Change-Id: Ic92149b5e12f35fe69265b6c8df289819313a899 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163942 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 5bc92fdb2a5d..4bc426ecd83c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -133,6 +133,8 @@ #include #include #include +#include +#include #include #ifdef IOS @@ -4820,6 +4822,37 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n } } +// To be an exportable selection, there must be something selected and that +// selection can't be "ScCellObj" which doesn't can't provide a svg. +// +// Typically a problem arises when double clicking a shape in calc. The 1st +// click selects the shape, triggering generation of a preview, but the second +// shape engers into edit mode befoce doc_renderShapeSelection has a chance to +// fire, at which point the shape is no longer selected. Rather than generate +// an error just return a 0 length result if there is no shape selected, so we +// continue to generate an error if a shape is selected, but could not provide +// an svg. +static bool doc_hasShapeSelection(const css::uno::Reference& rComponent) +{ +uno::Reference xModel(rComponent, uno::UNO_QUERY); +if (!xModel.is()) +return false; + +uno::Reference xController(xModel->getCurrentController()); +if (!xController.is()) +return false; + +uno::Reference xSelectionSupplier(xController, uno::UNO_QUERY); +if (!xSelectionSupplier.is()) +return false; + +Any selection = xSelectionSupplier->getSelection(); +uno::Reference xSelection; +selection >>= xSelection; + +return xSelection && xSelection->getImplementationName() != "ScCellObj"; +} + static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput) { comphelper::ProfileZone aZone("doc_renderShapeSelection"); @@ -4836,6 +4869,9 @@ static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu { LibLODocument_Impl* pDocument = static_cast(pThis); +if (!doc_hasShapeSelection(pDocument->mxComponent)) +return 0; + uno::Reference xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW); SvMemoryStream aOutStream;
core.git: desktop/source
desktop/source/lib/init.cxx | 17 + 1 file changed, 17 insertions(+) New commits: commit ba0773e50b7058f12981c4d29fb05c34d7486290 Author: Michael Meeks AuthorDate: Fri Feb 2 18:16:40 2024 + Commit: Caolán McNamara CommitDate: Fri Feb 9 12:54:46 2024 +0100 preload: open and close empty documents of main types in preinit. Some quick testing suggest this saves ~800k for writer, ~3Mb for impress each loading an ~empty hello-world document. Change-Id: I9a7bc25d38d82b5556dfb04a99d5c145dd71ffec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162939 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit d85cb3832286ae1fdcf4a8494abb8212f21e4e9a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163148 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0db7e1010156..1742488a7cf9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7543,6 +7543,23 @@ static void preloadData() #pragma GCC diagnostic pop #endif +static constexpr OUString preloadComponents[] = { +u"private:factory/swriter"_ustr, +u"private:factory/scalc"_ustr, +u"private:factory/simpress"_ustr, +u"private:factory/sdraw"_ustr +}; +// getting the remote LibreOffice service manager +uno::Reference xCompLoader(frame::Desktop::create(xContext)); + +// Preload and close each of the main components once to initialize global state +uno::Sequence szEmptyArgs(0); +for (const auto& component : preloadComponents) +{ +auto xComp = xCompLoader->loadComponentFromURL(component, "_blank", 0, szEmptyArgs); +xComp->dispose(); +} + // Set user profile's path back to the original one rtl::Bootstrap::set(u"UserInstallation"_ustr, sUserPath); }
core.git: desktop/source
desktop/source/lib/init.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 8c10c63388502322ac0ac6a7e5b14e657edbe630 Author: Gabriel Masei AuthorDate: Fri Jan 19 18:11:42 2024 +0200 Commit: Henry Castro CommitDate: Fri Jan 19 18:34:21 2024 +0100 lok: remove non-filter options from filter options Filter options should be what remains after extracting any other options from the original list of options. Change-Id: Iad787b34aba58c3910118e94df66a102b44034c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162316 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dc6931e931bb..a2675fd97871 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2762,8 +2762,6 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, Application::SetDialogCancelMode(DialogCancelMode::LOKSilent); } -const OUString sFilterOptions = aOptions; - rtl::Reference const pInteraction( new LOKInteractionHandler("load"_ostr, pLib)); auto const pair(pLib->mInteractionMap.insert(std::make_pair(aURL.toUtf8(), pInteraction))); @@ -2799,7 +2797,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, // as regular files, otherwise we cannot save them; it will try // to bring saveas dialog which cannot work with LOK case uno::Sequence aFilterOptions{ -comphelper::makePropertyValue(u"FilterOptions"_ustr, sFilterOptions), +comphelper::makePropertyValue(u"FilterOptions"_ustr, aOptions), comphelper::makePropertyValue(u"InteractionHandler"_ustr, xInteraction), comphelper::makePropertyValue(u"MacroExecutionMode"_ustr, nMacroExecMode), comphelper::makePropertyValue(u"AsTemplate"_ustr, false),
core.git: desktop/source
desktop/source/app/app.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 7baceb937de6a3eef7710cedd11590081ce759f9 Author: Stephan Bergmann AuthorDate: Thu Jan 18 13:16:36 2024 +0100 Commit: Stephan Bergmann CommitDate: Thu Jan 18 16:22:58 2024 +0100 -Werror,-Wunused-function (Emscripten) Change-Id: Ia7af2ad01bab012ad55bab86aac648078d4a8928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162247 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 370fc5761553..d99b7995ed93 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -341,6 +341,7 @@ void RemoveIconCacheDirectory() namespace { +#if !defined(EMSCRIPTEN) void runGraphicsRenderTests() { if (comphelper::LibreOfficeKit::isActive()) @@ -354,6 +355,7 @@ void runGraphicsRenderTests() GraphicsRenderTests TestObject; TestObject.run(); } +#endif OUString MakeStartupErrorMessage(std::u16string_view aErrorMessage)
core.git: desktop/source include/tools sc/source tools/Library_tl.mk tools/source ucb/source
desktop/source/lib/init.cxx|8 +++ include/tools/hostfilter.hxx | 28 ++ sc/source/core/tool/webservicelink.cxx |8 +-- sc/source/ui/docshell/externalrefmgr.cxx |5 +++- tools/Library_tl.mk|1 tools/source/inet/hostfilter.cxx | 31 + ucb/source/ucp/webdav-curl/CurlSession.cxx |7 ++ 7 files changed, 85 insertions(+), 3 deletions(-) New commits: commit cf767af8de12157155eaf525ee845b196826aeb9 Author: Szymon Kłos AuthorDate: Fri Dec 1 08:35:51 2023 +0100 Commit: Szymon Kłos CommitDate: Tue Jan 9 07:49:11 2024 +0100 lok: external data source list Make possible to filter allowed data sources. It is used for WebDAV curl, WEBSERVICE function, cell external references. Change-Id: Ifc82af31ff1123b5656a21e6a27624fb1616db39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160196 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161772 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b8acbcd9e599..dc6931e931bb 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -233,6 +233,8 @@ #include #include +#include + using namespace css; using namespace vcl; using namespace desktop; @@ -7749,6 +7751,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char } } +char* pAllowlist = ::getenv("LOK_HOST_ALLOWLIST"); +if (pAllowlist) +{ +HostFilter::setAllowedHostsRegex(pAllowlist); +} + // What stage are we at ? if (pThis == nullptr) { diff --git a/include/tools/hostfilter.hxx b/include/tools/hostfilter.hxx new file mode 100644 index ..afbf885b0cb4 --- /dev/null +++ b/include/tools/hostfilter.hxx @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TOOLS_HOSTFILTER_HXX +#define INCLUDED_TOOLS_HOSTFILTER_HXX + +#include +#include + +// Helper for filtering allowed hosts for remote connections + +class TOOLS_DLLPUBLIC HostFilter +{ +public: +static void setAllowedHostsRegex(const char* sAllowedRegex); + +static bool isForbidden(const OUString& rHost); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/source/core/tool/webservicelink.cxx b/sc/source/core/tool/webservicelink.cxx index 156048430636..c30f34300edf 100644 --- a/sc/source/core/tool/webservicelink.cxx +++ b/sc/source/core/tool/webservicelink.cxx @@ -7,7 +7,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include #include #include @@ -16,6 +15,9 @@ #include #include +#include +#include + #include #include #include @@ -37,7 +39,9 @@ sfx2::SvBaseLink::UpdateResult ScWebServiceLink::DataChanged(const OUString&, co aResult.clear(); bHasResult = false; -if (comphelper::LibreOfficeKit::isActive()) +INetURLObject aURLObject(aURL); +const OUString sHost = aURLObject.GetHost(); +if (HostFilter::isForbidden(sHost)) { SAL_WARN("sc.ui", "ScWebServiceLink::DataChanged: blocked access to external file: \"" << aURL << "\""); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 860ea8058c6e..f5b3dbd26fa1 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -2542,7 +2543,9 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt if (!isFileLoadable(aFile)) return nullptr; -if (comphelper::LibreOfficeKit::isActive()) +INetURLObject aURLObject(aFile); +const OUString sHost = aURLObject.GetHost(); +if (HostFilter::isForbidden(sHost)) { SAL_WARN( "sc.ui", "ScExternalRefManager::loadSrcDocument: blocked access to external file: \"" << aFile << "\""); return nullptr; diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index 8269e6ae98bf..99176a7c0902 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -67,6 +67,7 @@ $(eval $(call gb_Library_add_exception_objects,tl,\ tools/source/inet/inetmime \ tools/source/inet/inetmsg \ tools/source/inet/inetstrm \ +tools/source/inet/hostfilter \
core.git: desktop/source include/LibreOfficeKit libreofficekit/source sfx2/source sw/qa sw/source
desktop/source/lib/init.cxx| 28 +-- include/LibreOfficeKit/LibreOfficeKitEnums.h | 14 + libreofficekit/source/gtk/lokdocview.cxx |1 sfx2/source/view/lokhelper.cxx |3 + sw/qa/extras/tiledrendering/tiledrendering.cxx | 45 ++ sw/source/uibase/docvw/edtwin2.cxx | 60 - 6 files changed, 116 insertions(+), 35 deletions(-) New commits: commit 06ff6370a4ba8084890274418eec355e8468573f Author: Mike Kaganski AuthorDate: Tue Dec 26 14:08:07 2023 +0600 Commit: Mike Kaganski CommitDate: Thu Jan 4 14:12:23 2024 +0100 Send tooltip text to LOK Call vcl::Window::RequestHelp from LOKPostAsyncEvent for mouse movement. Introduce LOK_CALLBACK_TOOLTIP callback type, and send it from SwEditWin::RequestHelp. Intention is, that the tooltip is shown by client at the current mouse pointer position, which is hopefully not far away from the point that generated the mouse event. On the next movement, the client starts a timer to hide the tooltip. If the next tooltip message arrives, the tooltip would be updated in the new place. Alternatively, the payload could contain the coordinates from the HelpEvent. Change-Id: I8e96eb6e6983ad8d13b4c5d7be4d51ff3fd11893 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161302 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 01ee10facc71..c6ccb29424da 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1841,6 +1841,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_GRAPHIC_SELECTION: case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: case LOK_CALLBACK_INVALIDATE_TILES: +case LOK_CALLBACK_TOOLTIP: if (removeAll(type)) SAL_INFO("lok", "Removed dups of [" << type << "]: [" << aCallbackData.getPayload() << "]."); break; @@ -1868,6 +1869,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED: case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: +case LOK_CALLBACK_TOOLTIP: { if (removeAll(type)) SAL_INFO("lok", "Removed dups of [" << type << "]: [" << aCallbackData.getPayload() << "]."); @@ -1877,28 +1879,26 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) // These are safe to use the latest state and ignore previous // ones (if any) since the last overrides previous ones, // but only if the view is the same. +case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: +// deleting the duplicate of visible cursor message can cause hyperlink popup not to show up on second/or more click on the same place. +// If the hyperlink is not empty we can bypass that to show the popup +if (aCallbackData.getPayload().indexOf("\"hyperlink\":\"\"") == -1 +&& aCallbackData.getPayload().indexOf("\"hyperlink\": {}") == -1) +break; +[[fallthrough]]; case LOK_CALLBACK_CELL_VIEW_CURSOR: case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION: case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR: -case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: case LOK_CALLBACK_TEXT_VIEW_SELECTION: case LOK_CALLBACK_VIEW_CURSOR_VISIBLE: case LOK_CALLBACK_CALC_FUNCTION_LIST: case LOK_CALLBACK_FORM_FIELD_BUTTON: { -// deleting the duplicate of visible cursor message can cause hyperlink popup not to show up on second/or more click on the same place. -// If the hyperlink is not empty we can bypass that to show the popup -const bool hyperLinkException = type == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR && -aCallbackData.getPayload().indexOf("\"hyperlink\":\"\"") == -1 && -aCallbackData.getPayload().indexOf("\"hyperlink\": {}") == -1; -if(!hyperLinkException) -{ -const int nViewId = aCallbackData.getViewId(); -removeAll(type, [nViewId] (const CallbackData& elemData) { -return (nViewId == elemData.getViewId()); -} -); -} +const int nViewId = aCallbackData.getViewId(); +removeAll(type, [nViewId] (const CallbackData& elemData) { +return (nViewId == elemData.getViewId()); +} +);
core.git: desktop/source
desktop/source/app/app.cxx |7 +++ desktop/source/app/cmdlineargs.cxx |5 + desktop/source/app/cmdlineargs.hxx |1 + 3 files changed, 13 insertions(+) New commits: commit 4963fc47a0381967246e15479bf79bb58dddc465 Author: Justin Luth AuthorDate: Tue Jan 2 14:20:29 2024 -0500 Commit: Mike Kaganski CommitDate: Wed Jan 3 05:51:57 2024 +0100 tdf117100: do not attempt to re-install extensions on restart A common way to install extensions is to simply double-click on them in the OS's file browser. But in this case the reload still contains the extension in the cmdline and thus it "opens" the extension again and asks to re-install. So just eliminate OXTs from the commandline if OfficeRestartInProgress. If multiple OXTs are provided on the commandline, two things happen: -LO crashes (with an assert) -both extensions are successfully installed before restart is requested. In both cases removing ALL extensions during restart is appropriate. Prior to this patch, OfficeRestartInProgress was not actually used AFAICS. Mike Kaganski laid out lots of good criteria for this patch 1. After restart, user can still manually install an extension: YES 2. A restart after a restart should still inhibit extensions: YES 3. Must no interfere is user choses to "restart later": YES 4. It works with a clean profile (rm -r instdir/user): YES This implementation is closest to his suggested > Variant 4. Cleanup all fileopen/print arguments from the guards > that manage restarts (e.g., soffice.exe on Windows), so that > when restarting, they would not repeat using those arguments again. > Problem: first launch of soffice.bin that initializes user profile: > restart after this should repeat all the command line arguments. Change-Id: I2460cb31be0c6f3e10cbb5b200cf67839cbd822a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161549 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Mike Kaganski diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 0d66a48daac7..370fc5761553 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -478,6 +478,13 @@ void Desktop::Init() // the UserConfiguration directory comphelper::BackupFileHelper::reactOnSafeMode(Application::IsSafeModeEnabled()); +// tdf117100: do not try to re-install extensions after the requested restart +if (officecfg::Setup::Office::OfficeRestartInProgress::get()) +{ +if (!officecfg::Office::Common::Misc::FirstRun::get()) +GetCommandLineArgs().RemoveFilesFromOpenListEndingWith(".oxt"); +} + try { if (!langselect::prepareLocale()) diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index e7f315204048..f96814e8e7ff 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -736,6 +736,11 @@ bool CommandLineArgs::HasModuleParam() const || m_web || m_base; } +void CommandLineArgs::RemoveFilesFromOpenListEndingWith(const OUString& rExt) +{ +std::erase_if(m_openlist, [rExt](OUString url) { return url.endsWithIgnoreAsciiCase(rExt); }); +} + std::vector< OUString > CommandLineArgs::GetOpenList() const { return translateExternalUris(m_openlist); diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index 64a1bcfd0ccb..a9eca1d980f1 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -99,6 +99,7 @@ class CommandLineArgs boolHasSplashPipe() const { return m_splashpipe;} std::vector< OUString > const & GetAccept() const { return m_accept;} std::vector< OUString > const & GetUnaccept() const { return m_unaccept;} +void RemoveFilesFromOpenListEndingWith(const OUString& rExt); std::vector< OUString > GetOpenList() const; std::vector< OUString > GetViewList() const; std::vector< OUString > GetStartList() const;
core.git: desktop/source include/unotools unotools/source
desktop/source/lib/init.cxx|8 include/unotools/pathoptions.hxx |1 + unotools/source/config/pathoptions.cxx |6 ++ 3 files changed, 15 insertions(+) New commits: commit 21e58b94a2390a17571c30e91254f116d1566a2d Author: Szymon Kłos AuthorDate: Thu Nov 30 15:36:57 2023 +0100 Commit: Szymon Kłos CommitDate: Tue Jan 2 13:00:33 2024 +0100 lok: import Work path from LOK_WORKDIR Change-Id: If0c9727f53c1c4dfb78d1ccbd6b3ff602268bbf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160156 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161059 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index cc3139fcd22e..a54ebc6e469f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7977,6 +7977,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char OUString aNewTemp; osl::FileBase::getTempDirURL(aNewTemp); aOptions.SetTempPath(aNewTemp); +{ +const char *pWorkPath = getenv("LOK_WORKDIR"); +if (pWorkPath) +{ +OString sWorkPath(pWorkPath); +aOptions.SetWorkPath(OStringToOUString(sWorkPath, RTL_TEXTENCODING_UTF8)); +} +} desktop::Desktop::CreateTemporaryDirectory(); // The RequestHandler is specifically set to be ready when all the other diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx index c7468048d5df..c19a2b34baf4 100644 --- a/include/unotools/pathoptions.hxx +++ b/include/unotools/pathoptions.hxx @@ -106,6 +106,7 @@ public: voidSetAutoTextPath( const OUString& rPath ); voidSetBasicPath( const OUString& rPath ); voidSetTempPath( const OUString& rPath ); +voidSetWorkPath( const OUString& rPath ); OUStringSubstituteVariable( const OUString& rVar ) const; OUStringExpandMacros( const OUString& rPath ) const; diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 24c1fb323dcc..4234ec903df9 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -122,6 +122,7 @@ class SvtPathOptions_Impl voidSetAutoTextPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::AutoText, rPath ); } voidSetBasicPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Basic, rPath ); } voidSetTempPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Temp, rPath ); } +voidSetWorkPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Work, rPath ); } OUString SubstVar( const OUString& rVar ) const; OUString ExpandMacros( const OUString& rPath ) const; @@ -589,6 +590,11 @@ void SvtPathOptions::SetTempPath( const OUString& rPath ) pImpl->SetTempPath( rPath ); } +void SvtPathOptions::SetWorkPath( const OUString& rPath ) +{ +pImpl->SetWorkPath( rPath ); +} + OUString SvtPathOptions::SubstituteVariable( const OUString& rVar ) const { return pImpl->SubstVar( rVar );
core.git: desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 968cb673eb353bd5d19d96498c0d38c00801c8a0 Author: Julien Nabet AuthorDate: Sun Dec 31 12:23:51 2023 +0100 Commit: Julien Nabet CommitDate: Mon Jan 1 13:19:17 2024 +0100 Replace "size() != 0 with !empty()" (desktop) Change-Id: I164e29ed02fc4abf7a5b03ca0c391fb46b60e4f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161483 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4b1658d95e20..cc3139fcd22e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4564,7 +4564,7 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis, pViewShell->setLibreOfficeKitViewCallback(pDocument->mpCallbackFlushHandlers[nView].get()); } -if (pDocument->maFontsMissing.size() != 0) +if (!pDocument->maFontsMissing.empty()) { OString sPayload = "{ \"fontsmissing\": [ "_ostr; bool bFirst = true;
core.git: desktop/source filter/source sw/source xmloff/source
desktop/source/pkgchk/unopkg/unopkg_misc.cxx|3 +-- filter/source/config/cache/filterfactory.cxx|3 +-- sw/source/core/docnode/retrievedinputstreamdata.cxx |3 +-- xmloff/source/chart/SchXMLChartContext.cxx |3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) New commits: commit 427d8f61d7bc4087a9408ba7f0b8a718943f4240 Author: Caolán McNamara AuthorDate: Sat Dec 30 11:59:45 2023 + Commit: Caolán McNamara CommitDate: Sat Dec 30 16:23:05 2023 +0100 cid#1546349 COPY_INSTEAD_OF_MOVE and cid#1546236 COPY_INSTEAD_OF_MOVE cid#1546126 COPY_INSTEAD_OF_MOVE cid#1546042 COPY_INSTEAD_OF_MOVE Change-Id: I24b60d855f564ba8551501fc1dc614b24d5505c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161440 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 553952917748..ba49544f0fec 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -349,9 +349,8 @@ Reference connectToOffice( bool verbose ) { OUString pipeId( ::dp_misc::generateRandomPipeId() ); -OUString acceptArg = "--accept=pipe,name=" + pipeId + ";urp;"; -Sequence args { "--nologo", "--nodefault", acceptArg }; +Sequence args { "--nologo", "--nodefault", "--accept=pipe,name=" + pipeId + ";urp;" }; OUString appURL( getExecutableDir() + "/soffice" ); if (verbose) diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx index 1c6fadca6c86..9b0793b94e1e 100644 --- a/filter/source/config/cache/filterfactory.cxx +++ b/filter/source/config/cache/filterfactory.cxx @@ -152,8 +152,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea if (pos != -1) { OSL_FAIL("DEPRECATED! Please use new query format: 'matchByDocumentService=...'"); -OUString sPatchedQuery(OUString::Concat("matchByDocumentService=") + sNewQuery.subView(7)); -sNewQuery = sPatchedQuery; +sNewQuery = OUString::Concat("matchByDocumentService=") + sNewQuery.subView(7); } // analyze query and split it into its tokens diff --git a/sw/source/core/docnode/retrievedinputstreamdata.cxx b/sw/source/core/docnode/retrievedinputstreamdata.cxx index 311be07ca719..607f14c21359 100644 --- a/sw/source/core/docnode/retrievedinputstreamdata.cxx +++ b/sw/source/core/docnode/retrievedinputstreamdata.cxx @@ -38,8 +38,7 @@ SwRetrievedInputStreamDataManager::tDataKey SwRetrievedInputStreamDataManager::R // create empty data container for given thread Consumer tDataKey nDataKey( snNextKeyValue ); -tData aNewEntry( pThreadConsumer ); -maInputStreamData[ nDataKey ] = aNewEntry; +maInputStreamData[nDataKey] = tData(pThreadConsumer); // prepare next data key value if ( snNextKeyValue < SAL_MAX_UINT64 ) diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index dc3e4266be03..a6420f79e7f2 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -1051,9 +1051,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLChartContext::cr { xProp->setPropertyValue("HasMainTitle", uno::Any(true) ); } -uno::Reference< drawing::XShape > xTitleShape = xDoc->getTitle(); pContext = new SchXMLTitleContext( mrImportHelper, GetImport(), - maMainTitle, xTitleShape ); + maMainTitle, xDoc->getTitle() ); } break; case XML_ELEMENT(CHART, XML_SUBTITLE):
core.git: desktop/source
desktop/source/app/app.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6ca67850d471478542bec458e1ea94175e5bba14 Author: Stephan Bergmann AuthorDate: Wed Dec 20 10:04:45 2023 +0100 Commit: Stephan Bergmann CommitDate: Wed Dec 20 14:10:47 2023 +0100 Revert "updater: check every 12 hours for updates for now" This reverts commit bb5622adc5db348efcc9a6f41d19de9f00a367dd, going back to a less aggressive 7 day period for now. Change-Id: I439a49f3ca6761ef17ca2b92d395b0de5c400197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161050 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 8136d39a9806..0d66a48daac7 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1121,7 +1121,7 @@ bool isTimeForUpdateCheck() sal_uInt64 nLastUpdate = officecfg::Office::Update::Update::LastUpdateTime::get(); sal_uInt64 nNow = tools::Time::GetSystemTicks(); -sal_uInt64 n7DayInMS = 1000 * 60 * 60 * 12 * 1; // 12 hours in ms +sal_uInt64 n7DayInMS = 1000 * 60 * 60 * 24 * 7; // 7 days in ms if (nNow - n7DayInMS >= nLastUpdate) return true;
core.git: desktop/source external/onlineupdate Repository.mk
Repository.mk |1 desktop/source/app/updater.cxx | 26 ++- external/onlineupdate/Executable_update_service.mk |2 external/onlineupdate/Module_onlineupdate.mk |1 external/onlineupdate/Package_updater_ini.mk | 16 ++ external/onlineupdate/README.md|9 + external/onlineupdate/lo.patch | 151 ++--- external/onlineupdate/updater.ini | 12 + 8 files changed, 189 insertions(+), 29 deletions(-) New commits: commit 958a055be8d58137e1a32c5cd18f67d1aab3012d Author: Stephan Bergmann AuthorDate: Tue Dec 19 16:50:42 2023 +0100 Commit: Stephan Bergmann CommitDate: Tue Dec 19 20:24:32 2023 +0100 Improve --enable-online-update-mar Windows MOZ_MAINTENANCE_SERVICE feature To get the MOZ_MAINTENANCE_SERVICE mode going at all, update.status needs to contain a "pending-service" token. For Mozilla, code in its toolkit/mozapps/update/UpdateService.sys.mjs takes care of writing that. For us, lets always write that in update_checker() (even on Linux, where it's apparently harmless). Then, the MOZ_MAINTENANCE_SERVICE code is rather picky with its various sanity checks: Among other things, it expects argv[0] to be a full path to the updater executable, and it expects the update.mar (and its status and log files) to be in a directory hierarchy named updates/0/ rather than patch/. So get all that fixed in desktop/source/app/updater.cxx. And patch in external/onlineupdate/lo.patch where it expects to find the updater executable (just updater.exe vs. our program/updater.exe). And we shouldn't interfere with the upstream Mozilla maintenance service, so also rename that in external/onlineupdate/lo.patch. And `update_service install` wants to read version resources from the update_service.exe, so provide that (via gb_Executable_add_default_nativeres). Also, `update_service install` wants to read a MozillaMaintenanceDescription value from an updater.ini, so provide one (with contents of that value inspired by Mozilla's browser/locales/en-US/updater/updater.ini). As we now have an updater.ini anyway (and which apparently works fine with Unix line ends on both Linux and Windows), also use it on Linux and drop the onlineupdate/source/update/updater/progressui_gtk.cpp again from external/onlineupdate/lo.patch. And update external/onlineupdate/README.md how to manually execute that test against an updater.ini. Change-Id: I0e3e5e5311be61e1224cda700af2e5d751113a99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160996 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/Repository.mk b/Repository.mk index b9cf9c2ddb9c..9ef08e814a20 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1096,6 +1096,7 @@ $(eval $(call gb_Helper_register_packages_for_install,brand,\ readlicense_oo_files \ readlicense_oo_license \ $(call gb_Helper_optional,DESKTOP,setup_native_packinfo) \ + $(if $(ENABLE_ONLINE_UPDATE_MAR),updater_ini) \ )) ifeq ($(USING_X11), TRUE) diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 925b6b7116a4..3221d688a47f 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -173,17 +174,14 @@ void createStr(const OUString& rStr, CharT** pArgs, size_t i) pArgs[i] = pStr; } -CharT** createCommandLine(int * argc) +CharT** createCommandLine(OUString const & argv0, int * argc) { OUString aInstallDir = Updater::getInstallationPath(); size_t nCommandLineArgs = rtl_getAppCommandArgCount(); size_t nArgs = 8 + nCommandLineArgs; CharT** pArgs = new CharT*[nArgs]; -{ -OUString aUpdaterName = OUString::fromUtf8(pUpdaterName); -createStr(aUpdaterName, pArgs, 0); -} +createStr(argv0, pArgs, 0); { // directory with the patch log OUString aPatchDir = Updater::getPatchDirURL(); @@ -307,7 +305,7 @@ bool update() Updater::log("Calling the updater with parameters: "); int argc; -CharT** pArgs = createCommandLine(); +CharT** pArgs = createCommandLine(aUpdaterPath, ); bool bSuccess = true; const char* pUpdaterTestReplace = std::getenv("LIBO_UPDATER_TEST_REPLACE"); @@ -676,9 +674,11 @@ void download_file(const OUString& rURL, size_t nFileSize, const OUString& rHash throw invalid_hash(rHash, aHash); } -OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/"); +OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates/"); rtl::Bootstrap::expandMacros(aPatchDirURL);
core.git: desktop/source
desktop/source/app/app.cxx | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) New commits: commit dc08489bc715886c521c39336d81e5ffe0c06cca Author: Stephan Bergmann AuthorDate: Fri Dec 15 14:40:53 2023 +0100 Commit: Stephan Bergmann CommitDate: Fri Dec 15 15:57:08 2023 +0100 Avoid "Desktop disposed before terminating it" assert ...from Desktop::disposing() at framework/source/services/desktop.cxx:1041, on Windows, when the HAVE_FEATURE_UPDATE_MAR update() call returns true (and soffice.bin is about to exit now), but the css.frame.Desktop service happens to already have been created somewhere else (and will thus be disposed as part of disposing the service manager) but doesn't receive a terminate() call in Desktop::Main(). So reorder the code in Desktop::Main(), moving the HAVE_FEATURE_UPDATE_MAR code after the > xDesktop = css::frame::Desktop::create( xContext ); so that we have something to call > xDesktop->terminate(); on in this scenario. Change-Id: Iee5b6eeece33d5a27cadb94a7da0d26aa1492e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160831 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 4c13a2a8e716..8136d39a9806 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1351,6 +1351,22 @@ int Desktop::Main() if ( !InitializeConfiguration() ) return EXIT_FAILURE; +SetSplashScreenProgress(30); + +// create title string +OUString aTitle(ReplaceStringHookProc(RID_APPTITLE)); +#ifdef DBG_UTIL +//include buildid in non product builds +aTitle += " [" + utl::Bootstrap::getBuildIdData("development") + "]"; +#endif + +SetDisplayName( aTitle ); +SetSplashScreenProgress(35); +pExecGlobals->pPathOptions.reset( new SvtPathOptions); +SetSplashScreenProgress(40); + +xDesktop = css::frame::Desktop::create( xContext ); + #if HAVE_FEATURE_UPDATE_MAR const char* pUpdaterTestEnable = std::getenv("LIBO_UPDATER_TEST_ENABLE"); if (pUpdaterTestEnable || officecfg::Office::Update::Update::Enabled::get()) @@ -1414,7 +1430,10 @@ int Desktop::Main() CloseSplashScreen(); bool bSuccess = update(); if (bSuccess) +{ +xDesktop->terminate(); return EXIT_SUCCESS; +} } else if (isTimeForUpdateCheck() || pForcedUpdateCheck) { @@ -1429,22 +1448,6 @@ int Desktop::Main() } #endif -SetSplashScreenProgress(30); - -// create title string -OUString aTitle(ReplaceStringHookProc(RID_APPTITLE)); -#ifdef DBG_UTIL -//include buildid in non product builds -aTitle += " [" + utl::Bootstrap::getBuildIdData("development") + "]"; -#endif - -SetDisplayName( aTitle ); -SetSplashScreenProgress(35); -pExecGlobals->pPathOptions.reset( new SvtPathOptions); -SetSplashScreenProgress(40); - -xDesktop = css::frame::Desktop::create( xContext ); - // create service for loading SFX (still needed in startup) pExecGlobals->xGlobalBroadcaster = Reference < css::document::XDocumentEventListener > ( css::frame::theGlobalEventBroadcaster::get(xContext), UNO_SET_THROW );
core.git: desktop/source
desktop/source/app/updater.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 94233c2e1e86c3617f327e8bfd3cd4a980adf200 Author: Stephan Bergmann AuthorDate: Fri Dec 15 10:22:51 2023 +0100 Commit: Stephan Bergmann CommitDate: Fri Dec 15 12:32:19 2023 +0100 -Werror,-Wunused-result ...caused by typo in previous 58bfd8f982950566018f77ce8895963d914058f8 "Fix backward vs. forward slashes on Windows" Change-Id: Ibd1967688c6ab4c962818595d435c7f821ad3d64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 8796583df4d8..925b6b7116a4 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -91,7 +91,7 @@ OUString normalizePath(const OUString& rPath) aPath = aPath.replace('\\', '/'); #endif -aPath.replaceAll("//", "/"); +aPath = aPath.replaceAll("//", "/"); // remove final / if (aPath.endsWith("/"))
core.git: desktop/source
desktop/source/app/updater.cxx | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) New commits: commit 58bfd8f982950566018f77ce8895963d914058f8 Author: Stephan Bergmann AuthorDate: Thu Dec 14 12:15:10 2023 +0100 Commit: Stephan Bergmann CommitDate: Fri Dec 15 09:23:56 2023 +0100 Fix backward vs. forward slashes on Windows Change-Id: I24771a526848901ccedb15aa5dd7b373fe854977 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index fa3836596cc3..8796583df4d8 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -86,7 +86,12 @@ const char* pSofficeExeName = "soffice.exe"; OUString normalizePath(const OUString& rPath) { -OUString aPath = rPath.replaceAll("//", "/"); +OUString aPath = rPath; +#if defined WNT +aPath = aPath.replace('\\', '/'); +#endif + +aPath.replaceAll("//", "/"); // remove final / if (aPath.endsWith("/")) @@ -108,7 +113,10 @@ OUString normalizePath(const OUString& rPath) aPath = aTempPath.copy(0, i) + aPath.copy(nIndex + 3); } -return aPath.replaceAll("\\", "/"); +#if defined WNT +aPath = aPath.replace('/', '\\'); +#endif +return aPath; } void CopyFileToDir(const OUString& rTempDirURL, const OUString & rFileName, const OUString& rOldDir)
core.git: desktop/source
desktop/source/app/updater.cxx |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) New commits: commit c358da05eb2a588b1bdf2fba96cc38f6f1e2221e Author: Stephan Bergmann AuthorDate: Wed Dec 13 09:58:29 2023 +0100 Commit: Stephan Bergmann CommitDate: Wed Dec 13 16:31:53 2023 +0100 Fix number of actual arguments Change-Id: I04bb3462948aeab24d46ee7ee910fdae8da2aa65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160674 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 5596028b0f79..fa3836596cc3 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -165,7 +165,7 @@ void createStr(const OUString& rStr, CharT** pArgs, size_t i) pArgs[i] = pStr; } -CharT** createCommandLine() +CharT** createCommandLine(int * argc) { OUString aInstallDir = Updater::getInstallationPath(); @@ -231,6 +231,7 @@ CharT** createCommandLine() pArgs[nArgs - 1] = nullptr; +*argc = nArgs - 1; return pArgs; } @@ -297,7 +298,8 @@ bool update() OUString aUpdaterPath = getPathFromURL(aTempDirURL + "/" + OUString::fromUtf8(pUpdaterName)); Updater::log("Calling the updater with parameters: "); -CharT** pArgs = createCommandLine(); +int argc; +CharT** pArgs = createCommandLine(); bool bSuccess = true; const char* pUpdaterTestReplace = std::getenv("LIBO_UPDATER_TEST_REPLACE"); @@ -311,7 +313,7 @@ bool update() bSuccess = false; } #elif defined(_WIN32) -bSuccess = WinLaunchChild((wchar_t*)aUpdaterPath.getStr(), 8, pArgs); +bSuccess = WinLaunchChild((wchar_t*)aUpdaterPath.getStr(), argc, pArgs); #endif } else
core.git: desktop/source
desktop/source/app/updater.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 7ed0ba0555de892b348b14d4c5900ebcfb4ddd67 Author: Stephan Bergmann AuthorDate: Fri Dec 8 16:32:56 2023 +0100 Commit: Stephan Bergmann CommitDate: Sat Dec 9 08:32:10 2023 +0100 Fix Linux --enable-online-update-mar build ...after 13595f6220095d120e13ccb6fbfac1de4c803fe7 "Fix --enable-online-update-mar on Windows" Change-Id: I8e13a3f4234f3b5fb64d606eb3c2c16611dacd33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160491 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index bdd232be8560..5596028b0f79 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -141,9 +141,11 @@ void CopyUpdaterToTempDir(const OUString& rInstallDirURL, const OUString& rTempD #ifdef UNX typedef char CharT; #define tstrncpy std::strncpy +char const * toStream(char const * s) { return s; } #elif defined(_WIN32) typedef wchar_t CharT; #define tstrncpy std::wcsncpy +OUString toStream(wchar_t const * s) { return OUString(o3tl::toU(s)); } #else #error "Need an implementation" #endif @@ -317,7 +319,7 @@ bool update() SAL_WARN("desktop.updater", "Updater executable path: " << aUpdaterPath); for (size_t i = 0; i < 8 + rtl_getAppCommandArgCount(); ++i) { -SAL_WARN("desktop.updater", OUString(o3tl::toU(pArgs[i]))); +SAL_WARN("desktop.updater", toStream(pArgs[i])); } bSuccess = false; }
core.git: desktop/source onlineupdate/Executable_mar.mk onlineupdate/Executable_test_updater_dialog.mk onlineupdate/Executable_updater.mk onlineupdate/Executable_update_service.mk onlineupdate/source
desktop/source/app/updater.cxx |3 ++- onlineupdate/Executable_mar.mk |2 ++ onlineupdate/Executable_test_updater_dialog.mk |4 onlineupdate/Executable_update_service.mk |4 onlineupdate/Executable_updater.mk | 10 ++ onlineupdate/StaticLibrary_libmar.mk |2 ++ onlineupdate/StaticLibrary_libmarverify.mk |2 ++ onlineupdate/StaticLibrary_updatehelper.mk |6 ++ onlineupdate/source/update/updater/updater.cxx |2 +- 9 files changed, 33 insertions(+), 2 deletions(-) New commits: commit 13595f6220095d120e13ccb6fbfac1de4c803fe7 Author: Stephan Bergmann AuthorDate: Fri Dec 8 08:30:18 2023 +0100 Commit: Stephan Bergmann CommitDate: Fri Dec 8 09:49:41 2023 +0100 Fix --enable-online-update-mar on Windows The code had apparently rotten a bit, * a wchar_t vs. char16_t confusion in desktop/source/app/updater.cxx * code broken by 926e4e469d0285ee72f8da80f00370b4b3120417 "Rename online updater functions and strcmp relpath" in onlineupdate/source/update/updater/updater.cxx * -DUNICODE missing in some places (so that plain Windows functions resolve to the ...W variant), which had been set centrally in the past IIRC * silencing some warnings like "C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data" (where silencing is the right thing to do for effectively extern code); no sure why those apparently didn't hit in the past, maybe it is all warnings that compilers only started to emit in recent years, or only for recent -std:c++... modes * silencing some "Conversion from string literal loses const qualifier" errors with -Zc:strictStrings-; these hit at least with recent VS 2022 Preview and --with-latest-c++, where -Zc:strictStrings is apparently now on by default Change-Id: I7fe46f5aa2b42fc9c03f24f7f0236512b4d3b936 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 0cd95da8d4e7..bdd232be8560 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -316,7 +317,7 @@ bool update() SAL_WARN("desktop.updater", "Updater executable path: " << aUpdaterPath); for (size_t i = 0; i < 8 + rtl_getAppCommandArgCount(); ++i) { -SAL_WARN("desktop.updater", pArgs[i]); +SAL_WARN("desktop.updater", OUString(o3tl::toU(pArgs[i]))); } bSuccess = false; } diff --git a/onlineupdate/Executable_mar.mk b/onlineupdate/Executable_mar.mk index 5352f4ac2761..45a182323873 100644 --- a/onlineupdate/Executable_mar.mk +++ b/onlineupdate/Executable_mar.mk @@ -46,4 +46,6 @@ $(eval $(call gb_Executable_add_cobjects,mar,\ onlineupdate/source/libmar/tool/mar \ )) +$(eval $(call gb_Executable_set_warnings_not_errors,mar)) + # vim:set shiftwidth=4 tabstop=4 noexpandtab: */ diff --git a/onlineupdate/Executable_test_updater_dialog.mk b/onlineupdate/Executable_test_updater_dialog.mk index a2988d0079d6..1f95c21e20d1 100644 --- a/onlineupdate/Executable_test_updater_dialog.mk +++ b/onlineupdate/Executable_test_updater_dialog.mk @@ -60,4 +60,8 @@ $(eval $(call gb_Executable_add_exception_objects,test_updater_dialog,\ onlineupdate/workben/test_dialog \ )) +ifeq ($(OS),WNT) +$(eval $(call gb_Executable_add_defs,test_updater_dialog,-DUNICODE)) +endif + # vim:set shiftwidth=4 tabstop=4 noexpandtab: */ diff --git a/onlineupdate/Executable_update_service.mk b/onlineupdate/Executable_update_service.mk index edd02f6ecf96..2cbea4a63d71 100644 --- a/onlineupdate/Executable_update_service.mk +++ b/onlineupdate/Executable_update_service.mk @@ -55,4 +55,8 @@ $(eval $(call gb_Executable_add_exception_objects,update_service,\ onlineupdate/source/service/workmonitor \ )) +$(eval $(call gb_Executable_add_cxxflags,update_service,-Zc:strictStrings-)) + +$(eval $(call gb_Executable_add_defs,update_service,-DUNICODE)) + # vim:set shiftwidth=4 tabstop=4 noexpandtab: */ diff --git a/onlineupdate/Executable_updater.mk b/onlineupdate/Executable_updater.mk index ab15a94e4c60..03df54a83e03 100644 --- a/onlineupdate/Executable_updater.mk +++ b/onlineupdate/Executable_updater.mk @@ -82,4 +82,14 @@ $(eval $(call gb_Executable_add_exception_objects,updater,\ onlineupdate/source/update/updater/win_dirent )\ )) +$(eval $(call gb_Executable_set_warnings_not_errors,updater)) + +ifeq ($(OS),WNT) + +$(eval $(call gb_Executable_add_cxxflags,updater,-Zc:strictStrings-)) + +$(eval $(call gb_Executable_add_defs,updater,-DUNICODE)) + +endif + # vim:set shiftwidth=4 tabstop=4 noexpandtab: */ diff --git
[Libreoffice-commits] core.git: desktop/source drawinglayer/source include/vcl slideshow/source svx/source vcl/qa vcl/source vcl/workben
desktop/source/lib/init.cxx |2 drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx |2 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |6 include/vcl/alpha.hxx| 83 +-- include/vcl/bitmap.hxx |6 slideshow/source/engine/shapes/gdimtftools.cxx |8 - svx/source/dialog/_contdlg.cxx |2 vcl/qa/cppunit/BitmapExTest.cxx |4 vcl/qa/cppunit/canvasbitmaptest.cxx |4 vcl/qa/cppunit/skia/skia.cxx | 27 +-- vcl/source/bitmap/BitmapEx.cxx |8 - vcl/source/bitmap/alpha.cxx | 63 vcl/source/bitmap/bitmap.cxx |8 - vcl/source/bitmap/bitmappaint.cxx| 14 - vcl/source/bitmap/dibtools.cxx |2 vcl/source/filter/jpeg/JpegReader.cxx|2 vcl/source/filter/png/PngImageWriter.cxx |4 vcl/source/filter/wmf/emfwr.cxx |6 vcl/source/filter/wmf/wmfwr.cxx |4 vcl/source/gdi/FileDefinitionWidgetDraw.cxx |2 vcl/source/gdi/pdfwriter_impl.cxx|4 vcl/source/graphic/UnoGraphic.cxx|2 vcl/source/outdev/background.cxx |2 vcl/source/outdev/bitmap.cxx |4 vcl/source/outdev/bitmapex.cxx | 12 - vcl/workben/vcldemo.cxx |2 26 files changed, 168 insertions(+), 115 deletions(-) New commits: commit aa7d1c8f1411fe35465f265259cf1082adf05aea Author: Noel Grandin AuthorDate: Fri Dec 1 13:27:52 2023 +0200 Commit: Noel Grandin CommitDate: Wed Dec 6 09:51:17 2023 +0100 make AlphaMask separate from Bitmap Having it subclass Bitmap encourages confusion in passing it around, and I need the extra type-safety for my work on merged-alpha Change-Id: I35819f9b8ee609cbdaf865563c78531e397b529b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160235 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 66075e3312d9..fa1c55c09e05 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4222,7 +4222,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, Bitmap aBmp = aBmpEx.GetBitmap(); AlphaMask aAlpha = aBmpEx.GetAlphaMask(); Bitmap::ScopedReadAccess sraBmp(aBmp); -Bitmap::ScopedReadAccess sraAlpha(aAlpha); +AlphaMask::ScopedReadAccess sraAlpha(aAlpha); assert(sraBmp->Height() == nCanvasHeight); assert(sraBmp->Width() == nCanvasWidth); diff --git a/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx b/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx index ee4b6d4cb14f..e1dcac421344 100644 --- a/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx +++ b/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx @@ -40,7 +40,7 @@ AlphaMask ProcessAndBlurAlphaMask(const AlphaMask& rMask, double fErodeDilateRad // Only completely white pixels on the initial mask must be considered for transparency. Any // other color must be treated as black. This creates 1-bit B bitmap. -BitmapEx mask(bConvertTo1Bit ? tmpMask.CreateMask(COL_WHITE) : tmpMask); +BitmapEx mask(bConvertTo1Bit ? tmpMask.GetBitmap().CreateMask(COL_WHITE) : tmpMask.GetBitmap()); // Scaling down increases performance without noticeable quality loss. Additionally, // current blur implementation can only handle blur radius between 2 and 254. diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index e5658f6cf0d3..6a0dd7e070ee 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -283,7 +283,7 @@ namespace drawinglayer::primitive2d } else { -BitmapEx aExpandVisibilityMask(aAlphaMask, aAlphaMask); +BitmapEx aExpandVisibilityMask(aAlphaMask.GetBitmap(), aAlphaMask); maVirtualDeviceMask->DrawBitmapEx(rAnimationFrame.maPositionPixel, aExpandVisibilityMask); } @@ -306,7 +306,7 @@ namespace drawinglayer::primitive2d } else { -
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 8369765ec5be151082a6e31c16e2ab2b0df13f5c Author: Noel Grandin AuthorDate: Fri Nov 17 11:58:54 2023 +0200 Commit: Noel Grandin CommitDate: Fri Nov 17 19:45:21 2023 +0100 cool#6893 pre-init dictionary list so the forked processes don't need to Change-Id: Id37688ac88c14679e216cca744563ee75c7c4736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159561 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3ee743d4aada..dcdbf35b7d03 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -125,6 +125,7 @@ #include #include +#include #include #include #include @@ -7423,6 +7424,7 @@ static void preloadData() setLanguageToolConfig(); // preload all available dictionaries + linguistic2::DictionaryList::create(comphelper::getProcessComponentContext()); css::uno::Reference xLngSvcMgr = css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext()); css::uno::Reference xSpellChecker(xLngSvcMgr->getSpellChecker());
[Libreoffice-commits] core.git: desktop/source extensions/source include/curlinit.hxx include/opensslinit.hxx include/systools lingucomponent/source linguistic/source svl/source ucb/source vcl/source
desktop/source/app/updater.cxx|2 desktop/source/minidump/minidump.cxx |2 extensions/source/update/check/download.cxx |2 include/systools/curlinit.hxx | 24 lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 10 --- linguistic/source/translate.cxx |2 svl/source/crypto/cryptosign.cxx |2 ucb/source/ucp/cmis/cmis_content.cxx |2 ucb/source/ucp/webdav-curl/CurlSession.cxx| 28 -- vcl/source/app/svmain.cxx |2 10 files changed, 34 insertions(+), 42 deletions(-) New commits: commit f5926c8cfbd5af1fb7214428b4b03453b826f9a5 Author: Mike Kaganski AuthorDate: Fri Nov 10 15:36:45 2023 +0300 Commit: Mike Kaganski CommitDate: Sat Nov 11 08:42:57 2023 +0100 Move user agent initialization to InitCurl_easy Places that didn't initialize it previously, would benefit automatically Change-Id: I2f1ff25fc58d9378462072bc92d7b37be2370fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159299 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 7ff6234b4555..edac2cb38350 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 7fbb0884987d..0a31fff6f285 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -17,7 +17,7 @@ #include -#include +#include #ifdef _WIN32 #include diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index 9b4823777289..ab5402c0ae42 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -23,7 +23,7 @@ #include -#include +#include #include #include diff --git a/include/curlinit.hxx b/include/systools/curlinit.hxx similarity index 56% rename from include/curlinit.hxx rename to include/systools/curlinit.hxx index c80397caf466..7034534af66f 100644 --- a/include/curlinit.hxx +++ b/include/systools/curlinit.hxx @@ -19,6 +19,11 @@ #include "opensslinit.hxx" #endif +#include +#include + +#include + static void InitCurl_easy(CURL* const pCURL) { CURLcode rc; @@ -44,6 +49,25 @@ static void InitCurl_easy(CURL* const pCURL) rc = curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS_STR, "https"); assert(rc == CURLE_OK); } + +curl_version_info_data const* const pVersion(curl_version_info(CURLVERSION_NOW)); +assert(pVersion); +SAL_INFO("ucb.ucp.webdav.curl", + "curl version: " << pVersion->version << " " << pVersion->host + << " features: " << ::std::hex << pVersion->features << " ssl: " + << pVersion->ssl_version << " libz: " << pVersion->libz_version); +// Make sure a User-Agent header is always included, as at least +// en.wikipedia.org:80 forces back 403 "Scripts should use an informative +// User-Agent string with contact information, or they may be IP-blocked +// without notice" otherwise: +OString const useragent( +OString::Concat("LibreOffice " LIBO_VERSION_DOTTED " denylistedbackend/") ++ pVersion->version + " " + pVersion->ssl_version); +// looks like an explicit "User-Agent" header in CURLOPT_HTTPHEADER +// will override CURLOPT_USERAGENT, see Curl_http_useragent(), so no need +// to check anything here +rc = curl_easy_setopt(pCURL, CURLOPT_USERAGENT, useragent.getStr()); +assert(rc == CURLE_OK); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/opensslinit.hxx b/include/systools/opensslinit.hxx similarity index 100% rename from include/opensslinit.hxx rename to include/systools/opensslinit.hxx diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index 45b4f9df6bdc..599bb01c6194 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -135,14 +135,6 @@ std::string makeHttpRequest_impl(std::u16string_view aURL, HTTP_METHOD method, ::InitCurl_easy(curl.get()); -// Same useragent string as in CurlSession (ucp/webdav-curl/CurlSession.cxx) -curl_version_info_data const* const pVersion(curl_version_info(CURLVERSION_NOW)); -
[Libreoffice-commits] core.git: desktop/source
desktop/source/app/appinit.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 4897083c120fbe7ea2fbe14f0f7d2cb293b79fa8 Author: Stephan Bergmann AuthorDate: Wed Nov 8 16:54:20 2023 +0100 Commit: Stephan Bergmann CommitDate: Thu Nov 9 09:06:22 2023 +0100 Move "Acceptor already exists" warning to where it belongs 036ed05fe35044e49a91e12b6a8e5f36a5b9c4c2 "MWS_SRX644: migrate branch mws_srx644 -> HEAD" had added this with misleading indentation, so it (apparently accidentally) did not pertain to the "aAcceptString was found in the map of already existing acceptors" case. Then 4acffc240b4845beedfe66eaa571b814d65e2e57 "catch by const reference" fixed the indentation, but left the warning at the apparently wrong place. Change-Id: Ie73368bc1294e9b716e3fca75e12363cb6240fdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159157 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 926ad1bfa6b7..6eca704c7fb9 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -138,7 +138,11 @@ void Desktop::createAcceptor(const OUString& aAcceptString) AcceptorMap = acceptorMap(); AcceptorMap::const_iterator pIter = rMap.find(aAcceptString); if (pIter != rMap.end() ) +{ +// there is already an acceptor with this description +SAL_WARN( "desktop.app", "Acceptor already exists."); return; +} Sequence< Any > aSeq{ Any(aAcceptString), Any(bAccept) }; Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); @@ -161,8 +165,7 @@ void Desktop::createAcceptor(const OUString& aAcceptString) } else { -// there is already an acceptor with this description -SAL_WARN( "desktop.app", "Acceptor already exists."); +SAL_WARN( "desktop.app", "Acceptor could not be created"); } }
[Libreoffice-commits] core.git: desktop/source extensions/source fpicker/source shell/source
desktop/source/app/crashreport.cxx |2 +- extensions/source/ole/unoobjw.cxx|2 +- fpicker/source/win32/VistaFilePickerImpl.cxx |2 +- shell/source/tools/lngconvex/lngconvex.cxx | 10 +- 4 files changed, 8 insertions(+), 8 deletions(-) New commits: commit e624979ce4e06f34ce8c8e8c2ee5c2b5a9a10f57 Author: Stephan Bergmann AuthorDate: Wed Nov 8 08:41:12 2023 +0100 Commit: Stephan Bergmann CommitDate: Wed Nov 8 14:32:49 2023 +0100 loplugin:unnecessarygetstr (clang-cl) Change-Id: Ic0ec1614d48382bb5735a67bf9588657b9ebd521 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159106 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 186a59b02101..b90a04907f69 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -76,7 +76,7 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp"; CrashReporter::addKeyValue("Active-SfxObject",CrashReporter::getActiveSfxObjectName(),CrashReporter::AddItem); CrashReporter::addKeyValue("Last-4-Uno-Commands",CrashReporter::getLoggedUnoCommands(),CrashReporter::AddItem); -CrashReporter::addKeyValue("DumpFile", OStringToOUString(aPath.c_str(), RTL_TEXTENCODING_UTF8), CrashReporter::AddItem); +CrashReporter::addKeyValue("DumpFile", OStringToOUString(aPath, RTL_TEXTENCODING_UTF8), CrashReporter::AddItem); CrashReporter::addKeyValue("GDIHandles", OUString::number(::GetGuiResources(::GetCurrentProcess(), GR_GDIOBJECTS)), CrashReporter::Write); SAL_WARN("desktop", "minidump generated: " << aPath); return succeeded; diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 936e049b147a..915ecd92f8fc 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -1817,7 +1817,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP InterfaceOleWrapper::Invoke(DISPID dispidMembe sParams += ","; std::stringstream aStringStream; aStringStream << pdispparams->rgvarg[i]; -sParams += OUString::createFromAscii(aStringStream.str().c_str()); +sParams += OUString::createFromAscii(aStringStream.str()); } sParams += "]"; #endif diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx index 67e977156bd2..8a2531ab0119 100644 --- a/fpicker/source/win32/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/VistaFilePickerImpl.cxx @@ -1116,7 +1116,7 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(Request& rRequest) if ( SUCCEEDED(hResult) ) { const OUString& sItem = m_lItems[bValue]; -aValue <<= OUString(sItem.getStr()); +aValue <<= sItem; } } break; diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index 546d76653dca..f016d01f7133 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -113,7 +113,7 @@ OUString get_absolute_path( std::string make_absolute(const std::string& file_name) { OUString fp = get_absolute_path( -get_module_path(), OStringToOUString(file_name.c_str())); +get_module_path(), OStringToOUString(file_name)); return std::string(OUStringToOString(fp)); } @@ -157,7 +157,7 @@ public: { return OStringToOUString( maBcp47, RTL_TEXTENCODING_ASCII_US); } std::string make_std_string() const -{ return maBcp47.getStr(); } +{ return std::string(maBcp47); } private: OString maBcp47; @@ -184,7 +184,7 @@ std::string make_winrc_unicode_string(const OUString& str) std::string make_winrc_unicode_string(const std::string& str) { return make_winrc_unicode_string( -OUString::createFromAscii(str.c_str())); +OUString::createFromAscii(str)); } /** A replacement table contains pairs of @@ -272,8 +272,8 @@ void add_group_entries( OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8); Substitutor.add_substitution( -GroupName.getStr(), make_winrc_unicode_string(key_value_utf16)); -map[ ltype ] = std::string( iso_lang.getStr() ); +std::string(GroupName), make_winrc_unicode_string(key_value_utf16)); +map[ ltype ] = std::string( iso_lang ); } else {
[Libreoffice-commits] core.git: desktop/source extensions/source include/curlinit.hxx lingucomponent/source linguistic/source svl/source ucb/source
desktop/source/app/updater.cxx|4 desktop/source/minidump/minidump.cxx |4 extensions/source/update/check/download.cxx |4 include/curlinit.hxx | 59 ++ lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx |5 linguistic/source/translate.cxx |4 svl/source/crypto/cryptosign.cxx |6 + ucb/source/ucp/cmis/cmis_content.cxx |5 ucb/source/ucp/ftp/ftploaderthread.cxx|4 ucb/source/ucp/webdav-curl/CurlSession.cxx|2 10 files changed, 97 insertions(+) New commits: commit 11f439b861922b9286b2e47ed326f3508a48d44e Author: Michael Stahl AuthorDate: Fri Nov 3 20:16:09 2023 +0100 Commit: Michael Stahl CommitDate: Tue Nov 7 14:26:38 2023 +0100 curl: mitigate migration to OpenSSL on Linux The problem is that curl 8.3.0 removed the NSS backend, so we now have no other choice than to use the bundled OpenSSL on Linux. Currently any curl https connection fails with: CurlSession.cxx:963: curl_easy_perform failed: (60) SSL certificate problem: unable to get local issuer certificate Apparently this requires manually telling curl which CA certificates to trust; there is a configure flag --with-ca-bundle but that is useless as it tries to load the file relative to whatever is the current working directory, and also did i mention that there are at least 3 different locations where a Linux system may store its system trusted CA certificates because ALL ABOUT CHOICE. So add a new header with an init function to try out various file locations listed in this nice blog article and call it from way too many places that independently use curl. https://www.happyassassin.net/posts/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/ TODO: perhaps bundle a cacert.pem as a fallback in case the system chose to innovate by putting its certificates in yet another unexpected place (regression from commit c2930ebff82c4f7ffe8377ab82627131f8544226) Change-Id: Ibf1cc0069bc2ae011ecead9a4c2b455e94b01241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158915 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 92f060b976e2..7ff6234b4555 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -37,6 +37,8 @@ #include #include #include + +#include #include #include @@ -546,6 +548,8 @@ std::string download_content(const OString& rURL, bool bFile, OUString& rHash) if (!curl) return std::string(); +::InitCurl_easy(curl.get()); + curl_easy_setopt(curl.get(), CURLOPT_URL, rURL.getStr()); curl_easy_setopt(curl.get(), CURLOPT_USERAGENT, kUserAgent); bool bUseProxy = false; diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 0bf20f2aa419..7fbb0884987d 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -17,6 +17,8 @@ #include +#include + #ifdef _WIN32 #include #include @@ -95,6 +97,8 @@ static bool uploadContent(std::map& parameters, std::s if (!curl) return false; +::InitCurl_easy(curl); + std::string proxy, proxy_user_pwd, ca_certificate_file, file, url, version; getProperty("Proxy", proxy, parameters); diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index 8f090ed9b6dd..2124ee5a0512 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -23,6 +23,8 @@ #include +#include + #include #include #include @@ -222,6 +224,8 @@ static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aPro if( nullptr != pCURL ) { +::InitCurl_easy(pCURL); + out.curl = pCURL; OString aURL(OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)); diff --git a/include/curlinit.hxx b/include/curlinit.hxx new file mode 100644 index ..8b3a9968419d --- /dev/null +++ b/include/curlinit.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#if defined(LINUX) && !defined(SYSTEM_CURL) +#include + +#include + +static char const* GetCABundleFile() +{ +//
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) New commits: commit 2bf894e91adf8783baaabc2203f7e97c4b8f3ca7 Author: Mike Kaganski AuthorDate: Sat Nov 4 17:53:47 2023 +0300 Commit: Mike Kaganski CommitDate: Sat Nov 4 20:06:26 2023 +0100 External data must be checked when parsed Change-Id: I8bc5afb29fe22a4b06462a7c61b689c88c41003f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158938 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 92628177cb66..71eeabcbc380 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -542,34 +542,38 @@ RectangleAndPart RectangleAndPart::Create(const OString& rPayload) const char* pos = rPayload.getStr(); const char* end = rPayload.getStr() + rPayload.getLength(); tools::Long nLeft = rtl_str_toInt64_WithLength(pos, 10, end - pos); -while( *pos != ',' ) +while (pos < end && *pos != ',') +++pos; +if (pos < end) ++pos; -++pos; assert(pos < end); tools::Long nTop = rtl_str_toInt64_WithLength(pos, 10, end - pos); -while( *pos != ',' ) +while (pos < end && *pos != ',') +++pos; +if (pos < end) ++pos; -++pos; assert(pos < end); tools::Long nWidth = rtl_str_toInt64_WithLength(pos, 10, end - pos); -while( *pos != ',' ) +while (pos < end && *pos != ',') +++pos; +if (pos < end) ++pos; -++pos; assert(pos < end); tools::Long nHeight = rtl_str_toInt64_WithLength(pos, 10, end - pos); tools::Long nPart = INT_MIN; tools::Long nMode = 0; if (comphelper::LibreOfficeKit::isPartInInvalidation()) { -while( *pos != ',' ) +while (pos < end && *pos != ',') +++pos; +if (pos < end) ++pos; -++pos; assert(pos < end); nPart = rtl_str_toInt64_WithLength(pos, 10, end - pos); -while( *pos && *pos != ',' ) +while (pos < end && *pos != ',') ++pos; -if (*pos) +if (pos < end) { ++pos; assert(pos < end);
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 1131 +--- 1 file changed, 548 insertions(+), 583 deletions(-) New commits: commit e14a55c9aa834c160e9a5c70f0de3b0635cde66f Author: Mike Kaganski AuthorDate: Sat Nov 4 12:25:11 2023 +0300 Commit: Mike Kaganski CommitDate: Sat Nov 4 15:42:28 2023 +0100 LOK: Simplify a bit, and use more compile-time knowledge Bring some C++20 goodness to LOK code: avoid lots of small memory allocations when constructing OUString from ASCII char arrays; use string lengths known at compile and run time; use safer and cleaner syntax. Change-Id: Ia59ed3c8d8ce521880bb8d70b69a64b2d3e73c14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158927 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index af2eba39876a..92628177cb66 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -261,8 +261,8 @@ namespace { struct ExtensionMap { -const char *extn; -const char *filterName; +std::string_view extn; +OUString filterName; }; class TraceEventDumper : public AutoTimer @@ -300,88 +300,81 @@ public: } }; -} // unnamed namespace - -static TraceEventDumper *traceEventDumper = nullptr; - -const ExtensionMap aWriterExtensionMap[] = -{ -{ "doc", "MS Word 97" }, -{ "docm", "MS Word 2007 XML VBA" }, -{ "docx", "MS Word 2007 XML" }, -{ "fodt", "OpenDocument Text Flat XML" }, -{ "html", "HTML (StarWriter)" }, -{ "odt", "writer8" }, -{ "ott", "writer8_template" }, -{ "pdf", "writer_pdf_Export" }, -{ "epub", "EPUB" }, -{ "rtf", "Rich Text Format" }, -{ "txt", "Text" }, -{ "xhtml", "XHTML Writer File" }, -{ "png", "writer_png_Export" }, -{ "xml", "writer_indexing_export" }, -{ nullptr, nullptr } +TraceEventDumper *traceEventDumper = nullptr; + +constexpr ExtensionMap aWriterExtensionMap[] = +{ +{ "doc", u"MS Word 97"_ustr }, +{ "docm", u"MS Word 2007 XML VBA"_ustr }, +{ "docx", u"MS Word 2007 XML"_ustr }, +{ "fodt", u"OpenDocument Text Flat XML"_ustr }, +{ "html", u"HTML (StarWriter)"_ustr }, +{ "odt", u"writer8"_ustr }, +{ "ott", u"writer8_template"_ustr }, +{ "pdf", u"writer_pdf_Export"_ustr }, +{ "epub", u"EPUB"_ustr }, +{ "rtf", u"Rich Text Format"_ustr }, +{ "txt", u"Text"_ustr }, +{ "xhtml", u"XHTML Writer File"_ustr }, +{ "png", u"writer_png_Export"_ustr }, +{ "xml", u"writer_indexing_export"_ustr }, }; -const ExtensionMap aCalcExtensionMap[] = -{ -{ "csv", "Text - txt - csv (StarCalc)" }, -{ "fods", "OpenDocument Spreadsheet Flat XML" }, -{ "html", "HTML (StarCalc)" }, -{ "ods", "calc8" }, -{ "ots", "calc8_template" }, -{ "pdf", "calc_pdf_Export" }, -{ "xhtml", "XHTML Calc File" }, -{ "xls", "MS Excel 97" }, -{ "xlsm", "Calc MS Excel 2007 VBA XML" }, -{ "xlsx", "Calc MS Excel 2007 XML" }, -{ "png", "calc_png_Export" }, -{ nullptr, nullptr } +constexpr ExtensionMap aCalcExtensionMap[] = +{ +{ "csv", u"Text - txt - csv (StarCalc)"_ustr }, +{ "fods", u"OpenDocument Spreadsheet Flat XML"_ustr }, +{ "html", u"HTML (StarCalc)"_ustr }, +{ "ods", u"calc8"_ustr }, +{ "ots", u"calc8_template"_ustr }, +{ "pdf", u"calc_pdf_Export"_ustr }, +{ "xhtml", u"XHTML Calc File"_ustr }, +{ "xls", u"MS Excel 97"_ustr }, +{ "xlsm", u"Calc MS Excel 2007 VBA XML"_ustr }, +{ "xlsx", u"Calc MS Excel 2007 XML"_ustr }, +{ "png", u"calc_png_Export"_ustr }, }; -const ExtensionMap aImpressExtensionMap[] = -{ -{ "fodp", "OpenDocument Presentation Flat XML" }, -{ "html", "impress_html_Export" }, -{ "odg", "impress8_draw" }, -{ "odp", "impress8" }, -{ "otp", "impress8_template" }, -{ "pdf", "impress_pdf_Export" }, -{ "potm", "Impress MS PowerPoint 2007 XML Template" }, -{ "pot", "MS PowerPoint 97 Vorlage" }, -{ "pptm", "Impress MS PowerPoint 2007 XML VBA" }, -{ "pptx", "Impress MS PowerPoint 2007 XML" }, -{ "pps", "MS PowerPoint 97 Autoplay" }, -{ "ppt", "MS PowerPoint 97" }, -{ "svg", "impress_svg_Export" }, -{ "xhtml", "XHTML Impress File" }, -{ "png", "impress_png_Export"}, -{ nullptr, nullptr } +constexpr ExtensionMap aImpressExtensionMap[] = +{ +{ "fodp", u"OpenDocument Presentation Flat XML"_ustr }, +{ "html", u"impress_html_Export"_ustr }, +{ "odg", u"impress8_draw"_ustr }, +{ "odp", u"impress8"_ustr }, +{ "otp", u"impress8_template"_ustr }, +{ "pdf", u"impress_pdf_Export"_ustr }, +{ "potm", u"Impress MS PowerPoint 2007 XML Template"_ustr }, +{ "pot", u"MS PowerPoint 97 Vorlage"_ustr }, +{ "pptm", u"Impress MS PowerPoint 2007 XML VBA"_ustr }, +{ "pptx", u"Impress MS PowerPoint 2007 XML"_ustr }, +
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e963da8716a9e418ff220f0c0b5299dcaa82f53a Author: Ankit_Jaipuriar AuthorDate: Tue Oct 10 17:06:39 2023 +0530 Commit: Hossein CommitDate: Fri Nov 3 22:53:01 2023 +0100 tdf#114441 Convert sal_uLong to better data types The function getLength() returns a value as sal_Int32, which is then assigned to the variable nLinks. Change-Id: I44d626e2a26e3d9eb15b0884500f0dfddff12e9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157755 Tested-by: Hossein Reviewed-by: Hossein diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 78e8eeaf2180..af2eba39876a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -432,12 +432,12 @@ static void extractLinks(const uno::Reference< container::XNameAccess >& xLinks, { const uno::Sequence< OUString > aNames( xLinks->getElementNames() ); -const sal_uLong nLinks = aNames.getLength(); +const sal_Int32 nLinks = aNames.getLength(); const OUString* pNames = aNames.getConstArray(); static constexpr OUStringLiteral aProp_LinkDisplayName( u"LinkDisplayName" ); static constexpr OUStringLiteral aProp_LinkTarget( u"com.sun.star.document.LinkTarget" ); bool bIsTarget = false; -for( sal_uLong i = 0; i < nLinks; i++ ) +for( sal_Int32 i = 0; i < nLinks; i++ ) { uno::Any aAny; OUString aLink( *pNames++ );
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a269f52d2016ef72f51e8b73574b6cbd0f448e33 Author: Marco Cecchetti AuthorDate: Thu Oct 26 20:22:17 2023 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 31 15:44:24 2023 +0100 lok a11y: calc: make possible to enable accessibility for spreadsheets Change-Id: I462b2d386b58a895bd4c45d4bd61a049404d3848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158512 Reviewed-by: Andras Timar Tested-by: Andras Timar (cherry picked from commit e5481fdaf33a3921ef0624e8a62e28e2f68086da) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158691 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ab4987376f4f..78e8eeaf2180 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7179,7 +7179,7 @@ static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocumen SolarMutexGuard aGuard; int nDocType = getDocumentType(pThis); -if (!(nDocType == LOK_DOCTYPE_TEXT || nDocType == LOK_DOCTYPE_PRESENTATION)) +if (!(nDocType == LOK_DOCTYPE_TEXT || nDocType == LOK_DOCTYPE_PRESENTATION || nDocType == LOK_DOCTYPE_SPREADSHEET)) return; SfxLokHelper::setAccessibilityState(nId, nEnabled);
[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit libreofficekit/source sfx2/source svx/source
desktop/source/lib/init.cxx |2 include/LibreOfficeKit/LibreOfficeKitEnums.h | 31 libreofficekit/source/gtk/lokdocview.cxx |2 sfx2/source/view/viewsh.cxx | 835 --- svx/source/accessibility/ChildrenManagerImpl.cxx | 17 5 files changed, 642 insertions(+), 245 deletions(-) New commits: commit f3b20f31d55f304ed9d4a3eb257bf9d468fffe5f Author: Marco Cecchetti AuthorDate: Tue Oct 10 10:50:50 2023 +0200 Commit: Miklos Vajna CommitDate: Fri Oct 27 19:28:52 2023 +0200 lok: a11y: impress: help screen reader to report shape selection Refactored LOKDocumentFocusListener::notifyEvent. Implemented 2 new callbacks: - LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: it says the client if editing in a shape or cell is active or it isn't. - LOK_CALLBACK_A11Y_SELECTION_CHANGED: it says if a shape has been selected/unselected, the name of the shape and text content are sent too for being reported by a screen reader. (cherry picked from commit 76899152ec3d1924cc72d2b869e197a1e34a0a1a) Conflicts: sfx2/source/view/viewsh.cxx Change-Id: I644bcc7daeb8772805688a9bccdabd0631ce0a22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158562 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index bccac7338367..ab4987376f4f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1818,6 +1818,8 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED: case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: +case LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: +case LOK_CALLBACK_A11Y_SELECTION_CHANGED: { const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), type); auto pos2 = toQueue2(pos); diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 883a68ce09c6..378347108de6 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -1001,7 +1001,32 @@ typedef enum * the user got in from the outer to the inner; row/column span default * value is 1; paragraph is the cell text content. */ -LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED = 67 +LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED = 67, + +/** + * Accessibility event: text editing in a shape or cell has been enabled/disabled + * + * { + * "cell": true/false (editing a cell ?) + * "enabled": true|false + * "selection": a selection description + * "paragraph": focused paragraph + * } + */ +LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE = 68, + +/** + * Accessibility event: a selection (of a shape/graphic, etc.) has changed + * + * { + * "cell": true/false (selected object is a cell ?) + * "action": "create"|"add"|"remove" + * "name": selected object name + * "text": text content if any + * } + */ +LOK_CALLBACK_A11Y_SELECTION_CHANGED = 69 + } LibreOfficeKitCallbackType; @@ -1166,6 +1191,10 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_DOCUMENT_PASSWORD_RESET"; case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: return "LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED"; +case LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: +return "LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE"; +case LOK_CALLBACK_A11Y_SELECTION_CHANGED: +return "LOK_CALLBACK_A11Y_SELECTION_CHANGED"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index c3df48448815..6c7e6dbfc652 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1494,6 +1494,8 @@ callback (gpointer pData) case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET: +case LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: +case LOK_CALLBACK_A11Y_SELECTION_CHANGED: { // TODO: Implement me break; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 34edb460d4e3..8f2218c66175 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -253,6 +253,29 @@ typedef std::list> XAccessibleTa namespace { +constexpr +bool isText(sal_Int16 nRole) +{ +return nRole == accessibility::AccessibleRole::DOCUMENT_TEXT; +} + +constexpr +bool isSpreadsheet(sal_Int16 nRole) +{ +return nRole == accessibility::AccessibleRole::DOCUMENT_SPREADSHEET; +} + +constexpr +bool
[Libreoffice-commits] core.git: desktop/source sfx2/source svx/source
desktop/source/lib/init.cxx |2 sfx2/source/view/viewsh.cxx | 135 --- svx/source/accessibility/ChildrenManagerImpl.cxx |8 - 3 files changed, 126 insertions(+), 19 deletions(-) New commits: commit c34f465a21dab492afec12011f4a16584a663d9f Author: Marco Cecchetti AuthorDate: Tue Oct 3 12:34:45 2023 +0200 Commit: Caolán McNamara CommitDate: Sun Oct 22 16:39:59 2023 +0200 lok: a11y: impress: screen reader support for text shape editing Now accessibility support can be enabled in Impress. Fixed an issue that prevented to receive accessibility event when a shape text content was edited. Some rectangles overlapping check is performed for excluding not visible shapes from the a11y tree Anyway client and core visible area can differ some shape was wrongly pruned from the a11y tree. The problem has been fixed by not performing the overlapping test in the LOK case: we already do the same for shape area invalidation. In order to avoid the screen reader to report no more focused paragraph we send an empty paragraph to clear the editable area when shape selection state changes. When shape ediding becomes active the text content of the shape is sent to the client. Change-Id: Ia9ee08d060162891725d26efd2aa36e47b38ed50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157525 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158329 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index bbb32dd3d74f..57869a7540ef 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7293,7 +7293,7 @@ static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocumen SolarMutexGuard aGuard; int nDocType = getDocumentType(pThis); -if (nDocType != LOK_DOCTYPE_TEXT) +if (!(nDocType == LOK_DOCTYPE_TEXT || nDocType == LOK_DOCTYPE_PRESENTATION)) return; SfxLokHelper::setAccessibilityState(nId, nEnabled); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 68c99691fb4c..34edb460d4e3 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -271,6 +271,28 @@ bool isFocused(const accessibility::AccessibleEventObject& aEvent) return hasState(aEvent, accessibility::AccessibleStateType::FOCUSED); } +sal_Int16 getParentRole(const uno::Reference& xAccObject) +{ +if (!xAccObject.is()) +return 0; + +uno::Reference xContext(xAccObject, uno::UNO_QUERY); +if (xContext.is()) +{ +uno::Reference xParent = xContext->getAccessibleParent(); +if (xParent.is()) +{ +uno::Reference xParentContext(xParent, + uno::UNO_QUERY); +if (xParentContext.is()) +{ +return xParentContext->getAccessibleRole(); +} +} +} +return 0; +} + // Put in rAncestorList all ancestors of xTable up to xAncestorTable or // up to the first not-a-table ancestor if xAncestorTable is not an ancestor. // xTable is included in the list, xAncestorTable is not included. @@ -364,6 +386,16 @@ void aboutEvent(std::string msg, const accessibility::AccessibleEventObject& aEv << "\n parent: " << xContext->getAccessibleParent().get() << "\n child count: " << xContext->getAccessibleChildCount()); } +else +{ +SAL_INFO("lok.a11y", msg << ": event id: " << aEvent.EventId + << ", no accessible context!"); +} +} +else +{ +SAL_INFO("lok.a11y", msg << ": event id: " << aEvent.EventId + << ", no accessible source!"); } uno::Reference< accessibility::XAccessible > xOldValue; aEvent.OldValue >>= xOldValue; @@ -690,6 +722,7 @@ private: bool force, std::string msg = ""); void updateAndNotifyParagraph(const uno::Reference& xAccText, bool force, std::string msg = ""); +void resetParagraphInfo(); }; LOKDocumentFocusListener::LOKDocumentFocusListener(const SfxViewShell* pViewShell) @@ -891,6 +924,20 @@ bool LOKDocumentFocusListener::updateParagraphInfo(const uno::ReferencegetSelectionEnd(); m_nListPrefixLength = getListPrefixSize(xAccText); +// Inside a text shape when there is no selection, selection-start and selection-end are +// set to current caret position instead of -1. Moreover, inside a text shape pressing +// delete or backspace with an empty selection really deletes text and not only the empty +
[Libreoffice-commits] core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |3 ++- sfx2/source/control/unoctitm.cxx |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit b83f069101f1e6d8aaac09a805f02bbc4c619e7a Author: Pranam Lashkari AuthorDate: Wed Jul 26 16:39:49 2023 +0700 Commit: Pranam Lashkari CommitDate: Wed Oct 18 23:57:18 2023 +0200 LOK: send state of protected cells Change-Id: I432a3af50b6089faa80a28804d95d816af6cd278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154936 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-by: Pranam Lashkari (cherry picked from commit 5f13751cefd725cb2a38e66c9484046e6141c6c2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158150 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6d9697d60aed..416265df4099 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3842,7 +3842,8 @@ static void doc_iniUnoCommands () OUString(".uno:InsertDropdownContentControl"), OUString(".uno:InsertPlainTextContentControl"), OUString(".uno:InsertPictureContentControl"), -OUString(".uno:DataFilterAutoFilter") +OUString(".uno:DataFilterAutoFilter"), +OUString(".uno:CellProtection") }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 89e94caff794..1f3f37f5fc1b 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -935,7 +935,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "SpacePara1" || aEvent.FeatureURL.Path == "SpacePara15" || aEvent.FeatureURL.Path == "SpacePara2" || -aEvent.FeatureURL.Path == "DataFilterAutoFilter") +aEvent.FeatureURL.Path == "DataFilterAutoFilter" || +aEvent.FeatureURL.Path == "CellProtection") { bool bTemp = false; aEvent.State >>= bTemp;
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 0379bdc8c5cd8cdca64e3e0d567b32699308dcac Author: Andrea Gelmini AuthorDate: Thu Oct 12 13:04:14 2023 +0200 Commit: Julien Nabet CommitDate: Sat Oct 14 16:30:51 2023 +0200 Remove duplicated include Change-Id: I0a5bbd375e1841e3a441ab241b18933858ecd45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157864 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index fc57d748d5d4..6d9697d60aed 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -9,7 +9,6 @@ #include #include -#include #include #include #include
[Libreoffice-commits] core.git: desktop/source svx/source vcl/source
desktop/source/lib/init.cxx| 36 + svx/source/sdr/contact/viewcontact.cxx |2 + vcl/source/filter/graphicfilter.cxx|2 + 3 files changed, 40 insertions(+) New commits: commit 01e89930f8a0d50758ed23b0cf2bfd7b9ee47b9b Author: Ashod Nakashian AuthorDate: Sun Jul 23 10:07:04 2023 -0400 Commit: Caolán McNamara CommitDate: Wed Oct 11 12:45:49 2023 +0200 lok: flush the VOC primitives when trimming memory Signed-off-by: Ashod Nakashian Change-Id: I0a7748a1fb1b58b3bcfc6b8fdfa1410a345849a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154812 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit 5fba074e7f22ff0e5d5b9591a912193f7be8c08c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154868 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 67957a370751..40c11e54d080 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -8,6 +8,11 @@ */ #include +#include +#include +#include +#include +#include #include #include #include @@ -3170,6 +3175,37 @@ static char* lo_extractRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) static void lo_trimMemory(LibreOfficeKit* /* pThis */, int nTarget) { vcl::lok::trimMemory(nTarget); + +if (nTarget > 2000) +{ +SolarMutexGuard aGuard; + +// Flush all buffered VOC primitives from the pages. +SfxViewShell* pViewShell = SfxViewShell::Current(); +if (pViewShell) +{ +const SdrView* pView = pViewShell->GetDrawView(); +if (pView) +{ +SdrPageView* pPageView = pView->GetSdrPageView(); +if (pPageView) +{ +SdrPage* pCurPage = pPageView->GetPage(); +if (pCurPage) +{ +SdrModel& sdrModel = pCurPage->getSdrModelFromSdrPage(); +for (sal_uInt16 i = 0; i < sdrModel.GetPageCount(); ++i) +{ +SdrPage* pPage = sdrModel.GetPage(i); +if (pPage) + pPage->GetViewContact().flushViewObjectContacts(); +} +} +} +} +} +} + if (nTarget > 1000) { #ifdef HAVE_MALLOC_TRIM diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index 3529f98cf385..99106d0d6ed0 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -58,6 +58,8 @@ void ViewContact::deleteAllVOCs() // assert when there were new entries added during deletion DBG_ASSERT(maViewObjectContactVector.empty(), "Corrupted ViewObjectContactList in VC (!)"); + +mxViewIndependentPrimitive2DSequence = drawinglayer::primitive2d::Primitive2DContainer(); } // get an Object-specific ViewObjectContact for a specific diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index e323418674c8..f082e5b17d8b 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -694,12 +694,14 @@ void GraphicFilter::MakeGraphicsAvailableThreaded(std::vector& graphic if( toLoad.empty()) return; std::vector< std::unique_ptr> streams; +streams.reserve(toLoad.size()); for( auto graphic : toLoad ) { streams.push_back( std::make_unique( const_cast(graphic->GetSharedGfxLink()->GetData()), graphic->GetSharedGfxLink()->GetDataSize(), StreamMode::READ | StreamMode::WRITE)); } std::vector< std::shared_ptr> loadedGraphics; +loadedGraphics.reserve(streams.size()); ImportGraphics(loadedGraphics, std::move(streams)); assert(loadedGraphics.size() == toLoad.size()); for( size_t i = 0; i < toLoad.size(); ++i )
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 21 + 1 file changed, 21 insertions(+) New commits: commit a6c68549d0132d76a04d21c146a48345742c451f Author: Andras Timar AuthorDate: Sun May 14 18:19:18 2023 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 10 17:31:52 2023 +0200 lok: set help root URL Change-Id: Id4089027f095daebb69942eb3315d516cfb14779 (cherry picked from commit 2239e4c1b2dcf06650316a106e5bd883ceefb6c1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157750 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a2399b125b94..67957a370751 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7678,6 +7678,25 @@ static void activateNotebookbar(std::u16string_view rApp) } } +void setHelpRootURL() +{ +const char* pHelpRootURL = ::getenv("LOK_HELP_URL"); +if (pHelpRootURL) +{ +OUString aHelpRootURL = OStringToOUString(pHelpRootURL, RTL_TEXTENCODING_UTF8); +try +{ +std::shared_ptr batch(comphelper::ConfigurationChanges::create()); +officecfg::Office::Common::Help::HelpRootURL::set(aHelpRootURL, batch); +batch->commit(); +} +catch (uno::Exception const& rException) +{ +SAL_WARN("lok", "Failed to set the help root URL: " << rException.Message); +} +} +} + void setCertificateDir() { const char* pEnvVarString = ::getenv("LO_CERTIFICATE_DATABASE_PATH"); @@ -8106,6 +8125,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char } #endif + +setHelpRootURL(); setCertificateDir(); setDeeplConfig(); setLanguageToolConfig();
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) New commits: commit fa834e64e927efca00c9c47edfee58f0714c4fd4 Author: Henry Castro AuthorDate: Mon Sep 25 16:23:20 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Oct 10 09:30:46 2023 +0200 lok: fix getting SID_DOC_READONLY slot property Unfortunately, the property is not always set when import XLSX documents. Signed-off-by: Henry Castro Change-Id: If501734704174b92b3589b61a019ba973592c331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157259 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157736 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 52ca105d09b9..a2399b125b94 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5982,18 +5982,9 @@ static char* getDocReadOnly(LibreOfficeKitDocument* pThis) if (!pObjectShell) return nullptr; -SfxMedium* pMedium = pObjectShell->GetMedium(); -if (!pMedium) -return nullptr; - -bool bDocReadOnly = false; -if (const SfxBoolItem* pReadOnlyItem = -pMedium->GetItemSet().GetItem(SID_DOC_READONLY, false)) -bDocReadOnly = pReadOnlyItem->GetValue(); - boost::property_tree::ptree aTree; aTree.put("commandName", ".uno:ReadOnly"); -aTree.put("success", bDocReadOnly); +aTree.put("success", pObjectShell->IsLoadReadonly()); std::stringstream aStream; boost::property_tree::write_json(aStream, aTree);
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) New commits: commit 4dade552c67a36f83cb419f90369722dc913d9fe Author: Henry Castro AuthorDate: Fri Sep 8 14:23:33 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 21:32:49 2023 +0200 lok: add getter function to read "ReadOnly" flag Signed-off-by: Henry Castro Change-Id: Id9d2bc638d0f48cb33764b07fb8976b97117a621 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156621 Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157733 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d0c3e5fe939b..52ca105d09b9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5968,6 +5968,44 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis) pDoc->resetSelection(); } +static char* getDocReadOnly(LibreOfficeKitDocument* pThis) +{ +LibLODocument_Impl* pDocument = static_cast(pThis); +if (!pDocument) +return nullptr; + +SfxBaseModel* pBaseModel = dynamic_cast(pDocument->mxComponent.get()); +if (!pBaseModel) +return nullptr; + +SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell(); +if (!pObjectShell) +return nullptr; + +SfxMedium* pMedium = pObjectShell->GetMedium(); +if (!pMedium) +return nullptr; + +bool bDocReadOnly = false; +if (const SfxBoolItem* pReadOnlyItem = +pMedium->GetItemSet().GetItem(SID_DOC_READONLY, false)) +bDocReadOnly = pReadOnlyItem->GetValue(); + +boost::property_tree::ptree aTree; +aTree.put("commandName", ".uno:ReadOnly"); +aTree.put("success", bDocReadOnly); + +std::stringstream aStream; +boost::property_tree::write_json(aStream, aTree); +char* pJson = static_cast(malloc(aStream.str().size() + 1)); +if (!pJson) +return nullptr; + +strcpy(pJson, aStream.str().c_str()); +pJson[aStream.str().size()] = '\0'; +return pJson; +} + static char* getLanguages(LibreOfficeKitDocument* pThis, const char* pCommand) { css::uno::Sequence< css::lang::Locale > aLocales; @@ -6345,7 +6383,11 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo return nullptr; } -if (!strcmp(pCommand, ".uno:LanguageStatus")) +if (!strcmp(pCommand, ".uno:ReadOnly")) +{ +return getDocReadOnly(pThis); +} +else if (!strcmp(pCommand, ".uno:LanguageStatus")) { return getLanguages(pThis, pCommand); }
[Libreoffice-commits] core.git: desktop/source uui/source
desktop/source/lib/lokinteractionhandler.cxx | 24 desktop/source/lib/lokinteractionhandler.hxx |2 ++ uui/source/iahndl-errorhandler.cxx |1 - 3 files changed, 26 insertions(+), 1 deletion(-) New commits: commit 447d6af45b3c454bb858bc904f50e500aaaefc60 Author: Henry Castro AuthorDate: Wed Sep 6 10:28:59 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 16:32:35 2023 +0200 lok: implement "handleLoadReadOnlyRequest" Is used for interaction handle to query user decision regarding to open the document read only. Signed-off-by: Henry Castro Change-Id: Ia945eae7b1627d57d6211ae92a784d50313c2627 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156623 Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157703 Tested-by: Jenkins diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index 6df4fe2d98e5..a05091cedf5e 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -368,6 +369,26 @@ bool LOKInteractionHandler::handlePackageReparationRequest(const uno::Reference< return false; } +bool LOKInteractionHandler::handleLoadReadOnlyRequest(const uno::Reference& xRequest) +{ +uno::Any const request(xRequest->getRequest()); + +OUString aFileName; +beans::NamedValue aLoadReadOnlyRequest; +if ((request >>= aLoadReadOnlyRequest) && +aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" && +(aLoadReadOnlyRequest.Value >>= aFileName)) +{ +auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr)); + +if (xInteraction.is()) +xInteraction->handleInteractionRequest(xRequest); + +return true; +} +return false; +} + bool LOKInteractionHandler::handleFilterOptionsRequest(const uno::Reference& xRequest) { document::FilterOptionsRequest aFilterOptionsRequest; @@ -410,6 +431,9 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest( if (handlePackageReparationRequest(xRequest)) return true; +if (handleLoadReadOnlyRequest(xRequest)) +return true; + // TODO: perform more interactions 'for real' like the above selectApproved(rContinuations); diff --git a/desktop/source/lib/lokinteractionhandler.hxx b/desktop/source/lib/lokinteractionhandler.hxx index fc2bf12b48cc..c3641db0762f 100644 --- a/desktop/source/lib/lokinteractionhandler.hxx +++ b/desktop/source/lib/lokinteractionhandler.hxx @@ -79,6 +79,8 @@ private: static bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request); static bool handlePackageReparationRequest(const css::uno::Reference& xRequest); +static bool handleLoadReadOnlyRequest(const css::uno::Reference& xRequest); + public: void SetPassword(char const* pPassword); diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index c89e66b93c35..e4be8a713911 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -94,7 +94,6 @@ executeErrorDialog( break; } - switch (nButtonMask) { case MessageBoxStyle::NONE:
[Libreoffice-commits] core.git: desktop/source sfx2/source uui/source
desktop/source/lib/lokinteractionhandler.cxx | 21 + desktop/source/lib/lokinteractionhandler.hxx |1 + sfx2/source/doc/sfxbasemodel.cxx |4 +++- uui/source/iahndl.cxx|2 +- 4 files changed, 26 insertions(+), 2 deletions(-) New commits: commit e2ee3dd61ab8ea5d970d8da5df3233e7bba5909e Author: Szymon Kłos AuthorDate: Fri Sep 22 11:11:06 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Oct 2 17:55:04 2023 +0200 lok: add broken package interaction handler in case of repair don't use template flag to not make file readonly so we can overwrite it and upload to storage updated version Conflicts: desktop/source/lib/lokinteractionhandler.cxx desktop/source/lib/lokinteractionhandler.hxx sfx2/source/doc/sfxbasemodel.cxx Change-Id: Ia460009fc3b77582dde06dd6f94a85aef3aee11b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157493 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index ec3d2e365c45..6df4fe2d98e5 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -350,6 +351,23 @@ bool LOKInteractionHandler::handleMacroConfirmationRequest(const uno::Reference< return false; } +bool LOKInteractionHandler::handlePackageReparationRequest(const uno::Reference& xRequest) +{ +uno::Any const request(xRequest->getRequest()); + +document::BrokenPackageRequest aBrokenPackageRequest; +if (request >>= aBrokenPackageRequest) +{ +auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr)); + +if (xInteraction.is()) +xInteraction->handleInteractionRequest(xRequest); + +return true; +} +return false; +} + bool LOKInteractionHandler::handleFilterOptionsRequest(const uno::Reference& xRequest) { document::FilterOptionsRequest aFilterOptionsRequest; @@ -389,6 +407,9 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest( if (handleMacroConfirmationRequest(xRequest)) return true; +if (handlePackageReparationRequest(xRequest)) +return true; + // TODO: perform more interactions 'for real' like the above selectApproved(rContinuations); diff --git a/desktop/source/lib/lokinteractionhandler.hxx b/desktop/source/lib/lokinteractionhandler.hxx index 5c6c6f87de6d..fc2bf12b48cc 100644 --- a/desktop/source/lib/lokinteractionhandler.hxx +++ b/desktop/source/lib/lokinteractionhandler.hxx @@ -77,6 +77,7 @@ private: static bool handleMacroConfirmationRequest(const css::uno::Reference& xRequest); static bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request); +static bool handlePackageReparationRequest(const css::uno::Reference& xRequest); public: void SetPassword(char const* pPassword); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index e5eb0177fe6d..761bd16d2a76 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1980,9 +1980,11 @@ void SAL_CALL SfxBaseModel::load( const Sequence< beans::PropertyValue >& seqA xHandler->handle( aRequest.GetRequest() ); if( aRequest.isApproved() ) { +// lok: we want to overwrite file in jail, so don't use template flag +bool bIsLOK = comphelper::LibreOfficeKit::isActive(); // broken package: try second loading and allow repair pMedium->GetItemSet().Put( SfxBoolItem( SID_REPAIRPACKAGE, true ) ); -pMedium->GetItemSet().Put( SfxBoolItem( SID_TEMPLATE, true ) ); +pMedium->GetItemSet().Put( SfxBoolItem( SID_TEMPLATE, !bIsLOK ) ); pMedium->GetItemSet().Put( SfxStringItem( SID_DOCINFO_TITLE, aDocName ) ); // the error must be reset and the storage must be reopened in new mode diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index b6e88bcd3e40..e4aedbfc72dd 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -936,7 +936,7 @@ executeMessageBox( SolarMutexGuard aGuard; std::unique_ptr xBox(Application::CreateMessageDialog(pParent, eMessageType, -eMessageType == VclMessageType::Question ? VclButtonsType::YesNo : VclButtonsType::Ok, rMessage)); +eMessageType == VclMessageType::Question ? VclButtonsType::YesNo : VclButtonsType::Ok, rMessage, GetpApp())); xBox->set_title(rTitle); short nMessResult = xBox->run();
[Libreoffice-commits] core.git: desktop/source filter/Configuration_filter.mk filter/source officecfg/registry sd/inc sd/Library_sd.mk sd/qa sd/source
desktop/source/lib/init.cxx |2 filter/Configuration_filter.mk |2 filter/source/config/fragments/filters/draw_html_Export.xcu | 30 filter/source/config/fragments/filters/impress_html_Export.xcu | 30 officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu |2 sd/Library_sd.mk|2 sd/inc/sdhtmlfilter.hxx | 34 sd/qa/unit/HtmlExportTest.cxx | 29 sd/qa/unit/dialogs-test.cxx |1 sd/source/filter/html/htmlex.cxx| 858 ++ sd/source/filter/html/htmlex.hxx| 84 sd/source/filter/html/sdhtmlfilter.cxx | 44 sd/source/ui/docshell/docshel4.cxx |7 13 files changed, 1118 insertions(+), 7 deletions(-) New commits: commit 608c35665bee5990bd7e2799854e233d1454b6a4 Author: Xisco Fauli AuthorDate: Wed Sep 27 10:58:34 2023 +0200 Commit: Xisco Fauli CommitDate: Thu Sep 28 15:39:03 2023 +0200 tdf#105303: re-introduce single-document html export filter which was deleted in 28b6480c6bdd179f3943f768926b7f196226c768 "tdf#105303: Drop html export wizard" With this commit, exporting to HTML from File - Export dialog behaves the same way as using --convert-to html:"impress_html_Export" from the commandline. The slides are exported as a single document For more information see the discussion in tdf#105303 Change-Id: Ib96b3d855ae807e79f276099422903c86ea2628a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157331 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 777d1030d075..434b65319776 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -335,6 +335,7 @@ const ExtensionMap aCalcExtensionMap[] = const ExtensionMap aImpressExtensionMap[] = { { "fodp", "OpenDocument Presentation Flat XML" }, +{ "html", "impress_html_Export" }, { "odg", "impress8_draw" }, { "odp", "impress8" }, { "otp", "impress8_template" }, @@ -354,6 +355,7 @@ const ExtensionMap aImpressExtensionMap[] = const ExtensionMap aDrawExtensionMap[] = { { "fodg", "draw_ODG_FlatXML" }, +{ "html", "draw_html_Export" }, { "odg", "draw8" }, { "pdf", "draw_pdf_Export" }, { "svg", "draw_svg_Export" }, diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index 921189c4de25..bd3d3486234e 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -764,6 +764,7 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_drawgraphics_f draw_emz_Export \ draw_eps_Export \ draw_gif_Export \ + draw_html_Export \ draw_jpg_Export \ draw_png_Export \ draw_svg_Export \ @@ -808,6 +809,7 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_impressgraphic impress_emf_Export \ impress_eps_Export \ impress_gif_Export \ + impress_html_Export \ impress_jpg_Export \ impress_png_Export \ impress_svg_Export \ diff --git a/filter/source/config/fragments/filters/draw_html_Export.xcu b/filter/source/config/fragments/filters/draw_html_Export.xcu new file mode 100644 index ..ebb14b75b19f --- /dev/null +++ b/filter/source/config/fragments/filters/draw_html_Export.xcu @@ -0,0 +1,30 @@ + + +EXPORT ALIEN + + + +0 +graphic_HTML + +com.sun.star.drawing.DrawingDocument + +HTML Document (Draw) + + diff --git a/filter/source/config/fragments/filters/impress_html_Export.xcu b/filter/source/config/fragments/filters/impress_html_Export.xcu new file mode 100644 index ..1e0fb435e01e --- /dev/null +++ b/filter/source/config/fragments/filters/impress_html_Export.xcu @@ -0,0 +1,30 @@ + + +EXPORT ALIEN + + + +0 +graphic_HTML + +com.sun.star.presentation.PresentationDocument + +HTML Document (Impress) + + diff --git a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu index 3dc6272ab7b2..5dcce7b1e688 100644 --- a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu +++ b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu @@ -26,7 +26,7 @@ -draw8;draw8_template;StarOffice XML (Draw);draw_StarOffice_XML_Draw_Template;OpenDocument Drawing Flat XML;draw_pdf_Export;draw_flash_Export;WordPerfect Graphics;DXF - AutoCAD Interchange;EMF - MS Windows
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit b0b7db318717b64259fc136e8d5b3268cd9af1c3 Author: Andrea Gelmini AuthorDate: Fri Sep 1 18:17:47 2023 +0200 Commit: Julien Nabet CommitDate: Sat Sep 2 12:03:21 2023 +0200 Remove duplicated include Change-Id: I3a3ca7313e1921f806b256c7a66340d0e90a582e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156428 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4b81619cbc1f..434b65319776 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -127,7 +127,6 @@ #include #include #include -#include #include #ifdef IOS
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 4c2aa7e073d6ab9f063272011d2866addeeed526 Author: Henry Castro AuthorDate: Tue Aug 8 15:12:27 2023 -0400 Commit: Henry Castro CommitDate: Fri Sep 1 15:59:34 2023 +0200 lok: use constant keys enumeration Useful to better readability code. Signed-off-by: Henry Castro Change-Id: I335d010c3b1ddf3f8052b7ed6cb0f94ad20045f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155495 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156416 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 21c47eacdfc7..6db6f722bee6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4534,12 +4534,12 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWi // backspace if (nLOKWindowId == 0) { -KeyEvent aEvt(8, 1283); +KeyEvent aEvt(8, KEY_BACKSPACE); for (int i = 0; i < nCharBefore; ++i) pWindow->KeyInput(aEvt); } else -SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 8, 1283, nCharBefore - 1); +SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 8, KEY_BACKSPACE, nCharBefore - 1); } if (nCharAfter > 0) @@ -4547,12 +4547,12 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWi // delete (forward) if (nLOKWindowId == 0) { -KeyEvent aEvt(46, 1286); +KeyEvent aEvt(46, KEY_DELETE); for (int i = 0; i < nCharAfter; ++i) pWindow->KeyInput(aEvt); } else -SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 46, 1286, nCharAfter - 1); +SfxLokHelper::postKeyEventAsync(pWindow, LOK_KEYEVENT_KEYINPUT, 46, KEY_DELETE, nCharAfter - 1); } }
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) New commits: commit beeeb3b8d5dcdee45d3fb2cb97f3def789db0f6a Author: Szymon Kłos AuthorDate: Tue Aug 8 06:49:04 2023 +0200 Commit: Szymon Kłos CommitDate: Tue Aug 29 11:18:21 2023 +0200 jsdialog: detect special window id earlier Change-Id: Ib90d9d728d93a26d44a7f52b7ca0074338b1fae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155853 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156235 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 86a32708e59b..21c47eacdfc7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4721,11 +4721,21 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA try { OUString sControlId = aMap["id"]; +OUString sWindowId = OUString::number(nWindowId); +OUString sCurrentShellId = OUString::number(nCurrentShellId); + +// special values for window id +if (nWindowId == static_cast(-1)) +sWindowId = sCurrentShellId + "sidebar"; +if (nWindowId == static_cast(-2)) +sWindowId = sCurrentShellId + "notebookbar"; +if (nWindowId == static_cast(-3)) +sWindowId = sCurrentShellId + "formulabar"; // dialogs send own id but notebookbar and sidebar controls are remembered by SfxViewShell id -if (jsdialog::ExecuteAction(OUString::number(nWindowId), sControlId, aMap)) +if (jsdialog::ExecuteAction(sWindowId, sControlId, aMap)) return; -auto sCurrentShellId = OUString::number(nCurrentShellId); + if (jsdialog::ExecuteAction(sCurrentShellId + "sidebar", sControlId, aMap)) return; if (jsdialog::ExecuteAction(sCurrentShellId + "notebookbar", sControlId, aMap))
[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit libreofficekit/source sfx2/source
desktop/source/lib/init.cxx |2 include/LibreOfficeKit/LibreOfficeKitEnums.h | 44 +++- libreofficekit/source/gtk/lokdocview.cxx |1 sfx2/source/view/viewsh.cxx | 280 --- 4 files changed, 302 insertions(+), 25 deletions(-) New commits: commit 59c2e114f76247158a0da9dcf91d6449d5d61224 Author: Marco Cecchetti AuthorDate: Wed Jun 7 14:03:56 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Aug 14 08:09:53 2023 +0200 lok: a11y: when we are inside a table notify table and current cell info When we get in one or more tables we notify row and column count. When we get out one or more table we notify we are leaving a table. When the fosused cell changes we notify the new row/col index. The paragraph content is notified together with table info, so that client has some opportunity for getting the screen reader to report together content and table info. Change-Id: Ic524259aa1879a70fc3de2467bdee27475352b7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155577 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 42d838b889b6..6d5295222f74 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1798,6 +1798,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_A11Y_FOCUS_CHANGED: case LOK_CALLBACK_A11Y_CARET_CHANGED: case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED: +case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: { const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), type); @@ -1860,6 +1861,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_A11Y_FOCUS_CHANGED: case LOK_CALLBACK_A11Y_CARET_CHANGED: case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED: +case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: { if (removeAll(type)) diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index b7a43acf7d27..e7f31c2a14fe 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -924,14 +924,17 @@ typedef enum LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR = 61, /** - * Accessibility event: a paragraph get focus. + * Accessibility event: a paragraph got focus. * The payload is a json with the following structure. * * { * "content": "" * "position": N + * "start": N1 + * "end": N2 * } - * where N is the position of the text cursor inside the focused paragraph. + * where N is the position of the text cursor inside the focused paragraph, + * and [N1,N2] is the range of the text selection inside the focused paragraph. */ LOK_CALLBACK_A11Y_FOCUS_CHANGED = 62, @@ -946,7 +949,7 @@ typedef enum LOK_CALLBACK_A11Y_CARET_CHANGED = 63, /** - * Accessibility event: text cursor position has changed. + * Accessibility event: text selection has changed. * * { * "start": N1 @@ -965,7 +968,38 @@ typedef enum * Informs that the document password has been successfully changed. * The payload contains the new password and the type. */ -LOK_CALLBACK_DOCUMENT_PASSWORD_RESET = 66 +LOK_CALLBACK_DOCUMENT_PASSWORD_RESET = 66, + +/** + * Accessibility event: a cell got focus. + * The payload is a json with the following structure. + * + * { + * "outCount": + * "inList": [ + * { + * "rowCount": + * "colCount": + * }, + * ... + * { + * "rowCount": + * "colCount": + * } + * ] + * "row": + * "col": + * "rowSpan": + * "colSpan": + * "paragraph": { + * + *} + * } + * where row/column indexes start from 0, inList is the list of tables + * the user got in from the outer to the inner; row/column span default + * value is 1; paragraph is the cell text content. + */ +LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED = 67 } LibreOfficeKitCallbackType; @@ -1128,6 +1162,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_COLOR_PALETTES"; case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET: return "LOK_CALLBACK_DOCUMENT_PASSWORD_RESET"; +case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: +return "LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED"; } assert(!"Unknown
[Libreoffice-commits] core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |1 sfx2/source/view/viewsh.cxx | 558 +--- 2 files changed, 374 insertions(+), 185 deletions(-) New commits: commit 5964796de82a4050081d25ab20151020de0a16cc Author: Marco Cecchetti AuthorDate: Mon May 22 16:32:50 2023 +0200 Commit: Miklos Vajna CommitDate: Fri Aug 11 16:13:36 2023 +0200 lok: a11y: paragraph notifyied on text change, even coming from another view Debug code has been re-organized. Paragraph content is notifyied on any text change. That fixed issues related to fast typing. Paragraph content is also notified on text changed performed in another view. A paragraph is regarded as focused whenever the cursor position is valid. (cherry picked from commit cd726ba43c22e723b243dd6dfd5e3c253e81000b) Conflicts: sfx2/source/view/viewsh.cxx Change-Id: I33a187ced368b74824e55265be921804a492349c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155574 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 932810fd4758..42d838b889b6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7023,7 +7023,6 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, bool nEnabled) { SolarMutexGuard aGuard; -SetLastExceptionMsg(); int nDocType = getDocumentType(pThis); if (nDocType != LOK_DOCTYPE_TEXT) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index cef69764bb14..0d61e2f3f005 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -237,6 +238,246 @@ void SAL_CALL SfxClipboardChangeListener::changedContents( const datatransfer::c delete pInfo; } +namespace +{ + +bool hasState(const accessibility::AccessibleEventObject& aEvent, ::sal_Int64 nState) +{ +bool res = false; +uno::Reference< accessibility::XAccessibleContext > xContext(aEvent.Source, uno::UNO_QUERY); +if (xContext.is()) +{ +::sal_Int64 nStateSet = xContext->getAccessibleStateSet(); +res = (nStateSet & nState) != 0; +} +return res; +} + +bool isFocused(const accessibility::AccessibleEventObject& aEvent) +{ +return hasState(aEvent, accessibility::AccessibleStateType::FOCUSED); +} + +std::string stateSetToString(::sal_Int64 stateSet) +{ +static const std::string states[34] = { +"ACTIVE", "ARMED", "BUSY", "CHECKED", "DEFUNC", +"EDITABLE", "ENABLED", "EXPANDABLE", "EXPANDED", "FOCUSABLE", +"FOCUSED", "HORIZONTAL", "ICONIFIED", "INDETERMINATE", "MANAGES_DESCENDANTS", +"MODAL", "MULTI_LINE", "MULTI_SELECTABLE", "OPAQUE", "PRESSED", +"RESIZABLE", "SELECTABLE", "SELECTED", "SENSITIVE", "SHOWING", +"SINGLE_LINE", "STALE", "TRANSIENT", "VERTICAL", "VISIBLE", +"MOVEABLE", "DEFAULT", "OFFSCREEN", "COLLAPSE" +}; + +if (stateSet == 0) +return "INVALID"; +::sal_Int64 state = 1; +std::string s; +for (int i = 0; i < 34; ++i) +{ +if (stateSet & state) +{ +s += states[i]; +s += "|"; +} +state <<= 1; +} +return s; +} + +void aboutView(std::string msg, const void* pInstance, const SfxViewShell* pViewShell) +{ +if (!pViewShell) +return; + +SAL_INFO("lok.a11y", ">>> " << msg << ": instance: " << pInstance +<< ", VIED ID: " << pViewShell->GetViewShellId().get() << " <<<"); +} + +void aboutEvent(std::string msg, const accessibility::AccessibleEventObject& aEvent) +{ +try +{ +uno::Reference< accessibility::XAccessible > xSource(aEvent.Source, uno::UNO_QUERY); +if (xSource.is()) +{ +uno::Reference< accessibility::XAccessibleContext > xContext = +xSource->getAccessibleContext(); + +if (xContext.is()) +{ +SAL_INFO("lok.a11y", msg << ": event id: " << aEvent.EventId +<< "\n xSource: " << xSource.get() +<< "\n role: " << xContext->getAccessibleRole() +<< "\n name: " << xContext->getAccessibleName() +<< "\n index in parent: " << xContext->getAccessibleIndexInParent() +<< "\n state set: " << stateSetToString(xContext->getAccessibleStateSet()) +<< "\n parent: " << xContext->getAccessibleParent().get() +<< "\n child count: " << xContext->getAccessibleChildCount()); +} +} +uno::Reference< accessibility::XAccessible > xOldValue; +aEvent.OldValue >>=
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit 06ebb2a0c94e89eb638b0aec3d597a83dfafd10c Author: Paris Oplopoios AuthorDate: Wed Jul 26 14:19:35 2023 +0300 Commit: Paris Oplopoios CommitDate: Wed Aug 2 23:39:34 2023 +0200 Compare viewRenderState before setting view on doc_paintPartTile It shouldn't be the case that the view is changed upon painting a tile if the new view has different view options, as it may have a different theme (light/dark) Change-Id: Ie218ab1ca99a588cd04e93deb7b42a18b354b811 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154940 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna (cherry picked from commit 8e90368b55b2a8c23ccae8aa6cd1e157294a67db) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155172 Tested-by: Jenkins Reviewed-by: Paris Oplopoios diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 08609ef442d9..932810fd4758 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4118,6 +4118,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, int nViewId = nOrigViewId; int nLastNonEditorView = -1; int nViewMatchingMode = -1; +SfxViewShell* pCurrentViewShell = SfxViewShell::Current(); + if (!isText) { // Check if just switching to another view is enough, that has @@ -4129,11 +4131,16 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, { bool bIsInEdit = pViewShell->GetDrawView() && pViewShell->GetDrawView()->GetTextEditOutliner(); -if (!bIsInEdit) + +OString sCurrentViewRenderState = pDoc->getViewRenderState(pCurrentViewShell); +OString sNewRenderState = pDoc->getViewRenderState(pViewShell); + +if (sCurrentViewRenderState == sNewRenderState && !bIsInEdit) nLastNonEditorView = pViewShell->GetViewShellId().get(); if (pViewShell->getPart() == nPart && pViewShell->getEditMode() == nMode && +sCurrentViewRenderState == sNewRenderState && !bIsInEdit) { nViewId = pViewShell->GetViewShellId().get(); @@ -4142,7 +4149,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, doc_setView(pThis, nViewId); break; } -else if (pViewShell->getEditMode() == nMode && !bIsInEdit) +else if (pViewShell->getEditMode() == nMode && sCurrentViewRenderState == sNewRenderState && !bIsInEdit) { nViewMatchingMode = pViewShell->GetViewShellId().get(); } @@ -4154,7 +4161,6 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, // if not found view with correct part // - at least avoid rendering active textbox, This is for Impress. // - prefer view with the same mode -SfxViewShell* pCurrentViewShell = SfxViewShell::Current(); if (nViewMatchingMode >= 0 && nViewMatchingMode != nViewId) { nViewId = nViewMatchingMode;
[Libreoffice-commits] core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |3 +++ sfx2/source/control/unoctitm.cxx |3 +++ 2 files changed, 6 insertions(+) New commits: commit c93267f2901805aa6fe7b7ea44d4ba24e47233da Author: Aron Budea AuthorDate: Mon Jul 17 03:37:05 2023 +0200 Commit: Aron Budea CommitDate: Sun Jul 30 14:51:39 2023 +0200 Send Calc pivot table command state changes to LOK Change-Id: I0d9e04b0a0452f66cb9703d9f34fe6cb44d724c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154506 Tested-by: Jenkins CollaboraOffice Reviewed-by: Aron Budea (cherry picked from commit b62f9f484a0fc9215e34153daac4a8bdb9698d4b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155034 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6e8c0db99223..08609ef442d9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3606,6 +3606,9 @@ static void doc_iniUnoCommands () OUString(".uno:GroupSparklines"), OUString(".uno:UngroupSparklines"), OUString(".uno:FormatSparklineMenu"), +OUString(".uno:DataDataPilotRun"), +OUString(".uno:RecalcPivotTable"), +OUString(".uno:DeletePivotTable"), OUString(".uno:Protect"), OUString(".uno:UnsetCellsReadOnly"), OUString(".uno:ContentControlProperties"), diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 20ae855ab6f3..9b75d0a51118 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1097,6 +1097,9 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "GroupSparklines" || aEvent.FeatureURL.Path == "UngroupSparklines" || aEvent.FeatureURL.Path == "FormatSparklineMenu" || + aEvent.FeatureURL.Path == "DataDataPilotRun" || + aEvent.FeatureURL.Path == "RecalcPivotTable" || + aEvent.FeatureURL.Path == "DeletePivotTable" || aEvent.FeatureURL.Path == "NumberFormatDecDecimals" || aEvent.FeatureURL.Path == "NumberFormatIncDecimals" || aEvent.FeatureURL.Path == "Protect" ||
[Libreoffice-commits] core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx | 21 + sfx2/source/doc/sfxbasemodel.cxx | 18 +- 2 files changed, 38 insertions(+), 1 deletion(-) New commits: commit a52ba26e6a3567a1f63aeb8d20c084eb286974b4 Author: Jaume Pujantell AuthorDate: Fri Jul 14 09:11:07 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Jul 28 10:04:50 2023 +0200 Added possibility to set password on save through arguments Change-Id: I579ed7487f87515a21d83912d9c0d12e9edc5eea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154415 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8d830c0cbd00..6e8c0db99223 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3270,6 +3270,23 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha bool bFullSheetPreview = sFullSheetPreview == u"true"; +OUString filePassword; +if ((aIndex = aFilterOptions.indexOf(",Password=")) >= 0) +{ +int bIndex = aFilterOptions.indexOf("PASSWORDEND"); +filePassword = aFilterOptions.subView(aIndex + 10, bIndex - (aIndex + 10)); +aFilterOptions = OUString::Concat(aFilterOptions.subView(0, aIndex)) + + aFilterOptions.subView(bIndex + 11); +} +OUString filePasswordToModify; +if ((aIndex = aFilterOptions.indexOf(",PasswordToModify=")) >= 0) +{ +int bIndex = aFilterOptions.indexOf("PASSWORDTOMODIFYEND"); +filePassword = aFilterOptions.subView(aIndex + 18, bIndex - (aIndex + 18)); +aFilterOptions = OUString::Concat(aFilterOptions.subView(0, aIndex)) + + aFilterOptions.subView(bIndex + 19); +} + // Select a pdf version if specified a valid one. If not specified then ignore. // If invalid then fail. sal_Int32 pdfVer = 0; @@ -3344,6 +3361,10 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha { aSaveMediaDescriptor["FilterData"] <<= aFilterDataMap.getAsConstPropertyValueList(); } +if (!filePassword.isEmpty()) +aSaveMediaDescriptor["Password"] <<= filePassword; +if (!filePasswordToModify.isEmpty()) +aSaveMediaDescriptor["PasswordToModify"] <<= filePasswordToModify; // add interaction handler too if (gImpl) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 2b34d5fd5b46..ac0de0cc89a5 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -131,6 +131,7 @@ #include #include "printhelper.hxx" #include +#include #include #include #include @@ -3046,13 +3047,13 @@ void SfxBaseModel::impl_store( const OUString& sURL throw frame::IllegalArgumentIOException(); bool bSaved = false; +::comphelper::SequenceAsHashMap aArgHash(seqArguments); if ( !bSaveTo && m_pData->m_pObjectShell.is() && !sURL.isEmpty() && !sURL.startsWith( "private:stream" ) && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) ) { // this is the same file URL as the current document location, try to use storeOwn if possible -::comphelper::SequenceAsHashMap aArgHash( seqArguments ); static constexpr OUStringLiteral aFilterString( u"FilterName" ); const OUString aFilterName( aArgHash.getUnpackedValueOrDefault( aFilterString, OUString() ) ); if ( !aFilterName.isEmpty() ) @@ -3122,11 +3123,26 @@ void SfxBaseModel::impl_store( const OUString& sURL SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDoc : SfxEventHintId::SaveAsDoc, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ), m_pData->m_pObjectShell.get() ) ); +const OUString aFilterName(aArgHash.getUnpackedValueOrDefault("FilterName", OUString())); +OUString aPassword, aPasswordToModify; +if (!aArgHash.getUnpackedValueOrDefault("EncryptionData", Sequence()) + .hasElements()) +aPassword = aArgHash.getUnpackedValueOrDefault("Password", OUString()); +if (!aArgHash.getUnpackedValueOrDefault("ModifyPasswordInfo", Sequence()) + .hasElements() +&& aArgHash.getUnpackedValueOrDefault("ModifyPasswordInfo", static_cast(0)) == 0) +aPasswordToModify = aArgHash.getUnpackedValueOrDefault("PasswordToModify", OUString()); +aArgHash.erase("PasswordToModify"); + std::optional pItemSet(SfxGetpApp()->GetPool()); pItemSet->Put(SfxStringItem(SID_FILE_NAME, sURL)); if ( bSaveTo ) pItemSet->Put(SfxBoolItem(SID_SAVETO, true)); +if (!aFilterName.isEmpty() && (!aPassword.isEmpty() ||
[Libreoffice-commits] core.git: desktop/source include/tools tools/source
desktop/source/lib/init.cxx | 57 +++--- include/tools/json_writer.hxx |2 + tools/source/misc/json_writer.cxx | 20 + 3 files changed, 39 insertions(+), 40 deletions(-) New commits: commit 6086d896183a529d4a0b83d4862970c8f320b0aa Author: Szymon Kłos AuthorDate: Thu May 18 15:00:38 2023 +0200 Commit: Szymon Kłos CommitDate: Thu Jul 13 12:17:36 2023 +0200 linking: api: use JsonWriter Change-Id: If5bf1897f1aef8db1672789cbee14b90cb96dc08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151959 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154378 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 99ba738c17d5..8d830c0cbd00 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -410,7 +410,7 @@ std::vector desktop::jsonToPropertyValuesVector(const char return aArguments; } -static bool extractLinks(const uno::Reference< container::XNameAccess >& xLinks, bool subcontent, OUStringBuffer& jsonText) +static void extractLinks(const uno::Reference< container::XNameAccess >& xLinks, bool subcontent, tools::JsonWriter& aJson) { const uno::Sequence< OUString > aNames( xLinks->getElementNames() ); @@ -451,47 +451,27 @@ static bool extractLinks(const uno::Reference< container::XNameAccess >& xLinks, if (subcontent) { -jsonText.append("\""); -jsonText.append(aStrDisplayname); -jsonText.append("\": \""); -jsonText.append(aLink); -jsonText.append("\""); -if (i < nLinks-1) -{ -jsonText.append(", "); -} +aJson.put(aStrDisplayname, aLink); } else { uno::Reference< lang::XServiceInfo > xSI( xTarget, uno::UNO_QUERY ); bIsTarget = xSI->supportsService( aProp_LinkTarget ); -if (i != 0) -{ -if (!bIsTarget) -jsonText.append("}"); -if (i < nLinks) -{ -jsonText.append(", "); -} -} -jsonText.append("\""); -jsonText.append(aStrDisplayname); -jsonText.append("\": "); if (bIsTarget) { -jsonText.append("\""); -jsonText.append(aLink); -jsonText.append("\""); +aJson.put(aStrDisplayname, aLink); continue; } -jsonText.append("{"); -} +else +{ +std::unique_ptr pName(convertOUString(aStrDisplayname)); +auto aNode = aJson.startNode(pName.get()); -uno::Reference< document::XLinkTargetSupplier > xLTS( xTarget, uno::UNO_QUERY ); -if( xLTS.is() ) -{ -extractLinks(xLTS->getLinks(), true, jsonText); +uno::Reference< document::XLinkTargetSupplier > xLTS( xTarget, uno::UNO_QUERY ); +if( xLTS.is() ) +extractLinks(xLTS->getLinks(), true, aJson); +} } } catch(...) @@ -500,7 +480,6 @@ static bool extractLinks(const uno::Reference< container::XNameAccess >& xLinks, } } } -return bIsTarget; } static void unoAnyToJson(tools::JsonWriter& rJson, std::string_view pNodeName, const uno::Any& anyItem) @@ -3145,14 +3124,12 @@ static char* lo_extractRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) if( xLTS.is() ) { -OUStringBuffer jsonText("{ \"Targets\": { "); -bool lastParentheses = extractLinks(xLTS->getLinks(), false, jsonText); -jsonText.append("} }"); -if (!lastParentheses) -jsonText.append(" }"); - -OUString res(jsonText.makeStringAndClear()); -return convertOUString(res); +tools::JsonWriter aJson; +{ +auto aNode = aJson.startNode("Targets"); +extractLinks(xLTS->getLinks(), false, aJson); +} +return strdup(aJson.finishAndGetAsOString().getStr()); } xComp->dispose(); } diff --git
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit dd1d74281a119f076e58598c8e022ee30232e5bf Author: Patrick Luby AuthorDate: Wed Jul 12 13:08:29 2023 -0400 Commit: Patrick Luby CommitDate: Wed Jul 12 22:14:58 2023 +0200 Natively draw to pixel buffer with RBGA pixel format in iOS app Change-Id: I31917f914ed22bebffc52777cb974224d08bed83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154367 Reviewed-by: Michael Meeks Tested-by: Michael Meeks (cherry picked from commit 272de6ec30021fdbda38a1bd84a3036a0afc73d6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154325 Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dbd236858ce8..99ba738c17d5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3964,9 +3964,11 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, #if defined(IOS) double fDPIScale = 1.0; +// Onine uses the LOK_TILEMODE_RGBA by default so flip the normal flags +// to kCGImageAlphaPremultipliedLast | kCGImageByteOrder32Big CGContextRef pCGContext = CGBitmapContextCreate(pBuffer, nCanvasWidth, nCanvasHeight, 8, nCanvasWidth * 4, CGColorSpaceCreateDeviceRGB(), - kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little); + kCGImageAlphaPremultipliedLast | kCGImageByteOrder32Big); CGContextTranslateCTM(pCGContext, 0, nCanvasHeight); CGContextScaleCTM(pCGContext, fDPIScale, -fDPIScale); @@ -4234,7 +4236,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, static int doc_getTileMode(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) { SetLastExceptionMsg(); -#if ENABLE_CAIRO_RGBA +#if ENABLE_CAIRO_RGBA || defined IOS return LOK_TILEMODE_RGBA; #else return LOK_TILEMODE_BGRA; @@ -6613,8 +6615,9 @@ static void doc_paintWindowForView(LibreOfficeKitDocument* pThis, unsigned nLOKW comphelper::LibreOfficeKit::setDPIScale(fDPIScale); #if defined(IOS) - -CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little); +// Onine uses the LOK_TILEMODE_RGBA by default so flip the normal flags +// to kCGImageAlphaNoneSkipLast | kCGImageByteOrder32Big +CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipLast | kCGImageByteOrder32Big); CGContextTranslateCTM(cgc, 0, nHeight); CGContextScaleCTM(cgc, fDPIScale, -fDPIScale);
[Libreoffice-commits] core.git: desktop/source include/unotools lingucomponent/config lingucomponent/source postprocess/CustomTarget_registry.mk unotools/source
desktop/source/lib/init.cxx| 195 +++--- include/unotools/lingucfg.hxx |2 lingucomponent/config/Linguistic-lingucomponent-grammarchecker.xcu | 30 - lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 59 +-- postprocess/CustomTarget_registry.mk |1 unotools/source/config/lingucfg.cxx| 21 - 6 files changed, 186 insertions(+), 122 deletions(-) New commits: commit 94e6049b6467d9bc1e52a1a80c7cf1a5f138e82d Author: Xisco Fauli AuthorDate: Wed Jul 12 07:03:15 2023 +0200 Commit: Xisco Fauli CommitDate: Wed Jul 12 08:57:41 2023 +0200 Revert recent LanguageTool commits Reason for revert: See discussion in https://gerrit.libreoffice.org/c/core/+/154302 - it's causing CppunitTest_sw_layoutwriter2 to fail on Windows. - it's causing CppunitTest_sw_layoutwriter to fail on Linux. - Probably other recent CI failures are also related. - A similar commit was reverted one year ago for similar reasons -> https://gerrit.libreoffice.org/c/core/+/135859 This commit contains the following commits: Revert "lok: remove old hack for LanguageTool locales" This reverts commit 9a5329a266bd74abc4794f1fcbae3db07582dbde. Revert "lok: LanguageTool provides list of languages" This reverts commit 21d0489a5efa970e975ce1a70dfda2fd9e2c186d. Revert "lok: remove duplicated locales for LanguageTool" This reverts commit a0865169ab62508a7b933ed4634defa57b25f7b7. Revert "Load the locales from config file for languagetool" This reverts commit 81b0d9a951c9b15f4f1a76d45d0bd955b4dfc95b. Change-Id: I3dc48097615f510e33e233e868b6b10704d81e67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154342 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4f1b5287130f..dbd236858ce8 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -117,7 +117,6 @@ #include #include #include -#include #include #include #include @@ -228,8 +227,6 @@ using namespace vcl; using namespace desktop; using namespace utl; -using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool; - static LibLibreOffice_Impl *gImpl = nullptr; static bool lok_preinit_2_called = false; static std::weak_ptr< LibreOfficeKitClass > gOfficeClass; @@ -5620,6 +5617,132 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in pDoc->setGraphicSelection(nType, nX, nY); } +static void getDocLanguages(LibreOfficeKitDocument* pThis, uno::Sequence& rSeq) +{ +SfxViewFrame* pViewFrame = SfxViewFrame::Current(); +if (!pViewFrame) +return; + +SfxDispatcher* pDispatcher = pViewFrame->GetBindings().GetDispatcher(); +if (!pDispatcher) +return; + +css::uno::Any aLangStatus; +pDispatcher->QueryState(SID_LANGUAGE_STATUS, aLangStatus); + +OUString sCurrent; +OUString sKeyboard; +OUString sGuessText; +SvtScriptType eScriptType = SvtScriptType::LATIN | SvtScriptType::ASIAN +| SvtScriptType::COMPLEX; + +Sequence aSeqLang; +if (aLangStatus >>= aSeqLang) +{ +if (aSeqLang.getLength() == 4) +{ +sCurrent = aSeqLang[0]; +eScriptType = static_cast(aSeqLang[1].toInt32()); +sKeyboard = aSeqLang[1]; +sGuessText = aSeqLang[2]; +} +} +else +{ +aLangStatus >>= sCurrent; +} + +LanguageType nLangType; +std::set aLangItems; + +if (!sCurrent.isEmpty()) +{ +nLangType = SvtLanguageTable::GetLanguageType(sCurrent); +if (nLangType != LANGUAGE_DONTKNOW) +{ +aLangItems.insert(nLangType); +} +} + +const AllSettings& rAllSettings = Application::GetSettings(); +nLangType = rAllSettings.GetLanguageTag().getLanguageType(); +if (nLangType != LANGUAGE_DONTKNOW && +(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) +{ +aLangItems.insert(nLangType); +} + +nLangType = rAllSettings.GetUILanguageTag().getLanguageType(); +if (nLangType != LANGUAGE_DONTKNOW && +(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) +{ +aLangItems.insert(nLangType); +} + +if (!sKeyboard.isEmpty()) +{ +nLangType = SvtLanguageTable::GetLanguageType(sKeyboard); +if (nLangType != LANGUAGE_DONTKNOW && +(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) +{ +aLangItems.insert(nLangType); +} +} + +if (!sGuessText.isEmpty()) +{ +Reference xLangGuesser; +try +{ +xLangGuesser = linguistic2::LanguageGuessing::create(xContext); +
[Libreoffice-commits] core.git: desktop/source
desktop/source/deployment/misc/dp_platform.cxx |4 1 file changed, 4 insertions(+) New commits: commit 091eec9828c3cba728fb52924ad9a4103175e41f Author: Rene Engelhard AuthorDate: Tue Jul 11 16:56:02 2023 +0200 Commit: René Engelhard CommitDate: Wed Jul 12 00:41:17 2023 +0200 add linux_riscv64 and linux_loongarch64 to dp_platform.cxx forgotten in bc9487f745befde6534fd46058e119256952323d and d3625d968901eb93a9680db8d1165f70de3fd64e Change-Id: I7f33c1db54b8f66e797a29cd1ccf96d19a88cc60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154333 Tested-by: Jenkins Reviewed-by: René Engelhard diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx index ad1b5ea13fed..b2af59f9b926 100644 --- a/desktop/source/deployment/misc/dp_platform.cxx +++ b/desktop/source/deployment/misc/dp_platform.cxx @@ -126,6 +126,10 @@ namespace ret = checkOSandCPU(u"Linux", u"ALPHA"); else if (token == u"linux_aarch64") ret = checkOSandCPU(u"Linux", u"AARCH64"); +else if (token == u"linux_riscv64") +ret = checkOSandCPU(u"Linux", u"RISCV64"); +else if (token == u"linux_loongarch64") +ret = checkOSandCPU(u"Linux", u"LOONGARCH64"); else if (token == u"freebsd_x86") ret = checkOSandCPU(u"FreeBSD", u"x86"); else if (token == u"freebsd_x86_64")
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 142 1 file changed, 2 insertions(+), 140 deletions(-) New commits: commit 9a5329a266bd74abc4794f1fcbae3db07582dbde Author: Szymon Kłos AuthorDate: Fri Feb 10 14:56:06 2023 +0100 Commit: Szymon Kłos CommitDate: Mon Jul 10 11:36:30 2023 +0200 lok: remove old hack for LanguageTool locales Change-Id: I1098c51f03b4cdd4f21a635f7b6aae8e90fd9f9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146779 Reviewed-by: Henry Castro Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153962 Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154162 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 539291218213..4f1b5287130f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5620,132 +5620,6 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in pDoc->setGraphicSelection(nType, nX, nY); } -static void getDocLanguages(LibreOfficeKitDocument* pThis, uno::Sequence& rSeq) -{ -SfxViewFrame* pViewFrame = SfxViewFrame::Current(); -if (!pViewFrame) -return; - -SfxDispatcher* pDispatcher = pViewFrame->GetBindings().GetDispatcher(); -if (!pDispatcher) -return; - -css::uno::Any aLangStatus; -pDispatcher->QueryState(SID_LANGUAGE_STATUS, aLangStatus); - -OUString sCurrent; -OUString sKeyboard; -OUString sGuessText; -SvtScriptType eScriptType = SvtScriptType::LATIN | SvtScriptType::ASIAN -| SvtScriptType::COMPLEX; - -Sequence aSeqLang; -if (aLangStatus >>= aSeqLang) -{ -if (aSeqLang.getLength() == 4) -{ -sCurrent = aSeqLang[0]; -eScriptType = static_cast(aSeqLang[1].toInt32()); -sKeyboard = aSeqLang[1]; -sGuessText = aSeqLang[2]; -} -} -else -{ -aLangStatus >>= sCurrent; -} - -LanguageType nLangType; -std::set aLangItems; - -if (!sCurrent.isEmpty()) -{ -nLangType = SvtLanguageTable::GetLanguageType(sCurrent); -if (nLangType != LANGUAGE_DONTKNOW) -{ -aLangItems.insert(nLangType); -} -} - -const AllSettings& rAllSettings = Application::GetSettings(); -nLangType = rAllSettings.GetLanguageTag().getLanguageType(); -if (nLangType != LANGUAGE_DONTKNOW && -(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) -{ -aLangItems.insert(nLangType); -} - -nLangType = rAllSettings.GetUILanguageTag().getLanguageType(); -if (nLangType != LANGUAGE_DONTKNOW && -(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) -{ -aLangItems.insert(nLangType); -} - -if (!sKeyboard.isEmpty()) -{ -nLangType = SvtLanguageTable::GetLanguageType(sKeyboard); -if (nLangType != LANGUAGE_DONTKNOW && -(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) -{ -aLangItems.insert(nLangType); -} -} - -if (!sGuessText.isEmpty()) -{ -Reference xLangGuesser; -try -{ -xLangGuesser = linguistic2::LanguageGuessing::create(xContext); -} -catch(...) -{ -} - -if (xLangGuesser.is()) -{ -lang::Locale aLocale = xLangGuesser->guessPrimaryLanguage(sGuessText, 0, - sGuessText.getLength()); -LanguageTag aLanguageTag(aLocale); -nLangType = aLanguageTag.getLanguageType(false); -if (nLangType != LANGUAGE_DONTKNOW && -(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) -{ -aLangItems.insert(nLangType); -} -} -} - -LibLODocument_Impl* pDocument = static_cast(pThis); -Reference xDocumentLanguages(pDocument->mxComponent, UNO_QUERY); -if (xDocumentLanguages.is()) -{ -const Sequence aLocales(xDocumentLanguages->getDocumentLanguages( - static_cast(eScriptType), 64)); - -for (const lang::Locale& aLocale : aLocales) -{ -nLangType = SvtLanguageTable::GetLanguageType(aLocale.Language); -if (nLangType != LANGUAGE_DONTKNOW && -(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType))) -{ -aLangItems.insert(nLangType); -} -} -} - -int nLocale = 0; -Sequence aLocales(aLangItems.size()); -auto pLocales = aLocales.getArray(); -for (const LanguageType& itLang : aLangItems) -{ -pLocales[nLocale++] = LanguageTag::convertToLocale(itLang); -} -
[Libreoffice-commits] core.git: desktop/source lingucomponent/source
desktop/source/lib/init.cxx | 63 +++--- lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 15 ++ 2 files changed, 62 insertions(+), 16 deletions(-) New commits: commit 21d0489a5efa970e975ce1a70dfda2fd9e2c186d Author: Szymon Kłos AuthorDate: Wed Feb 8 11:10:58 2023 +0100 Commit: Szymon Kłos CommitDate: Fri Jul 7 19:30:47 2023 +0200 lok: LanguageTool provides list of languages - it sends supported list to the LOK client - disables Spell Checker for locales supported by LanguageTool - duden protocol supports only german - initialize language tool config before usage to fetch correct list of supported languages Change-Id: Id9de8519303774163721def8661fa408da449348 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146665 Reviewed-by: Henry Castro Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153960 Reviewed-by: Andras Timar Tested-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154161 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dbd236858ce8..539291218213 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -117,6 +117,7 @@ #include #include #include +#include #include #include #include @@ -227,6 +228,8 @@ using namespace vcl; using namespace desktop; using namespace utl; +using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool; + static LibLibreOffice_Impl *gImpl = nullptr; static bool lok_preinit_2_called = false; static std::weak_ptr< LibreOfficeKitClass > gOfficeClass; @@ -5760,12 +5763,28 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis) pDoc->resetSelection(); } +static void addLocale(boost::property_tree::ptree& rValues, css::lang::Locale const & rLocale) +{ +boost::property_tree::ptree aChild; +OUString sLanguage; +const LanguageTag aLanguageTag( rLocale ); +sLanguage = SvtLanguageTable::GetLanguageString(aLanguageTag.getLanguageType()); +if (sLanguage.endsWith("}")) +return; + +sLanguage += ";" + aLanguageTag.getBcp47(false); +aChild.put("", sLanguage.toUtf8()); +rValues.push_back(std::make_pair("", aChild)); +} + static char* getLanguages(LibreOfficeKitDocument* pThis, const char* pCommand) { css::uno::Sequence< css::lang::Locale > aLocales; +css::uno::Sequence< css::lang::Locale > aGrammarLocales; if (xContext.is()) { +// SpellChecker css::uno::Reference xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); if (xLangSrv.is()) { @@ -5774,6 +5793,18 @@ static char* getLanguages(LibreOfficeKitDocument* pThis, const char* pCommand) aLocales = xSpell->getLocales(); } +// LanguageTool +if (LanguageToolCfg::IsEnabled::get()) +{ +uno::Reference< linguistic2::XProofreader > xGC( + xContext->getServiceManager()->createInstanceWithContext("org.openoffice.lingu.LanguageToolGrammarChecker", xContext), +uno::UNO_QUERY_THROW ); +uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xGC, uno::UNO_QUERY_THROW ); +aGrammarLocales = xSuppLoc->getLocales(); +} + +// Fallback + /* FIXME: To obtain the document languages the spell checker can be disabled, so a future re-work of the getLanguages function is needed in favor to use getDocLanguages */ @@ -5788,19 +5819,10 @@ static char* getLanguages(LibreOfficeKitDocument* pThis, const char* pCommand) boost::property_tree::ptree aTree; aTree.put("commandName", pCommand); boost::property_tree::ptree aValues; -boost::property_tree::ptree aChild; -OUString sLanguage; -for ( css::lang::Locale const & locale : std::as_const(aLocales) ) -{ -const LanguageTag aLanguageTag( locale ); -sLanguage = SvtLanguageTable::GetLanguageString(aLanguageTag.getLanguageType()); -if (sLanguage.startsWith("{") && sLanguage.endsWith("}")) -continue; - -sLanguage += ";" + aLanguageTag.getBcp47(false); -aChild.put("", sLanguage.toUtf8()); -aValues.push_back(std::make_pair("", aChild)); -} +for ( css::lang::Locale const & rLocale : std::as_const(aLocales) ) +addLocale(aValues, rLocale); +for ( css::lang::Locale const & rLocale : std::as_const(aGrammarLocales) ) +addLocale(aValues, rLocale); aTree.add_child("commandValues", aValues); std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); @@ -7276,6 +7298,8 @@ static void preLoadShortCutAccelerators() batch->commit(); } +void setLanguageToolConfig(); + /// Used only by LibreOfficeKit when used by
[Libreoffice-commits] core.git: desktop/source include/svtools svtools/source
desktop/source/app/app.cxx |8 include/svtools/apearcfg.hxx | 14 -- svtools/source/config/apearcfg.cxx |8 3 files changed, 8 insertions(+), 22 deletions(-) New commits: commit ea0e9c0d4de19ac3f8fdfe91bdb085ad9e2b1757 Author: Noel Grandin AuthorDate: Wed Jul 5 14:22:20 2023 +0200 Commit: Noel Grandin CommitDate: Wed Jul 5 18:55:23 2023 +0200 these enums are unnecessary Change-Id: I29bf28202e11db836764276f773b134356d93e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154057 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c0b30c2ae2fd..e4058bfe8932 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1827,16 +1827,16 @@ void Desktop::OverrideSystemSettings( AllSettings& rSettings ) DragFullOptions nDragFullOptions = hStyleSettings.GetDragFullOptions(); -DragMode nDragMode = static_cast(officecfg::Office::Common::View::Window::Drag::get()); +sal_uInt16 nDragMode = officecfg::Office::Common::View::Window::Drag::get(); switch ( nDragMode ) { -case DragMode::FullWindow: +case 0: //FullWindow: nDragFullOptions |= DragFullOptions::All; break; -case DragMode::Frame: +case 1: // Frame: nDragFullOptions &= ~DragFullOptions::All; break; -case DragMode::SystemDep: +case 2: // SystemDep default: break; } diff --git a/include/svtools/apearcfg.hxx b/include/svtools/apearcfg.hxx index 85a521862ba7..fe2bc61df7de 100644 --- a/include/svtools/apearcfg.hxx +++ b/include/svtools/apearcfg.hxx @@ -21,20 +21,6 @@ #include class Application; -enum class MouseMiddleButtonAction; - -enum class SnapType { -ToButton = 0, -ToMiddle, -NONE -}; - -enum class DragMode { -FullWindow, -Frame, -SystemDep -}; - namespace SvtTabAppearanceCfg { diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index fec538b62a71..4e8a0215043b 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -64,16 +64,16 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) nMouseOptions &= ~ MouseSettingsOptions(MouseSettingsOptions::AutoCenterPos | MouseSettingsOptions::AutoDefBtnPos); -SnapType nSnapMode = static_cast(officecfg::Office::Common::View::Dialog::MousePositioning::get()); +sal_uInt16 nSnapMode = officecfg::Office::Common::View::Dialog::MousePositioning::get(); switch ( nSnapMode ) { -case SnapType::ToButton: +case 0: // ToButton nMouseOptions |= MouseSettingsOptions::AutoDefBtnPos; break; -case SnapType::ToMiddle: +case 1: // ToMiddle nMouseOptions |= MouseSettingsOptions::AutoCenterPos; break; -case SnapType::NONE: +case 2: // NONE default: break; }
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit dbd124519daa507f560fad4619c0b41f24001818 Author: Marco Cecchetti AuthorDate: Tue Jun 13 19:30:05 2023 +0200 Commit: Aron Budea CommitDate: Tue Jul 4 01:16:14 2023 +0200 lok: on switching from tabbed to compact ui 2 buttons were disabled Number Format Increase Decimals, Number Format Decrease Decimals were not enabled on switching ui. Change-Id: Ia81a43ef40168dcbf071d071231b795f9bf8659e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153050 Reviewed-by: Gökay ŞATIR Tested-by: Jenkins CollaboraOffice (cherry picked from commit cd4ad81ca334a3d2bc90bab81502ae5350bac84d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153594 Tested-by: Jenkins Reviewed-by: Aron Budea diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 971e1ecc75e4..bef06bcd4f98 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3486,6 +3486,8 @@ static void doc_iniUnoCommands () OUString(".uno:NumberFormatCurrency"), OUString(".uno:NumberFormatPercent"), OUString(".uno:NumberFormatDecimal"), +OUString(".uno:NumberFormatIncDecimals"), +OUString(".uno:NumberFormatDecDecimals"), OUString(".uno:NumberFormatDate"), OUString(".uno:EditHeaderAndFooter"), OUString(".uno:FrameLineColor"),
[Libreoffice-commits] core.git: desktop/source sfx2/source
desktop/source/lib/init.cxx |3 ++- sfx2/source/control/unoctitm.cxx |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit 1be3ab048d417611055a76d1776a0a69eb6fc6dd Author: Pranam Lashkari AuthorDate: Fri Jun 23 23:31:10 2023 +0700 Commit: Aron Budea CommitDate: Mon Jun 26 22:58:13 2023 +0200 LOK: send state of DataFilterAutoFilter Change-Id: Ib71dcdb6b02f3c1e9e1c552a718cb03e7cd9a4b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153532 Tested-by: Jenkins CollaboraOffice Reviewed-by: Aron Budea (cherry picked from commit 0407d4290617dc717abed3ea48f1abf3cf1d750f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153602 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 102028689451..074a5b81b1ad 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3611,7 +3611,8 @@ static void doc_iniUnoCommands () OUString(".uno:InsertDateContentControl"), OUString(".uno:InsertDropdownContentControl"), OUString(".uno:InsertPlainTextContentControl"), -OUString(".uno:InsertPictureContentControl") +OUString(".uno:InsertPictureContentControl"), +OUString(".uno:DataFilterAutoFilter") }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 4495873a89af..2feec75dac6c 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -935,7 +935,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "SheetRightToLeft" || aEvent.FeatureURL.Path == "SpacePara1" || aEvent.FeatureURL.Path == "SpacePara15" || -aEvent.FeatureURL.Path == "SpacePara2") +aEvent.FeatureURL.Path == "SpacePara2" || +aEvent.FeatureURL.Path == "DataFilterAutoFilter") { bool bTemp = false;
[Libreoffice-commits] core.git: desktop/source include/comphelper include/vcl sd/source sw/source vcl/source
desktop/source/deployment/registry/configuration/dp_configuration.cxx | 36 - include/comphelper/xmlencode.hxx | 62 ++ include/vcl/pdfwriter.hxx |2 sd/source/filter/html/htmlex.cxx |5 sw/source/filter/html/css1atr.cxx |3 sw/source/filter/html/htmlfldw.cxx|3 vcl/source/gdi/pdfwriter_impl.cxx | 39 -- 7 files changed, 75 insertions(+), 75 deletions(-) New commits: commit 71075740aee2e15f574d19d452f0a586e25a6bd0 Author: Szymon Kłos AuthorDate: Fri Apr 7 09:48:41 2023 +0200 Commit: Caolán McNamara CommitDate: Wed Jun 14 13:27:04 2023 +0200 Make encodeForXml accessible for other modules and share similar code Change-Id: I7729a46d40845893f577c273c1ab340f69ebb51b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151230 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151754 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 1f4ba053ec55..622814248670 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -566,39 +567,6 @@ BackendImpl::PackageImpl::isRegistered_( } -OUString encodeForXml( std::u16string_view text ) -{ -// encode conforming xml: -size_t len = text.size(); -OUStringBuffer buf; -for ( size_t pos = 0; pos < len; ++pos ) -{ -sal_Unicode c = text[ pos ]; -switch (c) { -case '<': -buf.append( "" ); -break; -case '>': -buf.append( "" ); -break; -case '&': -buf.append( "" ); -break; -case '\'': -buf.append( "" ); -break; -case '\"': -buf.append( "" ); -break; -default: -buf.append( c ); -break; -} -} -return buf.makeStringAndClear(); -} - - OUString replaceOrigin( OUString const & url, std::u16string_view destFolder, Reference< XCommandEnvironment > const & xCmdEnv, Reference< XComponentContext > const & xContext, bool & out_replaced) { @@ -651,7 +619,7 @@ OUString replaceOrigin( if (origin.isEmpty()) { // encode only once origin = OUStringToOString( -encodeForXml( url.subView( 0, url.lastIndexOf( '/' ) ) ), +comphelper::string::encodeForXml( url.subView( 0, url.lastIndexOf( '/' ) ) ), // xxx todo: encode always for UTF-8? => lookup doc-header? RTL_TEXTENCODING_UTF8 ); } diff --git a/include/comphelper/xmlencode.hxx b/include/comphelper/xmlencode.hxx new file mode 100644 index ..160de5c9cf42 --- /dev/null +++ b/include/comphelper/xmlencode.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include + +namespace comphelper::string +{ +inline OUString encodeForXml(std::u16string_view rStr) +{ +// encode conforming xml: +sal_Int32 len = rStr.length(); +OUStringBuffer buf(len + 16); // it's going to be at least len +for (sal_Int32 pos = 0; pos < len; ++pos) +{ +sal_Unicode c = rStr[pos]; +switch (c) +{ +case '<': +buf.append(""); +break; +case '>': +buf.append(""); +break; +case '&': +buf.append(""); +break; +case '\'': +buf.append(""); +
[Libreoffice-commits] core.git: desktop/source include/svtools sc/source sd/source svtools/source svx/source sw/inc sw/source
desktop/source/app/app.cxx |3 include/svtools/accessibilityoptions.hxx | 12 sc/source/ui/view/output.cxx |2 sd/source/ui/annotations/annotationwindow.cxx |5 sd/source/ui/view/outlview.cxx |3 svtools/source/config/accessibilityoptions.cxx | 264 +++-- svx/source/sdr/contact/objectcontactofpageview.cxx |8 svx/source/svdraw/svdedxv.cxx |3 sw/inc/view.hxx|2 sw/inc/viewsh.hxx |2 sw/source/core/view/viewsh.cxx |8 sw/source/uibase/app/apphdl.cxx|4 sw/source/uibase/config/viewopt.cxx|2 sw/source/uibase/inc/pview.hxx |2 sw/source/uibase/uiview/pview.cxx |6 sw/source/uibase/uiview/view.cxx |2 sw/source/uibase/uiview/view0.cxx |5 17 files changed, 73 insertions(+), 260 deletions(-) New commits: commit 1527fa8435ef415678b2e4a6972f5e378ee5cab1 Author: Noel Grandin AuthorDate: Tue Jun 6 11:20:17 2023 +0200 Commit: Noel Grandin CommitDate: Tue Jun 6 19:32:38 2023 +0200 convert SvtAccessibilityOptions to officecfg where possible Change-Id: Ia530086fe35e64379e55135d392020304b466325 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152649 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 4e3daca9893b..c0b30c2ae2fd 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1528,8 +1528,7 @@ int Desktop::Main() SvtTabAppearanceCfg::SetInitialized(); SvtTabAppearanceCfg::SetApplicationDefaults( this ); -SvtAccessibilityOptions aOptions; -aOptions.SetVCLSettings(); +SvtAccessibilityOptions::SetVCLSettings(); SetSplashScreenProgress(60); if ( !pExecGlobals->bRestartRequested ) diff --git a/include/svtools/accessibilityoptions.hxx b/include/svtools/accessibilityoptions.hxx index 2733cfa0e7ee..cb4596228bee 100644 --- a/include/svtools/accessibilityoptions.hxx +++ b/include/svtools/accessibilityoptions.hxx @@ -23,7 +23,7 @@ class SvtAccessibilityOptions_Impl; -class SVT_DLLPUBLIC SvtAccessibilityOptions final : +class SAL_WARN_UNUSED SVT_DLLPUBLIC SvtAccessibilityOptions final : public utl::detail::Options { private: @@ -35,12 +35,12 @@ public: virtual ~SvtAccessibilityOptions() override; // get & set config entries -boolGetIsAllowAnimatedGraphics() const; -boolGetIsAllowAnimatedText() const; -boolGetIsAutomaticFontColor() const; -boolIsSelectionInReadonly() const; +static bool GetIsAllowAnimatedGraphics(); +static bool GetIsAllowAnimatedText(); +static bool GetIsAutomaticFontColor(); +static bool IsSelectionInReadonly(); -voidSetVCLSettings(); +static void SetVCLSettings(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 8608817b6099..c43a903484cd 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -169,7 +169,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, bPagebreakMode( false ), bSolidBackground( false ), mbUseStyleColor( false ), -mbForceAutoColor( SC_MOD()->GetAccessOptions().GetIsAutomaticFontColor() ), +mbForceAutoColor( SvtAccessibilityOptions::GetIsAutomaticFontColor() ), mbSyntaxMode( false ), aGridColor( COL_BLACK ), mbShowNullValues( true ), diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index bc6304529e43..a5ab1eb0b784 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -550,10 +550,7 @@ void AnnotationWindow::SetColor() maColorLight = AnnotationManagerImpl::GetColorLight( nAuthorIdx ); } -{ -SvtAccessibilityOptions aOptions; -mpOutliner->ForceAutoColor( bHighContrast || aOptions.GetIsAutomaticFontColor() ); -} +mpOutliner->ForceAutoColor( bHighContrast || SvtAccessibilityOptions::GetIsAutomaticFontColor() ); mxPopover->set_background(maColor); mxMenuButton->set_background(maColor); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 4ddc3be230bd..8ce0a5dcb874 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -154,8 +154,7 @@ OutlineView::~OutlineView() EEControlBits nCntrl = mrOutliner.GetControlWord(); mrOutliner.SetUpdateLayout(false); // otherwise there will be drawn on SetControlWord mrOutliner.SetControlWord(nCntrl & ~EEControlBits::NOCOLORS); -SvtAccessibilityOptions