path: root/sw/source/core
AgeCommit message (Collapse)AuthorFilesLines
1 min.Replace magic numbers in SwPageFrame::UpdateAttr_()HEADmasterMiklos Vajna1-9/+9
By using the same SwPageFrameInvFlags constants that SwPageFrame::SwClientNotify() already does. Change-Id: Ic07ce518901890367ce95080bf2a588697b8990b Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
16 hourstdf#142080 sw: layout: fix infinite loop in CalcContent()Michael Stahl1-5/+9
On page 9, SwSectionFrame::Format() calls CalcContent() and that formats all its content frames, then on SwTextFrame 91 SwObjectFormatter::FormatObj() fails becuase it moved forward. With commit c799de145f7e289f31e3669646e5bd12814e6c5e this now sets the o_rbPageHasFlysAnchoredBelowThis to true, which prevents a call to SwLayouter::InsertMovedFwdFrame(), and the flys anchored in next frames aren't moved off the page at this time. Then the loop starts over at the beginning of the SwSectionFrame, and frame 91 will be formatted again because the loop tries to format the first frame on the next page to see if it will move back; now the MoveBwd() isn't prevented any more so the result is the same failure in SwObjectFormatter::FormatObj(). Fix this by ignoring the bRestartLayoutProcess in case the current frame was originally on the next page and didn't move back (or, as is the case here, moved back and then forward again); it should just be formatted again on the next page. Once that happens, it will eventually be entered into SwLayouter::InsertMovedFwdFrame() too. This happens to fix another problem with this bugdoc too: the first column of the section on page 9 is empty. This also happens in LO 6.4 but not LO 6.1. An alternative would be to move the flys anchored below off the page as is done in SwLayAction::FormatContent() now but sections can be in flys or footnotes or headers so perhaps it should be done only at the top-level. (regression from c799de145f7e289f31e3669646e5bd12814e6c5e) Change-Id: I0965aebb4e3cec687f4e70f8d5e3aa8a55da3393 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
25 hoursIntroduce SwPageFrameInvFlags to replace magic numbers in ...Miklos Vajna2-22/+38
... SwPageFrame::SwClientNotify() SwPageFrame::UpdateAttr_() is not yet updated to produce these. Change-Id: Id45162b11ca9bf60f0f0ae43fc22cc2086e0fd67 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
38 hourstdf#141945 sw: layout: check master frame when moving fly forwardMichael Stahl1-1/+4
The problem is that in the finished layout the fly frames are positioned on the first page but are in SwPageFrame::m_pSortedObjs of the second page. Don't use FindPageFrameOfAnchor() because that looks up the follow-frame that contains the anchor position. This was unintentional; the idea was to get flys anchored in subsequent paragraphs out of the way. This situation where it's on a follow-frame of the same paragraph is more complicated and less obvious, so don't try to solve it now. (regression from eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf) Change-Id: Ic6809a43c467955368807ccc82a7873c29fbfc2e Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
41 hourstdf#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: Tested-by: László Németh <> Reviewed-by: László Németh <>
46 hourscid#1478174 Uninitialized scalar fieldCaolán McNamara1-0/+1
Change-Id: Ib17e55b600012ef5f6a26d01e9d54aa7be9c590d Reviewed-on: Tested-by: Jenkins Tested-by: Caolán McNamara <> Reviewed-by: Caolán McNamara <>
3 daysloplugin:stringadd improvement for appending numbersNoel Grandin1-3/+3
I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
3 dayssw: prefix members of BaseFrameProperties_Impl, SwDocStyleSheetPool, ...Miklos Vajna2-15/+15
... SwShapeDescriptor_Impl and SwStyleSheetIterator See tdf#94879 for motivation. Change-Id: I5602b7e94da0e5b004a45bed56d8c231b11004f5 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
4 dayssal_uLong->sal_uInt32 in SvParserNoel Grandin2-4/+4
Change-Id: Ibe5599e1cc136330a8e9c089c7cc66d0ef4bc966 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
4 daysthrow() -> noexcept, part 2/3: Automatic loplugin:noexcept rewriteStephan Bergmann21-43/+43
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
4 daystdf#79049 speed up OOXML workbook load (4)Noel Grandin2-13/+9
Optimise LocaleDataWrapper for reads by initialising the data we in the constructor, so we don't need any kind of locking Reduces load time from 34s to 28s. Change-Id: I4bd3bddb30b70ba015fe5b1372534f9507762b74 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
6 dayssw: add some SAL_INFO on DoIdleJob interruptMichael Stahl1-0/+6
Change-Id: I44df06ab4bad1a5e0aaf5409590f5d7869f33482 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
6 dayssw: speed up DoIdleJobs(WORD_COUNT)Michael Stahl1-0/+8
SwTextNode::CountWords() has early returns that don't clear the WordCountDirty flag, for nodes that don't contain any plain text. This speeds things up considerably for tdf135116-1.odt, which didn't finish the idle jobs after 5 minutes in an optimized 7.1 build, because the time slice tends to expire iterating nodes in word-count before it can make progress. With this it does ~25 WORD_COUNT pages and then ~90 AUTOCOMPLETE_WORDS pages per idle, sending OnLayoutFinished after 13-14 seconds. jmux just pointed me to commit 0fedac18214a6025401c4c426466a5166553e8ec which is not in 7.1 today and may have improved the performance here. Change-Id: I5e9651da3a173649c49fc36edefb23298dfd6bc4 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
6 daystdf#78864 sw track changes: cross out deleted imagesLászló Németh3-1/+59
Show Changes mode shows deleted images with crossing out to allow differentiate deleted and inserted images during change tracking. See also commit d6322bcedc197a654abc7d64bfea8cf570f123bf (tdf#59463 track changes: record deletion of images). Change-Id: If9bc2252c6cdd06cbe267fe130023c416aa53ce7 Reviewed-on: Tested-by: László Németh <> Reviewed-by: László Németh <>
7 daysReplace magic numbers in SwFlyFrame::UpdateAttr_()Miklos Vajna1-12/+19
By using the same SwFlyFrameInvFlags constants that SwFlyFrame::SwClientNotify() already does. Change-Id: Ib0775c34cb4b1c6bec4455216ebb2dea3976d007 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
7 daysremove support for BITMASK in vcl backendsNoel Grandin1-1/+1
Rather use a proper alpha channel if we need transparency. This is another small step towards merged alpha in our vcl layer. I suspect the intent in a lot of this code was to save memory. Which have been a thing way back then, but these days our backends mostly end up doing a copy-and-convert to a real alpha channel anyway, so the existing code is actually now a pessimisation. Change-Id: I4a2bcbb2f76b841f05bc00580f364492829c69de Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
7 daystdf#137741 Add ability to navigate by fields from Navigate By controlJim Raykowski1-1/+2
Change-Id: I3cc464a3d5097b4e0438ea22ebf6daad5a2f2a86 Reviewed-on: Tested-by: Jenkins Reviewed-by: Jim Raykowski <>
7 dayscreatePixelProcessor2DFromOutputDevice won't return nullCaolán McNamara2-11/+6
nor will createProcessor2DFromOutputDevice Change-Id: I1e0359ef2f94eeaf2da9a89d9e9dfb615587d3da Reviewed-on: Tested-by: Caolán McNamara <> Reviewed-by: Caolán McNamara <>
8 daysuse string_view in INetURLObject::encodeNoel Grandin2-2/+2
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
8 dayssw bibliography: fix warning when de-selecting a biblio entry fieldMiklos Vajna2-6/+8
De-selecting a biblio entry field resulted in this warning: warn:sw.core:3311:3311:sw/source/core/fields/authfld.cxx:104: SwAuthorityFieldType::RemoveField: pEntry is not my field But this was even an assert before commit 64ffabbdb2725e93de997171708bb31c33c93a55 (sw bibliography, refer to a page: make the biblio field clickable, 2021-03-12). It seems the root of the problem was: - SwAuthorityFieldType has a list of SwAuthEntry instances that its SwAuthorityFields may have - when the field is selected, we copy the selection to a clipboard document, using SwFEShell::Copy() - this calls SwAuthorityFieldType::AppendField() to register the SwAuthEntry, but that registers a copy instead - SwAuthorityFieldType::RemoveField() then asserted that the original SwAuthEntry is part of SwAuthorityFieldType's list, but it was not Fix the problem by returning a reference to the copied SwAuthEntry in SwAuthorityFieldType::AppendField(), that fixes the warning and then we can turn this back to an assert, to detect problems where an unregistered SwAuthEntry would be de-registered. In practice this caused a problem in the Insert Bibliography Entry dialog: bibliography source = document content case uses SwAuthorityFieldType::GetAllEntryIdentifiers() to provide a list of sources, and this way sources were not removed from that list when deleting biblio entry fields. Change-Id: Iea4fa44302aaac0daa122bbf227888d1dbb06597 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
8 dayssw: layout: let nested table move forwardMichael Stahl1-2/+1
The problem is that a nested table at the bottom of the page doesn't fit into its cell, but it is split and its first row still remains on the page where it doesn't fit. The outer table 3 tries to split with bTryToSplit=true. In SwTabFrame::MakeAll(), first a split of the nested table 435 with bTryToSplit=true is attempted; this fails and is partially undone - the follow flow line is removed, but the last 2 rows remain in follow. The bTryToSplit=false is skipped because there's only one row now. Then MoveFwd() is tried, but it fails because the top-level table doesn't have a previous frame. Then bTryToSplit=false is tried, and succeeds, again leaving row 436 on page 1 and other 2 in follow. Now another attempt with bTryToSplit=true is made, failing again, not effectively changing anything. During all of this, growing of the outer cell frame 434 and row frame 433 is prevented by the outer table 3 having a follow flow line, see SwRowFrame::GrowFrame(). The result is that cell 434 has content area height 190 but the table 435 with its single row is all valid with height 406, so it's cut off in the rendering. This doesn't happen for SwTextFrame inside table because that one does the MoveFwd(). Plausibly it's the inner table's responsibility to finish with a valid state that fits the constraints of the current page; there are some checks in lcl_RecalcSplitLine() to check for no content frame in the row but none for the row being too small to contain the content that was formatted. So the only valid results for the inner table are that it either moved forward, or it left behind a row containing no content (such as that produced by its own failed attempt to split with bTryToSplit=true), which could be handled by the outer table split code - but the latter could be insufficient in case the outer table is itself a follow, or at least would require further changes in lcl_RecalcSplitLine(). So fix this by removing a condition in MoveFwd() that doesn't make any sense to me - why is it relevant for an inner table during a split of the outer table whether the outer table itself can move forward? Change-Id: I1e01ce233383cc70b9aea72d25369b7278eb75f0 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
8 dayssw: fix crash in SwFormatAutoFormat::dumpAsXml()Michael Stahl2-2/+8
Change-Id: Ib2d723b34d8e6f1254f5a9b0d0be509daf24ce43 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
8 dayssw: fix crash in SwAnchoredObject::dumpAsXml()Michael Stahl1-1/+2
SwAnchoredObject::GetObjBoundRect() is const, so it's only idiomatic that calling it reformats everything. Change-Id: Id57472ae3041c7264bc904e1a68907c48e60ac96 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
8 daysIntroduce SwFlyFrameInvFlags to replace magic numbers in ...Miklos Vajna2-27/+44
... SwFlyFrame::SwClientNotify() SwFlyFrame::UpdateAttr_() is not yet updated to produce these. Change-Id: Ie29d900c1796c868d051ffd9c28600e44ff3b704 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
9 daysuse string_view in INetURLObject::decodeNoel Grandin2-2/+3
Change-Id: I10e04970ceac33c9c3fbfd0182dd2140e06cb80b Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
9 daysloplugin:stringadd convert chained append to +Noel Grandin2-8/+8
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
9 daystdf#138604 sw textbox copy: fix missing fly frames of as-char draw frameMiklos Vajna2-0/+17
Regression from commit 682e0488df819c191c13a03758fad0690706e508 (tdf#134099 sw: fix textbox anchors on copy-paste and undo, 2020-06-29), now that we don't copy draw+fly format pairs more than once, the fly frame of a fly format was missing. This was broken because sw::DocumentContentOperationsManager::CopyFlyInFlyImpl() calls CopyLayoutFormat() with bMakeFrames=true, but the frame format list doesn't contain as-char frames. For as-char frames CopyLayoutFormat() is called by SwTextFlyCnt::CopyFlyFormat() instead, but with bMakeFrames=false, so the fly frame's layout frame were never made. Fix the problem by explicitly making frames in DocumentLayoutManager::CopyLayoutFormat(), which also requires delete+make in SwTextFlyCnt::SetAnchor(). [ This is now consistent with the start of SwTextFlyCnt::SetAnchor(), which also deletes frames for fly frame formats. Otherwise CppunitTest_sw_core_txtnode would crash in testTextBoxCopyAnchor. ] Change-Id: I87003ee09ca75b9fecd70a1aa5c42f762f715be8 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
9 daysCommandType is "long" type not "short" typeJulien Nabet1-1/+1
See + discussion here: Important remark from Stephan: "...the data type corresponding to UNOIDL LONG (i.e., 32 bit) is xs:int, not xs:long" Change-Id: Ic8f027e8a5be96bdb2e5629b0ff1ef4830ef6c88 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>
9 daystdf#141924: SwFormatAutoFormat::GetStyleHandle may return nullptrMike Kaganski1-3/+5
Change-Id: Id1b6fe687f5b328fa0743036a287bacfefe5e5fb Reviewed-on: Tested-by: Mike Kaganski <> Reviewed-by: Mike Kaganski <>
9 daysSW merge layout shortcut into the full layout codeJan-Marek Glogowski1-31/+10
The shortcut codepath just skips a large part of the full layout code. To make this more obvious, this refactors the main layout loop by merging both paths, really skipping the code in the shortcut case and getting rid of all the duplicate code. Change-Id: I015202e86e75576f03901746e1a082e9f6811549 Reviewed-on: Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <>
9 daysSW layout: convert XCHECKPAGE to lambdaJan-Marek Glogowski1-34/+23
Some refactoring, better to debug then preprocessor macro code. Change-Id: If2e8b126915b97dfa1d132713a57948993eace15 Reviewed-on: Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <>
10 dayssw: prefix members of SaveBox, SaveLine, SwDocStyleSheet and ...Miklos Vajna2-73/+76
... SwXTextTableRow See tdf#94879 for motivation. Change-Id: I1d27caebc8820f884114c4a8c0b3cbcdf35e86a7 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
13 daysno need to create temporaries when appending number to O[U]StringBufferNoel Grandin2-7/+7
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
14 daystdf#138518 sw: layout: avoid moving flys forward prematurelyMichael Stahl3-17/+152
(regression from b9ef71476fd70bc13f50ebe80390e0730d1b7afb "tdf#134298 sw: layout: remove left-over page frame without content") When updating the 3rd ToX, the change to remove empty page frames causes one page frame to be deleted. On the subsequent layout, things generally move backward, but there are some fly-related hiccups; the first problem is visible on page 7. Commit eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf "sw: layout: if fly's anchor moves forward, move fly off SwPageFrame" helps quite a bit, but not completely; now the first problem happens on page 54, when SwTextFrame 1261 and its fly 3132 are formatted. Frame 1261 moves forward to page 55, and then SwObjectFormatterTextFrame::CheckMovedFwdCondition() returns true and so SwMovedFwdFramesByObjPos::Insert() is called to prevent frame 1261 from moving back to page 54. But the reason why it moved forward is that there are 3 flys on page 54 that are anchored on frames in the next-chain of 1261, namely 1275, 1283 and 1284; if these flys weren't on the page then 1261 would fit. While the move forward cannot be easily prevented in the situation, it's possible to avoid the entry into the SwMovedFwdFramesByObjPos map, by detecting that there are flys on the page that would should forward *before* the current one does. With this fix and the above mentioned commit to get the flys off the page, frame 1261 will eventually move back to page 54 again. Change-Id: I83e44d65a0b889a49a313b0cd8b08efce4c3afa7 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
2021-04-22Replace magic numbers in SwFrame::UpdateAttrFrame()Miklos Vajna1-7/+11
By using the same SwFrameInvFlags constants that SwFrame::SwClientNotify() already does. Change-Id: I029006f95758bd91515ecc59ae02b28396a57d0d Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2021-04-21loplugin:stringadd replace OUStringLiteral temporaries with OUString::ConcatNoel Grandin2-2/+2
Change-Id: I656f06a74d9f0180ae460264563d6a935c7d2c60 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2021-04-21Introduce SwFrameInvFlags to replace magic numbers in SwFrame::SwClientNotify()Miklos Vajna2-20/+36
SwFrame::UpdateAttrFrame() is not yet updated to produce these. Change-Id: Ibe822139858cbb39a9ecc14e9631dde8ba369871 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2021-04-20sw bibliography table, text generator: handle relative URLsMiklos Vajna2-1/+36
Now that the doc model always contains absolute URLs, it is possible to decide when it does and when it doesn't make sense to convert to relative URLs. The bibliography table does a mixed approach: the document text depends on configuration (relative by default), but the underlying URL is an absolute one. This way it's always clickable and the ODT filter can save it as a relative one (again, depending on configuration). With this, all fields are meant to be clickable: biblio field vs biblio table, relative or absolute ones, with or with a (page) fragment, Writer UI vs PDF export. Change-Id: Ib6879709314fa127094faf7fa615fe57289b41f1 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
2021-04-20tdf#138785 sw: fix mis-positioned as-char flys when deleting empty pageMichael Stahl2-0/+6
When SwFrame::CheckPageDescs() deletes an empty page in the middle of the document, which happens during SetRedlineFlags() here, the SwFlyInContentFrame::maFrameArea is moved in lcl_MoveAllLowers(), but the SwFlyInContentFrame::m_aRefPoint stays unchanged. Because the formatting occurs only after the redline mode is reset, the position of the SwFlyInContentFrame when it is formatted is exactly the same as its (stale) m_aRefPoint, so the setting of (updated) maFrameArea is skipped in SwAsCharAnchoredObjectPosition::CalcPosition(), so the fly ends up a page above where it should be. So keep m_aRefPoint consistent with maFrameArea in lcl_MoveAllLowers(). (regression from b9ef71476fd70bc13f50ebe80390e0730d1b7afb) Change-Id: If1b421daa0d71718d89d9772f5c0d9e367e76845 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
2021-04-20use OUString::Concat here, not OUStringLiteralNoel Grandin1-1/+1
Change-Id: Ia2172bcab60f32c9d9d4f6ca0230484343eef69b Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2021-04-19sw: layout: if fly's anchor moves forward, move fly off SwPageFrameMichael Stahl7-9/+73
The problem is that on Show Changes->Hide Changes->Show Changes in a 311 page document, the fly "Grafik1" was initially on page 203 but ends up on page 204, with a fly-sized gap on page 194. In a 25 page cut down version of the bugdoc, on layout action 659 the fly's anchor SwTextFrame moves from page 21 to page 22, but the fly remains in the SwPageFrame's m_pSortedObjs, because it's not the anchor frame itself that moves but a distant previous frame, and page 21 goes valid. 0 SwFlowFrame::PasteTree(SwFrame*, SwLayoutFrame*, SwFrame*, SwFrame*) (pStart=0x57c9e30, pParent=0xba15c50, pSibling=0x5a0f920, pOldParent=0xb057690) at sw/source/core/layout/flowfrm.cxx:586 1 SwFlowFrame::MoveSubTree(SwLayoutFrame*, SwFrame*) (this=0x57c9f48, pParent=0xba15c50, pSibling=0x5a0f920) at sw/source/core/layout/flowfrm.cxx:677 2 SwFlowFrame::MoveFwd(bool, bool, bool) (this=0x57c9f48, bMakePage=true, bPageBreak=false, bMoveAlways=false) at sw/source/core/layout/flowfrm.cxx:2061 3 SwContentFrame::MakeAll(OutputDevice*) (this=0x57c9e30) at sw/source/core/layout/calcmove.cxx:1831 4 SwFrame::OptPrepareMake() (this=0x57c9e30) at sw/source/core/layout/calcmove.cxx:399 5 SwFrame::OptCalc() const (this=0x57c9e30) at sw/source/core/inc/frame.hxx:1065 6 SwLayAction::FormatContent_(SwContentFrame const*, SwPageFrame const*) (this=0x7ffec0191b30, pContent=0x57c9e30, pPage=0xb9a1fd0) at sw/source/core/layout/layact.cxx:1833 In subsequent layout actions the anchor frame moves forward one page at a time, until in action 665, when things get really interesting. On page 24, the anchor text frame 582 is formatted for the first time, and it moves the fly to page 24, after positioning it on the page. 2 SwPageFrame::MoveFly(SwFlyFrame*, SwPageFrame*) (this=0xb9a1fd0, pToMove=0x641d310, pDest=0x9125bb0) at sw/source/core/layout/flylay.cxx:972 3 SwFlyAtContentFrame::RegisterAtCorrectPage() (this=0x641d310) at sw/source/core/layout/flycnt.cxx:1432 4 SwAnchoredObject::SetVertPosOrientFrame(SwLayoutFrame const&) (this=0x641d468, _rVertPosOrientFrame=...) at sw/source/core/layout/anchoredobject.cxx:195 5 SwFlyAtContentFrame::MakeObjPos() (this=0x641d310) at sw/source/core/layout/flycnt.cxx:1466 6 SwFlyFreeFrame::MakeAll(OutputDevice*) (this=0x641d310) at sw/source/core/layout/flylay.cxx:223 7 SwFlyAtContentFrame::MakeAll(OutputDevice*) (this=0x641d310, pRenderContext=0x55b1f00) at sw/source/core/layout/flycnt.cxx:384 8 SwFrame::PrepareMake(OutputDevice*) (this=0x641d310, pRenderContext=0x55b1f00) at sw/source/core/layout/calcmove.cxx:375 9 SwFrame::Calc(OutputDevice*) const (this=0x641d310, pRenderContext=0x55b1f00) at sw/source/core/layout/trvlfrm.cxx:1791 10 SwFlyFrame::Calc(OutputDevice*) const (this=0x641d310, pRenderContext=0x55b1f00) at sw/source/core/layout/fly.cxx:2874 11 SwLayAction::FormatLayoutFly(SwFlyFrame*) (this=0x7ffec0191b30, pFly=0x641d310) at sw/source/core/layout/layact.cxx:1455 12 SwObjectFormatter::FormatObj_(SwAnchoredObject&) (this=0xa5c0d10, _rAnchoredObj=...) at sw/source/core/layout/objectformatter.cxx:286 13 SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool) (this=0xa5c0d10, _rAnchoredObj=..., _bCheckForMovedFwd=false) at sw/source/core/layout/objectformattertxtfrm.cxx:135 14 SwObjectFormatter::FormatObjsAtFrame_(SwTextFrame*) (this=0xa5c0d10, _pMasterTextFrame=0x0) at sw/source/core/layout/objectformatter.cxx:408 15 SwObjectFormatterTextFrame::DoFormatObjs() (this=0xa5c0d10) at sw/source/core/layout/objectformattertxtfrm.cxx:337 16 SwObjectFormatter::FormatObjsAtFrame(SwFrame&, SwPageFrame const&, SwLayAction*) (_rAnchorFrame=..., _rPageFrame=..., _pLayAction=0x7ffec0191b30) at sw/source/core/layout/objectformatter.cxx:160 17 SwLayAction::FormatContent(SwPageFrame const*) (this=0x7ffec0191b30, pPage=0x9125bb0) at sw/source/core/layout/layact.cxx:1675 18 SwLayAction::InternalAction(OutputDevice*) (this=0x7ffec0191b30, pRenderContext=0x55b1f00) at sw/source/core/layout/layact.cxx:771 Nothing invalidates page 21 now that the fly is gone, and formatting on page 24 is kind of pointless now because everything from page 21 on is wrongly positioned. (It's possible to skip out of the main layout action loop via SetNextCycle()/IsAgain(), but at this point it's in layact:771 in the layout-all-the-visible-pages loop that follows the main loop, and that one can't be cancelled.) Then DoFormatObjs() is called on frame 582, and this calls FormatAnchorFrameForCheckMoveFwd(), which formats previous frame 581, splitting it and moving its follow along with 582 to page 25. Here SwMovedFwdFramesByObjPos::Insert() is called, and now the anchor text frame 582 cannot move back to page 24 because it's prevented by SwMovedFwdFramesByObjPos::FrameMovedFwdByObjPos(), but that was all based on the wrong assumption that the pages before 24 were completely formatted (this happens in action 670). Something later formats page 21 again, and so at the end there is a fly-sized hole at the bottom of page 24, with frame 582 at the top of page 25. It won't help to detect a situation where the fly is on a page previous to the page it's anchor frame is on in DoFormatObjs() because it was actually moved to the same page in a previous formatting of the anchor frame, in the same layout action. To fix this, try to detect in SwLayAction::FormatContent() if the anchor frame of any fly on the page has moved forward, and move those flys off the page; this is enough for the 25 page document. The 311 page document still has a hole on page 194 though; apparently the last content frame on the page is never reformatted, so invalidate its size. Change-Id: I232c6b305e8593bfecd885c36058777f3980f82f Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
2021-04-19use more string_view in comphelper::stringNoel Grandin2-2/+2
Change-Id: I5d27824694e38de540e5f1fcd8704f8777f65140 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2021-04-19sw: prefix members of SwDoCapitals, SwDoGetCapitalSize, SwFntObj and ...Miklos Vajna6-87/+88
... SwFrameEventDescriptor See tdf#94879 for motivation. Change-Id: If2f85e543bc482e59ebe47a398df716f76b9adbd Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
2021-04-19tdf#141550 tdf#141557 tdf#140975 sw: fix textbox crashAttila Bakos (NISZ)2-105/+258
and regressions by refactoring SwTextBoxHelper. tdf#141550 was a DOCX import regression from commit ff321dd36554d25f0817903becf4598065e0a194 (tdf#140828 sw textbox: fix AS_CHAR regression), resulting bad horizontal position of the frame of the textbox. tdf#141557 was a regression resulting crash by changing text box anchoring "To Paragraph". tdf#140975 was an implementation error, resulting broken textbox by changing box anchoring to "As Character". In the SwTextBoxHelper class there were many repeating code parts for textbox positioning. Now these parts have been replaced with the calls of several new functions: 1) getShapeFormat() returns with the SwFrameFormat of the UNO XShape; 2) setWrapThrough() only sets the surround of the textframe (used in the code frequently); 3) changeAnchor() sets the anchor of the textframe according to the anchor of the shape; 4) doTextFramePositioning() sets the position of the textbox according to the shape (used in the code frequently); 5) isAnchorTypeDifferent() shows difference of the anchor types of the shape and the textframe. Also it handles the situation of anchoring "As Character"; 6) isTextBoxHasValidTextFrame() checks if the shape is a part of a textbox or not. Every function returns with true on success, otherwise gives information to the log. All of them can be called with ShapeFormat or UNO XShape. The goal of this to make the possibility to advance this class for further functions – rotation, grouped textboxes etc. – without code copying. Change-Id: I4441cab87931f161d0ace4983646d6d2a68a7321 Reviewed-on: Tested-by: László Németh <> Reviewed-by: László Németh <>
2021-04-19cid#1476278 silence Null pointer dereferencesCaolán McNamara1-1/+3
Change-Id: I8b98551c284d04378fe6dfa254be4f5f09efd9e6 Reviewed-on: Tested-by: Jenkins Reviewed-by: Caolán McNamara <>
2021-04-19Fix two string matches to not include the trailing NULsStephan Bergmann1-2/+2
...which had apparently been broken ever since they got introduced with 399fb822ef81bd2440da8ab48cc2028a6b44d5b7 "swunolocking1: #i105557#: fix locking for SwXDocumentIndex". (The first mis-use of sizeof had already been silently fixed with 46ce0d28b4c765076c7871358375c4e85e44534b "loplugin:stringliteralvar look for assignments". And we can now use the OUString::match overloads that take const char arrays, instead of using OUString::matchAsciiL, and simplify the first one even further to use OUString::startsWith.) Change-Id: I1e7975f29e225bae74ed0c2d447e541fa47bd954 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2021-04-16lok: force writer web-view off.Michael Meeks1-1/+6
A number of callers mutate this, so make the setting un-writable. Change-Id: I0a3727020309b92543e42730c997168f076e7bfb Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Meeks <>
2021-04-16tdf#141525 Fix "Line with Arrow/Circle" insertion error.Jeff Huang1-0/+8
When you insert "Line with Arrow/Circle" from "Lines and Arrows", it will show "Line Starts with Arrow" instead of "Line with Arrow/Circle". This patch can fix this issue. (This issue exists at least since 6.3 series.) Change-Id: I827b9582951fe359d89245970e73d63f7697553f Reviewed-on: Tested-by: Jenkins Reviewed-by: Mark Hung <>
2021-04-15store ptr to the original entries in SfxItemPropertyMapNoel Grandin18-160/+160
instead of copying them to a new data structure that is practically identical. Helps startup time since we build a ton of these when loading documents. And use o3tl::sorted_vector as a dense map data structure to reduce allocations and improve cache friendliness, since this is a build-once thing. Change-Id: I950be03b1a21c0c81c40f2677d4215f5e8e256cf Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2021-04-15sw: avoid rel<->abs URL conversion in SwTOXAuthority::GetSourceURL()Miklos Vajna2-19/+18
Suggested at <>, turns out we can clear the fragment of a relative URL without converting to an absolute one, which is less code and probably behaves better with a not yet saved document (empty base URL). Change-Id: I8cee210aada10a3e8049e5b7a6921f1be4445bb8 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins