summaryrefslogtreecommitdiff
path: root/sw/source/core
AgeCommit message (Collapse)AuthorFilesLines
2018-10-04sw: fix copying of PageDesc follows in SwDoc::AppendDocMichael Stahl1-9/+35
The problem in the bugdoc is that there are 2 styles; "First Page" has "Default Style" as the follow, and vice versa. When the "First Page" style is copied, its follow is copied as well, but the follow of the follow doesn't point to the *new* "First PageN" style that was just created, but the original "First Page" one. Change-Id: Ie5b0064581a585a3a545360ea5c05f60652f0d4e Reviewed-on: https://gerrit.libreoffice.org/60993 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit a6a4fa526b8ad19ff6d44a89ee56d4268c8e90be) Reviewed-on: https://gerrit.libreoffice.org/61062 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-20sw: fix return value of DocumentRedlineManager::AppendRedline()Michael Stahl1-1/+8
If a footnote is inserted, a redline that includes the start/end node of the footnote is created, but that is not a valid redline (as far as HasValidRange() is concerned), so instead a different redline without start/end nodes is inserted, but pNewRedl is reset and so AppendRedline() returns IGNORED, and then we get an assert in Undo from SwRedlineSaveData::RedlineToDoc(). Change-Id: I92253e1a40ba98e34e0bca601b4e3b6ef3751b08 (cherry picked from commit deacee23d9530350988eef68b0e9bb5cfcf2fde3) Reviewed-on: https://gerrit.libreoffice.org/60750 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-20sw: SwRedlineTable::DeleteAndDestroy() is surprisingly dangerousMichael Stahl1-23/+32
At least with the randomised test, it can happen that deleting one redline will recursively delete other redlines that are located in the hidden content section of the redline, or at least try to and crash because those have already been deleted before. The callers will either delete 1 redline, or delete all of them via DeleteAndDestroyAll(), so put a safer loop into DeleteAndDestroyAll() and have DeleteAndDestroy() only delete 1. Change-Id: I9c4225544a43a4a03f4eb7b6f56e7fe848c8ca54 (cherry picked from commit 471212d464f54054f7419ef1890267d0def852d9) Reviewed-on: https://gerrit.libreoffice.org/60749 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-20sw: fix 0-length delete redlines in SwUndoSaveSection::SaveSectionMichael Stahl1-7/+11
The delete redlines aren't restored properly on Undo because they are squashed into a point by DelBookmarks. (regression from 6af2caab7271e11d9501fd6a597e05194d33fd10) Change-Id: I34ea66b5ab0d441c42570e25ea374cb2d0cfc780 (cherry picked from commit 251b88be7fdca54c38cc7632a85184577f719180) Reviewed-on: https://gerrit.libreoffice.org/60745 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-20sw: fix usage of wrong string in SwUndoOverwrite::RedoImpl()Michael Stahl1-1/+1
At this point the "aDelStr" is in the document, don't use invalid index. Change-Id: I0aae8839e9669e3a474266a345b54a1e7e6db38f (cherry picked from commit a44d7917655dfec3f6a101752c68de8c46aeb822) Reviewed-on: https://gerrit.libreoffice.org/60748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-20sw: avoid asserts from SwSortedObjs::Insert()Michael Stahl1-1/+4
The first frame is almost certainly already inserted in line 2057; This causes "<SwSortedObjs::Insert()> - already contains object". Change-Id: I4a785accdec033865da971bf25d0ebe06ec2e765 (cherry picked from commit 7f406cbacf9c3abc45c7241535472ffab807e2f0) Reviewed-on: https://gerrit.libreoffice.org/60744 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-20tdf#119770 nullptr GetGraphic returnCaolán McNamara1-1/+2
Change-Id: I9e76b6704e7f82cd9d200ed6c5802101de264242 Reviewed-on: https://gerrit.libreoffice.org/60685 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-18tdf#119875 sw: fix invalid pos of frame after 0-sized section with laycacheMiklos Vajna1-4/+24
The interesting part of the layout of page 2 is: - frame #40 is a section frame with a text frame which is in a list ("A") - frame #48 is a section frame after that, with the same top=19213 Given that frame #40 has height > 0, they overlap when the page is rendered. What happens is: - frame #40 grows - there are other section frames between #40 and #48 in-between, but they don't have an SwSection - these frames are skipped - then the position of #48 is invalidated So the next time we calculate the position of #48, we look the last skipped (previous) section frame (which still has top=19213, since its position was not invalidated above), and since its height is 0, we conclude that our current top=19213 is valid after all. This is like this since commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62 (initial import, 2000-09-18), so leave the code there that invalidates not only the next frame, but all the way down to the first non-SwSection-less-SwSectionFrame. But instead of just invalidating the last frame, invalidate the in-between SwSection-less-SwSectionFrames as well. In practice this did not cause a problem in case the document has no layout cache. If it does, then the frames are created on pages hinted by the cache, then later moved to their final place. In practice this bug was visible only in this later case. (I.e. such a layout cache can be only created if the machine that saved the document last time does not have the fonts needed by the document installed; and then the document is opened on an other machine which has those fonts.) (cherry picked from commit b5937112d4035fb9ffb472e1bf36567d9c78c820) Conflicts: sw/qa/extras/layout/layout.cxx Change-Id: I02ae9f63d0b4b5e9d014df53ed2cf21a04b15090 Reviewed-on: https://gerrit.libreoffice.org/60590 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-09-17SOSAW080: Derive SdrObjGroup from SdrObjListArmin Le Grand9-28/+28
Also simplify parent/child relationships, get rid of double data (SdrPage/Parent infos in SdrObjects, also in SdrObjList). This is all not needed - when a SdrObject is inserted to a SdrPage, get SdrPage by traveling over parents (no double info, member as soon as inserted, ...). More cleanups/reworks included, will need some more cleanups, too. Stabilizing: SetRectsDirty/DefaultStyleSheet Had to correct the SetRectsDirty stuff for 3D due to going down the hierarchy while the 2D implementation goes the other direction -> endless loops. Added special handling for 3D stuff for now (will be chnaged again when SnapRect is no longer needed at SdrObject level). Also had to adapt how the DefaultStyleSheet is set at incarnated SdrObjects - better: their properties. Since we now always have a SdrModel, it is possible to correctly initialize with the correct default StyleSheet from that SdrModel. This needs to be done after ForceDefaultAttributes and in a way that again deletes Items that are set in the StyleSheet. This leads to an error in CppunitTest_sd_import_tests where I checked tdf100491 - it is okay and thus I change the control instance of the imported, XML-dumped file. The less hard attributes, the better for Styles in general. Cleanup of comments for last two commits Corrected SvxShape::getParent() Needed to get the direct parent, so test for SdrObject first (to get SdrObjGroup/E3DScene), for SdrPage second Fixed CppunitTest_sc_subsequent_export_test Several problems arose. The used SdrCaptionObj was Cloned, but the clone not inserted to a SdrPage. This leads to not being able to access a UNO API imlementation of the SdrPage (SvxPage) on lower levels. It worked before due to SdrObject having a SdrPage* additionally to being added to a SdrPage - this is exactly the main cleanup this change does. Looked for why it is cloned, could see no reasons. The SdrCaptionObj exists during all im/export, not difference to other SdrObjects (that do not get cloned). It is not changed in any way. It *might* be to suppress a crash that happened due to UNO API Service emfio/emfio not being available in the UnitTest scenario. Interestingly it did not crash with the cloned SdrCaptionObj, but the Graphic exported was probably wrong. Fixed by no longer Cloning the SdrCaptionObj and adding emfio/emfio UNO API Service. d139f821a5b39535a3e7b9c6261df7e18f8ae8ac 910e7f4bc628a715fda7545dffaf3369d5e76ea0 ca1de01b723051e09ac37d7ec7bba978beea41c5 3a76da1471dfe75e69847f64a6a3519ad21c8c9c Change-Id: I986586e326b563acebf00d931a7084c6eb09e5f8 Reviewed-on: https://gerrit.libreoffice.org/54689 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> Reviewed-on: https://gerrit.libreoffice.org/60535 Tested-by: Jenkins
2018-09-10sw: tdf#119742 fix null pointer in SetCursorInHdFtJuergen Funk1-1/+2
In SwWrtShell::ChangeHeaderOrFooter the ChgPageDesc destroys the frames of the header, that's why GetCurrFrame returns null later. Change-Id: I26915237c8b455a5b8ad0bbd5c2de38537dfef08 Reviewed-on: https://gerrit.libreoffice.org/60130 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 77d075facaf4fc8954666ad541ed14f75d964fba) Reviewed-on: https://gerrit.libreoffice.org/60249 Tested-by: Jenkins
2018-09-03Resolves: tdf#119607 crash in calling getPropertyState on TextParagraphCaolán McNamara1-2/+5
Change-Id: Ib7091473e3547241e95dc3d3921abf650f288aff Reviewed-on: https://gerrit.libreoffice.org/59825 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-03sw TextGraphicObject: handle XBitmap for GraphicURLMiklos Vajna2-1/+8
This restores compatibility for API users who called getByName() on the bitmap table and expected that the result can be set as a value for the GraphicURL property. Changing the property type to cppu::UnoType<css::uno::Any>::get() is necessary, otherwise scripting languages figure out (via reflection) that the type doesn't match, and SwXFrame::setPropertyValue() is not called. Change-Id: Idd62f109e91dbaebf1138b9038f66c6c648d780e Reviewed-on: https://gerrit.libreoffice.org/58745 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins (cherry picked from commit 587803ba46055d43b5b108be744fdde17aeabc7c) Reviewed-on: https://gerrit.libreoffice.org/59850 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-03sw TextGraphicObject: fix GraphicURL handling in the descriptorMiklos Vajna1-0/+10
Commit dfee7d93b4e863d673c45921f79bb876b5738ea6 (sw: get rid of FN_UNO_GRAPHIC_U_R_L and "GraphicURL" property, 2018-03-08) removed support for string-based graphic references, then a later commit restored the setter. But one scenario (when setting the graphic URL before inserting the text graphic object) was still unsupported for real URL setter; restore that as well. (cherry picked from commit bba0ccd743a3d023e4829155571cdf0318fcb81c) Conflicts: sw/qa/extras/unowriter/unowriter.cxx Change-Id: I52a7f96e820f614d9d031df3ba03c794984ad68b Reviewed-on: https://gerrit.libreoffice.org/59849 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-02tdf#118845: make HiddenPara have higher priority deciding visibilityMike Kaganski3-19/+40
Otherwise, a Database field in a paragraph which is non-empty would force the paragraph to be visible, regardless of HiddenPara field telling it to be hidden. Regression from commit db04be037b611e296ef9f2542322c52ed82d7a2b Change-Id: I21807e22bd339fd1ea0aaa3b382579f688903418 Reviewed-on: https://gerrit.libreoffice.org/59792 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 64cb57c82d9e7f7069821b2e2ef92574ec73ebe2) Reviewed-on: https://gerrit.libreoffice.org/59865 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-08-31Fix syntaxJulien Nabet1-1/+1
Change-Id: I21cca2e5cd81ee58a59fda077ed40ba02d9f1df3 Reviewed-on: https://gerrit.libreoffice.org/59844 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 49d1a2f70bb8c099f1a950e5ad9f805d252ea342) Reviewed-on: https://gerrit.libreoffice.org/59847 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-08-29tdf#119458 reorganize sw background Idle handlingJan-Marek Glogowski2-23/+30
This is the squashed version of the following commits: - ce68889678bc tdf#119458 always start the SwDocIdle - 107f0e6dba57 tdf#119458 fix sw background Idle state handling - 771544544ee1 tdf#119458 fix sw background Idle unblocking - 3bd8316718fd tdf#119458 just wakeup Scheduler on active Idle While the first commit was really wrong, the third is just an optimization to prevent unnecessary wakeups and Idle task interrups from new calls to StartIdling(). The 4th one contains the reset of the Idle state on run, which was probably the main origin of the problem and allows to wake up the Scheduler without moving the Task to the end of the queue. Starting the SwDocIdle in StartIdeling() just reintroduces the bug fixed in commit 401cba4c20fb ("tdf#116370 cleanup Writer idle job handing"), so trading one bug for the other. For the real solution we have to handle two states: 1. The SwDocIdle being active 2. The SwDocIdle being blocked For the first state we can just use the active state of the Idle itself. Since it's not a AutoIdle, it will be turned of, if invoked. Either some Idle handler will want to be run it again or some other thread might start it again, if needed. Since we're now tracking the wanted Idle state via the active task flag, we can drop the explicit mbStartIdleTimer handling. As a result of the first change, we can't stop the Idle anymore when blocking it. But the Idle itself checks its ready state via IsDocIdle() in its UpdateMinPeriod function, so we have to add the blocking state to IsDocIdle(). But we can't handle the correct state when blocking via a tasks mbActive bool, as this also schedules the task and starts the scheduler timer. So reintroduce a bool for the unblock state. This should prevent fdo#73165, which I couldn't reproduce, but just to be sure. More importantly this patch resets the m_bStartOnUnblock when the Idle job actually runs. This run should already determinates if more Idle work needs to be done, and others can still call BeginIdling() to ensure further processing. Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/59536 (cherry picked from commit ce68889678bca3b51c258452f7bfdd21982e4a0d) Reviewed-on: https://gerrit.libreoffice.org/59586 (cherry picked from commit 107f0e6dba57a5b27366a35a5cdb184079546df0) Reviewed-on: https://gerrit.libreoffice.org/59692 (cherry picked from commit 771544544ee13ec98961f93b5313a7d2e29429cd) Reviewed-on: https://gerrit.libreoffice.org/59730 (cherry picked from commit 3bd8316718fdfed454c01a9c4ae6af6beb34437d) Change-Id: I2d4328f31644017b09786ff4cba45cf7643f0a4b (cherry picked from commit f1fb30cf43eda45137ab96177238a29c3725789d) Reviewed-on: https://gerrit.libreoffice.org/59757 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-23tdf#116370 cleanup Writer idle job handingJan-Marek Glogowski4-16/+16
This prevents the start of the idle job, while processing itself, so the fixed WinSalInstance::AnyInput of commit 3bf6c97029d2 ("tdf#112975 WIN correctly handle VclInputFlags::OTHER") won't report the timer events of the re-started idle job to process. Fixes the early abort of the background job, which resulted in the busy loop of the reported bug and this strange printing behaviour. P.S. I'm not sure, why this was just broken on Windows. Change-Id: I6503dcd925c9a0ed843e794a31eea32a4a4b2889 Reviewed-on: https://gerrit.libreoffice.org/59279 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 401cba4c20fbc930f034168872642428d7459218) Reviewed-on: https://gerrit.libreoffice.org/59315 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-22tdf#119294: reimplement fix for tdf#118859Mike Kaganski1-17/+32
When removing paragraphs with mail mere fields, both field type reference and node reference could get invalid, because field type will be destroyed when its last field is gone; and node will be destroyed if it is in a fly with anchor in another node which gets destroyed. To avoid use-after-delete, we will use an SwClient on field types, thus detecting if a collected field type got destroyed; iterating over fields using SwIterator is safe, because removing a node with fields would update the iterator. Change-Id: Id8b555ef7015b13ab70ebb41845d34c477ac6b31 Reviewed-on: https://gerrit.libreoffice.org/59164 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit c883d5e073d2ac5b2d55126c929d7bf3e6d295e8) Reviewed-on: https://gerrit.libreoffice.org/59175 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-20tdf#118385 Avoid crash on loading documentSzymon Kłos1-1/+1
Change-Id: Ifb18fee79667a5d0284407e84877b0d4d89536d9 Reviewed-on: https://gerrit.libreoffice.org/59173 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 308fbd8cdf9ce0fc3921b6c4c58707609b486fb9) Reviewed-on: https://gerrit.libreoffice.org/59247 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-20tdf#117086 crash on deleted SwFootnoteBossFrameCaolán McNamara1-0/+4
use SwFrameDeleteGuard to lock pOldBoss to exist over the range its directly accessed Change-Id: I68af80114a380f68b86cbc78278fb9e5e87cccce Reviewed-on: https://gerrit.libreoffice.org/59113 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-20tdf#119224 start and end are expected to exist for the scope of this functionCaolán McNamara1-3/+5
Change-Id: I771bce68a2ac923af6a7d54646a2c59ce6f10f7e Reviewed-on: https://gerrit.libreoffice.org/59179 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-17Resolves: tdf#119013 do not over-aggressively reorder date particlesEike Rathke1-3/+3
In particular not when reading documents as we don't know what the original (default/system) locale was when the date format was created and stored and whether the format's date order actually matched the locale's ordering. Regression from commit 51478cefaa4e265b42e3f67eda0a64767ff3efba CommitDate: Tue Apr 18 17:01:27 2017 +0200 Resolves: tdf#107012 follow date order of the target locale Change-Id: I9d3bdbd512d95ed81ff6459e368a2d7497ec8a2d Reviewed-on: https://gerrit.libreoffice.org/59182 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 5b8007afdb97d416ee7c22bf9226e927d61e9bd3) Reviewed-on: https://gerrit.libreoffice.org/59215 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-16tdf#119252: Revert "Remove < USHRT_MAX check that is presumably no longerStephan Bergmann1-3/+3
...needed" This reverts commit 4a61006255c67bb6f9ac99107093a424a9de441e, as it turns out to actually break things. I'm not quite sure how I came across that code and the attempted fix back then, but at least ASan+UBSan `make check` still works after the revert (and UBSan seems the most likely reason I came across this). I know too little about that Writer table layout code to know whether the original code is actually good, or would need some other fixing, so lets just revert for now. Change-Id: I1e88372a3b688a5fdd4c1bf88033b51287195799 Reviewed-on: https://gerrit.libreoffice.org/59002 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit d9c312d1917bc039bb0354c8c3f5c9dbbb758cf1) Reviewed-on: https://gerrit.libreoffice.org/59039 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-08-16tdf#118058 sw, sections in tables: no split for multiple columnsMiklos Vajna1-1/+15
The original use-case was "group a few paragraphs together" for the split sections inside tables, i.e. it's safe to not split when the section has multiple columns. And the multiple columns case would mean that we don't find where to put the follow section inside a table, resulting in a layout loop. (cherry picked from commit d2d996db4806e84ae0bf6aef1c285b498f2d2867) Conflicts: sw/qa/extras/layout/layout.cxx Change-Id: Ifab220e582439d2e757b5645f3167b55a051a379 Reviewed-on: https://gerrit.libreoffice.org/58983 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-08-15outer loop unrelated to inner loopCaolán McNamara1-30/+17
since original checkin of... commit 9cddf9da7fb256418e1bc3b4719abb55e3b0604c Date: Tue May 22 15:33:44 2007 +0000 INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDED ... 2006/12/13 12:31:03 tl 1.1.2.38: #i71244# update charts in writer where I think this LockUnlockAllCharts chart2 loop was modelled on the previous chart[1] styles loop of e.g. DoUpdateAllCharts which loop over tables. chart2 objects are unrelated to these tables, so remove the outer loop, which then means the ofz#9689 ofz#9856 ofz9874 crashes that made me look at it will get fixed Change-Id: I7d7ba0a2aa257b5aa399f20d902f01306fbaecff Reviewed-on: https://gerrit.libreoffice.org/59111 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
2018-08-15tdf#117127 crash on inspecting value describing a tableCaolán McNamara1-10/+12
since... commit f86d0413f7cedf096b285c2eb6698653dd99c21e Date: Mon Mar 30 01:26:21 2015 +0200 SwXCellRange:: and SwXTextTable::getDataArray() do the same which used to have more checks than its replacement Change-Id: Id931882ef7c749ffa18ef3474e3e661ba8614ab0 Reviewed-on: https://gerrit.libreoffice.org/58977 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-14tdf#119130 only have the active postit as a dialog control...Caolán McNamara1-1/+1
in which pressing ctrl+tab cycles between text and button so we don't waste time searching thousands of SwAnnotationWins Change-Id: Iba34882c6588fc9414004f0ed3b2b779f77b30d1 Reviewed-on: https://gerrit.libreoffice.org/58683 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-10forcepoint73 deleted SwAnchoredObject still referenced in TmpConsiderWrapInflCaolán McNamara6-19/+42
Reviewed-on: https://gerrit.libreoffice.org/58760 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 6d0ea082889c89eb8b408779f2de08da7441ff54) Change-Id: If255723834d049865fcf6fd0eac7768dfcbad2a1 Reviewed-on: https://gerrit.libreoffice.org/58768 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-07tdf#118859: Avoid trying to remove already removed nodesMike Kaganski1-16/+18
Regression from commit db04be037b611e296ef9f2542322c52ed82d7a2b Change-Id: I530c00f6357b4822654add6e5f2eecb3252b88ae Reviewed-on: https://gerrit.libreoffice.org/58612 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 576fac6f6199a87fb07e4a067abaa18c89b6d7ea) Reviewed-on: https://gerrit.libreoffice.org/58619 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-07tdf#109137 sw textbox: fix initial wrap type of a shape's textboxMiklos Vajna1-0/+2
This was already working for the DOCX import by luck. Make the wrap type explicit, so the ODF import has it correctly. The wrap type for the hidden sw text frame ("textbox of a shape") should be always "through", wrapping is only performed for the surrounding draw shape. (cherry picked from commit 59f5f666a5085ae58a8dd164636a6bea47e6bddc) Conflicts: sw/qa/extras/layout/layout.cxx Change-Id: Ice28cd5b517d544cfab4900dee32f01b534fee26 Reviewed-on: https://gerrit.libreoffice.org/58671 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-07Ensure consistent pointer-to-member representation on MSVCStephan Bergmann1-0/+7
...even with --disable-pch, where CppunitTest_sw_macros_test failed because creating the three iterWrong, iterGrammar, iterSmartTags in SwTextFrame::PaintSwFrame (sw/source/core/text/frmpaint.cxx) happend to have a differnt idea about the size of pointer-to-SwTextNode-member than the WrongListIterator ctor in sw/source/core/text/wrong.cxx. Change-Id: I6acef19c798991cc0fd65f6e8d5cf44485b6d2c6 Reviewed-on: https://gerrit.libreoffice.org/58670 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit f96ba2d948deb4a14dd686d74c758e1429c239a4) Reviewed-on: https://gerrit.libreoffice.org/58678 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-07sw: fix ignored frames in AppendAllObjs()Michael Stahl1-3/+9
The problem is that AppendAllObjs() doesn't check if MakeFrames() actually created frames, it just assumes success. If there are frames anchored in frames, then it could go through the circular_buffer, find a dependent frame before its anchor frame, unsuccessfully call MakeFrames(), then call MakeFrames() on the anchor frame, and then the vector is empty. A surprising aspect is that push_back on a boost::circular_buffer will silently pop the first element if it's already "full". Possibly this is what caused tdf#112447. 1. insert section 2. in paragraph in section, insert frame 3. repeat 2 4. drag anchor of frame 1 into body of frame 2 5. edit section, click hide 6. edit section, un-click hide 7. only one frame is displayed (regression from 575e222a1742918be052f2b716ddf57ce0008404 and/or ce2fce9a41729774689080c8b5552b60c2e6ee2d) Change-Id: Ie782252ac388524dfb083f655320a50e95239b24 Reviewed-on: https://gerrit.libreoffice.org/58676 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 31e66bd07c1082bb375be8aaf7835f019351d9bb) Reviewed-on: https://gerrit.libreoffice.org/58679 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-08-03forcepoint#67 null derefCaolán McNamara1-2/+4
Change-Id: I666c6b1795e037d3bb74d4ccc33be0e161bfb157 Reviewed-on: https://gerrit.libreoffice.org/58445 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-03forcepoint#61 null derefCaolán McNamara1-2/+4
Change-Id: Ia22f1df0ce3a49a8cb9b11e35895f9d1e13a2e05 Reviewed-on: https://gerrit.libreoffice.org/58407 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-07-27tdf#109077 sw textbox: fix as-char shapes with custom print area in paraMiklos Vajna1-2/+6
Regression from d379d18666aa42031359ca8eb34b0021960347ae (oox: import WPS shape with text as shape with textbox, 2014-06-18), the position of the textbox should be relative to the print area of the text frame, not to the text frame itself. (cherry picked from commit 11d87b35474b642e99e7aa397aa18992c1bc20c9) Conflicts: sw/qa/extras/layout/layout.cxx Change-Id: I2b591dc46ad4967edd8a1691d9b100ef0d74bed3 Reviewed-on: https://gerrit.libreoffice.org/58084 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-07-27tdf#101534 sw: fix lost indent attributes when copying into numbered paragraphMiklos Vajna1-1/+3
Commit aa91dc0ccbe53ffcec9dbfec2265de057775d4e3 (CWS-TOOLING: integrate CWS sw32numbf01, 2009-09-08) replaced the SwDoc::ReplaceNumRule() call with SwDoc::SetNumRule(), as the later handles list ids. This required a decision if resetting of the indent attributes is needed or not, but it did not document why resetting was chosen. On the other hand, the current bugdoc shows why resetting is a bad idea: this way if you paste into a numbered paragraph which has a non-zero paragraph indent inherited from the numbering + zero indent as direct formatting, then this later is lost during paste. (cherry picked from commit 340eaa6aa15c18cc2696a4a304350810cb36565c) Change-Id: Ie5dcf6ed86c240fd61c4d5bfed886910aea3648f Reviewed-on: https://gerrit.libreoffice.org/57739 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-07-25tdf#118528 sw layout: only direct formatting for EmulateTableKeepJustin Luth2-7/+7
Emulating MSWord's way of keeping a table with the next paragraph has caused a few complaints, but never anything that seemed to clearly indicate a real problem - usually just badly designed documents. But a common theme has been the keep attribute coming through styles. Since our export-emulation writes directly to the paragraph properties, lets make the emulation dependent on direct formatting to avoid some of these complaints. Change-Id: I008fc7b6a7083292463c20972ad209761ec97601 Reviewed-on: https://gerrit.libreoffice.org/57613 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit ef86b2e7a08ea25c434db85087d094f030f762cc) Reviewed-on: https://gerrit.libreoffice.org/57697 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-24tdf#118716 Inner border of an embedded table can't be dragged aroundNoel Grandin1-1/+1
regression from commit f14b9d30293f180500fc56d81e5390021758e7c1 convert (a>b?a:b) to std::max(a,b) In this code int a; std::max<sal_uInt16>(a,0) std::max will first convert a and b to sal_uInt16, therefore potentially converting a negative number to a positive number due to the conversion rules. Then it will take the larger number. While this code int a; static_cast<sal_uInt16>(a > 0 ? a : 0) will compare first, and then convert the larger number to sal_uInt16, which might result in making a "a" that is larger than 2^16 into a smaller value, but which will never convert a negative "a" value into a positive value. Change-Id: Id4f6df0089b1a74ea4ac1c5d05655e7c1d8f0c7f Reviewed-on: https://gerrit.libreoffice.org/57846 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit c13865a4caf7898c4e59a5b22bbd493d6dad9661) Reviewed-on: https://gerrit.libreoffice.org/57908 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2018-07-18tdf#118738: use SwDepend instead of WriterMultiListener in SwContentNodeXisco Fauli2-161/+164
This reverts commit 83243003b46dfb258c2b41049b0e1cb82a2d7ddb use WriterMultiListener instead of SwDepend in SwContentNode - also move SwContentNode and SwTextNode from Modify to SwClientNotify - this removes the last public use of SwDepend, which should now become an implementation detail of WriterMultiListener and commit ecf50fe71596c3edba8ce437481ab80ae1cd8935 remove now obsolete SwDepend Revert them for now ( specially before the relese of LibreOffice 6.1 ) until a fix for the bugs listed in tdf#118738 is provided Change-Id: I174feb3b092ff31b4c4837011c31343296c0c693 Reviewed-on: https://gerrit.libreoffice.org/57698 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-07-18bubble referer to LinkManager::GetGraphicFromAnyCaolán McNamara1-1/+8
Change-Id: Id2c6d629692a365f96f3f81c5686930668389a6a Reviewed-on: https://gerrit.libreoffice.org/57549 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-07-18Resolves: tdf#118545 restore to historic logicCaolán McNamara1-4/+2
revert commit 9eff9e699e17cc5a8a25895bd28dc8e4ceb8071e Date: Wed Aug 10 09:47:40 2016 +0200 Don't re-check valid SwPageDescs when layouting and then revert commit 60d34e1c840d2c317bb7d0a5b14f4602c22b3fcc Date: Wed Nov 12 20:33:06 2014 +0000 coverity#735517 Logically dead code its possible that this was the original intent, maybe Change-Id: Iff45f1e7f3d7e3791d984eb117779a6f39ebb19c Reviewed-on: https://gerrit.libreoffice.org/57578 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2018-07-06tdf#118414 sw: fix fieldmarks in GetNextAttr()Michael Stahl1-2/+4
Apparently this needs to stop both before and after the CH_TXT_ATR_*. (regression from 3e724847308c0d9cdd727898faaeb347c5f0643a) Change-Id: Iff3d594d2eec59436ad683b9cc7aca04f7527bd5 Reviewed-on: https://gerrit.libreoffice.org/57017 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 2b0a7c346f8e3c5823a9e032a4501f20bc712914) Reviewed-on: https://gerrit.libreoffice.org/57043
2018-07-03tdf#116537: use page #s excluding empty pages when they are ignoredMike Kaganski1-0/+24
Since commit 3c1a343f6936f1dcefdf79a677f8c26ce29676e6, SwDoc::CalculatePagesForPrinting expects that PageRange contains page numbers that don't include empty pages' numbers, when the org.openoffice.Office.Writer/Print/EmptyPages is false. Change-Id: I4057d6e36765707affbd5f3a4507ae03f4a27171 Reviewed-on: https://gerrit.libreoffice.org/55756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit cc46e7b9c75ddbcaaefde5f396ba76b0b866fa58) Reviewed-on: https://gerrit.libreoffice.org/56758 Tested-by: Jenkins
2018-07-03tdf#108000 sw layout: ignore emulated keep on large tablesJustin Luth1-1/+2
There is no point in a very large (multipage) table keeping with the following content and it just makes the layout more complex. This is especially true when we are emulating this using MSWord's convention, and not LO's native table-keep option. This patch only affects my earlier code for emulated tables. Otherwise, something about the general logic could loop forever in certain huge tables. This seemed like a very reasonable compromise. Change-Id: Ic1bde12b266e71fc9f608ec4d1223277108750fa Reviewed-on: https://gerrit.libreoffice.org/56314 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit fc90f7ea8034e9585486ea9cc3e55771aca85540) Reviewed-on: https://gerrit.libreoffice.org/56791 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-26forcepoint#49 survive more kashidas than expectedCaolán McNamara3-10/+11
Change-Id: I66aa5389b3d80d1fe2f6898e8920eb37ca064381 contains... can use simple vector here Change-Id: Ia1565a946f9ac6d607fb6802b19e561fc9afc66d and... pass vector as arg, rather than raw pointer Change-Id: Id97df4cce7a2ce28f1a5e7cc30e27cf4ce9261d1 Reviewed-on: https://gerrit.libreoffice.org/56476 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-26forcepoint#48 null derefCaolán McNamara1-12/+14
Change-Id: I790fc6dafc0d8c9783b9dddc266b313af2a046d7 Reviewed-on: https://gerrit.libreoffice.org/56461 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-25tdf#118219 sw: fix SwCursorShell::GetContentAtPos() redline crashMichael Stahl1-0/+11
The problem is that CalcStartEnd() will not return the length of the node, but COMPLETE_STRING if the redline ends in a subsequent node. (regression from 4966b1d4d0dc7bce0a1741f9347dada7406a7fb4) Change-Id: Ic0a27f87b79f68417777842c611c2129fdc9b1f9 Reviewed-on: https://gerrit.libreoffice.org/56402 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 2bdb926bd6afa01cc3cad013317a1e0ecbde0735) Reviewed-on: https://gerrit.libreoffice.org/56411 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-06-25tdf#113877 Insert doc: merge list into text with specifc styleSerge Krot1-1/+42
When inserting document, in the current position the text could have custom style but really it is the same Standard style. Therefore we should not merge first inserted node into the insert position and just overwrite style in the insert position with text style from the inserted node. Change-Id: Ib67c56bed3d30f356f83dc0b4d4a1710def10853 Reviewed-on: https://gerrit.libreoffice.org/56052 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit baf3cec77db5f03200c038101e77720fae2ffba3) Reviewed-on: https://gerrit.libreoffice.org/56366
2018-06-18crashtesting: export of ooo24533-1.sxw to docxCaolán McNamara1-3/+9
a problem (I assume) since... commit d7d5fa52b03fe058759f90f489a5071a39883ed7 Date: Tue May 22 10:49:36 2018 +0200 sw_redlinehide: trivial conversions in reffld.cxx Change-Id: I4a9ec367e8a280cb56c3e0e47558da959fc14b38 Reviewed-on: https://gerrit.libreoffice.org/55957 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-06-18tdf#117723: nullcheck the ContentAnchor before derefBjoern Michaelsen1-1/+2
Change-Id: I4043efc204c8e3af8463ecd325313c99a9d61128 Reviewed-on: https://gerrit.libreoffice.org/55839 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org> Tested-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org> (cherry picked from commit d8142da066b6ee80444694e0eb6b0da9375a89c7) Reviewed-on: https://gerrit.libreoffice.org/55958 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>