/source/kl/sw/

uokunlong.cn/lo/core' title='lo/core Git repository'/>
summaryrefslogtreecommitdiff
path: root/sw/source/core/inc/sectfrm.hxx
AgeCommit message (Collapse)Author
2024-12-28move RES_FMT_CHG to SfxHintNoel Grandin
SwUpdateAttr is re-using this constant for a similar purpose, so rather give that its own constant to play with RES_UPDATEATTR_FMT_CHG. Change-Id: I5ffe2a861c44948d8c7dbdd6cf1435c913985c6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179305 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-10-16loplugin:unusedmethodsNoel Grandin
Change-Id: I6ba4b4046190b701d4a15c6fa90b6009ecf4ab1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-25tdf#162614: report the reason why a frame couldn't growMike Kaganski
... and use it in SwTextFrameBreak::IsBreakNow to decide if the content needs to go to a follow or not. The problem was, that in a specific case of the bugdoc, the follow text line was taller than the fixed row height on that page; that resulted in an attempt to break it again, creating an empty follow in the same table cell; it was not moved to the next page, detecting the problem in SwTextFrame::CalcFollow, and the formatting looped, until loop control fired, calling SwLooping::Drastic, which validated all page's content, including tables below, that had invalid zero client (prn) height. It was very difficult to tell when the break is needed, and when it's not, without the information why some frame eventually denied growing its height by the requested amount. In the bugdoc case, I failed to find at the SwTextFrameBreak::IsBreakNow level anything that could be used as a reliable distinction; some heuristic conditions used there broke layout in unit tests left and right. So eventually, I came with this mechanism of reporting the "why I can't grow" reason back to the caller, using the new out argument. I believe that, beyond this use case, it might be useful in many other cases, both to ease the decision, and to prevent needless trial-and- error iterations, increasing stability and performance. The enum used for the reason reporting includes 'FlowToFollow' and 'BalancedColumns', that could be used in those other cases. However, for my needs here, I only need the FixedSizeFrame reason, telling that it's not a case when breaking to a next frame is possible, so preventing the break. The choice of reported reasons in this patch is mostly best guess; it may be wrong in some places. The crucial for the current fix is the assignment inside the '!(GetType() & nTmpType) && HasFixSize()' check of SwLayoutFrame::GrowFrame. Change-Id: I9ce5dd4d2298b60e186fdf485efb85ab304308ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172362 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-05-09tdf#160984 sw continuous endnotes: add a way to find the endnote section startMiklos Vajna
Existing code with endnotes on separate page at the end of the document works by searching for a current or next page that is an endnote page in SwFootnoteBossFrame::AppendFootnote(), and in case none is found, then an endnote page is created. Add similar infrastructure for the inline endnotes case: here we want to find the first page that has an endnotes section, which also requires being able to tell if a section is an endnotes one. The newly introduced SwPageFrame::GetEndNoteSection() is not yet used in SwFootnoteBossFrame::AppendFootnote(), though. Change-Id: Ib08267f9bf6c7b06576624e3fa8e90e8b8b1b232 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167371 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-04-08tdf#160067 sw floattable: fix missing move bwd of paras in split section frameMiklos Vajna
The last (5th) paragraph in the index was on page 2, even if page 1 still had space for it. This is a regression from commit 397d72e582c725d162c7e0b819dc6c0bb62e42b0 (Related: tdf#158986 sw floattable: fix unexpected page break with sections, 2024-02-23), in case SwLayAction::FormatLayout() doesn't calc its lower content frames then this bugdoc is good, but the old bugdoc moves its floating table to the next page, which would be bad. Fix the problem by making the condition for this "calc lower in FormatLayout()" action more strict: only do this for content frames which are in sections, followed by sections. Note that probably a cleaner way would be to completely stop calculating content frames in SwLayAction::FormatLayout() and only do that in FormatContent(), but then it's not clear how to re-fix tdf#158986, and at least this resolves the regression. Change-Id: Id671b3b68d8af8ad1cca3399a9aa028de58df3a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165878 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-02-14tdf#159565 prerequisite: make hidden sections have zero-height framesMike Kaganski
As mentioned in commit bb733957dd39e6f0b9d80bb59eb0177188794797 (tdf#114973 sw: enable SelectAll with hidden para at start/end, 2023-01-27), the hidden sections didn't have frames. That prevented correct handling of the case when such a frame was in the beginning of the document. This change re-implements the hidden section to use 0-height frames, like hidden paragraphs, as a pre-requisite for a follow-up change. Some layout breakages noticed while working on this are unit-tested now. This change needed to handle the case when the first section is hidden, and then goes a page break with page style. In this case, the page style must apply to the very first page of the document. Implementing this now, when the frame that defines the page style is not the first in the document, I accidentally fixed also the previously broken case when the first paragraph was hidden. Now the page style defined in the second paragraph's page break will apply correctly. This change makes hidden sections break outer section's frames. This means that when text borders are shown, there will be an artifact in the place of the hidden sections (a horizontal line breaking outer frame). I suppose it's not a problem, actually helping to see the layout better, so in line with the "show text borders" helper functionality. If this proves to be problematic, this can be handled specially in a follow-up. Change-Id: I14ebf0559b463186aba28902cd10c5cc978ba456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163151 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-24sw: extract SwSectionFrame::dumpAsXmlAttributes() from SwFrameMiklos Vajna
Allows getting rid of a static cast. Change-Id: Iaba2a328399dacad3e16efa15df4f23abec6f883 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159869 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-17sw: fold SwSectionFrame::dumpAsXmlAttributes() into dumpAsXml()Miklos Vajna
One dumpAsXml() per SwFrame subclass is enough, no need to have a separate function that dumps just the attributes. Also eliminate a manual reinterpret_cast<> and a static_cast<>. Change-Id: I99c44f4b097586bdc174d3133bbb4ee9f26e57cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155747 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-05-12sw layout xml dump: extract SwSectionFrame::dumpAsXml() from SwFrameMiklos Vajna
Ideally SwFrame should not really know anything about section frames. Change-Id: I713c4646815e681c377e18ae0e1e0b77c15cf5a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151688 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-20tdf#154113: do not forget to split the outermost section frameMike Kaganski
... when the inserted section node is not the first one. The very first frame, where InsertCnt_ puts content to, may already have some content after the insertion position. When an inner section ends, the current section needs a new frame, and the rest of content must go to that new frame. Previously, the new empty frame was created without taking the content move into account. This moves the split into the single place inside InsertCnt_, to avoid special processing in MakeFrames. Change-Id: I1335ebbc620af0f2b064141e8267e5bd1af0b195 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150675 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-18bApres -> bAfterMike Kaganski
Change-Id: Iac6965fa7695e9123b7861add6e4425bb31b79ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150574 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-11tdf#146605 sw: try to fix SwSectionFormat notificationsMichael Stahl
SwSectionFormat no longer notifies via its SwModify to SwClient listeners, but only via SvtBroadcaster, so SwSection and SwSectionFrame need to be SvtListeners. This can be seen when changing the footnote-at-end setting in the section dialog, if the SwSection doesn't get the event the footnote numbers aren't adapted to a new restart value, if the SwSectionFrame doesn't get the event the footnote container isn't moved. This is of course not pretty but hopefully it will be refactored further in the future. (regression from commit 2e32f4ed5af16a68c97a50806a42ffa2d10f1d7a) Change-Id: I93c616e209a01fc5d4c8eba701a6ddce5d5b432e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128257 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>