summaryrefslogtreecommitdiff
path: root/sw/source/uibase
AgeCommit message (Collapse)Author
2023-11-28use AllowedLinkProtocolFromDocument in writer/calc/impress/drawCaolán McNamara
and add some protocols that don't make sense as floating frame targets Change-Id: Id900a5eef248731d1184c1df501a2cf7a2de7eb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158910 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 11ebdfef16501c6d35c3e3d0d62507f706557c71) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158901 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit ca5225ae4a53a8e99640cfa9440e112f3b39b11b) warn about exotic protocols as well Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158902 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 1f5371361875629065a22560e39b9253eb87a23b) default to ignoring libreoffice special-purpose protocols in calc hyperlink Change-Id: Ib9f62be3acc05f24ca234dec0fec21e24579e9de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158911 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit b6062623b4d69c79e90e9365ac7c5e7f11986793) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159046 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 113e16674e94955702edde514a9fb86fbe70b3ae) reuse AllowedLinkProtocolFromDocument in writer reorg calc hyperlink check to reuse elsewhere Change-Id: I20ae3c5df15502c3a0a366fb4a2924c06ffac3d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit e6a7537762e19fde446441edd10d301f9b37ce75) reuse AllowedLinkProtocolFromDocument in writer Change-Id: Iacf5e313fc6ca5f7d69ca6986a036f0e1ab1f2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159488 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 32535dfa82200b54296838b52285c054fbe5e51d) combine these hyperlink dispatchers into one call Change-Id: Icb7822e811013de648ccf2fbb23a5f0be9e29bb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159489 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 0df175ccc6ea542bc5801f631ff72bed187042eb) we can have just one LoadURL for writer Change-Id: Ia0162ee1c275292fcf200bad4662e4c2c6b7b972 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159557 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 521ca9cf6acbae96cf95d9740859c9682212013d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159858 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit e32b8601dbd63cf01497889601d6c9c1241106d6) reuse AllowedLinkProtocolFromDocument in impress/draw Change-Id: I73ca4f087946a45dbf92d69a0dc1e769de9b5690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159843 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit f0942eed2eb328b04856f20613f5226d66b66a20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159759 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159859 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 402fd49351123c476650c7280471d05d4de85d5d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159923
2023-11-28fix build for more recent compilersCaolán McNamara
Change-Id: Ie4729f9e4b0706b1d25dfaef4f558b985561af63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159918 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-10sw: fix crash in SwHeaderFooterWin::IsEmptyHeaderFooter()Miklos Vajna
Crashreport signature: Fatal signal received: SIGSEGV code: 1 for address: 0x0 program/../program/libswlo.so SwPageFrame::GetPageDesc() const sw/source/core/inc/pagefrm.hxx:144 program/../program/libswlo.so SwHeaderFooterWin::IsEmptyHeaderFooter() const sw/source/uibase/docvw/HeaderFooterWin.cxx:403 program/../program/libswlo.so SwHeaderFooterWin::ShowAll(bool) sw/source/uibase/docvw/HeaderFooterWin.cxx:273 program/../program/libswlo.so SwFrameControl::ShowAll(bool) sw/source/uibase/inc/FrameControl.hxx:49 Change-Id: I3c1a6f46c7a15c2ca1a3db69a14d49abbea8c879 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134640 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit c60bbd7a90a9281b02496099759584109e931f2b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142453 Reviewed-by: Aron Budea <aron.budea@collabora.com>
2022-11-10sw: fix crash in SwTextShell::Execute()Miklos Vajna
Crashreport signature: SwTextShell::Execute(SfxRequest&) sw/source/uibase/shells/textsh1.cxx:1540 SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:256 SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) sfx2/source/control/dispatch.cxx:811 SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) sfx2/source/control/unoctitm.cxx:671 This is the Grammar case, the Spelling case already checked for an empty xDictionary reference. Change-Id: If1f88e4bdf2d68d877fbb0bd89d0cadbd493771f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137161 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit d5b0d5b1aa379d7cc758f6206ac9b3143868f75e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142450 Reviewed-by: Aron Budea <aron.budea@collabora.com>
2022-09-29sw: fix format brush to override old formatSzymon Kłos
It should not only add attributes but replace old direct formatting with new one (character format). Change-Id: Ieac5c3d8c00b93ee08c74a36ea2ce4938915a2b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139216 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 2515ada695e9dbb92c3a228d0466d76b23a6185d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140380 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140708
2022-09-29sw: fix format brush to reset the font strikeout attributeHenry Castro
The format brush always inserts attributes to a set, it should be intersected. For a special use case, ugly hack to reset the font strikeout attribute. Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: I94c172e61b3d6d3339b1243a9344952b5c59d872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138839 Tested-by: Jenkins Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com> (cherry picked from commit 576ba26d09448f8bc332acdf6d17061e8ad552a3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140376 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-08-19added nullptr guardPranam Lashkari
solves the segfault introduced in d365da2c4 Change-Id: Ic9ab0c9e18a562cdc2120b1e1300c9b44e3f0900 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138513 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2022-08-18sw: online: make sure commment removal notification is sentPranam Lashkari
problem: when comment is added inside a table in online, and entire table is deleted, comments were not removed due to notification not being sent. Another failed case was when some text with comment is copy pasted, and then pasted text is undoed, text was removed but comment stayed. This patch will notify comment removal before actaully distroying the comment/note Signed-off-by: Pranam Lashkari <lpranam@collabora.com> Change-Id: I70aad7eb421b4bde52b9e54855e2360c59807852 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138398 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138464
2022-05-17forcepoint#104 sw: do not delete fieldmark chars in MoveNodeRange()Michael Stahl
The problem is that SwXTextTableCursor::mergeRange() wants to move some nodes, and the deleteMarks() deletes a fieldmark creating a SaveBookmark but it contains the positions relative to the CH_TXT_ATR_FIELD* still in the text, while deleting the fieldmark of course removes these. The SaveBookmark would need to adjust the indexes and store the separator position too and the vector would need to be restored in reverse order. But every time the SaveBookmarks are created, they are restored as well, so it looks simpler to just suppress deleting the CH_TXT_ATR_FIELD* in this case, and inserting them too (latter is already done when copying text). Change-Id: I690c6432a38eab6dec10adff74e638f0e52cca55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132531 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 5d41c2461642364b7159398024acccbee12f6e3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132589 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-10sw: fix crash in SwDrawShell::Execute()Miklos Vajna
Crashreport signature: SwDrawShell::Execute(SfxRequest&) [clone .cold] include/svx/svdhdl.hxx:194 SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:255 which is a bit tricky to read (probably due to LTO), but what happens here is that the handle index is user input and we look at index up in a list without error handling. This is a problem since commit 7eed711a6115bf892c998cbd73a2c5b706c6f99d (Extended MoveShapeHandle command for Anchors as well, 2021-05-24), which assumed that handle indexes and the handle list can't get out of sync. Fix the problem similar to what commit 48beccf52413981d3d1c525a81a2c57048abe261 (sw: fix crash in SwView::Execute(), 2021-09-03) did at SID_MOVE_SHAPE_HANDLE handler for Writer images (this one is for Draw shapes). This fix just makes sure we don't crash, there may be some deeper reason why the handle index is out of sync with the handle list in the first place. Change-Id: I8f3a25d74082984cedce09362a690f24d7236ba6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134046 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-24Make accessibility check dialog asyncNickWingate
Signed-off-by: NickWingate <nick.wingate@collabora.com> Change-Id: I88913b3d7e580a1d8c69a39454f2598e11ba43ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130438 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2022-02-23fix Writer key event delayed compression (tdf#145963)Luboš Luňák
SwEditWin::KeyInput() was stopping the flush timer on every invocation, which means that as long as key events kept coming the timer would be started again and again and would not time out, and so the input buffer would not be actually processed. It seems that AnyInput(KEYBOARD) there actually does not normally manage to return true ... except for Win11 where it seems that now GetQueueStatus() detects even key-up events even though it didn't before (I've not debugged this enough to be certain). I think it still makes sense to have the compression in case Writer get overloaded to help it process the pending input events, so fix this (but if there are problems, I think an easy solution is simply to drop it, it doesn't seem to be that necessary). Also decrease the timeout from 200 to 20ms, as 200ms is a very visible delay. Change-Id: I760ad9c4f58726a80bd6a9fbf93f2771f10cbdb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130083 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130251 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-05Add graphic size checker for the preferred document DPITomaž Vajngerl
This change adds a graphic size checker, which checks all the images in the document, if they largely differ (outside of 50% and 110% of the image size) from the set preferred image DPI document setting. For all images that don't fall under this bounds, list them in the dialog and offer the posibility to select/goto the image and pop-up the properties dialog for the image to change its size. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127094 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 046e6cfa544d2ffd67fd29ba7dde41b495744618) Change-Id: I06efce77c291fdb6ec3864d72c2f4d15dba9c42b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127239 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-05Add image preffered DPI document setting, use it in Writer, ImpressTomaž Vajngerl
This adds a "image preferred DPI" document setting, which is used as a suggestion of the DPI that an image should have in the document. This is currently used when the image is inserted into the document (Writer, Impress/Draw) to resize it to the preferred DPI value. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126334 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 4c00e8fb10437fcaefe8635ef390b78376938d15) Change-Id: I3ee9d409257e3c6aa2ead05144ecbba7b3b916f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127238 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-09lok: don't limit line length in HTMLWriterSzymon Kłos
Problem: https://github.com/CollaboraOnline/online/issues/3645 Test case: 1. Open Collabora Online and paste "Alphabet" section from wikipedia article: https://en.wikipedia.org/wiki/Estonian_language#Alphabet 2. Select last two sentences (starting from "The letter") 3. Open Insert -> Hyperlink dialog Result: notice that some spaces was removed/converted into new line Expected: Text field should contain original text Hyperlink dialog uses current selection which is get as HTML from the core. In the SwHTMLWriter there is a parameter defining how long line should be and it replaces ' ' space into '\n' new line when limit is reached. This patch turns off that feature but only for getting html for current selection in LOK case. For now don't remove new line at the beginning as cypress has to be fixed first. Added FIXME in the code. Change-Id: I03b540b0b2d639a08774ecc4fc75abb7b3f0b7a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125482 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-11-13sw, out of order undo: allow multiple actions from other viewsMiklos Vajna
Previously we assumed that the action to be executed is always exactly the top of the undo stack minus 1 element. Extend this, so that in case an other view appends two or more elements to the undo stack, we still find our undo action. Obviously only do this if all those undo actions are independent from us. This requires replacing the swap in svl/ with a move-out + move a range down + move in construct. (cherry picked from commit 39f231360013e944a8713248359662b9f282d902) Conflicts: sw/source/core/undo/docundo.cxx Change-Id: Ic12d32d6eb5e77618d99eddb4fa096802f32d655 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125102 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-12Fix -Werror=shadow in basesh.cxxAron Budea
sw/source/uibase/shells/basesh.cxx: In member function ‘void SwBaseShell::ExecUndo(SfxRequest&)’: sw/source/uibase/shells/basesh.cxx:564:29: error: declaration of ‘rView’ shadows a member of ‘SwBaseShell’ [-Werror=shadow] 564 | SwView& rView = rWrtShell.GetView(); | ^~~~~ In file included from sw/source/uibase/shells/basesh.cxx:63: sw/source/uibase/inc/basesh.hxx:41:18: note: shadowed declaration is here 41 | SwView &rView; | ^~~~~ Since c72e500ccaf0ce2261c5233b80fba9342778f810. Change-Id: I5fda3ad4805dc59a9e0e01dd262c09952a2bc97e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125077 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Aron Budea <aron.budea@collabora.com>
2021-11-12make it explicit whether to ignore the result of getLOKPayload()Luboš Luňák
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 <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-11-11lok: no need to layout comments in writercp-21.06.6-1Szymon Kłos
Annotations in writer use EditEngine what caused to send cursor position from that EditEngine to online and showing cursor in the top left corner of a document after comment insertion. We don't need to resize/update position comment windows as we send only abstract description of the comments and later rendering is handled by client. Change-Id: I1df0e44f9500c438efd00942a372754c7fbaa170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124794 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-11-11sw: allow undo of typing in 2 views independent from each otherMiklos Vajna
Undoing out of order is dangerous by default, so limit this to a very specific case as a start, that allows growing in follow-up commits. For now, allow out of order undo if: 1) redo stack is empty 2) we're in LOK mode (different views represent different users) 3) we undo a single action (count is 1) 4) the top undo action doesn't belong to the current view 5) the top and the previous undo actions are independent Which only requires that SwUndoInsert::UndoImpl() is independent for two different paragraphs, which seems to be the case. Independent undo actions opt in for this, currently the only such allowed undo action is SwUndoInsert ("typing"), which adds characters to a single text node. Even those are only considered independent if they operate on different text nodes. On the positive side, this allows out of order undo in the frequent case where two users collaborate on a long document and they just type some new content into the document at different paragraphs. (cherry picked from commit 8e8e72f08b01a284cf1a90b888d48acfb6a33d2e) Conflicts: sw/source/core/inc/UndoManager.hxx sw/source/uibase/shells/basesh.cxx Change-Id: Ibb4551e8f7046b4947491b8bf751eaa0cbb2d060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124955 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-25use pull model also for LOK text selectionLuboš Luňák
Make LOK_CALLBACK_TEXT_SELECTION, LOK_CALLBACK_TEXT_SELECTION_START, LOK_CALLBACK_TEXT_SELECTION_END and LOK_CALLBACK_TEXT_VIEW_SELECTION also use pull model, i.e. LO core will only set a flag and when CallbackFlushHandler needs the actual data it'll use getLOKPayload(). This again avoids a large number of messages passed to CallbackFlushHandler only for them to be sooner or later discarded. Change-Id: Ia7528039be996a6e9e8491b4eba3f4133582fa56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124147 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-24change some LOK internal updates to be pull model instead of pushLuboš Luňák
Some LOK messages may get called very often, such as updates about cursor position. And since only the last one matters, they get generated every time, which costs some time, and then later except for one they get all discard again from CallbackFlushHandler queue, which again costs time. Change the model to instead only set an 'updated' flag, and CallbackFlushHandler will request the actual message payload only before flushing. This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way. Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124084 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22sw: fix crash in SwXTextDocument::postMouseEvent()Miklos Vajna
From crashreport: SIG Fatal signal received: SIGSEGV SwXTextDocument::postMouseEvent(int, int, int, int, int, int) sw/source/uibase/uno/unotxdoc.cxx:3559 doc_postMouseEvent desktop/source/lib/init.cxx:4245 Make sure we don't crash when a mouse event is posted on a disposed document. Change-Id: I3fb123460b21bf8fe21406d1745f43270102af33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123947 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124044 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-20tdf#134426 tdf#138873 sw: Revert "tdf#79717 ...Justin Luth
...save/restore character format on selection overwrite" which might also fix tdf#144638 as well. This reverts LO 6.3 commit 6abed0ea006f3616e40faf2ae782cf64f8ac2914. This 6.3 fix for bug 79717 has caused too many other problems that are not being looked at, so it should just be reverted. It is spamming documents with direct formatting which is a terrible thing to have happen by accident. It completely wrecks the proper use of styles. Also revert asscoiated follow-up commits: Revert "tdf#79717 save/restore character style on selection overwrite" This reverts commit 6.3 04bd1925706360414438b814046b543c5e317d0a. Revert "tdf#79717: sw_uiwriter: Add unittest" This reverts commit 7.1 b05955b480fe4d32852e7be8a118d46ca7e6dbfa. These effectively revert 7.0.4 12eac5bcbc9b71bf00cb88b918988826229cca35 but its unit test is left intact. Change-Id: Ideced4d38bfdf4c82f1744534afbaad29689fded Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123566 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123577 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-15delay, collect and compress LOK invalidations for Writer viewsLuboš Luňák
Due the to way views are updated on any document change, invalidations are at least O(n^2), and since LOK may use a number of views and for each view the entire document is considered to be the view area, this can lead to a huge number of invalidations that are mostly the same repeated rectangles. Change-Id: I63682958d2fc388344641dcd19fa1d2b39054b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123618 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-30Resolves: tdf#143777 Exclude recipient is always greyed outCaolán McNamara
Change-Id: I6ce94fad6ba518457665ae6d6b473cfe6f80849f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121883 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-20sw: fix undo manager de-registration from editeng on shutdownMiklos Vajna
editeng/ asserts in the ImpEditEngine dtor that the undo manager it owns is indeed an EditUndoManager, and not a subclass. This means that if a subclass is set as the undo manager of editeng, then SetUndoManager() should be called in pairs: once to set it and once to unset it. The unset should happen before destroying the EditEngine. This normally works because SwView either has an active text edit and then its dtor calls SdrEndTextEdit() or it doesn't have an active text edit. The broken case was when the text edit was already ended, but the draw view still had a text edit outliner, which has an EditEngine, which knows the sw undo manager. The product build deleted the sw undo manager when deleting the EditEngine, and then later when the SwExtTextInput dtor wanted to access the sw undo manager, it crashes due to use-after-free. Fix the problem by explicitly disposing the undo manager of the draw view in the dtor of SwView. Also fix a couple of more places where an SdrObject* is returned and we didn't check if the result is a nullptr. Caught by the loolstress tool in online.git: cp test/data/hello-world.odt /tmp/test.odt ./loolstress ws://localhost:9980 /tmp/test.odt test/traces/writer-hello-shape.txt /tmp/test.odt test/traces/writer-hello-shape.txt /tmp/test.odt test/traces/writer-hello-shape.txt /tmp/test.odt test/traces/writer-mash-text-table.txt /tmp/test.odt test/traces/writer-mash-text-table.txt (cherry picked from commit 2bf269745bed9fefe32122fc432e239949bdf605) Change-Id: Ib838b2adf900b4f3bec63d2d62d432327bc0c6c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122151 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-16improve LOK notifyInvalidationNoel Grandin
(*) tweak buffer in SfxLokHelper::notifyInvalidation to be a bit larger, so we avoid the cost of a resize&copy (*) use our optimised OString concatentation instead of going via std::stringstream (*) pass down a pointer to rectangle, instead of a string. later we will use this to avoid doing the stringify until later Change-Id: Ia3e3042bc919d9b9cb80e47a93704eb236438605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119994 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120072 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 417f881d20cafe88a02b64894ba4483875fb9460) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122123
2021-09-08explicitly send LOK_CALLBACK_TEXT_SELECTION at the end of FindAllLuboš Luňák
It normally gets emitted by SwSelPaintRects::Show(), called from paiting, but Online uses tiled painting and so doesn't need normal painting. Change-Id: If276ce176f4e65b4efe3d053941b83917df2ae1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119268 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-03sw: fix crash in SwView::Execute()Miklos Vajna
Crashreport: program/../program/libswlo.so SwView::Execute(SfxRequest&) sw/source/uibase/uiview/view2.cxx:1312 program/libmergedlo.so SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:263 /opt/collaboraoffice6.4/program/libmergedlo.so SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) sfx2/source/control/dispatch.cxx:760 (discriminator 3) /opt/collaboraoffice6.4/program/libmergedlo.so SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) sfx2/source/control/dispatch.cxx:819 Change-Id: I2e7b27f458971dbd33971589f71337c59981ee83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121547 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121604 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-02indexing: move xml parsing into SearchResultLocatorTomaž Vajngerl
Let's keep unneeded complexity out of SwXTextDocument, so move parsing into SearchResultLocator. As a bonus we can now test parsing. Change-Id: I944bfc43e6953523eee19b26b7f483aa401809aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121032 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 0b698aa6eb26d75ca4baf677a461aee095f69317) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121116 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-09-02indexing: allow for multiple entries in search indexing dataTomaž Vajngerl
Change-Id: Idb9bbbaa940b7cd48423c6cc65b9c7d0b94f57dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120396 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit adf65471e889676a600a9c6d0454c75cbd549ad3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121114 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-09-02indexing: use XML as input that is identical to indexing XMLTomaž Vajngerl
Change-Id: I2242b4bd77220b55e67c2e0f0fe54f008759d282 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120194 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 7da5537f6a43c1b82afc5e0c8d18b8d847293fda) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121113 Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-02indexing: add support for SdrObjects in SearchResultLocatorTomaž Vajngerl
Also add (node) "type" parameter because we need to differentiate between Writer nodes and SdrObject nodes. Change-Id: I590695ae71781f64c22bdd7e1df01d69e3376e67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118671 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit ea1818b8ba34378b777b8706069d28fade2cc924) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121111 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-09-02indexing: add LOKit API to render the search result into a bitmapTomaž Vajngerl
This adds a new LOKit API to render the search result into a bitmap buffer. It combines the SearchResultLocator to get the location inside the document of the search result (a series of rectangles) and the existing LOKit paintTile API to render the result into a bitmap (byte) buffer. It also adds a LOKit test to show how the API is used and to render a search result of a example document. Change-Id: I4284d90188777fd28158d029daa04151e71022bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118670 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit e1511ce551f27a5560600029193f076fd65ece17) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121110 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-08-24rhbz#1996735 SwEditShell::GetCorrection can return nullCaolán McNamara
Though the exact steps to reproduce are unknown. From the text seen in the backtrace the language is possibly Finnish in which case voikko is probably the spellchecking backend in use. Change-Id: I9b3186e4699946235ccc161575bba7d4a3820565 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120879 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2021-08-24tdf#143778 these async callbacks expect to have SdrModel::IsChanged of falseCaolán McNamara
when they are entered. They are adapted from the original non-async SwDrawShell::ExecDrawDlg where the start of SwDrawShell::ExecDrawDlg has... bool bChanged = pDoc->IsChanged(); pDoc->SetChanged(false); and the end has if (pDoc->IsChanged()) GetShell().SetModified(); else if (bChanged) pDoc->SetChanged(); and before async dialogs the start and end happened before and after the dialog appeared and disappeared. The intent seems to be unset the sdrmodel-changed and restore its original state if the dialogs caused nothing to happen and to explicitly set SetModified on the document if something did. Now the async dialogs callback happens after SwDrawShell::ExecDrawDlg has ended and so the callbacks start with SdrModel::IsChanged at its original value (restored by the end of ExecDrawDlg), not the "false" they were originally written to expect. For simplicity set the SdrModel IsChanged to false at the start of the callbacks and continue to restore to the passed in bChanged state if there was no changes by the callback. Change-Id: I671b35acab6d1b391fa7e6590c09f8be135449b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120548 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit c64f221fc2e22ffa60c4d78240893f7f04531b3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120576 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-08-24tdf#139811 trigger layout when content changesCaolán McNamara
in writer styles panel of page deck which is similar to the draw case of tdf#143795. Doing this always in PanelLayout::queue_resize might make the most sense rather than these manual triggers, but do it this way initially for a safe backport. Change-Id: I4bd2e9cb9d52b66a73cd0615406052e19e6e8b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120369 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-08-20LOK make sure single row/column table are resizablePranam Lashkari
First row/column are treated as heading in the table, that's why need some special case handling for it First row/column are not counted in regular row/column Change-Id: If67b759911ea87f2b166a69243b85e98d90c4d22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120672 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-08-16undo blocking emitting focus events during grab_focusCaolán McNamara
revert... commit f97dbac73fe149e8fed0932890d0c1d6be4869a3 Author: Caolán McNamara <caolanm@redhat.com> Date: Wed Jun 26 21:00:02 2019 +0100 infinite focus changing in toc biblio page which blocked calling focus-changed callbacks when grab_focus is called explicitly analogous to how we block value-changed callbacks setting values through code but don't block them when the value is changed by user interaction. In retrospect that was a poor choice, so revert that and subsequent workarounds in favour of just not calling gtk_grab_focus if the widget already has focus. checked: a) tdf#138427 focus set to wrong input box b) tdf#138078 only call GetFocus if we gained focus from an unfocused state c) tdf#137993 ensure the toplevel vcl::Window is activated d) tdf#136941 call focus in handler explicitly Change-Id: I411480e2d627aa9995fb41b0aa17e9fb6d34d73f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114524 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit db1cf111666847ce5ce93d18ae5ae8c29a4c44d6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120079 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Caolán McNamara <caolanm@redhat.com>
2021-07-19sw: xDictionary may be an empty reference in SID_SPELLCHECK_IGNORE_ALLMiklos Vajna
Seen in a crashreport: handleFatalSignal ./common/SigUtil.cpp:255 /lib/x86_64-linux-gnu/libpthread.so.0 __restore_rt ??:? program/../program/libswlo.so SwTextShell::Execute(SfxRequest&) sw/source/uibase/shells/textsh1.cxx:1496 Change-Id: I709f361a1396abbb07cea06509afc41bb5f5c9a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119006 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119061 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-07-11Remove warning while buildingdante
Operator >>= from any does not guarantee initialization, so compiler warns you. Value defaluted at 0. Change-Id: Icecc765be73bb653f0167958e319a1417df6ac86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108485 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit edc7a8a372a689802a583092ff0da0f60b6dbf97) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118584 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-02fix potential use-after-free in SwClipboardChangeListenerNoel Grandin
we think we're seeing this in COOL Change-Id: I29a287b032158076a99a836d98113d1623ebef99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 558dface96fbc5f487b16cfa1bf3c3ea20776331) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118269 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-06-24tdf#142925 render the button arrow like it used to beCaolán McNamara
in 7.1 Change-Id: Ibbe4b7dd2212d1bc28bad7588672bb37c8259605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117417 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 0389e2eb50ddc0f83bfa4469861592165ea911de) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117755 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-06-24tdf#140934 update annotation menubutton bg when comment color changesCaolán McNamara
Change-Id: Ia4d10a8f19c039655dbe28c5f612061ce3755afa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112278 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 47ad7497f736b27c23667e0754cd686b78b60744) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117754 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-06-23tdf#142852 forward surrounding-text requests to an active drawing editengineCaolán McNamara
when present. As we do for related CommandEventId::[StartExtTextInput/EndExtTextInput] Change-Id: Ie5b57c8a8a1a258efc2be079a2674b1ca620dc9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117421 Tested-by: Jenkins Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-23Related: tdf#140409 scale the menubutton like the other widgetsCaolán McNamara
Change-Id: I6b42ef958dd1625cfef5e48e45c932aef9a5960f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111211 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117463 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-06-23tdf#140409 Comment text ignoring zoom sizeCaolán McNamara
Change-Id: If48d5c1085cbc86f81ba0c92c8875ef534900c15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111165 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117462 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-06-17Resolves tdf#142513 fix zoom caller handlingJim Raykowski
Calling ZoomPlus has always executed shell SID_ZOOM_OUT case handling. ZoomMinus, which replaced ZoomIn, does SID_ZOOM_IN case handling. This patch changes ZoomPlus to do SID_ZOOM_IN case handling and ZoomMinus to do SID_ZOOM_OUT case handling and makes appropriate changes required by these name changes to provide expected zoom results in all module shells that have handling for these calls. Change-Id: If148f4f7866bfc8fc6452ad1c1dace723a125ef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116287 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com> (cherry picked from commit ec629c5ee22d02f99d66a5cf975ce239876b7f4d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116702 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-14Assert on valid order of which ids in ranges on SfxItemSet creationMike Kaganski
This allows to make sure we actually use sorted which ranges, and then it's safe to call SfxItemSet::MergeRange when needed. Also this change relaxes the previous requirement that ranges must be separated by at least one; this allows to have adjacent ranges, like in RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_BEGIN, RES_GRFATR_END-1, where RES_FRMATR_END is equal to RES_GRFATR_BEGIN. Allowing this makes possible to (1) self-document the ranges, so it's clear which ranges are included; and (2) be safe in case when these constants would change, so that the one merged range would not unexpectedly contain everything inserted between RES_FRMATR_END and RES_GRFATR_BEGIN. Change-Id: Iaad0f099b85059b3aa318a347aa7fbd3f6d455c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116909 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117106 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>