[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit e4b6498eca03a5f055a4fc006a0241d50111cd42 Author: Henry Castro AuthorDate: Fri Nov 4 14:00:26 2022 -0400 Commit: Aron Budea CommitDate: Fri Nov 4 21:53:35 2022 +0100 lok: ensure to initialize the security context if the backend NSS is used, before load the document ensure the NSS is initialized otherwise NSS next functions calls will fail. Signed-off-by: Henry Castro Change-Id: I7ac1d7681995e6c284e2dd4595a33d044af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142213 Tested-by: Jenkins CollaboraOffice Reviewed-by: Aron Budea diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a9bf7ca19635..212fc322ba8f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3240,6 +3240,20 @@ static void doc_iniUnoCommands () return; } +uno::Reference xSEInitializer = xml::crypto::SEInitializer::create(xContext); +if (!xSEInitializer.is()) +{ +SAL_WARN("lok", "iniUnoCommands: XSEInitializer is not available"); +return; +} + +uno::Reference xSecurityContext = +xSEInitializer->createSecurityContext(OUString()); +if (!xSecurityContext.is()) +{ +SAL_WARN("lok", "iniUnoCommands: failed to create security context"); +} + SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame); uno::Reference xParser(util::URLTransformer::create(xContext));
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/app/cmdlineargs.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit 940e59252cf514b525891cf0a895df237a401d02 Author: Stephan Bergmann AuthorDate: Thu Sep 1 17:33:51 2022 +0200 Commit: Andras Timar CommitDate: Wed Sep 7 08:26:22 2022 +0200 Filter out unwanted command URIs Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139225 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 27d29f7df428885865a8e2313283839b20f2a34b) Conflicts: desktop/source/app/cmdlineargs.cxx Change-Id: I0b7e5329af8cc053d14d5c60ec14fe7f364ef993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139182 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit da291e2960b75153f41d440a1b41961567432e8c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139506 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 4d5a3bb78396..93d9e8742ba8 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -28,6 +28,7 @@ #include "cmdlineargs.hxx" #include #include +#include #include #include #include @@ -166,7 +167,14 @@ CommandLineEvent CheckOfficeURI(/* in,out */ OUString& arg, CommandLineEvent cur } if (nURIlen < 0) nURIlen = rest2.getLength(); -arg = rest2.copy(0, nURIlen); +auto const uri = rest2.copy(0, nURIlen); +if (INetURLObject(uri).GetProtocol() == INetProtocol::Macro) { +// Let the "Open" machinery process the full command URI (leading to failure, by intention, +// as the "Open" machinery does not know about those command URI schemes): +curEvt = CommandLineEvent::Open; +} else { +arg = uri; +} return curEvt; }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/svx include/vcl sd/source svx/source
desktop/source/lib/init.cxx | 12 include/svx/svdpntv.hxx |4 include/vcl/ITiledRenderable.hxx |5 + sd/source/ui/inc/unomodel.hxx|4 sd/source/ui/unoidl/unomodel.cxx | 13 +++-- svx/source/svdraw/svdpntv.cxx|4 +++- 6 files changed, 39 insertions(+), 3 deletions(-) New commits: commit a2759b539bcd7bf2e7b88caa2f78c0215230d026 Author: Szymon Kłos AuthorDate: Mon Aug 1 16:06:11 2022 +0200 Commit: Gökay ŞATIR CommitDate: Fri Aug 5 11:16:17 2022 +0200 lok: Dont render active text edit on slide previews - extend ITiledRenderable interface to pass active text edit drawing state to the SdXImpressDocument - when painting tiles - allow text edit only for current part - pass new setting also to SdrPaintView where painting happens Change-Id: Ib4ff226961a76129f4f5ff11c90694cd46a83a6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137676 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tumer Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137840 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index e787252525fb..4abe6f2c5166 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3679,8 +3679,20 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, } } +ITiledRenderable* pDoc = getTiledRenderable(pThis); +if (!pDoc) +{ +SetLastExceptionMsg("Document doesn't support tiled rendering"); +return; +} + +bool bPaintTextEdit = nPart == nOrigPart; +pDoc->setPaintTextEdit( bPaintTextEdit ); + doc_paintTile(pThis, pBuffer, nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); +pDoc->setPaintTextEdit( true ); + if (!isText && nPart != nOrigPart) { doc_setPartImpl(pThis, nOrigPart, false); diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index ad68da20dec2..1f46fc584800 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -193,6 +193,7 @@ protected: boolmbHideChart : 1; boolmbHideDraw : 1; // hide draw objects other than form controls boolmbHideFormControl : 1; // hide form controls only +boolmbPaintTextEdit : 1;// if should paint currently edited text public: // Interface for PagePaintingAllowed flag @@ -506,6 +507,9 @@ public: // Access to Drawinglayer configuration options const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } + +/// @see vcl::ITiledRenderable::setPaintTextEdit(). +void SetPaintTextEdit(bool bPaint) { mbPaintTextEdit = bPaint; } }; #endif // INCLUDED_SVX_SVDPNTV_HXX diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 306623234776..dceb4c9f462d 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -337,6 +337,11 @@ public: { return std::vector(); } + +/** + * Allow / disable drawing current text edit (used in Impress for slide previews) + */ +virtual void setPaintTextEdit(bool) {} }; } // namespace vcl diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 65614db92742..78e0c03b5b53 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -118,6 +118,8 @@ private: OUString maBuildId; +bool mbPaintTextEdit; + void initializeDocument(); sd::DrawViewShell* GetViewShell(); @@ -277,6 +279,8 @@ public: { return mbDisposed; } +/// @see vcl::ITiledRenderable::setPaintTextEdit(). +virtual void setPaintTextEdit(bool bPaint) override { mbPaintTextEdit = bPaint; } // XComponent diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 35caf84d649a..66ffac07e200 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -236,7 +236,8 @@ SdXImpressDocument::SdXImpressDocument(::sd::DrawDocShell* pShell, bool bClipBoa mbDisposed(false), mbImpressDoc( pShell && pShell->GetDoc() && pShell->GetDoc()->GetDocumentType() == DocumentType::Impress ), mbClipBoard( bClipBoard ), -mpPropSet( ImplGetDrawModelPropertySet() ) +mpPropSet( ImplGetDrawModelPropertySet() ), +mbPaintTextEdit( true ) { if( mpDoc ) { @@ -255,7 +256,8 @@ SdXImpressDocument::SdXImpressDocument(SdDrawDocument* pDoc, bool bClipBoard) mbDisposed(false), mbImpressDoc( pDoc && pDoc->GetDocumentType() == DocumentType::Impress ), mbClipBoard( bClipBoard ), -mpPropSet( ImplGetDrawModelPropertySet() ) +mpPropSet( ImplGetDrawModelPropertySet() ), +mbPaintTextEdit( true ) { if( mpDoc ) { @@ -2278,8
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |8 1 file changed, 8 insertions(+) New commits: commit b69ad8f8e7a0aa06cac724ffb93ee58cd7e4cb07 Author: Ashod Nakashian AuthorDate: Sun Jul 24 08:46:38 2022 -0400 Commit: Michael Meeks CommitDate: Thu Jul 28 12:52:44 2022 +0200 lok: initialize the load-language We need to use the load-language for saving the document. This is to avoid using the language of the view that is issuing the save, which causes all sorts of issues (language-translation related). This logic was implemented in 4b7b449bbdc5 but for some reason the load-language wasn't set. This patch sets the load-language. Signed-off-by: Ashod Nakashian Change-Id: I0cd1574d48a99e6ee84bacf75fc0d9ebe26e526b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137391 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137548 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 9d88234bdb21..e787252525fb 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2519,6 +2519,14 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, if (!aLanguage.isEmpty() && isValidLangTag) { +static bool isLoading = true; +if (isLoading) +{ +// Capture the language used to load the document. +SfxLokHelper::setLoadLanguage(aLanguage); +isLoading = false; +} + SfxLokHelper::setDefaultLanguage(aLanguage); // Set the LOK language tag, used for dialog tunneling. comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(aLanguage));
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source sfx2/source
desktop/source/lib/init.cxx |4 +++- sfx2/source/control/unoctitm.cxx |4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit e5a106f8b8de9936fce64d9056a81154c879527e Author: Pranam Lashkari AuthorDate: Mon Jun 6 19:30:35 2022 +0530 Commit: Andras Timar CommitDate: Thu Jun 9 20:48:09 2022 +0200 LOK: send state of Protect, UnsetCellsReadOnly Signed-off-by: Pranam Lashkari Change-Id: I92675ed0033088233fb442138b39a3c8d663c614 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135454 Tested-by: Jenkins CollaboraOffice Reviewed-by: Gökay ŞATIR Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135500 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 35bee204a24e..e99dace9c24e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3203,7 +3203,9 @@ static void doc_iniUnoCommands () OUString(".uno:RunMacro"), OUString(".uno:SpacePara1"), OUString(".uno:SpacePara15"), -OUString(".uno:SpacePara2") +OUString(".uno:SpacePara2"), +OUString(".uno:Protect"), +OUString(".uno:UnsetCellsReadOnly") }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 025dace91506..aeffcc9ab2b4 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1220,7 +1220,9 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "DecrementIndent" || aEvent.FeatureURL.Path == "EditHeaderAndFooter" || aEvent.FeatureURL.Path == "NumberFormatDecDecimals" || - aEvent.FeatureURL.Path == "NumberFormatIncDecimals") + aEvent.FeatureURL.Path == "NumberFormatIncDecimals" || + aEvent.FeatureURL.Path == "Protect" || + aEvent.FeatureURL.Path == "UnsetCellsReadOnly") { aBuffer.append(aEvent.IsEnabled ? std::u16string_view(u"enabled") : std::u16string_view(u"disabled")); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) New commits: commit 1d14333d82a694723ed5c63707d94dddfb67f93d Author: Szymon Kłos AuthorDate: Wed Apr 20 10:33:03 2022 +0200 Commit: Pranam Lashkari CommitDate: Mon Apr 25 11:41:28 2022 +0200 lok: don't render active textbox on all slides when we render tiles for slide previews we use viewid = 0 (first session) so when first session edits any textbox and in other session we request slide previews (eg. after new slide was added) then we received tile with additional text from the first session this is caused by: commit bee4ff508a456a1552aacdf6fc838b8b7cffb9ec desktop lok: avoid unnecessary setPart() in paintPartTile() If possible, switch views, not parts, that way started Impress text edits don't end as a side-effect. but later there was a fix which doesn't trigger closing of texbox editing when switching parts: commit ce7bf351972bbfd64ca99e8d2fb4c5f77591c9e0 impress: don't exit textbox editing when new slide was added so we don't need that in all cases... to fix issue described above: still switch views instead of parts when possible - but avoid views where editing is active Change-Id: Ib6e66a85b9ca68d6e67e3d9cb17060aa42b85220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133202 Tested-by: Jenkins CollaboraOffice Reviewed-by: Pranam Lashkari diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 58236658c08a..35bee204a24e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3628,6 +3628,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, int nOrigPart = 0; const bool isText = (doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT); int nViewId = nOrigViewId; +int nLastNonEditorView = nViewId; if (!isText) { // Check if just switching to another view is enough, that has @@ -3637,9 +3638,15 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while (pViewShell) { -if (pViewShell->getPart() == nPart) +bool bIsInEdit = pViewShell->GetDrawView() && +pViewShell->GetDrawView()->GetTextEditOutliner(); +if (!bIsInEdit) +nLastNonEditorView = pViewShell->GetViewShellId().get(); + +if (pViewShell->getPart() == nPart && !bIsInEdit) { nViewId = pViewShell->GetViewShellId().get(); +nLastNonEditorView = nViewId; doc_setView(pThis, nViewId); break; } @@ -3647,6 +3654,14 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, } } +// if not found view with correct part - at least avoid rendering active textbox +SfxViewShell* pCurrentViewShell = SfxViewShell::Current(); +if (pCurrentViewShell && pCurrentViewShell->GetDrawView() && +pCurrentViewShell->GetDrawView()->GetTextEditOutliner()) +{ +doc_setView(pThis, nLastNonEditorView); +} + nOrigPart = doc_getPart(pThis); if (nPart != nOrigPart) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) New commits: commit 37916a87204560f3bccbf9495b01c5d9295f1f11 Author: Tor Lillqvist AuthorDate: Tue Apr 19 16:40:11 2022 +0300 Commit: Tor Lillqvist CommitDate: Tue Apr 19 16:39:41 2022 +0200 Fix regression in the iOS app (and possibly the Android and GTK apps) The problem was caused by my remote font downloading changes. We need to be more careful in lo_initialize() and libreofficekit_hook_2() to distinguish whether the code is called from "normal" Online (with "pre-initialisation" through lok_preinit_2()) or otherwise, for instance the iOS app, where not pre-initialisation is done. Sadly, this fix makes state handling in init.c even more complex with one more static Boolean flag. Change-Id: I2a8fa96740eb79725aa162cf7adc86d49a8ba603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133175 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 392441079820..58236658c08a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -198,6 +198,7 @@ using namespace desktop; using namespace utl; static LibLibreOffice_Impl *gImpl = nullptr; +static bool lok_preinit_2_called = false; static std::weak_ptr< LibreOfficeKitClass > gOfficeClass; static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass; @@ -6537,8 +6538,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char if (pThis == nullptr) { eStage = PRE_INIT; -SAL_INFO("lok", "Create libreoffice object"); -gImpl = new LibLibreOffice_Impl(); +if (lok_preinit_2_called) +{ +SAL_INFO("lok", "Create libreoffice object"); +gImpl = new LibLibreOffice_Impl(); +} } else if (bPreInited) eStage = SECOND_INIT; @@ -6828,10 +6832,16 @@ LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user { static bool alreadyCalled = false; -if (!alreadyCalled) +if ((!lok_preinit_2_called && !gImpl) || (lok_preinit_2_called && !alreadyCalled)) { alreadyCalled = true; +if (!lok_preinit_2_called) +{ +SAL_INFO("lok", "Create libreoffice object"); +gImpl = new LibLibreOffice_Impl(); +} + if (!lo_initialize(gImpl, install_path, user_profile_url)) { lo_destroy(gImpl); @@ -6855,6 +6865,7 @@ int lok_preinit(const char* install_path, const char* user_profile_url) SAL_JNI_EXPORT int lok_preinit_2(const char* install_path, const char* user_profile_url, LibLibreOffice_Impl** kit) { +lok_preinit_2_called = true; int result = lo_initialize(nullptr, install_path, user_profile_url); if (kit != nullptr) *kit = gImpl;
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 126e1d15fd8764fe95c1df5de28a6149c0b3d380 Author: Tor Lillqvist AuthorDate: Wed Apr 13 16:50:17 2022 +0300 Commit: Tor Lillqvist CommitDate: Wed Apr 13 21:57:52 2022 +0200 Follow-up fix to Collabora Online "addfont" handling: avoid assertion failure Change-Id: Ib75954a39d515088dbd432d0aa0ca5893194ecc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132969 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8f991c37f818..392441079820 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4164,9 +4164,9 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c else if (strcmp(pOption, "addfont") == 0) { OutputDevice *pDevice = Application::GetDefaultDevice(); -OutputDevice::ImplClearAllFontData(true); +OutputDevice::ImplClearAllFontData(false); pDevice->AddTempDevFont(OUString::fromUtf8(OString(pValue)), ""); -OutputDevice::ImplRefreshAllFontData(true); +OutputDevice::ImplRefreshAllFontData(false); } }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/LibreOfficeKit include/vcl vcl/unx
desktop/source/lib/init.cxx| 27 ++--- include/LibreOfficeKit/LibreOfficeKit.hxx |4 +++ include/LibreOfficeKit/LibreOfficeKitInit.h|2 + include/vcl/outdev.hxx |4 +-- vcl/unx/generic/glyphs/freetype_glyphcache.cxx |7 ++ 5 files changed, 39 insertions(+), 5 deletions(-) New commits: commit cef57d2bfa19d249e1c1721f32640f955a137955 Author: Tor Lillqvist AuthorDate: Wed Mar 9 11:33:16 2022 +0200 Commit: Tor Lillqvist CommitDate: Wed Apr 13 12:54:33 2022 +0200 Handle "addfont" from Collabora Online We use the AddTempDevFont() API to add a new font. Sadly there is no corresponding way to remove such a temporarily added font. Change-Id: I6fe61919daa5af29e964cec1caf7293aefa8ea4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131250 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3e4265969053..8f991c37f818 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4161,6 +4161,13 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c else sal_detail_set_log_selector(pCurrentSalLogOverride); } +else if (strcmp(pOption, "addfont") == 0) +{ +OutputDevice *pDevice = Application::GetDefaultDevice(); +OutputDevice::ImplClearAllFontData(true); +pDevice->AddTempDevFont(OUString::fromUtf8(OString(pValue)), ""); +OutputDevice::ImplRefreshAllFontData(true); +} } static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished) @@ -6528,7 +6535,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char // What stage are we at ? if (pThis == nullptr) +{ eStage = PRE_INIT; +SAL_INFO("lok", "Create libreoffice object"); +gImpl = new LibLibreOffice_Impl(); +} else if (bPreInited) eStage = SECOND_INIT; else @@ -6815,11 +6826,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char SAL_JNI_EXPORT LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_url) { -if (!gImpl) +static bool alreadyCalled = false; + +if (!alreadyCalled) { -SAL_INFO("lok", "Create libreoffice object"); +alreadyCalled = true; -gImpl = new LibLibreOffice_Impl(); if (!lo_initialize(gImpl, install_path, user_profile_url)) { lo_destroy(gImpl); @@ -6840,6 +6852,15 @@ int lok_preinit(const char* install_path, const char* user_profile_url) return lo_initialize(nullptr, install_path, user_profile_url); } +SAL_JNI_EXPORT +int lok_preinit_2(const char* install_path, const char* user_profile_url, LibLibreOffice_Impl** kit) +{ +int result = lo_initialize(nullptr, install_path, user_profile_url); +if (kit != nullptr) +*kit = gImpl; +return result; +} + static void lo_destroy(LibreOfficeKit* pThis) { SolarMutexClearableGuard aGuard; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 2a4a8fd72661..507d1c5202b5 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -1037,6 +1037,10 @@ public: * environment variable SAL_LOG is again used as by default. You * can switch back and forth as you like. * + * "addfont": "" + * + * Adds the font at the URL given. + * * @param pOption the option name * @param pValue its value */ diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h index 8a48bd8392be..b1bfd2b54d7f 100644 --- a/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/include/LibreOfficeKit/LibreOfficeKitInit.h @@ -249,6 +249,8 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char *install_path, const char typedef int (LokHookPreInit) ( const char *install_path, const char *user_profile_url ); +typedef int (LokHookPreInit2) ( const char *install_path, const char *user_profile_url, LibreOfficeKit** kit); + #if defined(IOS) || defined(ANDROID) LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_path); #endif diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index ac5fa932a5b0..06f902388a8b 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1286,10 +1286,10 @@ public: //drop font data for all outputdevices. //If bNewFontLists is true then empty lists of system fonts -SAL_DLLPRIVATE static void ImplClearAllFontData( bool bNewFontLists ); +static void ImplClearAllFontData( bool bNewFontLists ); //fetch font data for all outputdevices //If
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source filter/source
desktop/source/lib/init.cxx|9 - filter/source/storagefilterdetect/filterdetect.cxx |7 +++ 2 files changed, 15 insertions(+), 1 deletion(-) New commits: commit 8461a6428c8e0e4e21cd8d340a389e34b64b68de Author: Mert Tumer AuthorDate: Wed Apr 6 16:59:53 2022 +0300 Commit: Gökay ŞATIR CommitDate: Wed Apr 6 18:36:08 2022 +0200 lok: load template documents as regular documents otherwise lok cannot save them directly because libreoffice will try to open a save-as dialog For odg, change the draw8_template type draw8 Signed-off-by: Mert Tumer Change-Id: I34b0ed03adcac89eaa926f8ae6c57e6f622a90f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132633 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index fdf93283101f..3e4265969053 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2540,7 +2540,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, Application::SetDialogCancelMode(DialogCancelMode::LOKSilent); } -uno::Sequence aFilterOptions(3); +uno::Sequence aFilterOptions(4); aFilterOptions[0] = css::beans::PropertyValue( "FilterOptions", 0, uno::makeAny(aOptions), @@ -2587,6 +2587,13 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, aFilterOptions[3].Value <<= nUpdateDoc; */ +// set this explicitly false to be able to load template files +// as regular files, otherwise we cannot save them; it will try +// to bring saveas dialog which cannot work with LOK case +aFilterOptions[3].Name = "AsTemplate"; +aFilterOptions[3].Value <<= false; + + const int nThisDocumentId = nDocumentIdCounter++; SfxViewShell::SetCurrentDocId(ViewShellDocId(nThisDocumentId)); uno::Reference xComponent = xComponentLoader->loadComponentFromURL( diff --git a/filter/source/storagefilterdetect/filterdetect.cxx b/filter/source/storagefilterdetect/filterdetect.cxx index f2eba546a4d3..64ee68175473 100644 --- a/filter/source/storagefilterdetect/filterdetect.cxx +++ b/filter/source/storagefilterdetect/filterdetect.cxx @@ -32,6 +32,8 @@ #include #include +#include + using namespace ::com::sun::star; using utl::MediaDescriptor; @@ -102,6 +104,11 @@ OUString SAL_CALL StorageFilterDetect::detect(uno::SequencegetPropertyValue( "MediaType" ) >>= aMediaType; aTypeName = getInternalFromMediaType( aMediaType ); +if (comphelper::LibreOfficeKit::isActive() && aTypeName == "draw8_template") +{ +// save it as draw8 instead of template format +aTypeName = "draw8"; +} } catch( const lang::WrappedTargetException& aWrap )
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source sfx2/source
desktop/source/lib/init.cxx |1 + sfx2/source/control/unoctitm.cxx |1 + 2 files changed, 2 insertions(+) New commits: commit c97de4c92e21e9708e0f3b9f76cb1b71a5648b35 Author: Szymon Kłos AuthorDate: Tue Apr 5 19:07:26 2022 +0200 Commit: Szymon Kłos CommitDate: Wed Apr 6 08:39:52 2022 +0200 lok: send status update for .uno:SplitCell Change-Id: Ic972d3ff3334f4c3a507868a95ac955c9ffbc614 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132585 Reviewed-by: Mert Tumer Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b3b506043ba6..fdf93283101f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3146,6 +3146,7 @@ static void doc_iniUnoCommands () OUString(".uno:InsertCaptionDialog"), OUString(".uno:FormatGroup"), OUString(".uno:SplitTable"), +OUString(".uno:SplitCell"), OUString(".uno:MergeCells"), OUString(".uno:DeleteNote"), OUString(".uno:AcceptChanges"), diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 2b55f8d202be..025dace91506 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1168,6 +1168,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "InsertCaptionDialog" || aEvent.FeatureURL.Path == "MergeCells" || aEvent.FeatureURL.Path == "SplitTable" || + aEvent.FeatureURL.Path == "SplitCell" || aEvent.FeatureURL.Path == "DeleteNote" || aEvent.FeatureURL.Path == "AcceptChanges" || aEvent.FeatureURL.Path == "SetDefault" ||
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source sfx2/source
desktop/source/lib/init.cxx |1 + sfx2/source/control/unoctitm.cxx |1 + 2 files changed, 2 insertions(+) New commits: commit 0090e414341f7ca9c70a2191a53d5b8fc855f4c8 Author: Aron Budea AuthorDate: Thu Mar 10 06:30:23 2022 +0100 Commit: Andras Timar CommitDate: Mon Mar 14 14:10:19 2022 +0100 Send Calc Insert Headers and Footers state change to LOK Change-Id: Id51b4cf1eb962f22ee1e381873f4670789675525 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131293 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ca65ec4ae2ca..b3b506043ba6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3089,6 +3089,7 @@ static void doc_iniUnoCommands () OUString(".uno:NumberFormatPercent"), OUString(".uno:NumberFormatDecimal"), OUString(".uno:NumberFormatDate"), +OUString(".uno:EditHeaderAndFooter"), OUString(".uno:FrameLineColor"), OUString(".uno:SortAscending"), OUString(".uno:SortDescending"), diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 7bc371cc78d3..2b55f8d202be 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1217,6 +1217,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "ResetAttributes" || aEvent.FeatureURL.Path == "IncrementIndent" || aEvent.FeatureURL.Path == "DecrementIndent" || + aEvent.FeatureURL.Path == "EditHeaderAndFooter" || aEvent.FeatureURL.Path == "NumberFormatDecDecimals" || aEvent.FeatureURL.Path == "NumberFormatIncDecimals") {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source filter/source sfx2/source sw/inc sw/source
desktop/source/lib/init.cxx |1 + filter/source/svg/svgexport.cxx |6 +- filter/source/svg/svgfilter.cxx | 10 ++ filter/source/svg/svgfilter.hxx |1 + filter/source/svg/svgwriter.cxx | 22 +- filter/source/svg/svgwriter.hxx |2 ++ sfx2/source/doc/objstor.cxx | 15 +++ sw/inc/cmdid.h |1 + sw/inc/unoprnms.hxx |1 + sw/source/core/unocore/unoframe.cxx | 16 +++- sw/source/core/unocore/unomap1.cxx |1 + 11 files changed, 73 insertions(+), 3 deletions(-) New commits: commit d01b1b174f4e18b8bef23f7409d4e9cf4f07d232 Author: Szymon Kłos AuthorDate: Mon Jan 31 17:15:21 2022 +0100 Commit: Szymon Kłos CommitDate: Thu Feb 3 10:06:16 2022 +0100 lok: render image preview with lower resolution renderShapeSelection callback is used to render image previews which are later used during eg. rotation. Do not render preview with original size which slows down app a lot. Use 1280x720 max. Change-Id: Ia8365a67d87cea869ef74cb70ce4830439a523b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129376 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 920041060d88..4693e79ec3f6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3969,6 +3969,7 @@ static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu } aMediaDescriptor["SelectionOnly"] <<= true; aMediaDescriptor["OutputStream"] <<= xOut; +aMediaDescriptor["IsPreview"] <<= true; // will down-scale graphics xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList()); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index fc8de3b18f68..d0eb6b9c6a8c 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -802,7 +802,9 @@ bool SVGFilter::implExportWriterTextGraphic( const Reference< view::XSelectionSu const Graphic aOriginalGraphic(xOriginalGraphic); uno::Reference xTransformedGraphic; -xPropertySet->getPropertyValue("TransformedGraphic") >>= xTransformedGraphic; +xPropertySet->getPropertyValue( +mbIsPreview ? OUString("GraphicPreview") : OUString("TransformedGraphic")) +>>= xTransformedGraphic; if (!xTransformedGraphic.is()) return false; @@ -978,6 +980,8 @@ bool SVGFilter::implExportDocument() mpSVGWriter->SetEmbeddedBitmapRefs( ); implExportTiledBackground(); } +if( mbIsPreview ) +mpSVGWriter->SetPreviewMode(); // #i124608# export a given object selection, so no MasterPage export at all if (!mbExportShapeSelection) diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 8025550b5837..67ff2dd80680 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -82,6 +82,7 @@ SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) : mbExportShapeSelection(false), maFilterData(), mxDefaultPage(), +mbIsPreview(false), mbWriterFilter(false), mbCalcFilter(false), mbImpressFilter(false), @@ -111,6 +112,15 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto if(mxSrcDoc.is()) { +for (const PropertyValue& rProp : rDescriptor) +{ +if (rProp.Name == "IsPreview") +{ +rProp.Value >>= mbIsPreview; +break; +} +} + for (const PropertyValue& rProp : rDescriptor) { if (rProp.Name == "FilterName") diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index aab158971e0b..975eb4ae2d02 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -209,6 +209,7 @@ private: Sequence< PropertyValue > maFilterData; Reference< css::drawing::XDrawPage > mxDefaultPage; std::vector< Reference< css::drawing::XDrawPage > > mSelectedPages; +boolmbIsPreview; boolmbWriterFilter; boolmbCalcFilter; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index f5c96878d4f4..9677c9e092fd 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2949,7 +2949,27 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, } } -if( !(bCached || GraphicConverter::Export( aOStm, rBmpEx, ConvertDataFormat::PNG ) == ERRCODE_NONE) ) +const BitmapEx* pBitmap = +std::unique_ptr pNewBitmap; + +// for
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 08bb96ca243afac1c7f031dd4146aba021b5fa28 Author: Michael Meeks AuthorDate: Thu Jan 20 15:03:00 2022 + Commit: Michael Meeks CommitDate: Sat Jan 22 22:22:24 2022 +0100 lok: avoid reundant progress bar messages. Change-Id: I9e04f428dbfafd98d1b08a549bb2758b9cc60eff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128688 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ea15a2702649..9ae83863d341 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1496,6 +1496,7 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL"); m_states.emplace(LOK_CALLBACK_TAB_STOP_LIST, "NIL"); m_states.emplace(LOK_CALLBACK_RULER_UPDATE, "NIL"); +m_states.emplace(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE, "NIL"); } CallbackFlushHandler::~CallbackFlushHandler()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 1b826cf5cdc6aa145d62a1b0e6567a91b4b1acb9 Author: Michael Meeks AuthorDate: Fri Jan 14 21:17:14 2022 + Commit: Jan Holesovsky CommitDate: Wed Jan 19 15:22:40 2022 +0100 lok: avoid duplicate notification of tab-stop and ruler changes. We get far too many of these, one per key-stroke sometimes. Change-Id: Ifecffe0a82c6eef6809e3a49883bb3f17cb4d170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128571 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dc3ff66ebd5c..ea15a2702649 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1494,6 +1494,8 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL"); m_states.emplace(LOK_CALLBACK_SET_PART, "NIL"); m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL"); +m_states.emplace(LOK_CALLBACK_TAB_STOP_LIST, "NIL"); +m_states.emplace(LOK_CALLBACK_RULER_UPDATE, "NIL"); } CallbackFlushHandler::~CallbackFlushHandler()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 47 1 file changed, 47 insertions(+) New commits: commit 5cf9509a118e2daf9bf474bee8747d5d217f4f09 Author: Noel Grandin AuthorDate: Mon Jan 10 15:27:48 2022 +0200 Commit: Noel Grandin CommitDate: Sat Jan 15 10:48:53 2022 +0100 preload configmgr data for COOL touch all the config data we need during LOK pre-init. This means that most of the keys we need should become cached by ConfigurationWrapper in comphelper. Which means that the child processes we fork should be able to use the shared pages and not allocate their own. Change-Id: Iea8b1c4beaba67b6310b20cc161061ccf9a0db89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128247 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 8de8abc5d26bfd0b3d7006d33a2231001ed77161) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128241 Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 545e7182068e..dc3ff66ebd5c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -177,6 +177,23 @@ #include "lokclipboard.hxx" #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace css; using namespace vcl; @@ -6465,6 +6482,36 @@ static void preloadData() OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); } +std::cerr << "Preload config\n"; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif +static SvtOptionsDialogOptions aDialogOptions; +static SvtCTLOptions aSvtCTLOptions; +static SvtAccessibilityOptions aSvtAccessibilityOptions; +static svtools::ColorConfig aColorConfig; +static SvtMiscOptions aSvtMiscOptions; +static SvtSlideSorterBarOptions aSvtSlideSorterBarOptions; +static SvtCommandOptions aSvtCommandOptions; +static SvtCompatibilityOptions aSvtCompatibilityOptions; +static SvtFilterOptions aSvtFilterOptions; +static SvtLinguConfig aSvtLinguConfig; +static SvtModuleOptions aSvtModuleOptions; +static SvtPathOptions aSvtPathOptions; +static SvtSearchOptions aSvtSearchOptions; +static SvtSysLocaleOptions aSvtSysLocaleOptions; +static SvtUserOptions aSvtUserOptions; +//static SvtViewOptions aSvtViewOptions; +static MouseSettings aMouseSettings; +static StyleSettings aStyleSettings; +static MiscSettings aMiscSettings; +static HelpSettings aHelpSettings; +static AllSettings aAllSettings; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + // Set user profile's path back to the original one rtl::Bootstrap::set("UserInstallation", sUserPath); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source sfx2/source
desktop/source/lib/init.cxx |7 ++- sfx2/source/view/viewsh.cxx |1 + 2 files changed, 7 insertions(+), 1 deletion(-) New commits: commit 09b30a80a3b2a58d981b712f8bd184410c222535 Author: Mert Tumer AuthorDate: Mon Jan 10 13:23:03 2022 +0300 Commit: Mert Tumer CommitDate: Mon Jan 10 13:13:40 2022 +0100 lok: Fix freshly added comments are not displayed Signed-off-by: Mert Tumer Change-Id: Ice772eff8b9f8ae8c23ec1e66675e33a80492028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128217 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1ef25f2c5dc6..545e7182068e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1585,13 +1585,18 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) SAL_INFO("lok", "Queue: [" << type << "]: [" << aCallbackData.getPayload() << "] on " << m_queue1.size() << " entries."); bool bIsChartActive = false; +bool bIsComment = false; if (type == LOK_CALLBACK_GRAPHIC_SELECTION) { LokChartHelper aChartHelper(SfxViewShell::Current()); bIsChartActive = aChartHelper.GetWindow() != nullptr; } +else if (type == LOK_CALLBACK_COMMENT) +{ +bIsComment = true; +} -if (callbacksDisabled() && !bIsChartActive) +if (callbacksDisabled() && !bIsChartActive && !bIsComment) { // We drop notifications when this is set, except for important ones. // When we issue a complex command (such as .uno:InsertAnnotation) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d1c0e48ba18e..292f6f4fe096 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1455,6 +1455,7 @@ static bool ignoreLibreOfficeKitViewCallback(int nType, const SfxViewShell_Impl* { case LOK_CALLBACK_FORM_FIELD_BUTTON: case LOK_CALLBACK_TEXT_SELECTION: +case LOK_CALLBACK_COMMENT: break; default: // Reject e.g. invalidate during paint.
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 23 +++ 1 file changed, 23 insertions(+) New commits: commit 03f177d22873069e8e2e520c98f05ebfcc1b063c Author: Tomaž Vajngerl AuthorDate: Wed Dec 8 20:42:42 2021 +0100 Commit: Andras Timar CommitDate: Mon Dec 13 12:58:03 2021 +0100 lokit: add env. var to set the certificate database dir This adds to LOKit a way to set the certificate database dir with a env. var. - LO_CERTIFICATE_DATABASE_PATH, which is used for signing and encrypting of documents. Change-Id: Ieb7725d41893212d962c8b9e32f9607d0ba10397 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126553 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3bd212195f4d..bf4bd7883f4f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -175,6 +175,7 @@ #include "lokinteractionhandler.hxx" #include "lokclipboard.hxx" +#include #include using namespace css; @@ -6448,6 +6449,26 @@ static void activateNotebookbar(const OUString& rApp) } } +void setCertificateDir() +{ +const char* pEnvVarString = ::getenv("LO_CERTIFICATE_DATABASE_PATH"); +if (pEnvVarString) +{ +OUString aCertificateDatabasePath = OStringToOUString(pEnvVarString, RTL_TEXTENCODING_UTF8); +try +{ +std::shared_ptr pBatch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Security::Scripting::CertDir::set(aCertificateDatabasePath, pBatch); + officecfg::Office::Common::Security::Scripting::ManualCertDir::set(aCertificateDatabasePath, pBatch); +pBatch->commit(); +} +catch (uno::Exception const& rException) +{ +SAL_WARN("lok", "Failed to set the NSS certificate database directory: " << rException.Message); +} +} +} + } static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl) @@ -6757,6 +6778,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char } #endif +setCertificateDir(); + if (bNotebookbar) { activateNotebookbar("Writer");
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 30 ++ 1 file changed, 30 insertions(+) New commits: commit 962f906395d4b73291df25558dd259af2cb549fc Author: Gabriel Masei AuthorDate: Mon Nov 15 21:05:17 2021 +0200 Commit: Jan Holesovsky CommitDate: Wed Dec 8 11:07:34 2021 +0100 lok: add pdf version option for export Change-Id: I02c1edecd291309bf028e6e5a0f04a578ac1b639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125255 Tested-by: Jenkins Reviewed-by: Jan Holesovsky Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125806 Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index feed3452dcf1..16ffe6f097e7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2938,6 +2938,33 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha bool bFullSheetPreview = sFullSheetPreview == "true"; +// Select a pdf version if specified a valid one. +// If not specified then ignore. If invalid then fail. +sal_Int32 pdfVer = 0; +if ((aIndex = aFilterOptions.indexOf(",PDFVer=")) >= 0) +{ +int bIndex = aFilterOptions.indexOf("PDFVEREND"); +OUString sPdfVer; +sPdfVer = aFilterOptions.subView(aIndex+8, bIndex-(aIndex+8)); +aFilterOptions = OUString::Concat(aFilterOptions.subView(0, aIndex)) + aFilterOptions.subView(bIndex+9); + +if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-1b")) +pdfVer = 1; +else if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-2b")) +pdfVer = 2; +else if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-3b")) +pdfVer = 3; +else if (sPdfVer.equalsIgnoreAsciiCase("PDF-1.5")) +pdfVer = 15; +else if (sPdfVer.equalsIgnoreAsciiCase("PDF-1.6")) +pdfVer = 16; +else +{ +SetLastExceptionMsg("wrong PDF version"); +return false; +} +} + // 'TakeOwnership' == this is a 'real' SaveAs (that is, the document // gets a new name). When this is not provided, the meaning of // saveAs() is more like save-a-copy, which allows saving to any @@ -2974,6 +3001,9 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha if (bFullSheetPreview) aFilterDataMap["SinglePageSheets"] <<= true; +if (pdfVer) +aFilterDataMap["SelectPdfVersion"] <<= pdfVer; + if (!aFilterDataMap.empty()) { aSaveMediaDescriptor["FilterData"] <<= aFilterDataMap.getAsConstPropertyValueList();
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/vcl sc/source sfx2/source vcl/inc vcl/jsdialog
desktop/source/lib/init.cxx | 14 +++-- include/vcl/jsdialog/executor.hxx|5 ++- sc/source/ui/cctrl/checklistmenu.cxx |2 - sfx2/source/sidebar/DeckLayouter.cxx |5 ++- vcl/inc/jsdialog/jsdialogbuilder.hxx | 19 +++-- vcl/jsdialog/executor.cxx|4 +- vcl/jsdialog/jsdialogbuilder.cxx | 51 --- 7 files changed, 62 insertions(+), 38 deletions(-) New commits: commit f43f08133f6004043ab4a0fb0fd0f51cd8b871fb Author: Szymon Kłos AuthorDate: Mon Nov 15 09:13:35 2021 +0100 Commit: Szymon Kłos CommitDate: Tue Nov 16 19:55:04 2021 +0100 jsdialog: use string identifiers Thanks to that it is easier to debug and find widgets in maps. Sidebar and notebookbar are now in different map entries. This fixes the issue when destroying notebookbar deleted sidebar's widgets. After this patch sidebar works correctly when using notebookbar mode in lok. Change-Id: Ie9dcb82675129bdb567b766e29779744f500cb48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125216 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index e71e62929903..feed3452dcf1 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4101,15 +4101,23 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA OString sControlId = OUStringToOString(aMap["id"], RTL_TEXTENCODING_ASCII_US); // dialogs send own id but notebookbar and sidebar controls are remembered by SfxViewShell id -bool bFoundWeldedControl = jsdialog::ExecuteAction(nWindowId, sControlId, aMap); +bool bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nWindowId), sControlId, aMap); if (!bFoundWeldedControl) -bFoundWeldedControl = jsdialog::ExecuteAction(nCurrentShellId, sControlId, aMap); +bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "sidebar", sControlId, aMap); +if (!bFoundWeldedControl) +bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "notebookbar", sControlId, aMap); +if (!bFoundWeldedControl && !SfxViewShell::Current()) +{ +// this is needed for dialogs shown before document is loaded: MacroWarning dialog, etc... +// these dialogs are created with WindowId "0" +bFoundWeldedControl = jsdialog::ExecuteAction("0", sControlId, aMap); +} if (bFoundWeldedControl) return; // force resend - used in mobile-wizard -jsdialog::SendFullUpdate(nCurrentShellId, "Panel"); +jsdialog::SendFullUpdate(std::to_string(nCurrentShellId) + "sidebar", "Panel"); } catch(...) {} } diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index 46455e985735..39c8c77f3a24 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -60,8 +60,9 @@ public: namespace jsdialog { -VCL_DLLPUBLIC bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rData); -VCL_DLLPUBLIC void SendFullUpdate(sal_uInt64 nWindowId, const OString& rWidget); +VCL_DLLPUBLIC bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, + StringMap& rData); +VCL_DLLPUBLIC void SendFullUpdate(const std::string& nWindowId, const OString& rWidget); VCL_DLLPUBLIC StringMap jsonToStringMap(const char* pJSON); }; diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 54c87adad219..efd8688dc649 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -300,7 +300,7 @@ void ScCheckListMenuControl::launchSubMenu(bool bSetMenuPos) rSubMenuControl.GrabFocus(); if (comphelper::LibreOfficeKit::isActive()) -jsdialog::SendFullUpdate(pSubMenu->GetLOKWindowId(), "toggle_all"); +jsdialog::SendFullUpdate(std::to_string(pSubMenu->GetLOKWindowId()), "toggle_all"); } IMPL_LINK_NOARG(ScCheckListMenuControl, PostPopdownHdl, void*, void) diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx index 9a758f1f7215..b1ae79129d13 100644 --- a/sfx2/source/sidebar/DeckLayouter.cxx +++ b/sfx2/source/sidebar/DeckLayouter.cxx @@ -312,7 +312,10 @@ sal_Int32 PlacePanels ( } if (comphelper::LibreOfficeKit::isActive()) - jsdialog::SendFullUpdate(reinterpret_cast(SfxViewShell::Current()), "Panel"); +{ +sal_uInt64 nShellId = reinterpret_cast(SfxViewShell::Current()); +jsdialog::SendFullUpdate(std::to_string(nShellId) + "sidebar", "Panel"); +} return nY; } diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 9f52846206d7..ccd2489d797b 100644 ---
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/sfx2 sfx2/source sw/inc sw/source test/source
desktop/source/lib/init.cxx |5 +++-- include/sfx2/viewsh.hxx |5 +++-- sfx2/source/view/viewsh.cxx |2 +- sw/inc/view.hxx |2 +- sw/inc/viscrs.hxx |4 ++-- sw/source/core/crsr/viscrs.cxx|6 -- sw/source/uibase/inc/wrtsh.hxx|2 +- sw/source/uibase/uiview/view.cxx |4 ++-- sw/source/uibase/wrtsh/wrtsh4.cxx |6 +++--- test/source/lokcallback.cxx | 10 ++ 10 files changed, 26 insertions(+), 20 deletions(-) New commits: commit c33f23598f9bc5ed80c95b18e373c91b68b2511e Author: Luboš Luňák AuthorDate: Fri Nov 12 10:56:54 2021 +0100 Commit: Luboš Luňák CommitDate: Fri Nov 12 12:10:00 2021 +0100 make it explicit whether to ignore the result of getLOKPayload() Returning an empty string to signify 'ignore' was a poor design, as some messages types actually may have valid empty messages. Change-Id: Ia82d3d97d150bc5ef412a1bd4b1091d9b2d84385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125089 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d3353e441474..e71e62929903 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2197,8 +2197,9 @@ void CallbackFlushHandler::enqueueUpdatedTypes() void CallbackFlushHandler::enqueueUpdatedType( int type, SfxViewShell* viewShell, int viewId ) { -OString payload = viewShell->getLOKPayload( type, viewId ); -if(payload.isEmpty()) +bool ignore = false; +OString payload = viewShell->getLOKPayload( type, viewId, ); +if(ignore) return; // No actual payload to send. CallbackData callbackData(payload.getStr(), viewId); m_queue1.emplace_back(type); diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index f0d71bc542e6..26a2324c7ca0 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -345,8 +345,9 @@ public: virtual void libreOfficeKitViewUpdatedCallback(int nType) const override; virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) const override; // Returns current payload for nType, after libreOfficeKitViewUpdatedCallback() or -// libreOfficeKitViewUpdatedCallbackPerViewId() were called. -virtual OString getLOKPayload(int nType, int nViewId) const; +// libreOfficeKitViewUpdatedCallbackPerViewId() were called. If no payload should +// be generated, the ignore flag should be set. +virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const; /// Set if we are doing tiled searching. void setTiledSearching(bool bTiledSearching); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 325c9ffa71cc..d1c0e48ba18e 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1552,7 +1552,7 @@ void SfxViewShell::flushPendingLOKInvalidateTiles() // SfxViewShell itself does not delay any tile invalidations. } -OString SfxViewShell::getLOKPayload(int nType, int /*nViewId*/) const +OString SfxViewShell::getLOKPayload(int nType, int /*nViewId*/, bool* /*ignore*/) const { // SfxViewShell itself currently doesn't handle any updated-payload types. SAL_WARN("sfx.view", "SfxViewShell::getLOKPayload unhandled type " << lokCallbackTypeToString(nType)); diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index b793614f58f7..0f062d3bedf3 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -680,7 +680,7 @@ public: virtual tools::Rectangle getLOKVisibleArea() const override; virtual void flushPendingLOKInvalidateTiles() override; -virtual OString getLOKPayload(int nType, int nViewId) const override; +virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const override; }; inline tools::Long SwView::GetXScroll() const diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx index b2ceb9c67c79..dc7e020ad103 100644 --- a/sw/inc/viscrs.hxx +++ b/sw/inc/viscrs.hxx @@ -61,7 +61,7 @@ public: void SetPosAndShow(SfxViewShell const * pViewShell); const vcl::Cursor& GetTextCursor() const; -OString getLOKPayload(int nType, int nViewId) const; +OString getLOKPayload(int nType, int nViewId, bool* ignore) const; }; // From here classes/methods for selections. @@ -115,7 +115,7 @@ public: static void Get1PixelInLogic( const SwViewShell& rSh, tools::Long* pX = nullptr, tools::Long* pY = nullptr ); -OString getLOKPayload(int nType, int nViewId) const; +OString getLOKPayload(int nType, int nViewId, bool* ignore) const; }; class SW_DLLPUBLIC SwShellCursor : public virtual SwCursor, public SwSelPaintRects diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 7d9564295fab..f81f9750b312 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source sd/uiconfig
desktop/source/lib/init.cxx |3 + sd/uiconfig/simpress/ui/notebookbar.ui| 38 +++--- sd/uiconfig/simpress/ui/notebookbar_compact.ui| 26 - sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui | 12 ++-- sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui| 20 +++ sd/uiconfig/simpress/ui/notebookbar_single.ui |8 +- 6 files changed, 55 insertions(+), 52 deletions(-) New commits: commit fe03d516660f9116ac759201b171144521e41816 Author: Nnamani Ezinne AuthorDate: Mon Nov 8 21:13:59 2021 +0100 Commit: Andras Timar CommitDate: Thu Nov 11 10:47:19 2021 +0100 Impress- Correct commands mentioning Page instead of Slide Replaced UNO commands that have similar implementation but their labels bear Page instead of Slide Change-Id: I5fb24493478b0a8fdd4e324066d8112497fc9eb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124888 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a8517c3cbaba..d3353e441474 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3055,6 +3055,9 @@ static void doc_iniUnoCommands () OUString(".uno:InsertPage"), OUString(".uno:DeletePage"), OUString(".uno:DuplicatePage"), +OUString(".uno:InsertSlide"), +OUString(".uno:DeleteSlide"), +OUString(".uno:DuplicateSlide"), OUString(".uno:Cut"), OUString(".uno:Copy"), OUString(".uno:Paste"), diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui index 318f7c61fd67..ac95d565625e 100644 --- a/sd/uiconfig/simpress/ui/notebookbar.ui +++ b/sd/uiconfig/simpress/ui/notebookbar.ui @@ -1168,7 +1168,7 @@ True False -.uno:ImportFromFile +.uno:ImportSlideFromFile @@ -1242,14 +1242,14 @@ True False -.uno:InsertPageField +.uno:InsertSlideField True False -.uno:InsertPagesField +.uno:InsertSlidesField @@ -3432,7 +3432,7 @@ True False -.uno:InsertPage +.uno:InsertSlide False @@ -3457,7 +3457,7 @@ True False center -.uno:DuplicatePage +.uno:DuplicateSlide False @@ -3469,7 +3469,7 @@ True False center -.uno:DeletePage +.uno:DeleteSlide False @@ -4991,7 +4991,7 @@ True False -.uno:InsertPage +.uno:InsertSlide False @@ -5034,7 +5034,7 @@ True False -.uno:DuplicatePage +.uno:DuplicateSlide False @@ -5058,7 +5058,7 @@ True False -.uno:ImportFromFile +.uno:ImportSlideFromFile False @@ -6172,7 +6172,7 @@ True False -.uno:InsertPage +.uno:InsertSlide False @@ -6266,7 +6266,7 @@ True False -.uno:PageSetup +
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e3f45fdc1e6547b35ab69a01e57ee7c926b8b7e7 Author: Mert Tumer AuthorDate: Fri Oct 1 15:34:33 2021 +0300 Commit: Mert Tumer CommitDate: Fri Oct 1 19:45:46 2021 +0200 lok: Fix graphicselection INPLACE msg is filtered out INPLACE message is not at the beginning, search it instead Signed-off-by: Mert Tumer Change-Id: I2a09ac5a664c1ff26790aa776d871ac34c3d99dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122919 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index dab77ee9aa8b..7e92549a7cb9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1673,7 +1673,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) // remove only selection ranges and 'EMPTY' messages // always send 'INPLACE' and 'INPLACE EXIT' messages removeAll(type, [payload] (const CallbackData& elemData) -{ return (elemData.PayloadString[0] != 'I'); }); +{ return (elemData.PayloadString.find("INPLACE") == std::string::npos); }); } break; }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 2e341c41aa751b4ea1603a8132a7f507571a2c80 Author: Szymon Kłos AuthorDate: Fri Apr 23 15:15:00 2021 +0200 Commit: Szymon Kłos CommitDate: Fri Oct 1 12:55:14 2021 +0200 Deduplicate reference marks and cell auto fill messages We use only the last value Change-Id: If3536b5b4bc67755cb7bb73850a590d37675e6a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114547 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122106 Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3e09f2d8b5ab..dab77ee9aa8b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1542,6 +1542,8 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_WINDOW: case LOK_CALLBACK_CALC_FUNCTION_LIST: case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: +case LOK_CALLBACK_REFERENCE_MARKS: +case LOK_CALLBACK_CELL_AUTO_FILL_AREA: { const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), type); auto pos2 = toQueue2(pos);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) New commits: commit 2b32ab3a32ce9fff42818a6813a041b356d324b8 Author: Luboš Luňák AuthorDate: Fri Sep 24 12:12:12 2021 +0200 Commit: Luboš Luňák CommitDate: Tue Sep 28 13:50:47 2021 +0200 do not use std::find_if() if std::find() does the job Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122642 Tested-by: Jenkins CollaboraOffice Reviewed-by: Luboš Luňák diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 73af13dd8910..824f45b5d23f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1529,8 +1529,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_CALC_FUNCTION_LIST: case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: { -const auto& pos = std::find_if(m_queue1.rbegin(), m_queue1.rend(), -[type] (int elemType) { return (elemType == type); }); +const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), type); auto pos2 = toQueue2(pos); if (pos != m_queue1.rend() && pos2->PayloadString == payload) { @@ -1543,14 +1542,12 @@ void CallbackFlushHandler::queue(const int type, const char* data) if (type == LOK_CALLBACK_TEXT_SELECTION && payload.empty()) { -const auto& posStart = std::find_if(m_queue1.rbegin(), m_queue1.rend(), -[] (int elemType) { return (elemType == LOK_CALLBACK_TEXT_SELECTION_START); }); +const auto& posStart = std::find(m_queue1.rbegin(), m_queue1.rend(), LOK_CALLBACK_TEXT_SELECTION_START); auto posStart2 = toQueue2(posStart); if (posStart != m_queue1.rend()) posStart2->PayloadString.clear(); -const auto& posEnd = std::find_if(m_queue1.rbegin(), m_queue1.rend(), -[] (int elemType) { return (elemType == LOK_CALLBACK_TEXT_SELECTION_END); }); +const auto& posEnd = std::find(m_queue1.rbegin(), m_queue1.rend(), LOK_CALLBACK_TEXT_SELECTION_END); auto posEnd2 = toQueue2(posEnd); if (posEnd != m_queue1.rend()) posEnd2->PayloadString.clear(); @@ -1715,9 +1712,7 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a // If we have to invalidate all tiles, we can skip any new tile invalidation. // Find the last INVALIDATE_TILES entry, if any to see if it's invalidate-all. const auto& pos -= std::find_if(m_queue1.rbegin(), m_queue1.rend(), [](int elemType) { - return (elemType == LOK_CALLBACK_INVALIDATE_TILES); - }); += std::find(m_queue1.rbegin(), m_queue1.rend(), LOK_CALLBACK_INVALIDATE_TILES); if (pos != m_queue1.rend()) { auto pos2 = toQueue2(pos);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 79 +--- 1 file changed, 31 insertions(+), 48 deletions(-) New commits: commit b96d0ff3f02d5a54c2cb773e470b98af585c323b Author: Marco Cecchetti AuthorDate: Wed Aug 18 12:29:01 2021 +0200 Commit: Luboš Luňák CommitDate: Fri Sep 24 20:51:33 2021 +0200 go on switching from boost::property_tree to JsonWriter JsonWriter provides better performance than boost::property_tree and it is also cleaner, so we need to start using the latter in place of the former as much as possible. Change-Id: I8c1e910c0b3d511b89679e622e2cc5d4848a8b47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120656 Tested-by: Jenkins Reviewed-by: Michael Meeks (cherry picked from commit 46d3fdeb4fa35e0575395a3a91213fd81fda0e50) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122437 Tested-by: Jenkins CollaboraOffice Reviewed-by: Luboš Luňák diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 86c468df402f..0426b53946d3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -482,37 +482,31 @@ std::vector desktop::jsonToPropertyValuesVector(const char return aArguments; } - -static boost::property_tree::ptree unoAnyToPropertyTree(const uno::Any& anyItem) +static void unoAnyToJson(tools::JsonWriter& rJson, const char * pNodeName, const uno::Any& anyItem) { -boost::property_tree::ptree aTree; +auto aNode = rJson.startNode(pNodeName); OUString aType = anyItem.getValueTypeName(); -aTree.put("type", aType.toUtf8().getStr()); +rJson.put("type", aType.toUtf8().getStr()); if (aType == "string") -aTree.put("value", anyItem.get().toUtf8().getStr()); +rJson.put("value", anyItem.get().toUtf8().getStr()); else if (aType == "unsigned long") -aTree.put("value", OString::number(anyItem.get()).getStr()); +rJson.put("value", OString::number(anyItem.get()).getStr()); else if (aType == "long") -aTree.put("value", OString::number(anyItem.get()).getStr()); +rJson.put("value", OString::number(anyItem.get()).getStr()); else if (aType == "[]any") { uno::Sequence aSeq; if (anyItem >>= aSeq) { -boost::property_tree::ptree aSubTree; +auto valueNode = rJson.startNode("value"); for (auto i = 0; i < aSeq.getLength(); ++i) { -aSubTree.add_child(OString::number(i).getStr(), unoAnyToPropertyTree(aSeq[i])); +unoAnyToJson(rJson, OString::number(i).getStr(), aSeq[i]); } -aTree.add_child("value", aSubTree); } } - -// TODO: Add more as required - -return aTree; } namespace desktop { @@ -3829,21 +3823,17 @@ public: virtual void SAL_CALL dispatchFinished(const css::frame::DispatchResultEvent& rEvent) override { -boost::property_tree::ptree aTree; -aTree.put("commandName", maCommand.getStr()); +tools::JsonWriter aJson; +aJson.put("commandName", maCommand); if (rEvent.State != frame::DispatchResultState::DONTKNOW) { bool bSuccess = (rEvent.State == frame::DispatchResultState::SUCCESS); -aTree.put("success", bSuccess); +aJson.put("success", bSuccess); } -aTree.add_child("result", unoAnyToPropertyTree(rEvent.Result)); - -std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); -OString aPayload = aStream.str().c_str(); -mpCallback->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aPayload.getStr()); +unoAnyToJson(aJson, "result", rEvent.Result); +mpCallback->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.extractData()); } virtual void SAL_CALL disposing(const css::lang::EventObject&) override {} @@ -3970,13 +3960,10 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma bool bResult = doc_saveAs(pThis, aURLUtf8.getStr(), "pdf", nullptr); // Send the result of save -boost::property_tree::ptree aTree; -aTree.put("commandName", pCommand); -aTree.put("success", bResult); -std::stringstream aStream; -boost::property_tree::write_json(aStream, aTree); -OString aPayload = aStream.str().c_str(); - pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aPayload.getStr()); +tools::JsonWriter aJson; +aJson.put("commandName", pCommand); +aJson.put("success", bResult); + pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.extractData()); return; } @@ -4005,18 +3992,16 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma // skip
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 32 1 file changed, 24 insertions(+), 8 deletions(-) New commits: commit 79b26048ae03a3ed92446012b6235d6a464bf7b8 Author: Luboš Luňák AuthorDate: Wed Sep 15 18:46:09 2021 +0200 Commit: Luboš Luňák CommitDate: Fri Sep 17 00:53:29 2021 +0200 use our string->number functions instead of std::istringstream This is sort of the other side of the 417f881d20cafe88a02b6489 optimizations. C++ streams are relatively slow. Change-Id: I295cc662ecab68eb23a6cb3a85606a4c95edeb07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122159 Tested-by: Jenkins Reviewed-by: Luboš Luňák (cherry picked from commit 9c5a9ee14273593ebcc4bf0f1d42583b6f4f3c52) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122122 Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b803d1372a77..c95de6ed4082 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -529,17 +529,33 @@ RectangleAndPart RectangleAndPart::Create(const std::string& rPayload) return aRet; } -std::istringstream aStream(rPayload); -tools::Long nLeft, nTop, nWidth, nHeight; +// Read ', , , [, ]'. C++ streams are simpler but slower. +const char* pos = rPayload.c_str(); +const char* end = rPayload.c_str() + rPayload.size(); +tools::Long nLeft = rtl_str_toInt64_WithLength(pos, 10, end - pos); +while( *pos != ',' ) +++pos; +++pos; +assert(pos < end); +tools::Long nTop = rtl_str_toInt64_WithLength(pos, 10, end - pos); +while( *pos != ',' ) +++pos; +++pos; +assert(pos < end); +tools::Long nWidth = rtl_str_toInt64_WithLength(pos, 10, end - pos); +while( *pos != ',' ) +++pos; +++pos; +assert(pos < end); +tools::Long nHeight = rtl_str_toInt64_WithLength(pos, 10, end - pos); tools::Long nPart = INT_MIN; -char nComma; if (comphelper::LibreOfficeKit::isPartInInvalidation()) { -aStream >> nLeft >> nComma >> nTop >> nComma >> nWidth >> nComma >> nHeight >> nComma >> nPart; -} -else -{ -aStream >> nLeft >> nComma >> nTop >> nComma >> nWidth >> nComma >> nHeight; +while( *pos != ',' ) +++pos; +++pos; +assert(pos < end); +nPart = rtl_str_toInt64_WithLength(pos, 10, end - pos); } if (nWidth > 0 && nHeight > 0)
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ac77d8a368e1ed21211bfe7768149481502317df Author: Tomaž Vajngerl AuthorDate: Fri Sep 3 12:04:08 2021 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Sep 3 14:20:46 2021 +0200 indexing: add indexing xml as a format for writer Needed so we can run "convert-to" service with COOL to produce indexing XML documents. Change-Id: Iabb77bd562a3307d0d20769a77f069e5250028ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121540 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit f35b9909070919013a753c382bff52614403c7a2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121576 Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index cd2562be2a86..b803d1372a77 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -255,6 +255,7 @@ const ExtensionMap aWriterExtensionMap[] = { "txt", "Text" }, { "xhtml", "XHTML Writer File" }, { "png", "writer_png_Export" }, +{ "xml", "writer_indexing_export" }, { nullptr, nullptr } };
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/LibreOfficeKit
desktop/source/lib/init.cxx | 11 +++ include/LibreOfficeKit/LibreOfficeKit.h |7 +-- include/LibreOfficeKit/LibreOfficeKit.hxx |4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) New commits: commit aeb53d226f0ef804cbe90d1e27a48bf5f7e8633f Author: Pranam Lashkari AuthorDate: Fri Jul 16 16:42:04 2021 +0530 Commit: Jan Holesovsky CommitDate: Thu Aug 5 14:21:17 2021 +0200 LOK: freemium: added new parameter in the API Added new parameter in the freemium API to make it consistent with other APIs Change-Id: Ieb73fd1f97e1886051b1de44a93ba87622862e2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119974 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1ebf880b0a31..7bc76e42ab8a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1048,9 +1048,12 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode); -static void doc_setFreemiumDenyList(const char* freemiumDenyList); +static void doc_setFreemiumDenyList(LibreOfficeKitDocument* pThis, +const char* freemiumDenyList); -static void doc_setFreemiumView(int nViewId, bool isFreemium); +static void doc_setFreemiumView(LibreOfficeKitDocument* pThis, +int nViewId, +bool isFreemium); static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, @@ -3559,12 +3562,12 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar } } -static void doc_setFreemiumDenyList(const char* freemiumDenyList) +static void doc_setFreemiumDenyList(LibreOfficeKitDocument* /*pThis*/, const char* freemiumDenyList) { comphelper::LibreOfficeKit::setFreemiumDenyList(freemiumDenyList); } -static void doc_setFreemiumView(int nViewId, bool isFreemium) +static void doc_setFreemiumView(LibreOfficeKitDocument* /*pThis*/, int nViewId, bool isFreemium) { SolarMutexGuard aGuard; SfxLokHelper::setFreemiumView(nViewId, isFreemium); diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 8383aeb9d920..fddec94a22f4 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -459,10 +459,13 @@ struct _LibreOfficeKitDocumentClass const char* pArguments); /// @see lok::Document::setFreemiumDenyList -void (*setFreemiumDenyList) (const char* freemiumDenyList); +void (*setFreemiumDenyList) (LibreOfficeKitDocument* pThis, +const char* freemiumDenyList); /// @see lok::Document::setFreemiumView -void (*setFreemiumView) (int nViewId, bool isFreemium); +void (*setFreemiumView) (LibreOfficeKitDocument* pThis, +int nViewId, +bool isFreemium); #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 2756dac9c919..aab8b94c8aae 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -789,12 +789,12 @@ public: void setFreemiumDenyList(const char* freemiumDenyList) { -mpDoc->pClass->setFreemiumDenyList(freemiumDenyList); +mpDoc->pClass->setFreemiumDenyList(mpDoc, freemiumDenyList); } void setFreemiumView(int nViewId, bool isFreemium) { -mpDoc->pClass->setFreemiumView(nViewId, isFreemium); +mpDoc->pClass->setFreemiumView(mpDoc, nViewId, isFreemium); } #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit b3ef7dd883beba3a0f8cbbb11912e1c3b7d2627e Author: Dennis Francis AuthorDate: Fri Jun 25 14:52:22 2021 +0530 Commit: Miklos Vajna CommitDate: Fri Jul 23 11:13:33 2021 +0200 lok: sw: avoid duplicate LOK_CALLBACK_TABLE_SELECTED msgs Alternate approach is to track changes in the active table in each view but it needs a bigger change and run the risk of overlooking cases where table dimensions and position changes, which is possibly why this message is created from UpdateCursor() in the first place. Change-Id: I06643e2a7416d6c0fe2b0dc5c9b4adcd45fa50c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118001 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118943 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8922176af3a4..1ebf880b0a31 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1392,6 +1392,7 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li m_states.emplace(LOK_CALLBACK_CELL_ADDRESS, "NIL"); m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL"); m_states.emplace(LOK_CALLBACK_SET_PART, "NIL"); +m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL"); Start(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 735e9a2563ccd5e50c813afb1a7b8576e74963bd Author: Tor Lillqvist AuthorDate: Tue Jun 29 15:04:58 2021 +0300 Commit: Miklos Vajna CommitDate: Fri Jul 16 13:09:02 2021 +0200 Avoid accumulating a huge number of Trace Events before calling the callback Don't use only the five second timer to flush the buffer. Set a limit on the number of accumulated events, too. Change-Id: I075028ce653d89cf099d91ce0d4d97c1361a3bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118205 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118933 Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 98adaa61e00d..8922176af3a4 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -212,7 +212,13 @@ public: SetTimeout(dumpTimeoutMS); Start(); } + virtual void Invoke() override +{ +flushRecordings(); +} + +static void flushRecordings() { const css::uno::Sequence aEvents = comphelper::TraceEvent::getRecordingAndClear(); @@ -3837,6 +3843,7 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c { if (strcmp(pValue, "start") == 0) { +comphelper::TraceEvent::setBufferSizeAndCallback(100, TraceEventDumper::flushRecordings); comphelper::TraceEvent::startRecording(); if (traceEventDumper == nullptr) traceEventDumper = new TraceEventDumper(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 76d6d8180e5d9532ea310026b67e167c72b285c0 Author: Michael Meeks AuthorDate: Tue Jun 22 21:18:24 2021 +0100 Commit: Mike Kaganski CommitDate: Tue Jun 22 22:52:25 2021 +0200 lok: allow .uno:JumpToMark. Change-Id: I0cd3173c94c6952bd5cf81474a7cc31b1585e50e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117675 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0fbb45d93745..a24fdfaa8a1c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2731,6 +2731,7 @@ static void doc_iniUnoCommands () OUString(".uno:IncrementIndent"), OUString(".uno:Italic"), OUString(".uno:JustifyPara"), +OUString(".uno:JumpToMark"), OUString(".uno:OutlineFont"), OUString(".uno:LeftPara"), OUString(".uno:LanguageStatus"), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 190 1 file changed, 87 insertions(+), 103 deletions(-) New commits: commit 080d8a82b2cd3a247ac5e381712cf1d68e3c51cc Author: Mike Kaganski AuthorDate: Mon Jun 14 14:28:04 2021 +0200 Commit: Mike Kaganski CommitDate: Mon Jun 14 21:04:00 2021 +0200 Use FontList::GetFirstFontMetric instead of custom iteration code Besides code deduplication, this takes care of case-insensitive search. Also fall back to a default font in case of no match in doc_renderFont*. Change-Id: Ica45ca10c374cf6581ba2f6b60563d6a1447232a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117121 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117180 Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a1006fa43015..0fbb45d93745 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1216,6 +1216,26 @@ rtl::Reference forceSetClipboardForCurrentView(LibreOfficeKitDocum #endif +const vcl::Font* FindFont(const OUString& rFontName) +{ +SfxObjectShell* pDocSh = SfxObjectShell::Current(); +const SvxFontListItem* pFonts += static_cast(pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); +const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr; +if (pList && !rFontName.isEmpty()) +if (sal_Handle hMetric = pList->GetFirstFontMetric(rFontName)) +return ::GetFontMetric(hMetric); +return nullptr; +} + +vcl::Font FindFont_FallbackToDefault(const OUString& rFontName) +{ +if (auto pFound = FindFont(rFontName)) +return *pFound; + +return OutputDevice::GetDefaultFont(DefaultFontType::SANS_UNICODE, LANGUAGE_NONE, +GetDefaultFontFlags::NONE); +} } // anonymous namespace LibLODocument_Impl::LibLODocument_Impl(const uno::Reference , int nDocumentId) @@ -4637,43 +4657,25 @@ static char* getFonts (const char* pCommand) static char* getFontSubset (const OString& aFontName) { OUString aFoundFont(::rtl::Uri::decode(OStringToOUString(aFontName, RTL_TEXTENCODING_UTF8), rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8)); -SfxObjectShell* pDocSh = SfxObjectShell::Current(); -const SvxFontListItem* pFonts = static_cast( -pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); -const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr; boost::property_tree::ptree aTree; aTree.put("commandName", ".uno:FontSubset"); boost::property_tree::ptree aValues; -if ( pList && !aFoundFont.isEmpty() ) +if (const vcl::Font* pFont = FindFont(aFoundFont)) { -sal_uInt16 nFontCount = pList->GetFontNameCount(); -sal_uInt16 nItFont = 0; -for (; nItFont < nFontCount; ++nItFont) -{ -if (aFoundFont == pList->GetFontName(nItFont).GetFamilyName()) -{ -break; -} -} +FontCharMapRef xFontCharMap (new FontCharMap()); +auto aDevice(VclPtr::Create(DeviceFormat::DEFAULT)); -if ( nItFont < nFontCount ) -{ -FontCharMapRef xFontCharMap (new FontCharMap()); -auto aDevice(VclPtr::Create(DeviceFormat::DEFAULT)); -const vcl::Font& aFont(pList->GetFontName(nItFont)); +aDevice->SetFont(*pFont); +aDevice->GetFontCharMap(xFontCharMap); +SubsetMap aSubMap(xFontCharMap); -aDevice->SetFont(aFont); -aDevice->GetFontCharMap(xFontCharMap); -SubsetMap aSubMap(xFontCharMap); - -for (auto const& subset : aSubMap.GetSubsetMap()) -{ -boost::property_tree::ptree aChild; -aChild.put("", static_cast(ublock_getCode(subset.GetRangeMin(; -aValues.push_back(std::make_pair("", aChild)); -} +for (auto const& subset : aSubMap.GetSubsetMap()) +{ +boost::property_tree::ptree aChild; +aChild.put("", static_cast(ublock_getCode(subset.GetRangeMin(; +aValues.push_back(std::make_pair("", aChild)); } } @@ -5297,98 +5299,80 @@ unsigned char* doc_renderFontOrientation(SAL_UNUSED_PARAMETER LibreOfficeKitDocu SolarMutexGuard aGuard; SetLastExceptionMsg(); -OString aSearchedFontName(pFontName); -OUString aText(OStringToOUString(pChar, RTL_TEXTENCODING_UTF8)); -SfxObjectShell* pDocSh = SfxObjectShell::Current(); -const SvxFontListItem* pFonts = static_cast( -pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); -const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr; - const int nDefaultFontSize = 25; -if ( pList ) -{ -sal_uInt16 nFontCount = pList->GetFontNameCount(); -for (sal_uInt16 i = 0; i < nFontCount; ++i) -{ -const FontMetric& rFontMetric =
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |7 ++- include/vcl/lok.hxx |4 vcl/source/app/svapp.cxx|8 3 files changed, 18 insertions(+), 1 deletion(-) New commits: commit c8522043b239aa0e463e6793b7c9b019d79b2d9d Author: Luboš Luňák AuthorDate: Wed Jun 9 17:11:15 2021 +0200 Commit: Michael Meeks CommitDate: Thu Jun 10 09:47:07 2021 +0200 scale VCL's scale cache according to the number of Online views If a document is opened in several Online views, each of them using a different zoom, then the scale cache is used for the scaling, and each view is sent updated tiles, so if there are too many views, the cache is not large enough. (Collabora T28503) Change-Id: I3fa719b0515064773fe4584fedbc8aff98e6e213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116928 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák (cherry picked from commit 53dd6aa5f3817d42bf676980f980051c3b7cdb03) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116898 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1466c04ffcf1..f730ab0a4c09 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5276,6 +5276,8 @@ static int doc_createViewWithOptions(LibreOfficeKitDocument* pThis, LibLODocument_Impl* pDocument = static_cast(pThis); const int nId = SfxLokHelper::createView(pDocument->mnDocumentId); + vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId)); + #ifdef IOS (void) pThis; #else @@ -5290,7 +5292,7 @@ static int doc_createView(LibreOfficeKitDocument* pThis) return doc_createViewWithOptions(pThis, nullptr); // No options. } -static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) +static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId) { comphelper::ProfileZone aZone("doc_destroyView"); @@ -5300,6 +5302,9 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis LOKClipboardFactory::releaseClipboardForView(nId); SfxLokHelper::destroyView(nId); + +LibLODocument_Impl* pDocument = static_cast(pThis); + vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId)); } static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) diff --git a/include/vcl/lok.hxx b/include/vcl/lok.hxx index 9f3f30ab7977..108f46def8aa 100644 --- a/include/vcl/lok.hxx +++ b/include/vcl/lok.hxx @@ -20,6 +20,10 @@ bool VCL_DLLPUBLIC isUnipoll(); void VCL_DLLPUBLIC registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void* pData); void VCL_DLLPUBLIC unregisterPollCallbacks(); + +// Called to tell VCL that the number of document views has changed, so that VCL +// can adjust e.g. sizes of bitmap caches to scale well with larger number of users. +void VCL_DLLPUBLIC numberOfViewsChanged(int count); } #endif // INCLUDE_VCL_LOK_HXX diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 2494bfcaf92e..10ca0e206325 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1720,6 +1720,14 @@ bool isUnipoll() return pSVData && pSVData->mpPollCallback != nullptr; } +void numberOfViewsChanged(int count) +{ +ImplSVData * pSVData = ImplGetSVData(); +auto& rCache = pSVData->maGDIData.maScaleCache; +// Normally the cache size is set to 10, scale according to the number of users. +rCache.setMaxSize(count * 10); +} + } // namespace lok, namespace vcl /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx | 62 +--- 1 file changed, 36 insertions(+), 26 deletions(-) New commits: commit c3b9503ab2c09534c954c64e8e0794b0d15661d6 Author: Tor Lillqvist AuthorDate: Mon May 10 15:50:45 2021 +0300 Commit: Tor Lillqvist CommitDate: Tue May 18 10:08:08 2021 +0200 We must collect the Trace Events when recording them is turned on Recording them can be turned on and off on-the-fly. Also rename the class from ProfileZoneDumper to TraceEventDumper as ProfileZones are just one special case of Trace Events. Change-Id: I4928397937963c83ffe8022ba4fa941f81119e15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115332 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115593 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 764b10743c11..6fdf245c4495 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -202,6 +202,37 @@ struct ExtensionMap } +class TraceEventDumper : public AutoTimer +{ +static const int dumpTimeoutMS = 5000; + +public: +TraceEventDumper() : AutoTimer( "Trace Event dumper" ) +{ +SetTimeout(dumpTimeoutMS); +Start(); +} +virtual void Invoke() override +{ +const css::uno::Sequence aEvents = +comphelper::TraceEvent::getRecordingAndClear(); +OStringBuffer aOutput; +for (const auto : aEvents) +{ +aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8)); +aOutput.append("\n"); +} +if (aOutput.getLength() > 0) +{ +OString aChunk = aOutput.makeStringAndClear(); +if (gImpl && gImpl->mpCallback) +gImpl->mpCallback(LOK_CALLBACK_PROFILE_FRAME, aChunk.getStr(), gImpl->mpCallbackData); +} +} +}; + +static TraceEventDumper *traceEventDumper = nullptr; + const ExtensionMap aWriterExtensionMap[] = { { "doc", "MS Word 97" }, @@ -3854,7 +3885,11 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c if (strcmp(pOption, "traceeventrecording") == 0) { if (strcmp(pValue, "start") == 0) +{ comphelper::TraceEvent::startRecording(); +if (traceEventDumper == nullptr) +traceEventDumper = new TraceEventDumper(); +} else if (strcmp(pValue, "stop") == 0) comphelper::TraceEvent::stopRecording(); } @@ -6102,31 +6137,6 @@ static void preloadData() namespace { -class ProfileZoneDumper : public AutoTimer -{ -static const int dumpTimeoutMS = 5000; -public: -ProfileZoneDumper() : AutoTimer( "zone dumper" ) -{ -SetTimeout(dumpTimeoutMS); -Start(); -} -virtual void Invoke() override -{ -const css::uno::Sequence aEvents = -comphelper::TraceEvent::getRecordingAndClear(); -OStringBuffer aOutput; -for (const auto : aEvents) -{ -aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8)); -aOutput.append("\n"); -} -OString aChunk = aOutput.makeStringAndClear(); -if (gImpl && gImpl->mpCallback) -gImpl->mpCallback(LOK_CALLBACK_PROFILE_FRAME, aChunk.getStr(), gImpl->mpCallbackData); -} -}; - static void activateNotebookbar(const OUString& rApp) { OUString aPath = "org.openoffice.Office.UI.ToolbarMode/Applications/" + rApp; @@ -6197,7 +6207,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char if (bProfileZones && eStage == SECOND_INIT) { comphelper::TraceEvent::startRecording(); -new ProfileZoneDumper(); +traceEventDumper = new TraceEventDumper(); } comphelper::ProfileZone aZone("lok-init"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/lokinteractionhandler.cxx | 29 --- desktop/source/lib/lokinteractionhandler.hxx |1 2 files changed, 19 insertions(+), 11 deletions(-) New commits: commit e49133a6fbe424ca7a5c635bbf089ec333baf3f5 Author: Tomaž Vajngerl AuthorDate: Mon May 10 14:59:29 2021 +0900 Commit: Tomaž Vajngerl CommitDate: Thu May 13 12:15:03 2021 +0200 lok: move handleMacroConfirmationRequest to its own method Just refactor to make it similar to other requests. Change-Id: I1a76d3d4ecc02b0a223ab8e44b11047455280142 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115306 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115533 Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index 7561bb968dd4..eb7d120a5e3e 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -333,6 +333,23 @@ bool LOKInteractionHandler::handlePasswordRequest(const uno::Sequence& xRequest) +{ +uno::Any const request(xRequest->getRequest()); + +task::DocumentMacroConfirmationRequest aConfirmRequest; +if (request >>= aConfirmRequest) +{ +auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr)); + +if (xInteraction.is()) +xInteraction->handleInteractionRequest(xRequest); + +return true; +} +return false; +} + sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest( const uno::Reference& xRequest) { @@ -348,18 +365,8 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest( if (handlePasswordRequest(rContinuations, request)) return true; -task::DocumentMacroConfirmationRequest aConfirmRequest; -if (request >>= aConfirmRequest) -{ -uno::Reference< task::XInteractionHandler2 > xInteraction( -task::InteractionHandler::createWithParent( -::comphelper::getProcessComponentContext(), nullptr)); - -if (xInteraction.is()) -xInteraction->handleInteractionRequest(xRequest); - +if (handleMacroConfirmationRequest(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 92bc2ffbac8e..9c15f85f4bc8 100644 --- a/desktop/source/lib/lokinteractionhandler.hxx +++ b/desktop/source/lib/lokinteractionhandler.hxx @@ -74,6 +74,7 @@ private: bool handleIOException(const css::uno::Sequence> , const css::uno::Any& rRequest); bool handleNetworkException(const css::uno::Sequence> , const css::uno::Any& rRequest); bool handlePasswordRequest(const css::uno::Sequence> , const css::uno::Any& rRequest); +static bool handleMacroConfirmationRequest(const css::uno::Reference& xRequest); public: void SetPassword(char const* pPassword); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4419c19197280973d9bc6934e85bc08828871448 Author: Tor Lillqvist AuthorDate: Thu Apr 29 12:06:24 2021 +0300 Commit: Tor Lillqvist CommitDate: Thu Apr 29 14:17:32 2021 +0200 Let's call it "traceeventrecording" and not "profilezonerecording" It is not just ProfileZone events any longer that are recorded. Change-Id: I9c2b5817fca8f8a23ebd571cbaccb9ac063ec73b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114849 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c0839e63f778..fcc260ee66a0 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3847,7 +3847,7 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c { static char* pCurrentSalLogOverride = nullptr; -if (strcmp(pOption, "profilezonerecording") == 0) +if (strcmp(pOption, "traceeventrecording") == 0) { if (strcmp(pValue, "start") == 0) comphelper::TraceEvent::startRecording(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/LibreOfficeKit include/sal sal/osl sal/util
desktop/source/lib/init.cxx | 30 ++ include/LibreOfficeKit/LibreOfficeKit.h |3 + include/LibreOfficeKit/LibreOfficeKit.hxx | 33 +++ include/sal/log.hxx |2 sal/osl/all/log.cxx | 63 +- sal/util/sal.map |1 6 files changed, 106 insertions(+), 26 deletions(-) New commits: commit d3fa1ae40a8df47bc5d047a86b9ec0c83d773bfd Author: Tor Lillqvist AuthorDate: Wed Apr 21 17:37:57 2021 +0300 Commit: Tor Lillqvist CommitDate: Fri Apr 23 22:41:08 2021 +0200 Add API to LibreOfficeKit to set arbitrary run-time options in core Add setOption(const char*, const char*) At the moment this enables starting and stopping the ProfileZone event recording and overriding the SAL_LOG environment variable. Change-Id: Ic3a934bb4246c755a91eee8a8343fafc15815116 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114439 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114559 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2df7a7226445..e92c916f1e5f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2076,6 +2076,8 @@ static void lo_sendDialogEvent(LibreOfficeKit* pThis, unsigned long long int nLOKWindowId, const char* pArguments); +static void lo_setOption(LibreOfficeKit* pThis, const char* pOption, const char* pValue); + LibLibreOffice_Impl::LibLibreOffice_Impl() : m_pOfficeClass( gOfficeClass.lock() ) , maThread(nullptr) @@ -2101,6 +2103,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl() m_pOfficeClass->signDocument = lo_signDocument; m_pOfficeClass->runLoop = lo_runLoop; m_pOfficeClass->sendDialogEvent = lo_sendDialogEvent; +m_pOfficeClass->setOption = lo_setOption; gOfficeClass = m_pOfficeClass; } @@ -3840,6 +3843,33 @@ static void lo_sendDialogEvent(LibreOfficeKit* /*pThis*/, unsigned long long int lcl_sendDialogEvent(nWindowId, pArguments); } +static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const char* pValue) +{ +static char* pCurrentSalLogOverride = nullptr; + +if (strcmp(pOption, "profilezonerecording") == 0) +{ +if (strcmp(pValue, "start") == 0) +comphelper::ProfileZone::startRecording(); +else if (strcmp(pValue, "stop") == 0) +comphelper::ProfileZone::stopRecording(); +} +else if (strcmp(pOption, "sallogoverride") == 0) +{ +if (pCurrentSalLogOverride != nullptr) +free(pCurrentSalLogOverride); +if (pValue == nullptr) +pCurrentSalLogOverride = nullptr; +else +pCurrentSalLogOverride = strdup(pValue); + +if (pCurrentSalLogOverride == nullptr || strlen(pCurrentSalLogOverride) == 0) +sal_detail_set_log_selector(nullptr); +else +sal_detail_set_log_selector(pCurrentSalLogOverride); +} +} + static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished) { comphelper::ProfileZone aZone("doc_postUnoCommand"); diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 2279260d0e90..82738d65ff93 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -115,6 +115,9 @@ struct _LibreOfficeKitClass void (*sendDialogEvent) (LibreOfficeKit* pThis, unsigned long long int nLOKWindowId, const char* pArguments); + +/// @see lok::Office::setOption +void (*setOption) (LibreOfficeKit* pThis, const char* pOption, const char* pValue); }; #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 962270452e20..06fe5abc19e2 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -990,6 +990,39 @@ public: { mpThis->pClass->sendDialogEvent(mpThis, nWindowId, pArguments); } + +/** + * Generic function to toggle and tweak various things in the core LO + * + * The currently available option names and their allowed values are: + * + * "profilezonerecording": "start" or "stop" + * Start or stop recording profile zone trace data in the process. + * + * "sallogoverride": "" + * Override the SAL_LOG environment variable + * + * For the syntax of the string see the documentation for "Basic + * logging functionality" in LibreOffice internal API + * documentation
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 5f6b57b67dbf07676cf5821bcc34eb7de79cb9ac Author: Henry Castro AuthorDate: Thu Oct 15 16:10:31 2020 -0400 Commit: Henry Castro CommitDate: Thu Apr 8 21:01:07 2021 +0200 lok: initialize to dispatch ".uno:RunMacro" command The ".uno:RunMacro" command it is needed for client side to show the Macro Selector Dialog. Change-Id: I8f01b9f5cc985119c9215734a6484ed7a0e30080 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107886 Tested-by: Jenkins Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109132 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113802 Tested-by: Henry Castro diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7ea03307b40c..d59bbd80d3bf 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2828,7 +2828,8 @@ static void doc_iniUnoCommands () OUString(".uno:FreezePanesColumn"), OUString(".uno:FreezePanesRow"), OUString(".uno:Sidebar"), -OUString(".uno:SheetRightToLeft") +OUString(".uno:SheetRightToLeft"), +OUString(".uno:RunMacro") }; util::URL aCommandURL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3a6544f89c438fcddd72efe216fb26b827e13bd5 Author: Ashod Nakashian AuthorDate: Sun Mar 10 12:21:33 2019 -0400 Commit: Andras Timar CommitDate: Thu Apr 8 08:56:09 2021 +0200 LOK: don't segfault when reporting error Change-Id: Ia6d614eb15b15f43ddd3e0b5742b888060dfd581 Reviewed-on: https://gerrit.libreoffice.org/69069 Reviewed-by: Andras Timar Tested-by: Andras Timar (cherry picked from commit 9fa568dced78011072390320f64eae28dd06d2b9) Reviewed-on: https://gerrit.libreoffice.org/78443 (cherry picked from commit fa18cdce824525ebd76b542a44741a35062741ce) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 55d5f00ae874..352dc13d5576 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3989,7 +3989,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma else bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector)); -if (!bResult) +if (!bResult && gImpl) { SetLastExceptionMsg("Failed to dispatch " + aCommand); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/LibreOfficeKit
desktop/source/lib/init.cxx | 18 +- include/LibreOfficeKit/LibreOfficeKit.h |5 + include/LibreOfficeKit/LibreOfficeKit.hxx | 11 +++ 3 files changed, 33 insertions(+), 1 deletion(-) New commits: commit dea03310cc257514ceaabc732461e9e976ba60ed Author: Henry Castro AuthorDate: Fri Dec 25 17:30:42 2020 -0400 Commit: Tor Lillqvist CommitDate: Mon Apr 5 14:31:48 2021 +0200 lok: add lo_sendDialogEvent to post dialog events When the "Macro Security Warning" is shown in client side, the model/view/controller are not created yet. It is necessary to create a function to posts a dialog event. Change-Id: I2bfc9edecc708dc79da575ea515e3144e78c10e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108293 Tested-by: Jenkins Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108678 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113599 Tested-by: Tor Lillqvist Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a302b5d46f76..6c4be59af5d6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2087,6 +2087,10 @@ static void lo_runLoop(LibreOfficeKit* pThis, LibreOfficeKitWakeCallback pWakeCallback, void* pData); +static void lo_sendDialogEvent(LibreOfficeKit* pThis, + unsigned long long int nLOKWindowId, + const char* pArguments); + LibLibreOffice_Impl::LibLibreOffice_Impl() : m_pOfficeClass( gOfficeClass.lock() ) , maThread(nullptr) @@ -2111,6 +2115,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl() m_pOfficeClass->runMacro = lo_runMacro; m_pOfficeClass->signDocument = lo_signDocument; m_pOfficeClass->runLoop = lo_runLoop; +m_pOfficeClass->sendDialogEvent = lo_sendDialogEvent; gOfficeClass = m_pOfficeClass; } @@ -3710,7 +3715,7 @@ public: } // anonymous namespace -static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long long int nWindowId, const char* pArguments) +static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pArguments) { SolarMutexGuard aGuard; @@ -3793,6 +3798,17 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long pWindow->Resize(); } + +static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long long int nWindowId, const char* pArguments) +{ +lcl_sendDialogEvent(nWindowId, pArguments); +} + +static void lo_sendDialogEvent(LibreOfficeKit* /*pThis*/, unsigned long long int nWindowId, const char* pArguments) +{ +lcl_sendDialogEvent(nWindowId, pArguments); +} + static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished) { comphelper::ProfileZone aZone("doc_postUnoCommand"); diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index f4244def5a6b..2279260d0e90 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -110,6 +110,11 @@ struct _LibreOfficeKitClass LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void* pData); + +/// @see lok::Office::sendDialogEvent +void (*sendDialogEvent) (LibreOfficeKit* pThis, +unsigned long long int nLOKWindowId, +const char* pArguments); }; #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 23b79c742c09..962270452e20 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -979,6 +979,17 @@ public: { mpThis->pClass->runLoop(mpThis, pPollCallback, pWakeCallback, pData); } + +/** + * Posts a dialog event for the window with given id + * + * @param nWindowId id of the window to notify + * @param pArguments arguments of the event. + */ +void sendDialogEvent(unsigned long long int nWindowId, const char* pArguments = NULL) +{ +mpThis->pClass->sendDialogEvent(mpThis, nWindowId, pArguments); +} }; /// Factory method to create a lok::Office instance. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
desktop/source/lib/init.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 2dd50a40fa295ed75ad16e379e3781cf5e31f21b Author: Pranam Lashkari AuthorDate: Wed Jan 20 14:30:14 2021 +0530 Commit: Pranam Lashkari CommitDate: Fri Apr 2 19:45:41 2021 +0200 Do not skip cursor invalidation if hyperlink in payload Change-Id: Iba08f9a52a282bdab890eeb4194222d0b576d64b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109664 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos (cherry picked from commit f7b31b02f2fe28f75d2a70c0261897aba4a7b72d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109676 Tested-by: Jenkins Reviewed-by: Pranam Lashkari (cherry picked from commit 1a13ba5927e5f2fdd8f1461bae568b48dd4abe0b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113491 Tested-by: Pranam Lashkari diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 5f1c413090c3..a302b5d46f76 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1429,7 +1429,9 @@ void CallbackFlushHandler::queue(const int type, const char* data) // Suppress invalid payloads. if (type == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR && -payload.find(", 0, 0, ") != std::string::npos) +payload.find(", 0, 0, ") != std::string::npos && +payload.find("\"hyperlink\":\"\"") == std::string::npos && +payload.find("\"hyperlink\": {}") == std::string::npos) { // The cursor position is often the relative coordinates of the widget // issuing it, instead of the absolute one that we expect. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 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 291b3433921f094203de794c87e73a137c7656b7 Author: Pranam Lashkari AuthorDate: Sat Nov 7 12:29:33 2020 +0530 Commit: Pranam Lashkari CommitDate: Fri Apr 2 19:40:44 2021 +0200 LOK: send state of SheetRightToLeft Change-Id: I4b58ab74003065a63e4274293b868c909f4f583f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105428 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit cc7bf1755c31fcd4c388f25e642c37d0e2fd758a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106810 Tested-by: Jenkins Reviewed-by: Pranam Lashkari (cherry picked from commit 218b61fd1b2c7e614a877bb38f92affc6915c3fd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113485 Tested-by: Pranam Lashkari diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2c2fbfa0be36..5f1c413090c3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2838,7 +2838,8 @@ static void doc_iniUnoCommands () OUString(".uno:FreezePanes"), OUString(".uno:FreezePanesColumn"), OUString(".uno:FreezePanesRow"), -OUString(".uno:Sidebar") +OUString(".uno:Sidebar"), +OUString(".uno:SheetRightToLeft") }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index e291eb472a25..9c78b4c693ce 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1019,7 +1019,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "TraceChangeMode" || aEvent.FeatureURL.Path == "FormatPaintbrush" || aEvent.FeatureURL.Path == "FreezePanes" || -aEvent.FeatureURL.Path == "Sidebar") +aEvent.FeatureURL.Path == "Sidebar" || +aEvent.FeatureURL.Path == "SheetRightToLeft") { bool bTemp = false; aEvent.State >>= bTemp; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits