summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/ssfrm.cxx
AgeCommit message (Collapse)AuthorFilesLines
34 hoursuse tools::Long in swNoel1-25/+25
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
8 daysstatic_cast after dynamic_castNoel1-6/+6
Change-Id: If1194bd3364fef8b2d0c26c22854745d0fb7b412 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-30SwNode::GetDoc can return a reference insteadCaolán McNamara1-3/+3
and remove discovered redundant null checks Change-Id: I6b8bc9593434f38947e399a48888a8fa0d4f7e77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103640 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-01loplugin:flatten in sw/core/layoutNoel Grandin1-90/+90
Change-Id: I67fd1a269d960174b88c57da4a0588f5d9252660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-10tdf#128880 sw btlr: fix SwFrame::GetPaintArea() for the row span caseMiklos Vajna1-1/+13
To be specific, this focuses on the case where a single cell has btlr direction, but the containing row does not, and there is a row span. The old code that took the logical right of the cell frame served two purposes, it seems to me: - in the rare case where the 1st row is wider then a subsequent row, we make sure that as the cell frame is expanded downwards, we're still inside the table polygon - in the tb-rl ("Japanese") case, the logical right maps to physical bottom, and this way the cell frame is OK to render not only into its own row frame, but can expand also downwards. Given that btlr maps left to bottom, this mechanism is broken there. Be consistent with the working tbrl case, so just expand towards the logical left in the btlr case. The rest of the changes just make sure that SwAttrHandler::FontChg() calls SwFont::SetVertical() with the correct bVertLayoutLRBT parameter, which instantly fixes the actual position of the text. Change-Id: I9032e7c6de72cec704843f3aae3c7848e139ebfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90241 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-07rename GetBaseOfstForFly->GetBaseOffsetForFlyNoel Grandin1-1/+1
Change-Id: Ieeeaa53d916e192e7219d7d3d405584a22249e7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88181 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-11convert SwFrameSize to scoped enumNoel Grandin1-2/+2
Change-Id: I7e1e641ff180035c7dcefdcfdd185eadbae32142 Reviewed-on: https://gerrit.libreoffice.org/84850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-29tdf#128399 sw btlr: fix clicking to lower rotated cellMiklos Vajna1-6/+7
In case a table has more than 1 btlr cells in multiple rows, the first captured the mouse. This was because SwFrame::GetPaintArea() assumed that left and right edges can be compared directly, without going via the SwRectFnSet abstraction. This works for hozizontal and plain vertical directions, but not for btlr. Change-Id: Ia3bd7623a5d8d9ad3bdfabceb10adc0dbf105059 Reviewed-on: https://gerrit.libreoffice.org/81688 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-08-24loplugin:returnconstval in swNoel Grandin1-2/+2
Change-Id: I15d8553bff7528f690ff92bee75d6a67037c0adf Reviewed-on: https://gerrit.libreoffice.org/78062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12sw: fix assert in SwTextFrame::RegisterToNode() on ooo33427-1.sxwMichael Stahl1-2/+3
If we now allow deleting the first node from SwRangeRedline::DelCopyOfSection(), it will trigger if there's a insert redline ending on the same empty node where a delete redline starts. (somehow this was missing in beec1594587d0bf1ea2268f9a435c948b5580278) Change-Id: I83ce5bdac983873b89536e06d1dc0d7d8fb17ada Reviewed-on: https://gerrit.libreoffice.org/77351 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-07-21crashtesting: failures on swfootnoteframe_colunlock_heap_use_after_free.sampleCaolán McNamara1-40/+1
undo forcepoint80 hackery and try a different solution Change-Id: I52b5f9b41074e122bd32e70967e198ce9f86aec7 Reviewed-on: https://gerrit.libreoffice.org/76072 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19sw: fix use after free on tdf117215-1.odtMichael Stahl1-1/+1
Move the fix from 6d0ea082889c89eb8b408779f2de08da7441ff54 to SwFlyFrame::DestroyImpl() so we unregister every SwFlyFrame. ==1550==ERROR: AddressSanitizer: heap-use-after-free on address 0x615000383f56 at pc 0x7efcd70d5ab9 bp 0x7ffeb7ac7c40 sp 0x7ffeb7ac7c38 WRITE of size 1 at 0x615000383f56 thread T0 0 SwAnchoredObject::SetTmpConsiderWrapInfluence(bool) sw/source/core/layout/anchoredobject.cxx:743:32 1 SwObjsMarkedAsTmpConsiderWrapInfluence::Clear() sw/source/core/layout/objstmpconsiderwrapinfl.cxx:53:23 2 SwLayouter::ClearObjsTmpConsiderWrapInfluence(SwDoc const&) sw/source/core/layout/layouter.cxx:387:84 3 sw::DocumentLayoutManager::ClearSwLayouterEntries() sw/source/core/doc/DocumentLayoutManager.cxx:497:5 4 sw::DocumentStateManager::SetModified() sw/source/core/doc/DocumentStateManager.cxx:45:39 5 sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&) sw/source/core/doc/DocumentContentOperationsManager.cxx:3942:36 0x615000383f56 is located 342 bytes inside of 504-byte region [0x615000383e00,0x615000383ff8) freed by thread T0 here: 1 SwFlyAtContentFrame::~SwFlyAtContentFrame() sw/source/core/inc/flyfrms.hxx:159:7 2 SwFrame::DestroyFrame(SwFrame*) sw/source/core/layout/ssfrm.cxx:389:9 3 SwFrameFormat::DelFrames() sw/source/core/layout/atrfrm.cxx:2624:17 4 SwUndoFlyBase::DelFly(SwDoc*) sw/source/core/undo/undobj1.cxx:161:19 5 SwUndoDelLayFormat::SwUndoDelLayFormat(SwFrameFormat*) sw/source/core/undo/undobj1.cxx:403:5 6 SwHistoryTextFlyCnt::SwHistoryTextFlyCnt(SwFrameFormat*) sw/source/core/undo/rolbck.cxx:538:20 7 SwHistory::Add(SwFlyFrameFormat&, unsigned short&) sw/source/core/undo/rolbck.cxx:1083:50 8 SwUndoSaveContent::DelContentIndex(SwPosition const&, SwPosition const&, DelContentType) sw/source/core/undo/undobj.cxx:1020:39 9 SwUndoDelete::SwUndoDelete(SwPaM&, bool, bool) sw/source/core/undo/undel.cxx:229:9 11 sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&) sw/source/core/doc/DocumentContentOperationsManager.cxx:3939:55 Change-Id: Ia0c28c9d5792615cbb566e502374efd0f4056daf Reviewed-on: https://gerrit.libreoffice.org/75857 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-23convert nsRedlineType_t to scoped enumNoel Grandin1-1/+1
and move the auto-format embedded flag to a separate field Change-Id: I02155702389178fbfdf874f592d47a29f8759974 Reviewed-on: https://gerrit.libreoffice.org/72771 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-14tdf#42949 Fix IWYU warnings in sw/source/core/inc/[t-w]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7cd9837360e244741bfa22b4693fd221241daf12 Reviewed-on: https://gerrit.libreoffice.org/71833 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-25ubsan: use after freeCaolán McNamara1-1/+29
Change-Id: I1a3396d434f6cc5bb615bcb2fe06a819bc11c013 Reviewed-on: https://gerrit.libreoffice.org/71256 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-18forcepoint#80 avoid crashCaolán McNamara1-2/+10
Change-Id: I7a96d2951fbcd5f53a2f7e65e8c07926fc035a11 Reviewed-on: https://gerrit.libreoffice.org/70936 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-19tdf#42949 Fix IWYU warnings in sw/source/core/inc/[a-f]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I6c3ae806cbb4a00381e39414ff8c8fede5bf1733 Reviewed-on: https://gerrit.libreoffice.org/69150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-14sw btlr writing mode shell: fix cursor selectionMiklos Vajna1-4/+5
All changes are about not assuming logical top is a lower y value than logical bottom, by going via the SwRectFnSet abstraction, which already does the right thing. Change-Id: I94a9881b018ad14b02e97425f60af01aa3fd9269 Reviewed-on: https://gerrit.libreoffice.org/69226 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-12sw btlr writing mode: implement initial layoutMiklos Vajna1-2/+2
The bulk of this commit is reasonably straightforward, the interesting parts are: - SwFrame::CheckDir() is where the layout reads the doc model, i.e. sets the new SwFrame::mbVertLRBT. - We had 3 text directions previously: horizontal, vertical (implicitly RL) and vertical LR (implicitly TB). This adds a 4th text direction for the LRBT case. - SwTextFrame::SwitchHorizontalToVertical() is responsible for re-locating the origo of a string to be painted from the top left to the bottom left corner (in addition to the height/width swap that's done for all vertical directions). - Finally MapDirection() is the place where we map Writer's new btlr mode (with no character rotation) to VCL's 900 (90 degrees) rotated direction. No functional changes intended for existing text directions. Lots of places are still not yet adapted, but this is good enough to paint a single word in a table cell at the correct position with the correct direction. Change-Id: I465c62db6562d8a2be140c3d37473e590830139e Reviewed-on: https://gerrit.libreoffice.org/67740 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-11-15sw_redlinehide_3: fix SwAccessibleParagraph not being disposedMichael Stahl1-1/+3
If it is merged, it doesn't have GetDep(). Change-Id: I5a362c03fe7fcb0a6246aef0a0ac2824c48ede36
2018-10-10forcepoint#74 crash in layoutCaolán McNamara1-0/+3
Change-Id: Iad5770b512d7c49483ac823aa4f51212f281bbca Reviewed-on: https://gerrit.libreoffice.org/61628 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-03tdf#41542 sw cleanup: m_bBorderDist was always trueJustin Luth1-2/+2
This was forced to True in LO 5.4, leaving the variable intact in case any problems arose that would make it easier to revert. But now it is time to clean it up and remove the unnecessary logic. I didn't change the indenting because I don't like obscuring the significant changes. I can do that in a followup commit. Change-Id: Iab04a6a8f4ba8ff7151cf7941f655173136258eb Reviewed-on: https://gerrit.libreoffice.org/61270 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-09-19sw_redlinehide_2: JoinPrev() may need to move frames on deleted ...Michael Stahl1-2/+9
... prev. Node to the second node, if the two were merged before the Join. Change-Id: I047b6008c5f0bb6e79c63421a4dba09ba8cf3320
2018-09-19sw_redlinehide_2: fix ordering of SplitNode usage of ContentIdxStore 2Michael Stahl1-1/+8
The flys have their anchor positions updated, and that causes lookups from the layout frame to the anchor SwTextFrame, but that isn't updated yet; it looks like the fly restore must be done after adapting the SwTextFrames, while the redline restore must be done before. Also RegisterToNode must call Check only for the 1st node. Change-Id: If87a62108f1bcaf794e5be1cc38dc936f08cd69e
2018-09-19sw_redlinehide_2: show/hide footnotes in redlinesMichael Stahl1-1/+2
This requires some manual work to delete the footnote frames. Change-Id: I2c5efccdd1e97f26e18402b809ca4f893147cba1
2018-09-19sw_redlinehide_2: assert that SwContentFrame is created only when allowedMichael Stahl1-0/+1
Change-Id: I1b42b386eb7323dcbf40d4086276bd0a74d581b9
2018-08-09forcepoint73 deleted SwAnchoredObject still referenced in TmpConsiderWrapInflCaolán McNamara1-0/+1
Change-Id: If255723834d049865fcf6fd0eac7768dfcbad2a1 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>
2018-08-09dynamic_cast followed by static_castCaolán McNamara1-2/+2
Change-Id: I931ed8945b4af713ead42e0eca0bb5fb6cb07d9c Reviewed-on: https://gerrit.libreoffice.org/58759 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-08sw_redlinehide: SwContentFrame::DestroyImpl()Michael Stahl1-3/+8
Change-Id: I4539ef0a7dc04de1c87cf6f54ca319dbdc719755
2018-06-08sw_redlinehide: convert to GetDep()Michael Stahl1-1/+1
Change-Id: I3b128fe797e8fd6989821cfd540dc5e630e74d37
2018-06-08sw_redlinehide: use WriterMultiListener to connect SwTextFrameMichael Stahl1-1/+4
... with multiple SwTextNodes in CheckParaRedlineMerge() Change-Id: I57402ca7d2210fc30015b9a7e2e05216e0b8a8eb
2018-06-08sw_redlinehide: reinit m_pMergedPara on split nodeMichael Stahl1-0/+1
Change-Id: I560f1cdb537fa848fdbaf719424d4e6608ceda0d
2018-06-08sw_redlinehide: move SwContentFrame::RegisterToNode to SwTextFrameMichael Stahl1-1/+2
It is only called on SwTextFrame, since other SwContentFrame do not register at SwTextNode but their own node type. Change-Id: I2bbb4571810a407c33f526f6df526727bde67b65
2018-04-07Revert "long->sal_Int32 in tools/gen.hxx"Stephan Bergmann1-14/+14
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-03long->sal_Int32 in tools/gen.hxxNoel Grandin1-14/+14
which triggered a lot of changes in sw/ Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6 Reviewed-on: https://gerrit.libreoffice.org/48806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21loplugin:changetoolsgen in swNoel Grandin1-12/+12
Change-Id: If07efe4c15cfc28df38a9327856d39313ca78d50 Reviewed-on: https://gerrit.libreoffice.org/50078 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-04sw: convert SwFrame::mpDrawObjs to unique_ptrMichael Stahl1-6/+5
Change-Id: I0713e6fb2b3f2cfc3115daafe37ae5380f3e7938
2017-12-19loplugin:unusedmethodsNoel Grandin1-45/+0
Change-Id: I3ffd9142fed98e4df75c2c28f8a025be3e8eb803 Reviewed-on: https://gerrit.libreoffice.org/46687 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07SwFrameBorder: Removed IsInverse() from SwFrameArmin Le Grand1-2/+1
IsInverse was always false and never set, elliminating it from SwFrame makes the code cleaner and reduces cases for SwRectFnSet from 5 to 3, making it also more understandable. Cleaned up all the code using it, ran all UnitTests, works well. In question, this single commit can be re-applied. Change-Id: If077c65a6dacd83de61d259cddbb3cd4c5e25a2f
2017-12-07SwFrameBorder: Preparations and renamingsArmin Le Grand1-2/+2
As preparation to restucture the Paint of Borders for SwFrames (Writer), isolated and renamed some of Writer functionality to get a better overview Change-Id: I7b4d5acc84f0c52519c2de0e5a5caa68e75957b5
2017-10-31RotateFlyFrame2: Unified FrameAreaDefinitionArmin Le Grand1-62/+62
Isolated all Frame AreaDefinition and it's layout flags to SwFrameAreaDefinition class which is now base for SwFrame. Adapted calls to get/set and WriteAccess hekper classes accordingly. This allows much deeper understanding what Writer is doing when layouting it's frames and needed when reaction on such changes is necessary Change-Id: I96220a1d140e69c76cc63023aae26e4ed17f3504
2017-10-30Adapted to get methods and WriteAccess helpersArmin Le Grand1-36/+16
Change-Id: Ife3c1b2391ad7beae8c7f31f796b1454709ddd26
2017-10-30Adapted to get/setSwFrame and get/setSwPrintArmin Le Grand1-78/+78
Change-Id: I6cce40ec49dd5bd32d94fe06b9d2dabd368448be
2017-10-30Migrated from SwFrame::PrintWA to setPrintArmin Le Grand1-12/+32
Change-Id: Ieea3b467f296a190de5b5f47721bef148bebf60b
2017-10-30Migrated from SwFrame::FrameWA to setFrameArmin Le Grand1-26/+66
Change-Id: I01f7b828fe2134411cc76639e880da46b415d767
2017-10-30Isolated SwFrame members maFrane and maPrtArmin Le Grand1-64/+64
To gain more control over changes of the Writer layout, isolated mentioned members and replaced all calls with inline methods for read and/or write access. Moved to own class to also identify 'private' accesses reliably. Change-Id: Ib0b7f852f5176744e860e2aad12dd13c9a906d68
2017-06-05Improved loplugin:cstylecast to reference types: swStephan Bergmann1-1/+1
Change-Id: I7206d3325b4bfedb852d559b68dc1678da524b41
2017-04-11tdf#107057 revert the logic of SwFrame::PaintAreaMark Hung1-5/+0
It seems that getting the minimum of all the bottom the window doesn't work when there are merged cells. This reverts commit b13a0a27444ffbf9ef45cb16ad69fdff0dc64306. Change-Id: I39a22a477874794912e44d4f56c2de27bc5e7179 Reviewed-on: https://gerrit.libreoffice.org/36382 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-04-07tdf#106390 improve table in table and table in frame clipping.Mark Hung1-0/+5
Set bottom of PaintArea() with the topmost botom of the upper frames, in case table might be cover by upper frame. Change-Id: Id379469114af2c3c5f844a69b584863f7dd7fd4c Reviewed-on: https://gerrit.libreoffice.org/35237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-03-08convert SvxShadowLocation to scoped enumNoel Grandin1-1/+1
Change-Id: Ie51995579312328538263172cd3173641df89bca Reviewed-on: https://gerrit.libreoffice.org/34965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>