summaryrefslogtreecommitdiff
path: root/sfx2
AgeCommit message (Collapse)Author
9 daysuno: introduced command to copy slidesPranam Lashkari
problem: in online though kit process it was difficult to trigger the slidesorter clipboard to copy slides. Difficulty was caused by slidesorter using its own viewshell to copy and online triggering copy command on drawviewshell. It's more convenient to use a different command rather than jumping between viewshells in this case Change-Id: I347ad0044efa64a3e5dcd26aeb16fe5b8103bb12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182605 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
11 dayscool#11226 sw per-view redline on: state for the per-view and per-doc commandsMiklos Vajna
The UI for recording is one toolbar button (toggle) with a dropdown that has 2 radio buttons. The expectation is that once the toggle is on, one of the radio buttons report enabled state. So this is a tri-state: the record status is off, per-view or per-doc on the UI. At a code level, we have a per-doc flag and we have a boolean in each view. The requirements: 1) Compatibility: if the dropdown menu is not used, then clicking on the old toggle should enable recording for all views & once it's enabled (either per-view or per-doc), clicking on it should disable the recording. 2) If recording is on, the exactly one of per-view or per-doc radio button in the submenu should report enabled status. This leads to a not entirely symmetric behavior if you compare the enable, status and disable parts of this commands, and this is wanted to result in the least amount of surprise. Fix the problem by: 1) Enable: the toolbar button enables recording for all views (to stay compatible), the dropdown menu allows choosing between this view vs all views. 2) Status: the toolbar button reports enabled status if recording is on for this view for any reason; the "this view" command reports enabled status if recording is on in this view but not in all views; the "all views" command reports enabled status if recording is on in this view and no other view has it disabled. 3) Disable is almost the opposite of enabled, but the toolbar toggle can always disable recording, so a per-view -> off -> all-views transition is possible by clicking on the toggle twice. This required a single change to testTrackChangesPerViewEnableOne, because now going back to the no-record state is doable by clicking on the enabled toolbar button, i.e. by dispatching the .uno:TrackChanges command; dispatching .uno:TrackChangesInThisView always changes to the per-view recording. Change-Id: Iacc984f832b4c08e0e100a67774e1e559729d82a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182517 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
11 dayscool#11226 sw per-view redline on: allow both per-view and per-docMiklos Vajna
Have two windows for a document, record changes in one view, and be surprised that now this is not turned on in the other view since commit ae6d396552cd3cebd7fba4942e6ca2fd5de579af (cool#11226 sw per-view redline on: add view-aware getter, 2025-03-03). Adding the ability to record changes per-view is intentional, but it was not a deliberate choice to also remove the old per-document recording. Fix this by turning the "is recording on" UI into a tristate, so the user can enable recording for all document windows or just the current document window -- similar to how showing changes can be off, inline and there are also 2 more on-margin options. The state of the new UNO commands still has to be implemented. Change-Id: I1e5271d4cc8900a28c7a8da8d34e00fec9e2e1b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182455 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
13 dayscool#11226 sw per-view redline on: add view-aware getterMiklos Vajna
Have 2 views, view 1 enables tracked changes recording by dispatching .uno:TrackChanges, view 2 does not. The result is that this gets enabled in both views, including the toolbar button state, insertion recording, deletion recording. The toolbar button state behavior was introduced in commit d890ec2f130188af9d998abf5968f06e7218b7a4 (tdf#101592 sw: track changes state is doc-specific, not view-specific, 2016-08-19), but there the motivation was that *if* the setting is per-doc, then all views should show the same toolbar button state. Fix the problem by: - improving SwDocShell::IsChangeRecording(), so it takes a hitn on what is the relevant view; the relevant view is the view where the state is updated, it may not be the current view - using sw::DocumentRedlineManager::GetRedlineFlags() everywhere, so we'll have a central points for reading these flags - extending sw::DocumentRedlineManager::GetRedlineFlags() to try to take the "is recording" setting from the current view (if there is such a view) - improving SwEditShell::GetRedlineFlags() to pass itself to sw::DocumentRedlineManager::GetRedlineFlags(), so the entire chain of calls for the toolbar button work with the correct view Also add tests to make sure all of uno command state, insert & delete works. Drop the desktop/ test that is now redundant -- and testing per-view callbacks there is harder than in sw/. Change-Id: I6dbd826ea27facb9f8d06029efe805c637b7e080 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182345 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-24lok: handle saveas as exportAshod Nakashian
SaveAs saves the document to a new path. In the jail, this is unhelpful, since we upload the document after saving from a specific path. Instead, we do SaveACopy, or export, which saves the given document as a copy, retaining the original path for subsequent saves. This fixes a serious issue where after hitting Ctrl+Shift+S, the document would no longer store any further changes (in fact, it was saving the changes to a different path, which was not used for uploading). Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk> Change-Id: I6ba72df6a0a908d181786c02cb7c060177cd0302 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182071 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-19lok: switch dark mode fasterSzymon Kłos
We don't need to load the color scheme every time we switch the dark mode on/off. Let's load it once then reuse. - preloading - reuse instance Change-Id: I72478327124dad7142af826232f483e4033764e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181812 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-02-18cool#11064 vcl lok: fold the scheduler info into the anyinput callbackMiklos Vajna
This changes the LOK API added in commit e9e39e45f0daed52276377321088aa4d49b112b6 (cool#11064 vcl lok: expose info about the scheduler, 2025-02-14) so that a LOK client doesn't have to query the priority of the most urgent task: instead the anyInput callback gets it as a parameter. The scheduler is a hot path and it's not expected this priority information would be needed in other places, so folding the new LOK API into the anyInput callback simplifies things. Change-Id: I1385055bfa27f47a243d40683b54cb2ddc9d33bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181842 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-14cool#11064 vcl lok: expose info about the schedulerMiklos Vajna
A LOK client can interrupt the vcl main loop in its 'any input' callback. When making that decision, it's useful in case it can know what's the priority of the most urgent job, for example it may want core to still finish high priority tasks, but not idle ones. Add a LOK API to expose this info. Keep it minimal, so it's realistic to call this frequently from a LOK client. Change-Id: Id51668eb8156067e60d6fd0f33606c65858008a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181668 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-02-14Rename "Spotlight" to "Highlight styles"Banobe Pascal
This improves clarity and aligns better with user expectations. Signed-off-by: Banobe Pascal <banobe.pascal@collabora.com> Change-Id: I7ba7548a724bbee5e56fdcdc04488c49af797ae2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181436 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Pedro Silva <pedro.silva@collabora.com> Tested-by: Pedro Silva <pedro.silva@collabora.com>
2025-02-11tdf#165185: consider LOK read-only view in SID_SEARCH_OPTIONSMike Kaganski
This reverts commit cae3ed92df74672a886ee706ebb970a763be3712 "disable invoking Search and Replace dialog (by Ctrl+H) in read-only documents", 2025-02-11. Instead, the dialog will disable replacement controls. Change-Id: Iefef1f636492f60b2bcff07379c2c2dc7bcead79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181412 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2025-02-10disable invoking Search and Replace dialog (by Ctrl+H) in read-only documentsAndras Timar
Change-Id: Ib49d6260ec465070caa6dae6620ea01b5814648e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181377 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-02-10jsdialog: reorganize style list sidebar panel information hierarchyBanobe Pascal
The style list sidebar panel components were poorly organized, leading to confusion about the relationship between controls and their effects. This commit implements a standardized visual hierarchy: New hierarchy: - Toolbar (top-level actions) - Settings (show previews and spotlight) - Filter controls (filter list) - TreeView/FlatView (filtered content) Previous hierarchy: - Toolbar - TreeView/FlatView - Filter controls - Settings Signed-off-by: Banobe Pascal <banobe.pascal@collabora.com> Change-Id: I9eac2719ba3dd1bbf8f62b324b05d47ca418bd7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181322 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Pedro Silva <pedro.silva@collabora.com>
2025-02-07Don't broadcast SfxHintId::TitleChanged if title doesn't changeCaolán McNamara
Change-Id: Id3a0adb8903f269a94fdfb63220305780b96db4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180852 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-02-06avoid uno casting cost, and simplifyCaolán McNamara
these are always XStorageBasedLibraryContainers, so transport around as that and can avoid casting and some expensive throw/catches Change-Id: I772efceea3bb4f38d70be0497345f5f81173494c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181150 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-02-03ucbhelper::Content can do nothing with a "private:stream"Caolán McNamara
so don't bother, and skip throwing exceptions in this case Change-Id: Ie5f4dc5fb24f117be7e671dc83766c7804a98005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180950 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-01-31lok: allow save on comment only modeJaume Pujantell
Allow execution of .uno:Save command on comment only mode for all types of files, not only pdf. Change-Id: I35387d93d00d709d209d3ed1ba2d315bd20b67d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180940 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-01-24cool#11002 sfx2: fix uncaught exception in SfxObjectShell::isExportLocked()Miklos Vajna
Similar to commit 71aa5352f6f57283d1db51c980f6f0b802381871 (sfx2: fix uncaught exception in SfxObjectShell::isEditDocLocked(), 2025-01-23). This seems to be the last problem with this pattern. Change-Id: Ibaceb23beaff808d9f192fd55505361bf74016b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180683 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-01-24cool#11002 sfx2: fix uncaught exception in ↵Miklos Vajna
SfxObjectShell::isContentExtractionLocked() Similar to commit 71aa5352f6f57283d1db51c980f6f0b802381871 (sfx2: fix uncaught exception in SfxObjectShell::isEditDocLocked(), 2025-01-23). Change-Id: I9f6c35c8b2934fee193a4c4211f4d3fbcad12aab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180682 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-23cool#11002 sfx2: fix crash in SfxViewFrame::StateReload_Impl()Miklos Vajna
Now that the scheduler no longer calls std::abort(), we crashed with: #5 <signal handler called> (gdb) #6 std::__uniq_ptr_impl<SfxMedium_Impl, std::default_delete<SfxMedium_Impl> >::_M_ptr (this=0x10) at /usr/include/c++/12/bits/unique_ptr.h:191 191 pointer _M_ptr() const noexcept { return std::get<0>(_M_t); } (gdb) #7 0x00007ff37cdaf9da in std::unique_ptr<SfxMedium_Impl, std::default_delete<SfxMedium_Impl> >::get (this=0x10) at /usr/include/c++/12/bits/unique_ptr.h:462 462 { return _M_t._M_ptr(); } (gdb) #8 0x00007ff37cdab888 in std::unique_ptr<SfxMedium_Impl, std::default_delete<SfxMedium_Impl> >::operator-> (this=0x10) at /usr/include/c++/12/bits/unique_ptr.h:455 455 return get(); (gdb) #9 0x00007ff37cd989e3 in SfxMedium::GetItemSet (this=0x0) at sfx2/source/doc/docfile.cxx:3810 3810 if (!pImpl->m_pSet) (gdb) up #10 0x00007ff37d082c50 in SfxViewFrame::StateReload_Impl (this=0x1ba830c0, rSet=SfxItemSet of pool 0x18ba4d60 with parent 0x0 and Which ranges: [(6312, 6312)] = {...}) at sfx2/source/view/viewfrm.cxx:944 944 const SfxBoolItem* pItem = pSh->GetMedium()->GetItemSet().GetItem(SID_EDITDOC, false); (gdb) print pSh->GetMedium() $1 = (SfxMedium *) 0x0 So just check for that case when the shell doesn't have a medium. Change-Id: I0198121853d283253b782c7e526ef8ef9436eed7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180664 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-01-23sfx2: fix uncaught exception in SfxObjectShell::isEditDocLocked()Miklos Vajna
Crashreport signature: SIG Fatal signal received: SIGABRT code: 18446744073709551610 for address: 0x1da00001e2c program/libmergedlo.so Scheduler::CallbackTaskScheduling() vcl/source/app/scheduler.cxx:486 (discriminator 7) program/libmergedlo.so comphelper::SolarMutex::release(bool) include/comphelper/solarmutex.hxx:91 program/libmergedlo.so SvpSalInstance::ImplYield(bool, bool) vcl/headless/svpinst.cxx:401 program/libmergedlo.so SvpSalInstance::DoYield(bool, bool) vcl/headless/svpinst.cxx:475 I.e. we do an abort when a task throws when the scheduler processes events on the main loop. This happens *sometimes* locally, but it's unclear to me how to reliably trigger it. When it happens, we warn like this: warn:vcl.schedule:27650:27441:vcl/source/app/scheduler.cxx:485: Uncaught com.sun.star.lang.NotInitializedException message: "at sfx2/source/doc/sfxbasemodel.cxx:3034" context: SdXImpressDocument Checking the SAL_DEBUG_BACKTRACE() output for the case when SfxBaseModel::MethodEntryCheck() throws: #3 instdir/program/libsfxlo.so(SfxBaseModel::MethodEntryCheck(bool) const+0x154) [0x7fec1e8ad9b4] #4 instdir/program/libsfxlo.so(+0x6bdd1e) [0x7fec1e8bdd1e] #5 instdir/program/libsfxlo.so(SfxBaseModel::getArgs2(com::sun::star::uno::Sequence<rtl::OUString> const&)+0x56) [0x7fec1e8a0dd2] #6 instdir/program/libsfxlo.so(SfxObjectShell::isEditDocLocked() const+0x11c) [0x7fec1e8239da] #7 instdir/program/libsfxlo.so(+0x882851) [0x7fec1ea82851] #8 instdir/program/libsfxlo.so(+0x87cefc) [0x7fec1ea7cefc] #9 instdir/program/libsfxlo.so(SfxDispatcher::FillState_(SfxSlotServer const&, SfxItemSet&, SfxSlot const*)+0x1cc) [0x7fec1e4d57f4] #10 instdir/program/libsfxlo.so(+0x2b900a) [0x7fec1e4b900a] #11 instdir/program/libsfxlo.so(+0x2bd954) [0x7fec1e4bd954] #12 instdir/program/libsfxlo.so(+0x2bd631) [0x7fec1e4bd631] #13 instdir/program/libsfxlo.so(+0x2bd5a1) [0x7fec1e4bd5a1] #14 instdir/program/libvcllo.so(+0xf4fb91) [0x7fec1894fb91] #15 instdir/program/libvcllo.so(Timer::Invoke()+0x23) [0x7fec1894fa19] #16 instdir/program/libvcllo.so(Scheduler::CallbackTaskScheduling()+0x123d) [0x7fec188fe277] Fix this in SfxObjectShell::isEditDocLocked(), where we already return false to avoid a nullptr dereference, and do it the way SfxObjectShell::isScriptAccessAllowed() does the same for consistency. Change-Id: I435b2877b1b600e01bf32b44bfa664be1672c231 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180629 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-23defer finding dialog parent until we need itCaolán McNamara
which might be never for the typical save Change-Id: I2989f2e9629ce13c8b301a6b85707443ddc4954a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180602 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-01-20cool#10630 doc electronic sign: unselect & reject reselectMiklos Vajna
Insert a signature line, move/resize the selected shape, finish signing, the signature line is still selected and you can still move/resize it. This was working for the desktop visual signing which SfxViewShell::GetSignPDFCertificate() returned an XCertificate, but not for electronic signing, which is a separate branch in SfxObjectShell::ExecFile_Impl(). Fix the problem by deselecting the shape even in the desktop case and the moving this cleanup code to a new ResetSignatureSelection() and calling that in the electronic sign case, too. SdrMarkView::UnmarkAllObj() is private to sfx2/, so go via UNO to do the same. Change-Id: I52c89c4aea0203f8624bd801a900186211541dc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180496 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-01-17bump copyright year to 2025Xisco Fauli
Conflicts: setup_native/source/packinfo/packinfo_brand.txt setup_native/source/packinfo/packinfo_extensions.txt setup_native/source/packinfo/packinfo_office.txt setup_native/source/packinfo/packinfo_office_help.txt setup_native/source/packinfo/packinfo_office_lang.txt setup_native/source/packinfo/packinfo_sdkoo.txt setup_native/source/packinfo/packinfo_ure.txt Change-Id: Id2d0597ed86a5f798eec22dde5b954c06442a2a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179610 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins (cherry picked from commit 48527403950033b7002807bd248a5e887af5159d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179615 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit e52e3641de46dd41596687b357b3925a0f05ab09) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180383 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-01-17LOK: Do not try to show an "update links" dialogMike Kaganski
In commit f8528cdda9292c7ae6c9d49b80c1a3a3b4a67094 (LOK: don't crash when trying to show a dialog during file load, 2024-12-26), all not yet async / not properly set up dialogs made to fail gracefully. In the follow-up https://gerrit.libreoffice.org/c/core/+/180334, an assert is added to still fail in debug builds. The specific "update links" dialog case, that triggered the original change in the first place, does not need to appear at all in the LOK case, because there is no external documents available for updating. This change avoids the dialog in that case. Change-Id: I7c6bc755d87656f002829460f4768fed34dc2f17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180354 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-01-17tdf#160180: bump copyright year to 2024Julien Nabet
Conflicts: setup_native/source/packinfo/packinfo_brand.txt setup_native/source/packinfo/packinfo_extensions.txt setup_native/source/packinfo/packinfo_office.txt setup_native/source/packinfo/packinfo_office_help.txt setup_native/source/packinfo/packinfo_office_lang.txt setup_native/source/packinfo/packinfo_sdkoo.txt setup_native/source/packinfo/packinfo_ure.txt Change-Id: I466b8f86e8a53a238ed2ce2d2b053dc519ff8eed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164794 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 94da114cd86e3bcd8b6235566ca5f926f09d4b18) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164748 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 697dbd9a708e73f6e83a76baf0541dcaf1489a68) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180310 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2025-01-16cool#10630 doc electronic sign: move signature line tracking to the viewMiklos Vajna
No functional changes intended: - Replace SfxObjectShell::GetSignPDFCertificate() and SfxObjectShell::ResetSignPDFCertificate() with SfxViewShell::SetSignPDFCertificate() and SfxViewShell::GetSignPDFCertificate(), because information about shape selection belongs to the view. - Change svx::SignatureLineHelper::setShapeCertificate() to use SfxViewShell::SetSignPDFCertificate() to avoid duplication. - Change GetSignatureLineShape() in xmlsecurity/ to use SfxViewShell::GetSignPDFCertificate(), again to avoid duplication. With this, all setters/getters of the inserted signature line go via SfxViewShell and the amount of getCurrentSelection() calls on the model is reduced. Change-Id: I021bc41262b2a16d1014fbf1431a0eb6e1e86c73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180332 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-15cool#10630 doc electronic sign: fix no graphic selection for the signature lineMiklos Vajna
Insert a signature line in "extern" mode, the shape gets selected but there is no graphic selection at a LOK API level. This is because GetSignPDFCertificate() returned an XCertificate, which is empty in the external signing case, so we can't differentiate between no signing and external signing. Fix this by changing the return type to svl::crypto::CertificateOrName, this way SdrMarkView::SetMarkHandlesForLOKit() can annotate the signature line correctly even in the external signing case. The tracking of the signature line selection is still in the model (not in the view), that's not yet fixed here. Change-Id: I4ef9c1fa0a88af0c0fcd55156b973a3705f985c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180264 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-13cool#10630 doc electronic sign: fix insertion of the signature lineMiklos Vajna
Have electronic signing configured in the LOK client, try to insert a signature line, you'll get a certificate picker, while we don't have a cert during esign. What's in fact needed for creating the signature line is just a name (previously extracted from the certificate), we can survive the lack of actual certificate. Fix the problem by adding a new External parameter to .uno:InsertSignatureLine to hint that the certificate chooser should not be opened, instead the editor name (used for comments already) should be used. Add a new CertificateOrName in svl/ and use that in all places where previously we wanted a certificate but in fact it's enough to have a certificate or a name to create the signature line. The name on the signature line is just visual feedback, the actual name on the crypto signature is still not based on untrusted used input. Change-Id: Ib7008112a8e28a9e7d9649745e6021dd6b6b9c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180167 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-13Slightly more informative loggingAron Budea
Change-Id: Ia474a208d5a562e424df76ff389cfcc4e3f2b1fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179817 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com> (cherry picked from commit 899d87a844c2aa2990df4a9268008960d8489379) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180151 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2025-01-10SD: fillapi: slide, text, uno commandsAttila Szűcs
Implemented extract and transform for slides. It can manipulate slides and some of its text content. usable commands for transform: {"JumpToSlide": 4}, //jump to slide 4 (counted from 0) "last" can be used {"JumpToSlideByName": "Slide 4"},jump to slide named "Slide 4" {"InsertMasterSlide": 10}, //insert the 10. masterSlide after the actual slide, and jump to this new Slide {"InsertMasterSlideByName": "name"}, //same as InsertMasterSlide, but with parameter of masterSlide name. {"DeleteSlide": 2}, // delete the 2. slide. It may or may not change the actual slide can be used without parameter: {"DeleteSlide": ""}, // it delete the actual slide. {"MoveSlide.2": 5}, // move the 2. slide to the 5. position, if it is the actual slide, then jump to the new position of this slide. If it is not the actual slide then it may jump, so the actual Slide eill remain the same. {"MoveSlide": 5}, // move the actual slide to the 5. position {"DuplicateSlide": 5}, //duplicate the 5. slide , it jumps to the duplicated slide {"DuplicateSlide": ""}, // duplicate the actual slide {"ChangeLayout": 18}, // change the actual page layout to the 18. layout. (would be good to have a better ID) {"ChangeLayoutByName": "AUTOLAYOUT_TITLE_2CONTENT"}, //same as ChangeLayout, nbut indxed by the layout name. {"RenameSlide": "NewNameForSlide"}, //rename the actual slide {"SetText.0": "first"}, //set the text of 0. sdrobject on the actual page to "first" {"MarkObject": "1"}, //mark the 1. sdrobject on the actual slide {"UnMarkObject": "1"}, //Unmark the 1. sdrobject on the act slide {"UnoCommand": ".uno:DefaultBullet"}, //run an uno command. This uno command toggle the default bullet type on thext marked. There are many more uno commands. Limited uno commands allowed to be used here, because some would be dangerous. For allowed uno commands, check lokunocmdlist.hxx. Note: Uno commands not worked on a windows system For layout names these can be used: "AUTOLAYOUT_TITLE_CONTENT" "AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT" "AUTOLAYOUT_TITLE_CONTENT_2CONTENT" "AUTOLAYOUT_TITLE_4CONTENT" "AUTOLAYOUT_ONLY_TEXT" "AUTOLAYOUT_TITLE_ONLY" "AUTOLAYOUT_TITLE_6CONTENT" "AUTOLAYOUT_TITLE" "AUTOLAYOUT_TITLE_2CONTENT_CONTENT" "AUTOLAYOUT_TITLE_2CONTENT_OVER_CONTENT" "AUTOLAYOUT_TITLE_2CONTENT" "AUTOLAYOUT_VTITLE_VCONTENT" "AUTOLAYOUT_VTITLE_VCONTENT_OVER_VCONTENT" "AUTOLAYOUT_TITLE_VCONTENT" "AUTOLAYOUT_TITLE_2VTEXT" Extract will: Extract all masterSlides name Extract the following for all Slides: Name, MatsreSlideName, LayoutId, LayoutName, ObjectCount, Objects. For all objects it will extract: TextCount, Texts For all texts it will extract: ParaCount, Paragraphs where Paragraphs is an array of strings. Change-Id: Icab5afe44acc30f8b75974240d8b39fd040ede2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178167 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-10math: store main viewshell id in math view shellPranam Lashkari
problem: when we enter to edit a formula a new view shell is created. In LOK all the JSwidgets would be mapped to this window id. But when LOK requests widgets we get the requests from the main viewshell and we can't find any widgets mapped to the main viewshell which means LOK can't load any widgets. Currently there's no mechanism to find the sub viewshell Change-Id: I4f9ce161101ef6815f4d9e712d9bd42f0dc83ea3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180038 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-08cool#10782 vcl lok: avoid changing the current view during YieldMiklos Vajna
Commit 520cc546e2940bdfbc45eab1e569bb06bab17a9c (cool#10782 sfx2 lok: fix bad view id on PDF export, 2024-12-20) provided a specific fix for one case where spinning the main loop can result in callbacks being emitted on the wrong view. Hunting down all the SfxViewShell::Current() calls and auditing them if they are problematic in practice is a large task, so it's desirable to handle this problem in a more generic way. Fix the problem by pushing/popping the current LOK view in Application::Reschedule(), which is what e.g. the framework/ status bar code uses during PDF export. This keeps the original problem fixed but is more generic. This requires storing function pointers in comphelper/, since normally vcl/ code can't call SfxLokHelper, since sfx2/ already depends on vcl/. The fix can be tested by reverting the original fix: git show 520cc546e2940bdfbc45eab1e569bb06bab17a9c -- sfx2|git apply -R and then running the testcase: make -C sw -sr CppunitTest_sw_tiledrendering CPPUNIT_TEST_NAME=testPDFExportViewSwitch which now passes even if the sfx2-level fix is not there. Keep that specific fix, though: the less time we assume SfxViewShell::Current() returns the correct view, the better. Change-Id: Ic1811ff1e67f73fa5066af775d31589136b8502a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179623 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2025-01-06cool#10630 doc sign: fix Impress sign line, to be able to finish signing againMiklos Vajna
Open a PDF for signing on the desktop, insert a signature line, click the "finish signing" button on the infobar, Draw first asks if you want to save your modified document as ODG, then crashes. The first problem is that opening a PDF for signing and adding a signature line / visual signature didn't result in a modified doc model, but that now happens since commit aca32a55456aa4e907b216fb490b3c15d26c3d55 (tdf#146547 sfx2: allow read-only documents to be modified, 2023-06-16). Probably we want to keep this feaature that read-only documents can be modified in some cases, so explicitly mark the PDF document as not-modified before signing in SfxObjectShell::SignDocumentContentUsingCertificate(). The other problem is that visual signing tried to reload the document: this is handy, as it shows if our PDF export worked correctly, but reloading is problematic since the signing code moved to async and it assumes that the underlying object shell is never deleted, so callbacks can have a pointer to it without worrying about the lifecycle. Fix this problem by not reloading, but clearing the marker on the signature shape and invalidating the signature status, instead of reloading, in SfxObjectShell::ExecFile_Impl(). With this, visual signing of an existing PDF file works again in desktop Draw. Change-Id: I743983947d4607aa06674a1329bc8efb5af8a6d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179821 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-31jsdialog: be sure we found entry for context menu in treeviewSzymon Kłos
Fix regression from commit 0d18454f08476475255469d23107d8a9ee6549c4 jsdialog: reduce unwanted containers after that patch we didn't get the entry because coordinates of the entry based on abs pos in the tree were negative Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I6a9e2c7acb7f02231caaeac1a861321a3a235fb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178962 Reviewed-by: Pranam Lashkari <lpranam@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-12-20cool#10782 sfx2 lok: fix bad view id on PDF exportMiklos Vajna
Have 2 views, view 2 dispatches .uno:ExportDirectToPDF, and sometimes view 1 gets the LOK_CALLBACK_EXPORT_FILE callback, which is incorrect. What happens is that the command gets dispatched correctly, but during save the progressbar gets updated in framework::StatusIndicatorFactory::end(), which calls Application::Reschedule(), which processes LOK jobs on the main loop, which may switch back to view 1, so the callback is emitted on that view. Fix the problem by reducing the duration where we work with the "current view". We know that initially the command dispatch has the correct current view since commit ee7ca8e4ea8ed93655f99e77a9e77032ac830c46 (cool#7865 sfx2 lok: fix bad view id on async command dispatch, 2023-12-20), so fetch the current view before the actual filter call and work with that view explicitly later. This is also similar to what SfxObjectShell::ExecFile_Impl() does for the bMailPrepareExport case, which also had trouble with GUIStoreModel() spinning the main loop. Change-Id: Id642056aa55831c54e88c61931753c03fa23b6b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178883 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-12-18jsdialog: reduce unwanted containersSzymon Kłos
we don't need additional container on top level which makes it harder to layout widgets Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I49532c4cd0ab8790c27e84098faa86a338da3c4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178705 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Pedro Silva <pedro.silva@collabora.com>
2024-12-17jsdialog: enable style sidebarSzymon Kłos
- disable not supported previews field, action menu for now Change-Id: Ife94ee96dd15bd92752ff6e9cc5e68243aac0851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175646 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-16enable spotlight subset in kit modeCaolán McNamara
Use the index of the style within the list of writer's instantiated styles as the indicator number to use, so this is stable regardless of what particular mode the style dialog/panel is using. Unused styles don't get a number indicator, but do have a (stable) color until they are used in the document. For kit, Para/Char style mode renders all styles, not just the subset selected in the style dialog/panel, when Para/Char spotlight is enabled. Change-Id: I513e4a676a7c4f7f542c016afa5a79d158778210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178481 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-12-16Replace workaround of resize to invalidate with an explicit SfxHintCaolán McNamara
Change-Id: Ic0c8ba5e5f65f7b1e472a667b69e737f4f1d9fbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178392 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-11added nullptr checkPranam Lashkari
Change-Id: I5658108bf39b93579072af7b865b72817481586c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178329 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-11jsdialog: send message for weld::MenuSzymon Kłos
- we need to setup correct notifier - enable context menu in the style sidebar in Writer - handle menu actions - base of vcl::Window and PopupMenu is VclReferenceBase - prepare template function sendMessage to handle both Change-Id: I54c8dc468856c0f98495bdaf4ddd504c2f56562f Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177782 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-12-11Use SvtSecurityOptions::IsMacroDisabled() instead of officecfg checkMike Kaganski
The change is most important for Viewer app mode, which also disables macros Change-Id: Ie305649dafbb3717e7986a4b437c38b09ffc1802 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178276 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-10tdf#62845: Introduce ViewerApp flag for slots, to hide in Viewer app modeMike Kaganski
Some slots make sense in read-only files, when the application runs in normal mode; but they make no sense in Viewer app mode. So this new flag is orthogonal to the existing ReadOnlyDoc flag. When it is FALSE, the respective command should not be active in the viewer mode. The default is TRUE. Change-Id: I5b5c75487fdf5a647aeab80129b6e84b42c00745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178013 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-12-10lok: use locale units in dialogs and sidebarPranam Lashkari
this patch updates fix for the dialog which were not fixed by e2708fecb34fb4084f8db5f2c5ffb4d8923002ca Change-Id: I7a9531d5af5b388cd6d763ea8c8d62ff4e7f12ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177896 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-09tdf#62845: Hide some sidebar panels in Viewer app modeMike Kaganski
These are confusing and cluttering the UI in this mode. Change-Id: I909f17f71846f5a7e82e43f078f32ed7b5daf159 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178009 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-12-09tdf#62845: Introduce an application-wide viewer modeMike Kaganski
Using the new 'ViewerAppMode' expert setting, the UI should disable all the edit controls; all options to create new content (including new documents); i.e., work as a view-only application. This change: 1. Introduces the setting. 2. Checks it in SfxMedium::IsReadOnly, making sure that all documents always have read-only medium. 3. Checks it in SfxFrameLoader_Impl::load, to prevent creation of new documents. 4. Checks it in SfxObjectShell::isEditDocLocked, to prevent entering edit mode. 5. Checks it in BackingWindow::checkInstalledModules, to hide buttons that create new documents. 6. Checks it in SfxViewFrame methods, to avoid showing "readonly" and "macros" infobars. Change-Id: Iaeeb8aab16db83ebdf500fd2bca8b8a9ac2180ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178007 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-29sfx2 lok: fix crash in SfxLokHelper::notifyOtherViewsUpdatePerViewId()Miklos Vajna
Crashreport signature: > SIG Fatal signal received: SIGSEGV code: 1 for address: 0x0 > program/libmergedlo.so > SfxLokHelper::notifyOtherViewsUpdatePerViewId(SfxViewShell const*, int) > sfx2/source/view/lokhelper.cxx:1098 > program/libswlo.so > SwSelPaintRects::Show(std::vector<rtl::OString, std::allocator<rtl::OString> >*) > sw/source/core/crsr/viscrs.cxx:514 ... > program/libswlo.so > SwWrtShell::SwWrtShell(SwDoc&, vcl::Window*, SwView&, SwViewOption const*) > sw/source/uibase/wrtsh/wrtsh1.cxx:2032 ... > program/libmergedlo.so > framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) > framework/source/services/desktop.cxx:592 I.e. it can happen that during load we don't yet have a view, similar to commit a2b22f5b551cb2030cd29d3dd3510fca42a0bfc1 (sfx2 lok: fix crash in SfxLokHelper::notifyUpdate(), 2024-11-26). Change-Id: Id17a61296a181a2ba4909b633d46a3c9d7aacb02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177513 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-26sfx2 lok: fix crash in SfxLokHelper::notifyUpdate()Miklos Vajna
Crashreport signature: > kit-09946-09946 2024-11-25 16:46:13.180120 +0000 [ kitbroker_498 ] SIG Fatal signal received: SIGSEGV code: 1 for address: 0x0 > program/libmergedlo.so > SfxLokHelper::notifyUpdate(SfxViewShell const*, int) > sfx2/source/view/lokhelper.cxx:1072 > program/libswlo.so > SwViewShell::GetSfxViewShell() const > sw/inc/viewsh.hxx:472 > program/libswlo.so > SwCursorShell::UpdateCursor(unsigned short, bool) > sw/source/core/crsr/crsrsh.cxx:2382 ... > program/libmergedlo.so > framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) > framework/source/services/desktop.cxx:592 I.e. it can happen that during load we don't yet have a view, handle this in SfxLokHelper::notifyUpdate() till it takes a pointer and not a reference. Change-Id: Ifa5d9300029076e91ba8722152a7d91a1f2ecbc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177315 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-22consider VndSunStarExpand an exotic protocolCaolán McNamara
and generally don't bother with it when fetching data from urls Change-Id: I51a2601c6fb7d6c32f9e2d1286ee0d3b05b370b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176922 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-11-21cool#9992 doc electronic sign: make return type for .uno:Signature consistentMiklos Vajna
It turns out the majority of getCommandValues() return values specify a commandName and a commandValues key, which is helpful when we don't track the request for this reply. Fix .uno:Signature to do the same for consistency. Change-Id: I46ffe5c36047ef2b59113d0221a1874ba28d335b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176896 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>