summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docdesc.cxx
AgeCommit message (Collapse)AuthorFilesLines
10 dayssfx2: use SAL_RET_MAYBENULL in GetDispatcher() and GetFrame()Xisco Fauli1-8/+12
Change-Id: Ic9876dbdd0dc0ce887a6eb135bd411f8e3dc9e12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168288 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-03replace createFromAscii with OUString literals in SwFormatNoel Grandin1-2/+2
Change-Id: I53ec6e3914ef995a4fd708ea0f1c2976673d97d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-30SwModify::Add/Remove always derefs argCaolán McNamara1-1/+1
an effort to remove C6011 Dereferencing NULL pointer 'pDepend' Change-Id: If9e7b7be25ece3df60ada09e5c83d03aebe9c535 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166865 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-30move IsFuzzing to comphelperCaolán McNamara1-2/+2
and try something a bit more generic Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2022-12-22check GetEditShell()Caolán McNamara1-1/+1
Change-Id: I975c7dca9ea569e326fc5d8670a078959ab9f093 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144761 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-13sw: improve duplicated bookmarks in copied header/footer textMiklos Vajna1-2/+2
Bookmarks in copied text were renamed in a way that made it hard to differentiate between the original bookmark and the copy, e.g. "Bookmark 1" was renamed to "Bookmark 11". Bookmarks are supposed to have a unique name, so renaming makes sense, and it's probably better to do that compared to what commit 3ec224dcb15e0e663ba85077b8ea0e632f8f03f8 (DOCX import: avoid duplicated bookmarks in copied header/footer text, 2022-09-08) did to just omit them during copy. That solved the duplicated bookmarks, but if one had bookmarks around images to find them, now it doesn't work to find all such images. Fix the problem by going back to copying bookmarks, but copy "Bookmark 1" as "Bookmark 1 Copy 1" (and "Bookmark 1 Copy 2", etc), so API users can identify the original and the copied bookmarks. A similar problem is there for images as well, but that's not yet addressed here. Change-Id: Ic0689b05f790a99ff06523ff4836b1dd412af896 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141293 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-09-08DOCX import: avoid duplicated bookmarks in copied header/footer textMiklos Vajna1-2/+2
In case a DOCX document has 2 sections and the 2nd section has a linked header, writerfilter/ copies the header text from the 1st page style to the 2nd page style. This leads to duplicated bookmarks in the doc model, which causes an unexpected increase in bookmark count on export. This went wrong with 8885bdf2f564bb7b56181c50baf39ff99d551ec9 (tdf#128106 sw: copy bookmarks at start if whole node is copied, 2021-08-27), previously at least bookmarks at the start of the header were not duplicated, though that was also inconsistent, since other bookmarks were still duplicated. Interestingly the DOC import doesn't have this problem, because it first copies header text and only later imports the bookmarks. Fix the problem by introducing a new SwCopyFlags::SkipBookmarks flag, add UNO API to set this from writerfilter/ code and skip copying bookmarks (but not other marks) in sw::CopyBookmarks() accordingly. Copying other marks is still needed, because e.g. fieldmarks have a mark and a field, and it would be inconsistent to copy the field, but not the mark. Note that the text is still duplicated in header/footer, linked header/footer is a missing feature on the Writer side. Change-Id: I40e18f231ef2c0d91ae9582621684ef5b6284904 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139697 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-13pass SwNode instead of SwNodeIndex to CopyFlyInFlyImplNoel Grandin1-6/+4
part of the process of hiding the internals of SwPosition Change-Id: Ib2ac69352ca7e37117ad449fa7cb9f7cd69dd333 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138232 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-13pass SwNode instead of SwNodeIndex to MakeEmptySectionNoel Grandin1-6/+4
part of the process of hiding the internals of SwPosition Change-Id: Ic24e646571eec0ff764d307e20e784d39d8411e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138230 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-13pass SwNode instead of SwNodeIndex to CopyNodeNoel Grandin1-4/+2
part of the process of hiding the internals of SwPosition Change-Id: Icaecb1c2eee09baf3f1630937bca9a96556eb023 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-07make ParkCursor take a SwNode, not an SwNodeIndexNoel Grandin1-1/+1
as part of the process of hiding the internals of SwPosition Change-Id: I5fde455225b5571bca7f461898146800837fa4cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-01sw: fix crash in SwDoc::CopyMasterHeader and SwDoc::CopyMasterFooterXisco Fauli1-60/+72
Similar to 3eda5d345f14f8926358df7b425c452a8a165c7d "tdf#149184 DOCX: fix crash removing footer, then saving to doc" check that GetHeaderFormat and GetFooterFormat are not nullptr Also restructure the code a bit to reduce the scope of pRight See https://crashreport.libreoffice.org/stats/signature/SwDoc::CopyMasterHeader(SwPageDesc%20const%20&,SwFormatHeader%20const%20&,SwPageDesc%20&,bool,bool) and https://crashreport.libreoffice.org/stats/signature/SwDoc::CopyMasterFooter(SwPageDesc%20const%20&,SwFormatFooter%20const%20&,SwPageDesc%20&,bool,bool) Change-Id: Ia30d06593124d90b88f7d26ed7be9a5d7a64872c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135230 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-13Use o3tl::convertMike Kaganski1-5/+5
Change-Id: I78db3001d602ec1a0847785b3c127b9d345f5af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125173 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-21introduce SwNodeOffset strong typedefNoel Grandin1-3/+3
for indexing into node children. Replaces various usage of sal_uLong, tools::Long, sal_uInt32 with an underlying type of sal_Int32. Also add a NODE_OFFSET_MAX constant to replace usage of ULONG_MAX Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-14tdf#143320 Crash at paste/undo paste againNoel Grandin1-1/+0
revert commit 790135003b03b38a14efb7e0d345188607020a99 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed May 19 20:03:07 2021 +0200 fix leak when removing PageDesc Change-Id: Ia6a03dec2db8f68c5c0c34d6ee9fb1889151f29d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28Fix uninitialised conditional jumpJan-Marek Glogowski1-1/+1
Since we just handle one specific case, just initialize the variable to something different, instead of checking the GetFirstRedoInfo result. From valgrind: ==10566== Conditional jump or move depends on uninitialised value(s) ==10566== at 0x270E4451: SwDoc::ChgPageDesc(unsigned long, SwPageDesc const&) (docdesc.cxx:431) ==10566== by 0x272E341F: SwFEShell::ChgPageDesc(unsigned long, SwPageDesc const&) (fedesc.cxx:122) ... Change-Id: Ib95f81297959a535a08dc399f72b68c15e621a27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118017 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-05-21sw: replace most static_cast<sal_uInt16>() calls with o3tl::narrowing()Miklos Vajna1-2/+2
o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I499abda3be6943e8c111c56df390e72939586221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115948 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-19fix leak when removing PageDescNoel Grandin1-0/+1
m_PageDescs owns the SwPageDesc entries, so when we remove from it, we need to delete that entry Change-Id: Ib6dbba227ec64c2d6cfc310b93e1d11397648847 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115824 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-10tdf#141613 sw: avoid possible crash when undoing header creationDaniel Arato (NISZ)1-3/+0
Move the ClearRedo() call to the very end of the undo process in order to avoid heap use after free. We still need to call ClearRedo() because there's no mechanism in place to Redo a header/footer change. Regression from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104 "tdf#141613 sw: fix crash at header/footer undo". Change-Id: Ibd4604379c9791e85aef3d4dc6c29c9e3ecd5a28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115275 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-04tdf#141613 sw: fix crash at header/footer undoDaniel Arato (NISZ)1-0/+84
Undoing the creation of a header/footer used to leave their corresponding document nodes intact, causing the node index of a previous undo entry to point to the wrong node. We now force the destruction of the header/footer nodes manually. We also cut the redo chain which loses the redo history, but solves another crash for now (when redoing the creation of the header). The proper solution would be to create a new SwUndo* derived class from scratch to represent the creation of a new header/footer section in the document. Regression from commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e (tdf#46561 sw: fix lost undo stack setting header/footer) Change-Id: I97188aa8ded802bc6b6fa88ddd83a95c40de8bc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114667 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-04-09Recheck include/ with IWYUGabor Kelemen1-0/+1
See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-31tdf#141158 DOCX: import discarded headers/footersAttila Bakos (NISZ)1-6/+24
Before the inactive DOCX headers/footers lost during import time. Now it can be restored by disabling the options “Same content on left and right pages” and “Same content on first page” on the Header and the Footer panes of the Page style. This is for improving the interoperability with other Office programs, e.g. supporting DOCX text document templates better. Follow-up of commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3 (tdf#140117 sw UI: keep headers/footers when inactive). To start the py-UItest run: $ make UITest_writer_tests7 UITEST_TEST_NAME="tdf141158.TestTdf141158.test_tdf141158" Note: In spite of this patch implements the left/first/first_left page header/footer stash at import time, the left one works correctly at now. This is because the first pages have different page styles so changing the right page style will restore the hidden header/footer content. For this problem further improvements are planned, exactly in the filter part. Number of unit tests had to be modified, because before these headers and footers were dropped. Co-developed-with: Daniel Arato (NISZ) Change-Id: I3dd452a648bc465710698707c083734dc762ed94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112580 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-03-30Use o3tl::convert instead of GetMetricValMike Kaganski1-3/+4
... and drop the latter. Change-Id: Ia877358bbd8a699b9e8cc4d72dc1fb7c4d0ef980 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113328 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-29sw page rtl gutter margin: add doc modelMiklos Vajna1-0/+2
This is a new flag on the page style, and if it's true, then non-top gutter is right, not left. This is just the doc model, other parts will come in follow-up commits. Change-Id: I36ffe9d2f62fc057cf98952c743d415d9240513d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113323 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-25tdf#134734 tdf#141059 tdf#122508 cui,sw,xmloff: BackgroundFullSizeMichael Stahl1-1/+3
* add BackgroundFullSize property to PageProperties * add a checkbox on the SvxPageDescPage * marshal the item via SfxGrabBagItem to avoid changing svxids.hrc * add RES_BACKGROUND_FULL_SIZE item, pool default is "true" which is appropriate for Word import filters * ODF export: remove hard-coded export in XMLPageMasterExportPropMapper::ContextFilter() * use it in SwFrame::PaintSwFrameBackground() * fix painting of bitmaps by also using the page frame area in SwFrame::GetBackgroundBrush(), which was the reason why f006b6339e20af6a3fbd60d97d21590d4ebf5021 painted things inconsistently * force repaint in lcl_DescSetAttr()/SwFrame::UpdateAttrFrame() Change-Id: I4cb64f87c01d17c051936e9b8128395fbb8b4fe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112594 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-17tdf#46561 sw: fix lost undo stack setting header/footerDaniel Arato (NISZ)1-58/+29
Changing 'shared' setting of left vs right or first vs non-first page headers or footers removed the whole undo stack. Note: style changes before a 'shared' change can still not be undone. Co-authored-by: Attila Bakos (NISZ) Change-Id: I6875bd0581869ffeb853911347dbc9f8c666214b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111635 Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-by: Balazs Varga <varga.balazs3@nisz.hu> Tested-by: Balazs Varga <varga.balazs3@nisz.hu>
2021-03-04ofz#31672 Bad-castCaolán McNamara1-6/+6
==3484068== Invalid read of size 8 ==3484068== at 0x226E9EDC: SwClient::GetRegisteredIn() const (calbck.hxx:159) ==3484068== by 0x22A09E30: SwDoc::ChgPageDesc(unsigned long, SwPageDesc const&) (docdesc.cxx:465) ==3484068== by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) (fltshell.cxx:1094) ==3484068== by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) (ww8par.cxx:5482) ==3484068== by 0x1CDD90A1: SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939) ==3484068== by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) (ww8par.cxx:6243) ==3484068== Address 0x28c215c8 is 40 bytes inside a block of size 56 free'd ==3484068== at 0x483AEDD: operator delete(void*) (vg_replace_malloc.c:584) ==3484068== by 0x23009F47: SwFormatHeader::~SwFormatHeader() (atrfrm.cxx:503) ==3484068== by 0x9DDC3F3: SfxItemPool::Remove(SfxPoolItem const&) (itempool.cxx:741) ==3484068== by 0x9E17BD6: SfxItemSet::~SfxItemSet() (itemset.cxx:252) ==3484068== by 0x227FE847: SwAttrSet::~SwAttrSet() (swatrset.hxx:161) ==3484068== by 0x227FD139: SwFormat::SetFormatAttr(SfxPoolItem const&) (format.cxx:524) ==3484068== by 0x22A07AA6: SwDoc::CopyMasterHeader(SwPageDesc const&, SwFormatHeader const&, SwPageDesc&, bool, bool) (docdesc.cxx:248) ==3484068== by 0x22A09B4D: SwDoc::ChgPageDesc(unsigned long, SwPageDesc const&) (docdesc.cxx:457) ==3484068== by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) (fltshell.cxx:1094) ==3484068== by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) (ww8par.cxx:5482) ==3484068== by 0x1CDD90A1: SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939) ==3484068== by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) (ww8par.cxx:6243) since... commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3 Date: Tue Jan 26 13:11:42 2021 +0100 tdf#140117 sw UI: keep headers/footers when inactive Change-Id: I14787d4203c457393e8b5d0222df67d394a4c9ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111970 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-02tdf#140117 sw UI: keep headers/footers when inactiveDaniel Arato (NISZ)1-14/+56
Custom left page and first headers (and footers) used to disappear forever if hidden temporarily by checking the "Same content on left and right pages" or "Same content on first page" options, respectively. This commit stashes the endangered headers (footers) in SwPageDesc and restores them on demand. Change-Id: I1f6b605e2bd19af18726de1b825721487d29b4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110398 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-11-24tdf#42949 Fix new IWYU warnings in directory swGabor Kelemen1-1/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I4bb84c3f401aba8a3dede9cec3a7f2187a2ba02a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106473 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-01sw/source/core/doc: Stop abusing observer pattern for code obfuscation.Bjoern Michaelsen1-3/+2
The old SwClient/SwModify combo is a questionable implementation of the observer pattern (among other things). The one thing the observer pattern is good for is dependency inversion: The creator of the message does not need to know the type of the receiver. Calling the message handling on the receiver directly introduces tight coupling and entirely defeats the purpose, leaving us with the worst of both worlds. In such case, at least be honest about the tight coupling and call a somewhat more explicit member function of the target. Thus introduce SwFootNoteInfo::UpdateFormatOrAttr, SwContentNode::UpdateAttr, remove some useless SwFormatChg clutter in Set{Foot,End}NodeInfo, and check for some invariants in SwContentNode::SwClientNotify to limit some of the "a message are two void pointers" madness. Change-Id: I32a8d6973231bb5f65c9e144be72d5bcf98f3f44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105104 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-10-13static_cast after dynamic_castNoel1-2/+2
Change-Id: I68c20dfbedb84660cf25df785e1e0b13a7592994 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-04tdf#135144 sw: copy bookmarks in SwDoc::CopyMasterHeader()Michael Stahl1-2/+6
... and SwDoc::CopyMasterFooter(); this is the same as commit 9f7ee38acec0cb614e37aecc5ea9c5f1c63b61b6 but for 2 other functions that do the same thing. Change-Id: Id7ed449a004ee3c9452d4603bf8632e2720651ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100077 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-08-01loplugin:flatten in sw/core/docNoel Grandin1-24/+24
Change-Id: If7738d47ec0273f24eee99b7336380cfa78c1243 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99896 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-05remove unused nSearchFamily and nMask membersCaolán McNamara1-1/+0
and so SetSearchMask which doesn't have any effect anymore Change-Id: I0b7f402ce0317971d5196fc448fe2945a6a292f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93393 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-04for these we know what the SearchFamily and GetSearchMask are alreadyCaolán McNamara1-1/+1
Change-Id: If12f144bb4e9d02a5caafc5ea64dd1dc7b8b5709 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93355 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-03Related: tdf#130108 expand single arg SfxStyleSheetBasePool::Find usesCaolán McNamara1-1/+1
remove it and expand its uses to explicitly show what it does Change-Id: I2d4511c58b51003c327a2c70e3cc4f60751f520d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93352 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2019-12-11convert SwFrameSize to scoped enumNoel Grandin1-1/+1
Change-Id: I7e1e641ff180035c7dcefdcfdd185eadbae32142 Reviewed-on: https://gerrit.libreoffice.org/84850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-05tdf#42949 Fix IWYU warnings in sw/source/core/d*/*cxxGabor Kelemen1-7/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Id33b8c1e0c02c21591b167a8b3f0ea288fac63bd Reviewed-on: https://gerrit.libreoffice.org/81689 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-11SwDoc::ChgPageDesc: OSL_ENSURE -> assertMichael Weghorn1-1/+1
'i' is used as index and the retrieved pointer dereferenced. Change-Id: I07226f13b90754c182d11e6fe778fa353ac7ada8 Reviewed-on: https://gerrit.libreoffice.org/80651 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-07-22tdf#117185 tdf#110442 sw: bring harmony & peace to fly at-char selectionMichael Stahl1-2/+2
Use IsDestroyFrameAnchoredAtChar() to harmonize the at-char fly selection across all relevant operations: * CopyImpl: this is the most tricky one: - the code in CopyWithFlyInFly() and CopyFlyInFlyImpl() is quite con- voluted as it needs to do some things ignoring a partially selected start node, while including it in other cases - it had pre-existing bugs too that would lose a fly anchored to the 2nd (1st fully selected) node of a redline - now it needs to copy the flys in the selection if it is inside a single node - another complication is that flys that already existed at the insert position need to have their anchors corrected - SwUndoInsLayFormat need to be created for the appropriate flys - SwUndoInserts Undo/Redo needs to run the nested SwUndoInsLayFormat at the appropriate time - SwUndoInserts::UndoImpl() needs a special case to *never* delete flys at the start/end of the selection because those are handled by nested SwUndoInsLayFormat - Insert File (shellio.cxx) needs adapting to the SwUndoInserts change * DeleteRange: this just needs to delete the flys via DelFlyInRange() * MoveRange: - this is used by the old SwRangeRedline Show/Hide, i.e. on ODF export - the SaveFlyInRange()/RestFlyInRange() was rather inadequate and didn't even restore content indexes at all... * IsShown: the sw_redlinehide code needs to check visibility against the (inverted) extents The selection behavior is changed so that at-char flys in the start and end node of the selection are also selected, instead of having their anchor moved to a different content index by the operation. This appears more obvious and user-friendly, fixes tdf#110442, and is also more like what Word does. Selections exclude the start and end position except if it's a fully selected node or at the start or end of a section (i.e. Ctrl+A should also select every at-char fly). A special hack is needed to keep writerfilter happy for now; it likes to anchor flys at nodes which it then deletes in RemoveLastParagraph(), which likely could be improved there (disposing the SwXParagraph runs into the same problem...). Crashes fixed by this: tdf#117185 tdf#117215 except comment#12 tdf#124720 tdf#124721 tdf#124739 Previously fixed bugs tested: i#97570 plus the 2 bugs that already have UITests Change-Id: I4fec2a3c15ca0e64e5c4e99acfb04f59bb2bcf64 Reviewed-on: https://gerrit.libreoffice.org/75516 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-13tdf#42949 Fix IWYU warnings in sw/source/core/inc/[g-S]*hxxGabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I4ebebbbbad31b29c1e63a30685493042462bb52f Reviewed-on: https://gerrit.libreoffice.org/71832 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-07o3tl::make_unique -> std::make_unique in swGabor Kelemen1-4/+3
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I871312c1077439377c67b76112f38b7019fa6fb1 Reviewed-on: https://gerrit.libreoffice.org/67376 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-09use unique_ptr in SwContentNode::CreateOLENodesArrayNoel Grandin1-4/+3
Change-Id: I4ff33dbdc4d87fd00e4a2b995fff1238c7e2a679 Reviewed-on: https://gerrit.libreoffice.org/65995 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-09use unique_ptr in pGlobalOLEExcludeListNoel Grandin1-3/+3
Change-Id: Ib52e594b469818a0567c9c6b5cd460375d997abc Reviewed-on: https://gerrit.libreoffice.org/65994 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-10tdf#42949 Fix IWYU warnings in include/vcl/s*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie87d27dd2c385a63349e0b322fd067ba03d2d152 Reviewed-on: https://gerrit.libreoffice.org/64479 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-15sw_redlinehide_3: add second footnote numberMichael Stahl1-1/+1
Add a separate footnote number to SwFormatFootnote for the case when the layout hides redlines. If the footnote is in a delete redline, the value will be an arbitrary number, let's use the same number as the last visible footnote for simplicity. Change-Id: Ic7fff9d1bb2c90f5ad811b859c6501a193b7ae70
2018-10-05use std::unique_ptr in sw::IDocumentUndoRedoNoel Grandin1-5/+5
Change-Id: I504706ff1a3fc11a7a06ebe935f9dbc5323aefe8 Reviewed-on: https://gerrit.libreoffice.org/61369 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-24tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a Reviewed-on: https://gerrit.libreoffice.org/60837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-03Add missing sal/log.hxx headersGabor Kelemen1-0/+1
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory sw Change-Id: I1ede3f86e390bfec1a2d3ee8e8bb6ec67083b194 Reviewed-on: https://gerrit.libreoffice.org/58372 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>