ESC meeting minutes: 2024-06-13
* Present: + Cloph, Michael W, Olivier, Caolan, Heiko, Hossein, Xisco, Ilmari, Jonathan, Michael S, Eike, Stéphane, Regina, Stephan, Miklos * Completed Action Items: + Commit access: Heiko to send the welcome mail to Bayram + Commit access: Cloph to enable the commit bit for Bayram * Pending Action Items: * Release Engineering update (Cloph) + 24.2: 24.2.5 RC1 in 2 weeks + 24.8: + beta1 was tagged a bit later, python 3.8 was near EOL + now shipping 3.9 + might break compat with Windows 7 + depending on test results, may need to raise the Windows baseline + https://github.com/nalexandru/api-ms-win-core-path-HACK + Windows 7 is deprecated already in the release notes + should update release notes when this is known (Ilmari) + https://wiki.documentfoundation.org/ReleaseNotes/24.8#Platform_Compatibility + is beta1 built already? (Xisco) + yes, the trick is to find a Windows 7 system (Cloph) + can announce it tomorrow in the qa blog (Xisco) + call for testing + explicitly mention we look for Windows 7 testers + in sync with the idea that we support OSes as long as supported by their vendors, only best effort after that (Cloph) + Minimum Python version policy (Ilmari) + Nothing is mentioned in any readme or system requirements page at the moment + no problem with the python ide integration anymore (Cloph) + given we have python 3.9 by now + would be ideal to update python further on master + Python release cycle (Hossein) https://devguide.python.org/versions/ + like the idea, to update to 3.12 (Hossein) + around this time is a good time (Xisco) + what if removing old version checks? (Ilmari) + that's mostly for enterprise distros that build rpm packages (Michael S) + need to ask Eike and the SUSE maintainer + they usually build new LO against old system baseline + Fedora 41 is heading for 3.13 at the moment + would be ideal to still lock down what is the needed baseline (Ilmari) + once known, good to document it in README.md (Miklos) + and just mention LTS distros are the intended baseline, OK to clean up the rest (Cloph) + beta2 in 1 week, if needed + no plans so far (Cloph) + string / UI freeze in 2 weeks + late features? + late addition to the notes page in Impress in the works (Thorsten) * Documentation (Olivier) + Helpcontents2 + Updates and fixes (stragu, sberg) + improvements in contents (erack, A. Romedene) + New pages: LET function (ohallot) + Guides + work in progress. + Question from community + Do we have (visible) documentation for oovbaapi/ (VBA api)? + should it be published? + list of what works and what doens'nt + (purpose: advise to public, get people to contribute). + know that the full VBA API is documented on the Microsoft side (Olivier) + Noel had some concerns if this is published too widely, it makes later fixes / improvements harder (Miklos) + probably it's not intentional that this is excluded in odk/, though (Miklos) + hard to document StarBasic vs .NET Basic differences (Hossein) + Bugzilla Documentation statistics 250(250) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 7(-3) 48(-2) 103(-10) 233(2) commented 12(-10) 100(0)233(-31) 898(7) resolved 2(-1) 26(-1)62(-6)134(1) + top 10 contributors: Dione Maddern made 67 changes in 1 month, and 98 changes in 1 year Olivier Hallot made 38 changes in 1 month, and 264 changes in 1 year Stéphane Guillou made 20 changes in 1 month, and 253 changes in 1 year Vernon, Stuart Foote made 16 changes in 1 month, and 121 changes in 1 year Heiko Tietze made 14 changes in 1 month, and 84 changes in 1 year Ilmari Lauhakangas made 12 changes in 1 month, and 81 changes in 1 year Dieter made 10 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Timur made 6 changes in 1 month, and 8 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 239(239) (topicUI) bugs open, 38(38) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-2) 11(0) 16(0) 23(-1) commented
ESC meeting minutes: 2024-06-13
* Present: + Cloph, Michael W, Olivier, Caolan, Heiko, Hossein, Xisco, Ilmari, Jonathan, Michael S, Eike, Stéphane, Regina, Stephan, Miklos * Completed Action Items: + Commit access: Heiko to send the welcome mail to Bayram + Commit access: Cloph to enable the commit bit for Bayram * Pending Action Items: * Release Engineering update (Cloph) + 24.2: 24.2.5 RC1 in 2 weeks + 24.8: + beta1 was tagged a bit later, python 3.8 was near EOL + now shipping 3.9 + might break compat with Windows 7 + depending on test results, may need to raise the Windows baseline + https://github.com/nalexandru/api-ms-win-core-path-HACK + Windows 7 is deprecated already in the release notes + should update release notes when this is known (Ilmari) + https://wiki.documentfoundation.org/ReleaseNotes/24.8#Platform_Compatibility + is beta1 built already? (Xisco) + yes, the trick is to find a Windows 7 system (Cloph) + can announce it tomorrow in the qa blog (Xisco) + call for testing + explicitly mention we look for Windows 7 testers + in sync with the idea that we support OSes as long as supported by their vendors, only best effort after that (Cloph) + Minimum Python version policy (Ilmari) + Nothing is mentioned in any readme or system requirements page at the moment + no problem with the python ide integration anymore (Cloph) + given we have python 3.9 by now + would be ideal to update python further on master + Python release cycle (Hossein) https://devguide.python.org/versions/ + like the idea, to update to 3.12 (Hossein) + around this time is a good time (Xisco) + what if removing old version checks? (Ilmari) + that's mostly for enterprise distros that build rpm packages (Michael S) + need to ask Eike and the SUSE maintainer + they usually build new LO against old system baseline + Fedora 41 is heading for 3.13 at the moment + would be ideal to still lock down what is the needed baseline (Ilmari) + once known, good to document it in README.md (Miklos) + and just mention LTS distros are the intended baseline, OK to clean up the rest (Cloph) + beta2 in 1 week, if needed + no plans so far (Cloph) + string / UI freeze in 2 weeks + late features? + late addition to the notes page in Impress in the works (Thorsten) * Documentation (Olivier) + Helpcontents2 + Updates and fixes (stragu, sberg) + improvements in contents (erack, A. Romedene) + New pages: LET function (ohallot) + Guides + work in progress. + Question from community + Do we have (visible) documentation for oovbaapi/ (VBA api)? + should it be published? + list of what works and what doens'nt + (purpose: advise to public, get people to contribute). + know that the full VBA API is documented on the Microsoft side (Olivier) + Noel had some concerns if this is published too widely, it makes later fixes / improvements harder (Miklos) + probably it's not intentional that this is excluded in odk/, though (Miklos) + hard to document StarBasic vs .NET Basic differences (Hossein) + Bugzilla Documentation statistics 250(250) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 7(-3) 48(-2) 103(-10) 233(2) commented 12(-10) 100(0)233(-31) 898(7) resolved 2(-1) 26(-1)62(-6)134(1) + top 10 contributors: Dione Maddern made 67 changes in 1 month, and 98 changes in 1 year Olivier Hallot made 38 changes in 1 month, and 264 changes in 1 year Stéphane Guillou made 20 changes in 1 month, and 253 changes in 1 year Vernon, Stuart Foote made 16 changes in 1 month, and 121 changes in 1 year Heiko Tietze made 14 changes in 1 month, and 84 changes in 1 year Ilmari Lauhakangas made 12 changes in 1 month, and 81 changes in 1 year Dieter made 10 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Timur made 6 changes in 1 month, and 8 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 239(239) (topicUI) bugs open, 38(38) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-2) 11(0) 16(0) 23(-1) commented
core.git: Branch 'libreoffice-24-8' - sw/qa sw/source
sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx |binary sw/qa/core/objectpositioning/objectpositioning.cxx | 31 ++ sw/source/core/objectpositioning/anchoredobjectposition.cxx |4 - 3 files changed, 33 insertions(+), 2 deletions(-) New commits: commit 838eb1a370b3bc533e81e819ae697222d3da5022 Author: Miklos Vajna AuthorDate: Thu Jun 13 08:04:30 2024 +0200 Commit: Miklos Vajna CommitDate: Thu Jun 13 13:27:14 2024 +0200 tdf#161199 sw DoNotCaptureDrawObjsOnPage: capture wrap=none draw objects Regression from commit af313fc149f80adb0f1680ca20e19745ccb7fede (tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option, 2017-01-06), the second page of the document has an off-page positioned draw shape, which is still kept inside the page frame in Word, but not in Writer anymore. Reading the SwAnchoredObjectPosition::GetInfoAboutObj() code, there are a number of conditions at play here, but the relevant one is that fly frames have the restriction that the "do not capture" behavior is restricted to wrap=through, but the wrap type was ignored in the draw shape case. Fix the problem by being consistent here: require wrap=through for both fly frames and draw shapes that moves the shape back inside the page frame. Note that Word goes a bit further here and even keeps the shape inside the body text area, but that doesn't seem to be a regression, so leave that unchanged for now. Change-Id: I3b6331c13d2376cac9b0de90f6f57289a7a0f0e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168762 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit a0b6587c4acb1d74e1b00904147821640c98b323) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168727 diff --git a/sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx b/sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx new file mode 100644 index ..8eea3a7e0df2 Binary files /dev/null and b/sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx differ diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx b/sw/qa/core/objectpositioning/objectpositioning.cxx index ba2e225e7d07..e8d9f0d445cc 100644 --- a/sw/qa/core/objectpositioning/objectpositioning.cxx +++ b/sw/qa/core/objectpositioning/objectpositioning.cxx @@ -475,6 +475,37 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjsLayout) // i.e. the graphic was on the left margin, not on the right margin. CPPUNIT_ASSERT_GREATER(nBodyRight, aAnchoredCenter.getX()); } + +CPPUNIT_TEST_FIXTURE(Test, testDoNotCaptureDrawObjsOnPageDrawWrapNone) +{ +// Given a document with a draw object on page 2, wrap type is set to none (not through): +createSwDoc("do-not-capture-draw-objs-on-page-draw-wrap-none.docx"); + +// When laying out that document: +calcLayout(); + +// Then make sure the draw object is captured on page 2: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage1 = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage1); +auto pPage2 = pPage1->GetNext()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage2); +CPPUNIT_ASSERT(pPage2->GetSortedObjs()); +const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs(); +CPPUNIT_ASSERT_EQUAL(static_cast(2), rPage2Objs.size()); +SwAnchoredObject* pDrawObj = rPage2Objs[0]; +CPPUNIT_ASSERT_EQUAL(static_cast(RES_DRAWFRMFMT), + pDrawObj->GetFrameFormat()->Which()); +SwTwips nDrawObjTop = pDrawObj->GetObjRect().Top(); +SwTwips nPage2Top = pPage2->getFrameArea().Top(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected greater than: 17383 +// - Actual : 13518 +// i.e. the draw object was way above the page 2 rectangle, instead of inside it (apart from +// some <1px difference). +CPPUNIT_ASSERT_GREATER(nPage2Top - MINFLY, nDrawObjTop); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 4af3af542b27..9d61d9cd3054 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -119,12 +119,12 @@ void SwAnchoredObjectPosition::GetInfoAboutObj() // determine, if anchored object has not to be captured on the page. // the following conditions must be hold to *not* capture it: // - corresponding document compatibility flag is set -// - it's a drawing object or it's a non-textbox wrap-th
core.git: Branch 'libreoffice-24-2' - sw/source writerfilter/qa writerfilter/source
sw/source/core/unocore/unotext.cxx | 24 +++ writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx | 24 +++ writerfilter/qa/cppunittests/dmapper/data/table-style-para-border-spacing.docx |binary writerfilter/source/dmapper/DomainMapper.cxx | 67 +++--- writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 48 ++- writerfilter/source/dmapper/PropertyIds.cxx | 27 ++-- writerfilter/source/dmapper/PropertyIds.hxx | 12 + 7 files changed, 171 insertions(+), 31 deletions(-) New commits: commit 86a5e47b07d5b8140434d24f74230eacaac16bd4 Author: Miklos Vajna AuthorDate: Tue Jun 11 10:49:29 2024 +0200 Commit: Michael Stahl CommitDate: Thu Jun 13 10:57:22 2024 +0200 tdf#161443 DOCX import, table style: handle para border in table cell paras Open the bugdoc, the in-table paragraphs have some top and bottom paragraph borders in Word, not in Writer -- because the cell and paragraph UNO object both have a property named TopBorder as mentioned in commit 39c54c0ef837e0e23a676a4d1fa5da667e18939c (tdf#161443 DOCX import, table style: fix para border leaking into cell border, 2024-06-07). The previous fix avoided the problem that the unwanted border affects, the cell, but re-routing the property to affect the in-table paragraph were not done. Fix the problem by adding 3 new meta-properties with a "Para" prefix for all 4 border locations (top/left/bottom/right), this way the paragraph borders defined in a table style can affect the in-table paragraphs, but not the table cells. Apart from the border itself, this also affected the border spacing, which means that the position of all text inside and below the table is now also correct. Unfortunately this also means we need to move away from the constexpr frozen container that is only suitable for a limited number of items: sw/source/writerfilter/dmapper/PropertyIds.cxx:394:6: error: ‘constexpr’ evaluation operation count exceeds limit of 33554432 (use ‘-fconstexpr-ops-limit=’ to increase the limit) Returning to std::unordered_map is good enough for our needs. (cherry picked from commit 013300c751d7a9ede12c1bf1c784254d1c6c5433) Change-Id: I478f274800a1d0b200f10226438ab4cfd4957b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168696 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice (cherry picked from commit dded9c034bd1be2fdac41923ec0724e52505d40b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168711 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 3f720e452f15..30b89a06e0c4 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2113,6 +2113,18 @@ lcl_ApplyCellProperties( { static const std::initializer_list vDenylist = { u"LeftMargin", +u"ParaTopBorder", +u"ParaTopBorderDistance", +u"ParaTopBorderComplexColor", +u"ParaLeftBorder", +u"ParaLeftBorderDistance", +u"ParaLeftBorderComplexColor", +u"ParaBottomBorder", +u"ParaBottomBorderDistance", +u"ParaBottomBorderComplexColor", +u"ParaRightBorder", +u"ParaRightBorderDistance", +u"ParaRightBorderComplexColor", }; if (std::find(vDenylist.begin(), vDenylist.end(), rName) == vDenylist.end()) { @@ -2251,6 +2263,18 @@ SwXText::convertToTable( u"RightBorder", u"TopBorder", u"VerticalBorder", +u"ParaTopBorder", +u"ParaTopBorderDistance", +u"ParaTopBorderComplexColor", +u"ParaLeftBorder", +u"ParaLeftBorderDistance", +u"ParaLeftBorderComplexColor", +u"ParaBottomBorder", +u"ParaBottomBorderDistance", +u"ParaBottomBorderComplexColor", +u"ParaRightBorder", +u"ParaRightBorderDistance", +u"ParaRightBorderComplexColor", }; if (std::find(vDenylist.begin(
core.git: sw/qa sw/source
sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx |binary sw/qa/core/objectpositioning/objectpositioning.cxx | 31 ++ sw/source/core/objectpositioning/anchoredobjectposition.cxx |4 - 3 files changed, 33 insertions(+), 2 deletions(-) New commits: commit a0b6587c4acb1d74e1b00904147821640c98b323 Author: Miklos Vajna AuthorDate: Thu Jun 13 08:04:30 2024 +0200 Commit: Miklos Vajna CommitDate: Thu Jun 13 09:44:46 2024 +0200 tdf#161199 sw DoNotCaptureDrawObjsOnPage: capture wrap=none draw objects Regression from commit af313fc149f80adb0f1680ca20e19745ccb7fede (tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option, 2017-01-06), the second page of the document has an off-page positioned draw shape, which is still kept inside the page frame in Word, but not in Writer anymore. Reading the SwAnchoredObjectPosition::GetInfoAboutObj() code, there are a number of conditions at play here, but the relevant one is that fly frames have the restriction that the "do not capture" behavior is restricted to wrap=through, but the wrap type was ignored in the draw shape case. Fix the problem by being consistent here: require wrap=through for both fly frames and draw shapes that moves the shape back inside the page frame. Note that Word goes a bit further here and even keeps the shape inside the body text area, but that doesn't seem to be a regression, so leave that unchanged for now. Change-Id: I3b6331c13d2376cac9b0de90f6f57289a7a0f0e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168762 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx b/sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx new file mode 100644 index ..8eea3a7e0df2 Binary files /dev/null and b/sw/qa/core/objectpositioning/data/do-not-capture-draw-objs-on-page-draw-wrap-none.docx differ diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx b/sw/qa/core/objectpositioning/objectpositioning.cxx index ba2e225e7d07..e8d9f0d445cc 100644 --- a/sw/qa/core/objectpositioning/objectpositioning.cxx +++ b/sw/qa/core/objectpositioning/objectpositioning.cxx @@ -475,6 +475,37 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjsLayout) // i.e. the graphic was on the left margin, not on the right margin. CPPUNIT_ASSERT_GREATER(nBodyRight, aAnchoredCenter.getX()); } + +CPPUNIT_TEST_FIXTURE(Test, testDoNotCaptureDrawObjsOnPageDrawWrapNone) +{ +// Given a document with a draw object on page 2, wrap type is set to none (not through): +createSwDoc("do-not-capture-draw-objs-on-page-draw-wrap-none.docx"); + +// When laying out that document: +calcLayout(); + +// Then make sure the draw object is captured on page 2: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage1 = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage1); +auto pPage2 = pPage1->GetNext()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage2); +CPPUNIT_ASSERT(pPage2->GetSortedObjs()); +const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs(); +CPPUNIT_ASSERT_EQUAL(static_cast(2), rPage2Objs.size()); +SwAnchoredObject* pDrawObj = rPage2Objs[0]; +CPPUNIT_ASSERT_EQUAL(static_cast(RES_DRAWFRMFMT), + pDrawObj->GetFrameFormat()->Which()); +SwTwips nDrawObjTop = pDrawObj->GetObjRect().Top(); +SwTwips nPage2Top = pPage2->getFrameArea().Top(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected greater than: 17383 +// - Actual : 13518 +// i.e. the draw object was way above the page 2 rectangle, instead of inside it (apart from +// some <1px difference). +CPPUNIT_ASSERT_GREATER(nPage2Top - MINFLY, nDrawObjTop); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 4af3af542b27..9d61d9cd3054 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -119,12 +119,12 @@ void SwAnchoredObjectPosition::GetInfoAboutObj() // determine, if anchored object has not to be captured on the page. // the following conditions must be hold to *not* capture it: // - corresponding document compatibility flag is set -// - it's a drawing object or it's a non-textbox wrap-though fly frame +// - it's a drawing object or it's a non-textbox fly frame with wrap-though // - it doesn't follow the text flo
Re: [a11y] LibreOffice Calc exposes 2^31 children, freezes on `GetChildren`
Hi, On Wed, Jun 12, 2024 at 02:55:50PM +, Michael Weghorn wrote: > Is there an easy way to test COOL a11y web and impacts of potential changes? > > (I just opened a sample Writer doc on nextcloud.documentfoundation.org and > couldn't find the doc content via Accerciser in a quick test, but am also > not very familiar with web content/browser a11y.) It's something that has to be explicitly enabled on the server side, let me know off-list if it's useful to have a test account at https://staging-perf-a11y.eu.collaboraonline.com/nextcloud/ where you can see this in action. Or just build from source locally, make run, and enable 'accessibility' in the config. Regards, Miklos
ESC meeting agenda: 2024-06-13 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + Commit access: Heiko to send the welcome mail to Bayram + Commit access: Cloph to enable the commit bit for Bayram * Release Engineering update (Cloph) + 24.2: 24.2.5 RC1 in 2 weeks? + 24.8: + beta2 in 1 weeks, if needed + string / UI freeze in 2 weeks + late features? + late addition to the notes page in Impress in the works (Thorsten) * Documentation (Olivier) + Bugzilla Documentation statistics 250(250) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 7(-3) 48(-2) 103(-10) 233(2) commented 12(-10) 100(0)233(-31) 898(7) resolved 2(-1) 26(-1)62(-6)134(1) + top 10 contributors: Dione Maddern made 67 changes in 1 month, and 98 changes in 1 year Olivier Hallot made 38 changes in 1 month, and 264 changes in 1 year Stéphane Guillou made 20 changes in 1 month, and 253 changes in 1 year Vernon, Stuart Foote made 16 changes in 1 month, and 121 changes in 1 year Heiko Tietze made 14 changes in 1 month, and 84 changes in 1 year Ilmari Lauhakangas made 12 changes in 1 month, and 81 changes in 1 year Dieter made 10 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Timur made 6 changes in 1 month, and 8 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 239(239) (topicUI) bugs open, 38(38) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-2) 11(0) 16(0) 23(-1) commented 41(-10) 194(-16) 514(-32) 1731(2) removed 0(0) 0(0) 5(0) 10(0) resolved 3(-8) 28(-5) 79(-1) 289(1) + top 10 contributors: Heiko Tietze made 115 changes in 1 month, and 957 changes in 1 year Stéphane Guillou made 99 changes in 1 month, and 653 changes in 1 year Eyal Rozenberg made 43 changes in 1 month, and 162 changes in 1 year Vernon, Stuart Foote made 19 changes in 1 month, and 313 changes in 1 year Telesto made 13 changes in 1 month, and 34 changes in 1 year Dieter made 11 changes in 1 month, and 118 changes in 1 year Ilmari Lauhakangas made 9 changes in 1 month, and 130 changes in 1 year Henschel, Regina made 9 changes in 1 month, and 41 changes in 1 year Rafael Lima made 6 changes in 1 month, and 57 changes in 1 year Ady made 5 changes in 1 month, and 114 changes in 1 year * Vertical tabpages state (Samuel/Thorsten) + suggest: re-check this next week, again (Xisco) + still have a few weeks to just undo this last minute if needed. * Crash Testing (Caolan) + 21(-1) import failure, 18(-1) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.1.216928(+523) + 24.2.2.214680(+847) + 24.2.3.29801(+2091) + 24.2.4.2501(+0) * Mentoring (Hossein) committer... 1 week 1 month 3 months12 months open 99(46) 189(19) 191(18) 191(18) reviews 396(70)1222(-76)3262(-50) 12538(28) merged 212(-17)997(-154) 3134(-42) 12657(-3) abandoned 35(17) 70(13) 178(21) 688(20) own commits 148(-24)732(-98)2274(-22)9278(2) review commits 40(-7) 225(-6) 721(-40)2995(-11) contributor... 1 week 1 month 3 months12 months open 37(4) 87(-11) 87(-11) 87(-11) reviews 744(110) 2650(-252) 7268(-92) 29450(-12) merged 9(-5) 66(-10) 295(-37)1540(-23) abandoned 15(12) 33(10) 108(12) 717(5) own commits 13(-8) 90(-8) 342(-37)1134(-6) review commits 0(0)0(0) 0(0) 0(0) + easyHack statistics: needsDevEval 9(9) needsUXEval 1(1) cleanup_comments 329(329) total 412(412) assigned 29(29) open 349(349) + top 10 contributors: Dione Maddern made 27 patches in 1 month, and 63 patches in 1 year Weblate made 7 patches in 1 month, and 30 patches in 1 year LeSasse made 4
ESC meeting agenda: 2024-06-13 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + Commit access: Heiko to send the welcome mail to Bayram + Commit access: Cloph to enable the commit bit for Bayram * Release Engineering update (Cloph) + 24.2: 24.2.5 RC1 in 2 weeks? + 24.8: + beta2 in 1 weeks, if needed + string / UI freeze in 2 weeks + late features? + late addition to the notes page in Impress in the works (Thorsten) * Documentation (Olivier) + Bugzilla Documentation statistics 250(250) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 7(-3) 48(-2) 103(-10) 233(2) commented 12(-10) 100(0)233(-31) 898(7) resolved 2(-1) 26(-1)62(-6)134(1) + top 10 contributors: Dione Maddern made 67 changes in 1 month, and 98 changes in 1 year Olivier Hallot made 38 changes in 1 month, and 264 changes in 1 year Stéphane Guillou made 20 changes in 1 month, and 253 changes in 1 year Vernon, Stuart Foote made 16 changes in 1 month, and 121 changes in 1 year Heiko Tietze made 14 changes in 1 month, and 84 changes in 1 year Ilmari Lauhakangas made 12 changes in 1 month, and 81 changes in 1 year Dieter made 10 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Timur made 6 changes in 1 month, and 8 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 239(239) (topicUI) bugs open, 38(38) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-2) 11(0) 16(0) 23(-1) commented 41(-10) 194(-16) 514(-32) 1731(2) removed 0(0) 0(0) 5(0) 10(0) resolved 3(-8) 28(-5) 79(-1) 289(1) + top 10 contributors: Heiko Tietze made 115 changes in 1 month, and 957 changes in 1 year Stéphane Guillou made 99 changes in 1 month, and 653 changes in 1 year Eyal Rozenberg made 43 changes in 1 month, and 162 changes in 1 year Vernon, Stuart Foote made 19 changes in 1 month, and 313 changes in 1 year Telesto made 13 changes in 1 month, and 34 changes in 1 year Dieter made 11 changes in 1 month, and 118 changes in 1 year Ilmari Lauhakangas made 9 changes in 1 month, and 130 changes in 1 year Henschel, Regina made 9 changes in 1 month, and 41 changes in 1 year Rafael Lima made 6 changes in 1 month, and 57 changes in 1 year Ady made 5 changes in 1 month, and 114 changes in 1 year * Vertical tabpages state (Samuel/Thorsten) + suggest: re-check this next week, again (Xisco) + still have a few weeks to just undo this last minute if needed. * Crash Testing (Caolan) + 21(-1) import failure, 18(-1) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.1.216928(+523) + 24.2.2.214680(+847) + 24.2.3.29801(+2091) + 24.2.4.2501(+0) * Mentoring (Hossein) committer... 1 week 1 month 3 months12 months open 99(46) 189(19) 191(18) 191(18) reviews 396(70)1222(-76)3262(-50) 12538(28) merged 212(-17)997(-154) 3134(-42) 12657(-3) abandoned 35(17) 70(13) 178(21) 688(20) own commits 148(-24)732(-98)2274(-22)9278(2) review commits 40(-7) 225(-6) 721(-40)2995(-11) contributor... 1 week 1 month 3 months12 months open 37(4) 87(-11) 87(-11) 87(-11) reviews 744(110) 2650(-252) 7268(-92) 29450(-12) merged 9(-5) 66(-10) 295(-37)1540(-23) abandoned 15(12) 33(10) 108(12) 717(5) own commits 13(-8) 90(-8) 342(-37)1134(-6) review commits 0(0)0(0) 0(0) 0(0) + easyHack statistics: needsDevEval 9(9) needsUXEval 1(1) cleanup_comments 329(329) total 412(412) assigned 29(29) open 349(349) + top 10 contributors: Dione Maddern made 27 patches in 1 month, and 63 patches in 1 year Weblate made 7 patches in 1 month, and 30 patches in 1 year LeSasse made 4
core.git: Branch 'distro/collabora/co-24.04' - sw/source writerfilter/qa writerfilter/source
sw/source/core/unocore/unotext.cxx | 24 +++ writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx | 24 +++ writerfilter/qa/cppunittests/dmapper/data/table-style-para-border-spacing.docx |binary writerfilter/source/dmapper/DomainMapper.cxx | 67 +++--- writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 48 ++- writerfilter/source/dmapper/PropertyIds.cxx | 27 ++-- writerfilter/source/dmapper/PropertyIds.hxx | 12 + 7 files changed, 171 insertions(+), 31 deletions(-) New commits: commit dded9c034bd1be2fdac41923ec0724e52505d40b Author: Miklos Vajna AuthorDate: Tue Jun 11 10:49:29 2024 +0200 Commit: Caolán McNamara CommitDate: Wed Jun 12 10:35:08 2024 +0200 tdf#161443 DOCX import, table style: handle para border in table cell paras Open the bugdoc, the in-table paragraphs have some top and bottom paragraph borders in Word, not in Writer -- because the cell and paragraph UNO object both have a property named TopBorder as mentioned in commit 39c54c0ef837e0e23a676a4d1fa5da667e18939c (tdf#161443 DOCX import, table style: fix para border leaking into cell border, 2024-06-07). The previous fix avoided the problem that the unwanted border affects, the cell, but re-routing the property to affect the in-table paragraph were not done. Fix the problem by adding 3 new meta-properties with a "Para" prefix for all 4 border locations (top/left/bottom/right), this way the paragraph borders defined in a table style can affect the in-table paragraphs, but not the table cells. Apart from the border itself, this also affected the border spacing, which means that the position of all text inside and below the table is now also correct. Unfortunately this also means we need to move away from the constexpr frozen container that is only suitable for a limited number of items: sw/source/writerfilter/dmapper/PropertyIds.cxx:394:6: error: ‘constexpr’ evaluation operation count exceeds limit of 33554432 (use ‘-fconstexpr-ops-limit=’ to increase the limit) Returning to std::unordered_map is good enough for our needs. (cherry picked from commit 013300c751d7a9ede12c1bf1c784254d1c6c5433) Change-Id: I478f274800a1d0b200f10226438ab4cfd4957b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168696 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 3f720e452f15..30b89a06e0c4 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2113,6 +2113,18 @@ lcl_ApplyCellProperties( { static const std::initializer_list vDenylist = { u"LeftMargin", +u"ParaTopBorder", +u"ParaTopBorderDistance", +u"ParaTopBorderComplexColor", +u"ParaLeftBorder", +u"ParaLeftBorderDistance", +u"ParaLeftBorderComplexColor", +u"ParaBottomBorder", +u"ParaBottomBorderDistance", +u"ParaBottomBorderComplexColor", +u"ParaRightBorder", +u"ParaRightBorderDistance", +u"ParaRightBorderComplexColor", }; if (std::find(vDenylist.begin(), vDenylist.end(), rName) == vDenylist.end()) { @@ -2251,6 +2263,18 @@ SwXText::convertToTable( u"RightBorder", u"TopBorder", u"VerticalBorder", +u"ParaTopBorder", +u"ParaTopBorderDistance", +u"ParaTopBorderComplexColor", +u"ParaLeftBorder", +u"ParaLeftBorderDistance", +u"ParaLeftBorderComplexColor", +u"ParaBottomBorder", +u"ParaBottomBorderDistance", +u"ParaBottomBorderComplexColor", +u"ParaRightBorder", +u"ParaRightBorderDistance", +u"ParaRightBorderComplexColor", }; if (std::find(vDenylist.begin(), vDenylist.end(), rTableProperty.Name) == vDenylist.end()) { diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx b/writer
core.git: Branch 'distro/collabora/co-24.04' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx | 24 ++ writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx |binary writerfilter/source/dmapper/DomainMapper.cxx |9 +++ 3 files changed, 33 insertions(+) New commits: commit fdb0593e1eddb38f68bb8735acce3e3100b5c6a6 Author: Miklos Vajna AuthorDate: Fri Jun 7 09:14:21 2024 +0200 Commit: Caolán McNamara CommitDate: Tue Jun 11 16:19:48 2024 +0200 tdf#161443 DOCX import, table style: fix para border leaking into cell border Open the document with a single table, notice that start of the text in A1 cell is missing. Seems what happens is that the cell has some positive border distance, then the para has the same negative left margin, so in total there is 0 left margin for the text, which makes this readable in Word. On our side, we map the paragraph border from the table style to the LeftBorderDistance property, then throw this on the cell object, which gives us 0 border distance, so the negative para left margin results in an unwanted shift of text towards the left: the start of the text is hidden by clipping to make sure the painted text is inside the cell frame. (Both paragraphs and cells have a LeftBorderDistance property, by accident.) Given that a visible paragraph border from table style is not actually imported, first just do the minimal fix and make sure we don't import paragraph borders from table style at all: this solves the problem of unwanted 0 cell border distances and the full text is now readable. In case the paragraph border in the table style would be actually visible, that would be useful to route to the paragraphs in the cell, that's not yet done here. (cherry picked from commit 39c54c0ef837e0e23a676a4d1fa5da667e18939c) Change-Id: I79907a2487c48659effcc55253b9d9881550284d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168660 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx index 885443c5a210..6029806e171d 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -161,6 +162,29 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158360) // just test that doc with annotation in TOC doesn't crash/assert loadFromFile(u"tdf158360.docx"); } + +CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorder) +{ +// Given a document with a table, table style defines 115 twips left cell margin and an empty +// paragraph border: +// When importing that file: +loadFromFile(u"table-style-para-border.docx"); + +// Then make sure the cell margin is not lost: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xCell(xPara->getCellByName("A1"), uno::UNO_QUERY); +sal_Int32 nLeftBorderDistance{}; +xCell->getPropertyValue("LeftBorderDistance") >>= nLeftBorderDistance; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 203 +// - Actual : 0 +// i.e. the 0 para border distance was applied on the cell instead. +CPPUNIT_ASSERT_EQUAL(static_cast(203), nLeftBorderDistance); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx b/writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx new file mode 100644 index ..0d7154eade1f Binary files /dev/null and b/writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx differ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index d206fa0b140f..7e0cc8b21b06 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1666,6 +1666,15 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) PropertyIds eBorderId = PropertyIds::INVALID; PropertyIds eBorderComplexColorId = PropertyIds::INVALID; PropertyIds eBorderDistId = PropertyIds::INVALID; + +const StyleSheetEntryPtr& pEntry = GetStyleSheetTable()->GetCurrentEntry(); +if (pEntry && pEntry->m_nStyleTypeCode == STYLE_TYPE_TABLE) +{ +
core.git: sw/qa sw/source
sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx | 24 +++ sw/qa/writerfilter/dmapper/data/table-style-para-border-spacing.docx |binary sw/source/core/unocore/unotext.cxx | 24 +++ sw/source/writerfilter/dmapper/DomainMapper.cxx | 67 +++--- sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx | 48 ++- sw/source/writerfilter/dmapper/PropertyIds.cxx | 27 ++-- sw/source/writerfilter/dmapper/PropertyIds.hxx | 12 + 7 files changed, 171 insertions(+), 31 deletions(-) New commits: commit 013300c751d7a9ede12c1bf1c784254d1c6c5433 Author: Miklos Vajna AuthorDate: Tue Jun 11 10:49:29 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 11 12:09:51 2024 +0200 tdf#161443 DOCX import, table style: handle para border in table cell paras Open the bugdoc, the in-table paragraphs have some top and bottom paragraph borders in Word, not in Writer -- because the cell and paragraph UNO object both have a property named TopBorder as mentioned in commit 39c54c0ef837e0e23a676a4d1fa5da667e18939c (tdf#161443 DOCX import, table style: fix para border leaking into cell border, 2024-06-07). The previous fix avoided the problem that the unwanted border affects, the cell, but re-routing the property to affect the in-table paragraph were not done. Fix the problem by adding 3 new meta-properties with a "Para" prefix for all 4 border locations (top/left/bottom/right), this way the paragraph borders defined in a table style can affect the in-table paragraphs, but not the table cells. Apart from the border itself, this also affected the border spacing, which means that the position of all text inside and below the table is now also correct. Unfortunately this also means we need to move away from the constexpr frozen container that is only suitable for a limited number of items: sw/source/writerfilter/dmapper/PropertyIds.cxx:394:6: error: ‘constexpr’ evaluation operation count exceeds limit of 33554432 (use ‘-fconstexpr-ops-limit=’ to increase the limit) Returning to std::unordered_map is good enough for our needs. Change-Id: I478f274800a1d0b200f10226438ab4cfd4957b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168659 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx b/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx index bfcbf09fe130..4ae51bfc0758 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx @@ -229,6 +229,30 @@ CPPUNIT_TEST_FIXTURE(Test, testDOCXFloatingTableHeaderBodyOverlap) // Fly bottom was 3063, body text top was 7148. CPPUNIT_ASSERT_LESS(nBodyTextTop, nFlyBottom); } + +CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorderSpacing) +{ +// Given a document with a table style, table style defines top and bottom border for +// paragraphs: +// When loading that document: +loadFromFile(u"table-style-para-border-spacing.docx"); + +// Then make sure the in-table paragraph gets its top border: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xText(xTextDocument->getText(), uno::UNO_QUERY); +uno::Reference xParaEnum = xText->createEnumeration(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xCell(xPara->getCellByName("A1"), uno::UNO_QUERY); +xParaEnum = xCell->createEnumeration(); +uno::Reference xParaProps(xParaEnum->nextElement(), uno::UNO_QUERY); +sal_Int32 nTopBorderDistance{}; +xParaProps->getPropertyValue("TopBorderDistance") >>= nTopBorderDistance; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 35 +// - Actual : 0 +// i.e. the top and bottom border and its 1pt spacing was not set on the in-table paragraph. +CPPUNIT_ASSERT_EQUAL(static_cast(35), nTopBorderDistance); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/writerfilter/dmapper/data/table-style-para-border-spacing.docx b/sw/qa/writerfilter/dmapper/data/table-style-para-border-spacing.docx new file mode 100644 index ..b8382000b2b5 Binary files /dev/null and b/sw/qa/writerfilter/dmapper/data/table-style-para-border-spacing.docx differ diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index fd2811f05743..7d0593221201 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2113,6 +2113,18 @@ lcl_ApplyCellProperties( { static const std::initializer_list vDenylist = { u"LeftMargin", +
core.git: Branch 'libreoffice-24-2' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx | 24 ++ writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx |binary writerfilter/source/dmapper/DomainMapper.cxx |9 +++ 3 files changed, 33 insertions(+) New commits: commit c15531dd24101c78ec41345685cbda7c2a8eaef4 Author: Miklos Vajna AuthorDate: Fri Jun 7 09:14:21 2024 +0200 Commit: Michael Stahl CommitDate: Tue Jun 11 11:20:09 2024 +0200 tdf#161443 DOCX import, table style: fix para border leaking into cell border Open the document with a single table, notice that start of the text in A1 cell is missing. Seems what happens is that the cell has some positive border distance, then the para has the same negative left margin, so in total there is 0 left margin for the text, which makes this readable in Word. On our side, we map the paragraph border from the table style to the LeftBorderDistance property, then throw this on the cell object, which gives us 0 border distance, so the negative para left margin results in an unwanted shift of text towards the left: the start of the text is hidden by clipping to make sure the painted text is inside the cell frame. (Both paragraphs and cells have a LeftBorderDistance property, by accident.) Given that a visible paragraph border from table style is not actually imported, first just do the minimal fix and make sure we don't import paragraph borders from table style at all: this solves the problem of unwanted 0 cell border distances and the full text is now readable. In case the paragraph border in the table style would be actually visible, that would be useful to route to the paragraphs in the cell, that's not yet done here. (cherry picked from commit 39c54c0ef837e0e23a676a4d1fa5da667e18939c) Change-Id: I79907a2487c48659effcc55253b9d9881550284d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168621 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx index 885443c5a210..6029806e171d 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -161,6 +162,29 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158360) // just test that doc with annotation in TOC doesn't crash/assert loadFromFile(u"tdf158360.docx"); } + +CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorder) +{ +// Given a document with a table, table style defines 115 twips left cell margin and an empty +// paragraph border: +// When importing that file: +loadFromFile(u"table-style-para-border.docx"); + +// Then make sure the cell margin is not lost: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xCell(xPara->getCellByName("A1"), uno::UNO_QUERY); +sal_Int32 nLeftBorderDistance{}; +xCell->getPropertyValue("LeftBorderDistance") >>= nLeftBorderDistance; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 203 +// - Actual : 0 +// i.e. the 0 para border distance was applied on the cell instead. +CPPUNIT_ASSERT_EQUAL(static_cast(203), nLeftBorderDistance); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx b/writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx new file mode 100644 index ..0d7154eade1f Binary files /dev/null and b/writerfilter/qa/cppunittests/dmapper/data/table-style-para-border.docx differ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 344a36cf9520..0c2cb13a3185 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1608,6 +1608,15 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) PropertyIds eBorderId = PropertyIds::INVALID; PropertyIds eBorderComplexColorId = PropertyIds::INVALID; PropertyIds eBorderDistId = PropertyIds::INVALID; + +const StyleSheetEntryPtr& pEntry = GetStyleSheetTable()->GetCurrentEntry(); +if (pEntry && pEntry->m_nStyleTypeCode == STYLE_TYPE_TABLE) +{ +// This would map pa
core.git: include/svx svx/source
include/svx/svdograf.hxx | 14 ++--- svx/source/svdraw/svdograf.cxx | 104 - 2 files changed, 59 insertions(+), 59 deletions(-) New commits: commit fd7418c1f75e855a19078c6288a024b1b465f614 Author: Miklos Vajna AuthorDate: Mon Jun 10 08:41:56 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 10 09:54:14 2024 +0200 svx: prefix members of SdrGrafObj See tdf#94879 for motivation. Change-Id: Icc587c31582fb5fdfbdfe375005b96ea219bf4a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168597 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index ec2c94ab3f45..88296f4a2629 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -79,14 +79,14 @@ private: SAL_DLLPRIVATE virtual std::unique_ptr CreateObjectSpecificProperties() override; SAL_DLLPRIVATE void ImpSetAttrToGrafInfo(); // Copy values from the pool -GraphicAttr aGrafInfo; +GraphicAttr m_aGrafInfo; -OUString aFileName; // If it's a Link, the filename can be found in here -OUString aFilterName; +OUString m_aFileName; // If it's a Link, the filename can be found in here +OUString m_aFilterName; std::unique_ptr mpGraphicObject; // In order to speed up output of bitmaps, especially rotated ones std::unique_ptr mpReplacementGraphicObject; -SdrGraphicLink* pGraphicLink; // And here a pointer for linked graphics -bool bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis +SdrGraphicLink* m_pGraphicLink; // And here a pointer for linked graphics +bool m_bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis // Flag for allowing text animation. Default is true. bool mbGrafAnimationAllowed:1; @@ -157,7 +157,7 @@ public: voidReleaseGraphicLink(); bool IsLinkedGraphic() const; -const OUString& GetFileName() const { return aFileName;} +const OUString& GetFileName() const { return m_aFileName;} voidStartAnimation(); @@ -192,7 +192,7 @@ public: SAL_DLLPRIVATE virtual voidNotify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; -bool IsMirrored() const { return bMirrored;} +bool IsMirrored() const { return m_bMirrored;} SAL_DLLPRIVATE void SetMirrored( bool _bMirrored ); virtual bool shouldKeepAspectRatio() const override { return true; } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 1e09eccab766..a0c97cc3dde9 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -86,7 +86,7 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj) if( pLinkManager && rValue.hasValue() ) { -sfx2::LinkManager::GetDisplayNames( this, nullptr, , nullptr, ); +sfx2::LinkManager::GetDisplayNames( this, nullptr, _aFileName, nullptr, _aFilterName ); Graphic aGraphic; if (pLinkManager->GetGraphicFromAny(rMimeType, rValue, aGraphic, nullptr)) @@ -106,7 +106,7 @@ void SdrGraphicLink::Closed() { // close connection; set pLink of the object to NULL, as link instance is just about getting destructed. rGrafObj.ForceSwapIn(); -rGrafObj.pGraphicLink=nullptr; +rGrafObj.m_pGraphicLink=nullptr; rGrafObj.ReleaseGraphicLink(); SvBaseLink::Closed(); } @@ -181,8 +181,8 @@ void SdrGrafObj::onGraphicChanged() SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel) : SdrRectObj(rSdrModel) ,mpGraphicObject(new GraphicObject) -,pGraphicLink(nullptr) -,bMirrored(false) +,m_pGraphicLink(nullptr) +,m_bMirrored(false) ,mbIsSignatureLine(false) ,mbIsSignatureLineShowSignDate(true) ,mbIsSignatureLineCanAddComment(false) @@ -205,7 +205,7 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel) SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) : SdrRectObj(rSdrModel, rSource) ,mpGraphicObject(new GraphicObject) -,pGraphicLink(nullptr) +,m_pGraphicLink(nullptr) { onGraphicChanged(); @@ -220,8 +220,8 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) // #i25616# mbSupportTextIndentingOnLineWidthChange = false; -aFileName = rSource.aFileName; -bMirrored = rSource.bMirrored; +m_aFileName = rSource.m_aFileName; +m_bMirrored = rSource.m_bMirrored; mbIsSignatureLine = rSource.mbIsSignatureLine; maSignatureLineId = rSource.maSignatureLineId; @@ -250,7 +250,7 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) if( rSource.IsLinkedGraphic() ) { -SetGraphicLink( aFileName ); +SetGraphicLink( m_aFileName ); } ImpSetAttrToGrafInfo(); @@ -262,8 +262,8 @@ SdrGrafObj::SdrGrafObj(
core.git: sw/qa sw/source
sw/qa/writerfilter/dmapper/DomainMapper.cxx | 24 +++ sw/qa/writerfilter/dmapper/data/table-style-para-border.docx |binary sw/source/writerfilter/dmapper/DomainMapper.cxx |9 3 files changed, 33 insertions(+) New commits: commit 39c54c0ef837e0e23a676a4d1fa5da667e18939c Author: Miklos Vajna AuthorDate: Fri Jun 7 09:14:21 2024 +0200 Commit: Miklos Vajna CommitDate: Fri Jun 7 10:20:05 2024 +0200 tdf#161443 DOCX import, table style: fix para border leaking into cell border Open the document with a single table, notice that start of the text in A1 cell is missing. Seems what happens is that the cell has some positive border distance, then the para has the same negative left margin, so in total there is 0 left margin for the text, which makes this readable in Word. On our side, we map the paragraph border from the table style to the LeftBorderDistance property, then throw this on the cell object, which gives us 0 border distance, so the negative para left margin results in an unwanted shift of text towards the left: the start of the text is hidden by clipping to make sure the painted text is inside the cell frame. (Both paragraphs and cells have a LeftBorderDistance property, by accident.) Given that a visible paragraph border from table style is not actually imported, first just do the minimal fix and make sure we don't import paragraph borders from table style at all: this solves the problem of unwanted 0 cell border distances and the full text is now readable. In case the paragraph border in the table style would be actually visible, that would be useful to route to the paragraphs in the cell, that's not yet done here. Change-Id: I79907a2487c48659effcc55253b9d9881550284d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168516 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/writerfilter/dmapper/DomainMapper.cxx b/sw/qa/writerfilter/dmapper/DomainMapper.cxx index 5c6b429bc9f6..851ab20412e8 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapper.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -161,6 +162,29 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158360) // just test that doc with annotation in TOC doesn't crash/assert loadFromFile(u"tdf158360.docx"); } + +CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorder) +{ +// Given a document with a table, table style defines 115 twips left cell margin and an empty +// paragraph border: +// When importing that file: +loadFromFile(u"table-style-para-border.docx"); + +// Then make sure the cell margin is not lost: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xCell(xPara->getCellByName("A1"), uno::UNO_QUERY); +sal_Int32 nLeftBorderDistance{}; +xCell->getPropertyValue("LeftBorderDistance") >>= nLeftBorderDistance; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 203 +// - Actual : 0 +// i.e. the 0 para border distance was applied on the cell instead. +CPPUNIT_ASSERT_EQUAL(static_cast(203), nLeftBorderDistance); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/writerfilter/dmapper/data/table-style-para-border.docx b/sw/qa/writerfilter/dmapper/data/table-style-para-border.docx new file mode 100644 index ..0d7154eade1f Binary files /dev/null and b/sw/qa/writerfilter/dmapper/data/table-style-para-border.docx differ diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx index 72f88fc2a1a3..30c5f02fb693 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx @@ -1654,6 +1654,15 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) PropertyIds eBorderId = PropertyIds::INVALID; PropertyIds eBorderComplexColorId = PropertyIds::INVALID; PropertyIds eBorderDistId = PropertyIds::INVALID; + +const StyleSheetEntryPtr& pEntry = GetStyleSheetTable()->GetCurrentEntry(); +if (pEntry && pEntry->m_nStyleTypeCode == STYLE_TYPE_TABLE) +{ +// This would map para borders in table style to cell borders, avoid that till we +// have separate property names for these. +break; +} + switch( nSprmId ) { case NS_ooxml::LN_CT_PBdr_top:
ESC meeting minutes: 2024-06-06
* invitation list for LibOCon (Michael W) + sent link to formal ESC members by email + please enter your suggestions before ESC call next week * Community Townhall Meeting (Heiko) + idea from BoD call on Monday + a bit of an "ask me anything" style + would be done per-project, including one for development + any feedback, let the board know + no objections from the ESC side (all) + had an AMA session on reddit a few years ago, it went well (Heiko) * QA update (Xisco) + UNCONFIRMED: 1161 (+20) + enhancements: 270 (-5) + needsUXEval: 10 (+0) + haveBackTrace: 10 (+0) + needsDevAdvice: 45 (+0) + documentation: 4 (+1) + android: 0 (+0) + iOS: 0 (+0) + Online: 9 (+0) + Most pressing bugs: New: None + New high severity bugs of the week: + Hypertext, relative URL to local files does not work + https://bugs.documentfoundation.org/show_bug.cgi?id=159768 + not tagged as a regression * QA stats (Stéphane) + https://bugs.documentfoundation.org/page.cgi?id=weekly-bug-summary.html +111 -6 (-93) overall) many thanks to the top bug squashers: Stéphane Guillou (stragu) 14 QA Administrators 10 Heiko Tietze9 Mike Kaganski 8 László Németh 4 Rafael Lima 4 Thorsten Behrens (allotropia) 4 Buovjaga3 Hossein 3 Justin L3 + top 10 bugs reporters: johnks 7 Gabor Kelemen (allotropia) 6 Mike Kaganski 4 Xisco Faulí 4 Eyal Rozenberg 3 Olivier Hallot 3 Stéphane Guillou (stragu) 3 László Németh 2 Miklos Vajna2 Regina Henschel 2 + top 10 bugs fixers: Heiko Tietze5 Kaganski, Mike 5 Németh, László 4 Thorsten Behrens (CIB) 4 Justin Luth 3 Samuel Mehrbrodt3 Balland-Poirier, Laurent 2 Caolán McNamara 2 Grandin, Noel 2 Rafael Lima 2 + top 10 bugs confirmers: Stéphane Guillou15 m.a.riosv 7 Heiko Tietze6 Nabet, Julien 6 Alex Thurgood 5 Robert Großkopf 4 Ady 3 Ilmari Lauhakangas 3 Kaganski, Mike 3 Xisco Fauli 3 * Bisected bugs open: keyword 'bisected' + more accurate - down to a single commit. + http://bit.ly/2dyIfDy + done by: Stéphane Guillou 5 Raal 4 Xisco Fauli3 Aron Budea 1 Kaganski, Mike 1 Timur 1 * Bibisected bugs open: keyword 'bibisected' + http://bit.ly/2cSCXlS + done by: Stéphane Guillou 6 Raal 4 Xisco Fauli4 Aron Budea 1 Timur 1 * all bugs tagged with 'regression' + 1244(-7) bugs open of 13405(+15) total 24(+1) high prio. done by: Stéphane Guillou 4 Xisco Fauli4 Ady1 Eyal Rozenberg 1 Ilmari Lauhakangas 1 m.a.riosv 1 Kaganski, Mike 1 Telesto1 Timur 1 * ~Component count net * high severity regressions + http://bit.ly/1HWHb3E Writer- 14(+1) Calc - 3(+0) Impress - 2(+0) LibreOffice - 2(+0) UI- 2(+0) by OS: All - 17(+1) Linux - 5(+0) Mac OS X - 0(+0) Windows - 2(+0) * ~Component count net * all regressions + http://bit.ly/1BUdI8i Writer: other- 429(-2) Calc - 230(-1) Impress - 126(+0) LibreOffice - 52(-1) Draw - 51(-1) Writer: docx filter - 44(+0) Base - 42(+0) Crashes - 42(+1) UI - 39(-4) Borders - 34(-1) Writer: perf - 34(+0) Writer: other filter - 32(+1) Printing and PDF export - 26(+0) Chart- 24(+0) RTL - 23(+0) BASIC- 21(+0) filters and storage - 21(+0) Writer: doc filter - 16(+0) graphics stack - 13(+0) Formula Editor - 7(+0) framework- 3(+0) Extensions - 2(+0) sdk - 2(+0) Linguistic - 1(+0)
ESC meeting minutes: 2024-06-06
* invitation list for LibOCon (Michael W) + sent link to formal ESC members by email + please enter your suggestions before ESC call next week * Community Townhall Meeting (Heiko) + idea from BoD call on Monday + a bit of an "ask me anything" style + would be done per-project, including one for development + any feedback, let the board know + no objections from the ESC side (all) + had an AMA session on reddit a few years ago, it went well (Heiko) * QA update (Xisco) + UNCONFIRMED: 1161 (+20) + enhancements: 270 (-5) + needsUXEval: 10 (+0) + haveBackTrace: 10 (+0) + needsDevAdvice: 45 (+0) + documentation: 4 (+1) + android: 0 (+0) + iOS: 0 (+0) + Online: 9 (+0) + Most pressing bugs: New: None + New high severity bugs of the week: + Hypertext, relative URL to local files does not work + https://bugs.documentfoundation.org/show_bug.cgi?id=159768 + not tagged as a regression * QA stats (Stéphane) + https://bugs.documentfoundation.org/page.cgi?id=weekly-bug-summary.html +111 -6 (-93) overall) many thanks to the top bug squashers: Stéphane Guillou (stragu) 14 QA Administrators 10 Heiko Tietze9 Mike Kaganski 8 László Németh 4 Rafael Lima 4 Thorsten Behrens (allotropia) 4 Buovjaga3 Hossein 3 Justin L3 + top 10 bugs reporters: johnks 7 Gabor Kelemen (allotropia) 6 Mike Kaganski 4 Xisco Faulí 4 Eyal Rozenberg 3 Olivier Hallot 3 Stéphane Guillou (stragu) 3 László Németh 2 Miklos Vajna2 Regina Henschel 2 + top 10 bugs fixers: Heiko Tietze5 Kaganski, Mike 5 Németh, László 4 Thorsten Behrens (CIB) 4 Justin Luth 3 Samuel Mehrbrodt3 Balland-Poirier, Laurent 2 Caolán McNamara 2 Grandin, Noel 2 Rafael Lima 2 + top 10 bugs confirmers: Stéphane Guillou15 m.a.riosv 7 Heiko Tietze6 Nabet, Julien 6 Alex Thurgood 5 Robert Großkopf 4 Ady 3 Ilmari Lauhakangas 3 Kaganski, Mike 3 Xisco Fauli 3 * Bisected bugs open: keyword 'bisected' + more accurate - down to a single commit. + http://bit.ly/2dyIfDy + done by: Stéphane Guillou 5 Raal 4 Xisco Fauli3 Aron Budea 1 Kaganski, Mike 1 Timur 1 * Bibisected bugs open: keyword 'bibisected' + http://bit.ly/2cSCXlS + done by: Stéphane Guillou 6 Raal 4 Xisco Fauli4 Aron Budea 1 Timur 1 * all bugs tagged with 'regression' + 1244(-7) bugs open of 13405(+15) total 24(+1) high prio. done by: Stéphane Guillou 4 Xisco Fauli4 Ady1 Eyal Rozenberg 1 Ilmari Lauhakangas 1 m.a.riosv 1 Kaganski, Mike 1 Telesto1 Timur 1 * ~Component count net * high severity regressions + http://bit.ly/1HWHb3E Writer- 14(+1) Calc - 3(+0) Impress - 2(+0) LibreOffice - 2(+0) UI- 2(+0) by OS: All - 17(+1) Linux - 5(+0) Mac OS X - 0(+0) Windows - 2(+0) * ~Component count net * all regressions + http://bit.ly/1BUdI8i Writer: other- 429(-2) Calc - 230(-1) Impress - 126(+0) LibreOffice - 52(-1) Draw - 51(-1) Writer: docx filter - 44(+0) Base - 42(+0) Crashes - 42(+1) UI - 39(-4) Borders - 34(-1) Writer: perf - 34(+0) Writer: other filter - 32(+1) Printing and PDF export - 26(+0) Chart- 24(+0) RTL - 23(+0) BASIC- 21(+0) filters and storage - 21(+0) Writer: doc filter - 16(+0) graphics stack - 13(+0) Formula Editor - 7(+0) framework- 3(+0) Extensions - 2(+0) sdk - 2(+0) Linguistic - 1(+0)
core.git: Branch 'libreoffice-24-2' - sw/CppunitTest_sw_core_text.mk sw/qa sw/source
sw/CppunitTest_sw_core_text.mk|1 sw/qa/core/text/data/clearing-break-wrap-through.docx |binary sw/qa/core/text/txtfly.cxx| 52 ++ sw/source/core/text/txtfly.cxx|7 ++ 4 files changed, 60 insertions(+) New commits: commit 317e12faa71dab378da6db48b5d612ad258c058c Author: Miklos Vajna AuthorDate: Thu May 30 08:10:13 2024 +0200 Commit: Xisco Fauli CommitDate: Thu Jun 6 16:35:37 2024 +0200 tdf#161318 sw clearing break: ignore wrap-through anchored objects Import the bugdoc: we expect just a single page for the 2 paragraphs, but the second paragraph goes to a 2nd page. What seems to happen since commit f86d1482bef285f90079b5130e410646db96cf58 (sw clearing breaks: add DOCX import, 2022-03-08) is that on one hand, SwTextFly::ForEach() ignores wrap-through shapes, but at the same time SwTextFly::GetMaxBottom() did not, and this lead to a loop: the first paragraph kept growing till the shape was shifted to page 2, but then the same first paragraph was reduced to just 2 lines, goto 1. Fix the problem by extending SwTextFly::GetMaxBottom() to also ignore wrap-though shapes: this is the intention, just clearing breaks were not tested with wrap-though wrap mode before. This is a reduced bugdoc, the original one even produced warnings like: warn:legacy.osl:12034:12034:sw/source/core/layout/flowfrm.cxx:2667: - layout loop control for layout action applied! without the fix, and these are now gone. Change-Id: Iaf9849dbf8e1a8e5d625d3c19b99636247804cdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168239 Reviewed-by: Miklos Vajna Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168264 diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk index ce27696b3c4c..5e623d3b0cd0 100644 --- a/sw/CppunitTest_sw_core_text.mk +++ b/sw/CppunitTest_sw_core_text.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_text, \ sw/qa/core/text/porlay \ sw/qa/core/text/porrst \ sw/qa/core/text/text \ +sw/qa/core/text/txtfly \ )) $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \ diff --git a/sw/qa/core/text/data/clearing-break-wrap-through.docx b/sw/qa/core/text/data/clearing-break-wrap-through.docx new file mode 100644 index ..c96e8c27da5e Binary files /dev/null and b/sw/qa/core/text/data/clearing-break-wrap-through.docx differ diff --git a/sw/qa/core/text/txtfly.cxx b/sw/qa/core/text/txtfly.cxx new file mode 100644 index ..461ed81e2203 --- /dev/null +++ b/sw/qa/core/text/txtfly.cxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +namespace +{ +/// Covers sw/source/core/text/txtfly.cxx fixes. +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/core/text/data/") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakWrapThrough) +{ +// Given a document with a clearing break, then a shape in the next paragraph: +createSwDoc("clearing-break-wrap-through.docx"); + +// When laying out that document: +calcLayout(); + +// Then make sure we layout these 2 paragraphs on a single page, since there is enough space for +// them: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage); +// Without the accompanying fix in place, this test would have failed, we had an unexpected 2nd +// page. +CPPUNIT_ASSERT(!pPage->GetNext()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 7c4d9a2e160d..45eea853 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -1051,6 +1051,13 @@ SwTwips SwTextFly::GetMaxBottom(const SwBreakPortion& rPortion, const SwTextForm continue; } +const SwFormatSurround& rSurround = pAnchoredObj->GetFrameFormat()->GetSurround(); +if (rSurround.GetValue() == text::WrapTextMode_THROUGH) +{ +// Wrap through has no influence on clearing breaks. +continue; +} + SwRect aRect(pAnchoredObj->GetObjRectWithSpaces()); if (m_pCurrFrame->IsVertical())
core.git: cpp.hint sw/qa
cpp.hint |1 - sw/qa/inc/swmodeltestbase.hxx |1 - 2 files changed, 2 deletions(-) New commits: commit c6a2fb62947ae8411a8a336d74f2ceb2258c899c Author: Miklos Vajna AuthorDate: Thu Jun 6 08:12:01 2024 +0200 Commit: Miklos Vajna CommitDate: Thu Jun 6 09:58:39 2024 +0200 sw: remove unused DECLARE_RTFEXPORT_TEST() Replaced by CPPUNIT_TEST_FIXTURE(). Change-Id: I6966e94bf39f8353ca00287939aa348176e001ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168484 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/cpp.hint b/cpp.hint index 1000d44cd627..727243a3f966 100644 --- a/cpp.hint +++ b/cpp.hint @@ -57,7 +57,6 @@ void TestName::verify() #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) -#define DECLARE_RTFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_ODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_FODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 579fb77e7217..e4fff44da2bc 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -56,7 +56,6 @@ void TestName::verify() #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) -#define DECLARE_RTFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_ODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_FODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test)
ESC meeting agenda: 2024-06-06 16:00 CEST
in 1 month, and 9 patches in 1 year Zainab Abbasi made 3 patches in 1 month, and 4 patches in 1 year Jakub Kościelak made 3 patches in 1 month, and 7 patches in 1 year Srebotnjak, Martin made 2 patches in 1 month, and 17 patches in 1 year Marco Pinto made 2 patches in 1 month, and 6 patches in 1 year Bayram Çiçek made 2 patches in 1 month, and 3 patches in 1 year Kurt Nordback made 2 patches in 1 month, and 25 patches in 1 year + top 10 reviewers: Caolán McNamara made 154 review comments in 1 month, and 1532 in 1 year Ilmari Lauhakangas made 102 review comments in 1 month, and 556 in 1 year Thorsten Behrens made 82 review comments in 1 month, and 620 in 1 year Adolfo Jayme Barrientos made 74 review comments in 1 month, and 550 in 1 year Vajna, Miklos made 72 review comments in 1 month, and 1084 in 1 year Michael Stahl made 66 review comments in 1 month, and 886 in 1 year Grandin, Noel made 64 review comments in 1 month, and 712 in 1 year Christian Lohmaier made 60 review comments in 1 month, and 380 in 1 year Hossein made 58 review comments in 1 month, and 310 in 1 year Heiko Tietze made 44 review comments in 1 month, and 250 in 1 year * GSoC (Ilmari) * Commit Access * LibreOffice Technology hackfest at Budapest (Miklos) + 4th & 5th June (Tue-Wed), in 0,5 weeks + details: https://wiki.documentfoundation.org/Hackfest/Budapest2024 + on blog: https://blog.documentfoundation.org/blog/2024/05/16/coming-up-libreoffice-technology-budapest-2024-hackfest/ * Developer Certification (Stephan/Miklos/László/Gabriel) + resting since: 6 weeks (limit: 20 weeks) * Jenkins / CI update (Cloph) * What’s cooking (Miklos) + A11y update (Michael W) + RTL/CTL/CJK update (Jonathan) * invitation list for LibOCon (Michael W) * QA update (Xisco) + UNCONFIRMED: 1161 (+20) + enhancements: 270 (-5) + needsUXEval: 10 (+0) + haveBackTrace: 10 (+0) + needsDevAdvice: 45 (+0) + documentation: 4 (+1) + android: 0 (+0) + iOS: 0 (+0) + Online: 9 (+0) + Most pressing bugs: New: Old: Fixed: + New high severity bugs of the week: + Hypertext, relative URL to local files does not work + https://bugs.documentfoundation.org/show_bug.cgi?id=159768 + not tagged as a regression * QA stats (Stéphane) + https://bugs.documentfoundation.org/page.cgi?id=weekly-bug-summary.html +111 -6 (-93) overall) many thanks to the top bug squashers: Stéphane Guillou (stragu) 14 QA Administrators 10 Heiko Tietze9 Mike Kaganski 8 László Németh 4 Rafael Lima 4 Thorsten Behrens (allotropia) 4 Buovjaga3 Hossein 3 Justin L3 + top 10 bugs reporters: johnks 7 Gabor Kelemen (allotropia) 6 Mike Kaganski 4 Xisco Faulí 4 Eyal Rozenberg 3 Olivier Hallot 3 Stéphane Guillou (stragu) 3 László Németh 2 Miklos Vajna2 Regina Henschel 2 + top 10 bugs fixers: Heiko Tietze5 Kaganski, Mike 5 Németh, László 4 Thorsten Behrens (CIB) 4 Justin Luth 3 Samuel Mehrbrodt3 Balland-Poirier, Laurent 2 Caolán McNamara 2 Grandin, Noel 2 Rafael Lima 2 + top 10 bugs confirmers: Stéphane Guillou15 m.a.riosv 7 Heiko Tietze6 Nabet, Julien 6 Alex Thurgood 5 Robert Großkopf 4 Ady 3 Ilmari Lauhakangas 3 Kaganski, Mike 3 Xisco Fauli 3 * Bisected bugs open: keyword 'bisected' + more accurate - down to a single commit. + http://bit.ly/2dyIfDy + done by: Stéphane Guillou 5 Raal 4 Xisco Fauli3 Aron Budea 1 Kaganski, Mike 1 Timur 1 * Bibisected bugs open: keyword 'bibisected' + http://bit.ly/2cSCXlS + done by: Stéphane Guillou 6 Raal 4 Xisco Fauli4 Aron Budea 1 Timur 1 * all bugs tagged with 'regression' + 1244(-7) bugs open of 13405(+15) total 24(+1) high prio. done by: Stéphane Guillou 4 Xisco Fauli4 Ady1 Eyal Rozenberg 1 Ilmari Lauhakangas 1 m.a.riosv
core.git: sw/qa sw/source
sw/qa/extras/rtfexport/rtfexport8.cxx | 31 +++ sw/source/filter/ww8/rtfattributeoutput.cxx | 18 + sw/source/filter/ww8/rtfexport.cxx | 55 ++-- 3 files changed, 102 insertions(+), 2 deletions(-) New commits: commit 937bdd08ee8ff9ce90db06fd463719ba8e9da996 Author: Miklos Vajna AuthorDate: Wed Jun 5 12:13:14 2024 +0200 Commit: Miklos Vajna CommitDate: Wed Jun 5 14:49:36 2024 +0200 tdf#161417 RTF export: handle endnotes at section ends Similar to commit 566c7017a84e3d573de85a6d986b81d3f59de0fa (tdf#160984 sw continuous endnotes: DOCX: export of pos == sectEnd, 2024-05-29), but this is RTF, not DOCX. Additional complexity is that it's not enough to just write endnotes (sect end) or enddoc (doc end) to export the position, also et and ndnhere needs writing, otherwise Word ignores this. Last bit is to ignore section formats which are not nullptr but are -1, ignore these in RtfAttributeOutput::SectionBreak(), similar to how DocxAttributeOutput::SectionBreak() does the same already. Change-Id: I2327c979d5af402eb15523d97149f6409fcf4adf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168468 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index 33219edcfe9d..347b39c68563 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -39,6 +39,7 @@ #include #include #include +#include using namespace css; @@ -173,6 +174,36 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_lostFrame) verify(); } +CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndRTF) +{ +// Given a document, endnotes at collected at section end: +createSwDoc(); +{ +SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); +pWrtShell->SplitNode(); +pWrtShell->Up(/*bSelect=*/false); +pWrtShell->Insert("x"); +pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); +SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); +pWrtShell->StartAction(); +SfxItemSetFixed aSet(pWrtShell->GetAttrPool()); +aSet.Put(SwFormatEndAtTextEnd(FTNEND_ATTXTEND)); +pWrtShell->InsertSection(aSection, ); +pWrtShell->EndAction(); +pWrtShell->InsertFootnote(OUString(), /*bEndNote=*/true); +} + +// When saving to DOC: +saveAndReload(mpFilter); + +// Then make sure the endnote position is section end: +SwDoc* pDoc = getSwDoc(); +SwSectionFormats& rSections = pDoc->GetSections(); +SwSectionFormat* pFormat = rSections[0]; +// Without the accompanying fix in place, this test would have failed, endnotes were at doc end. +CPPUNIT_ASSERT(pFormat->GetEndAtTextEnd().IsAtEnd()); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf158983) { auto verify = [this]() { diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 2c9f92aaa245..8721e2f0d99b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -97,6 +97,7 @@ #include "rtfexport.hxx" #include #include +#include using namespace ::com::sun::star; using namespace sw::util; @@ -1367,6 +1368,23 @@ void RtfAttributeOutput::SectionBreak(sal_uInt8 nC, bool /*bBreakAfter*/, m_rExport.SectionProperties(*pSectionInfo); break; } + +// Endnotes included in the section: +if (!pSectionInfo) +{ +return; +} +const SwSectionFormat* pSectionFormat = pSectionInfo->pSectionFormat; +if (!pSectionFormat || pSectionFormat == reinterpret_cast(sal_IntPtr(-1))) +{ +// MSWordExportBase::WriteText() can set the section format to -1, ignore. +return; +} +if (!pSectionFormat->GetEndAtTextEnd().IsAtEnd()) +{ +return; +} +m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_ENDNHERE); } void RtfAttributeOutput::StartSection() diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 8acd96461ac6..88a3086c6dfc 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -70,6 +70,9 @@ #include #include #include +#include +#include +#include using namespace ::com::sun::star; @@ -798,7 +801,8 @@ ErrCode RtfExport::ExportDocument_Impl() // enable it on a per-section basis. OTOH don't always enable it as it // breaks moving of drawings - so write it only in case there is really a // protected section in the document. -for (auto const& pSectionFormat : m_rDoc.GetSections()) +SwSectionFormats& rSections = m_rDoc.GetSections(); +for (auto const& pSectionFormat : rSection
core.git: sw/qa sw/source
sw/qa/writerfilter/rtftok/data/endnote-at-section-end.rtf | 15 + sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx | 23 ++ sw/source/writerfilter/rtftok/rtfdispatchflag.cxx |7 +++- 3 files changed, 44 insertions(+), 1 deletion(-) New commits: commit ad8fa1b5912a04f4cc016965175315e4784fa229 Author: Miklos Vajna AuthorDate: Wed Jun 5 09:34:14 2024 +0200 Commit: Miklos Vajna CommitDate: Wed Jun 5 10:38:18 2024 +0200 tdf#161417 RTF import: handle endnotes at section ends This is similar to commit 2d2dd56e0b2dc708f1f758d7fc9a1263ff09b83c (tdf#160984 sw continuous endnotes: DOCX: import pos == sectEnd, 2024-05-28), but that was for DOCX import, this is for RTF import. Change-Id: I6772f78360f681d18559556e71526eb76670bec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168424 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/writerfilter/rtftok/data/endnote-at-section-end.rtf b/sw/qa/writerfilter/rtftok/data/endnote-at-section-end.rtf new file mode 100644 index ..945bd42c24c9 --- /dev/null +++ b/sw/qa/writerfilter/rtftok/data/endnote-at-section-end.rtf @@ -0,0 +1,15 @@ +{ tf1 +\paperw11906\paperh16838\margl1134\margr1134\margt1134\margb1134 +endnoteset1 +\pard\plain +First +\sect\sectd\sbknonendnhere +second ++{ootnotetnalt\pard\plain ++} +\sect\sectd\sbknonendnhere\pard\plain +third +\par +} diff --git a/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx b/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx index 8c660435a3a6..62fb089e29d3 100644 --- a/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx +++ b/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx @@ -13,6 +13,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -100,6 +101,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTblOverlap) // "can overlap". CPPUNIT_ASSERT(!bAllowOverlap); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnoteAtSectionEndRTFImport) +{ +// Given a document with at-section-end endnotes enabled: +// When loading that document: +loadFromFile(u"endnote-at-section-end.rtf"); + +// Go to the second paragraph, which is inside Word's second section: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +xParaEnum->nextElement(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xSection; +xPara->getPropertyValue("TextSection") >>= xSection; +bool bEndnoteIsCollectAtTextEnd = false; +xSection->getPropertyValue("EndnoteIsCollectAtTextEnd") >>= bEndnoteIsCollectAtTextEnd; +// Without the accompanying fix in place, this test would have failed, endnotes were always at +// document end. +CPPUNIT_ASSERT(bEndnoteIsCollectAtTextEnd); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx b/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx index dfc5be5b1e05..acd753fe6eb3 100644 --- a/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx +++ b/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx @@ -925,8 +925,13 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) break; case RTFKeyword::AENDDOC: // Noop, this is the default in Writer. +break; case RTFKeyword::AENDNOTES: -// Noop +{ +auto pValue = new RTFValue(NS_ooxml::LN_Value_ST_EdnPos_sectEnd); +m_aSettingsTableSprms.set(NS_ooxml::LN_CT_EdnProps_pos, pValue); +} +break; case RTFKeyword::AFTNRSTCONT: // Noop, this is the default in Writer. case RTFKeyword::AFTNRESTART:
core.git: bin/diff-pdf-page.py
bin/diff-pdf-page.py | 42 ++ 1 file changed, 42 insertions(+) New commits: commit e42b7ab0c796f5b2a985cdac56b1c342c5501984 Author: Miklos Vajna AuthorDate: Tue Jun 4 16:14:15 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 4 17:27:40 2024 +0200 bin: add a diff-pdf-page.py script to diff reference vs our rendering via PDF Thanks László Németh for the idea, the mechanism used in the tool was also used to generate the visual diff visible at <https://wiki.documentfoundation.org/ReleaseNotes/24.2#New_line_break_algorithm_for_interoperability>. Change-Id: I51afb08c60c7134f75a54acdb94b49d2ff94befd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168404 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/bin/diff-pdf-page.py b/bin/diff-pdf-page.py new file mode 100755 index ..153654d5d386 --- /dev/null +++ b/bin/diff-pdf-page.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# Diffs two PDF pages: a reference and our own output. Red output means some to fix: the amount of +# red is meant to reduce as fixing progresses. Sample usage: +# +# bin/diff-pdf-page.py reference.pdf test.pdf diff.png + +import argparse +import tempfile +import subprocess + +def run(argv): +print(" ".join(argv)) +subprocess.run(argv, check=True) + +def main(): +parser = argparse.ArgumentParser(description="Diffs two PDF pages, first is painted red instead of black, the second is painted on top of the first.") +parser.add_argument("-d", "--density", default="384") +parser.add_argument("-p", "--page", default="0") +parser.add_argument("a_pdf") +parser.add_argument("b_pdf") +parser.add_argument("diff_png") +args = parser.parse_args() + +a_png = tempfile.NamedTemporaryFile(suffix=".png") +a_pdf = args.a_pdf + "[" + args.page + "]" +run(["convert", "-density", args.density, a_pdf, "-colorspace", "RGB", "-fuzz", "95%", "-fill", "red", "-opaque", "black", a_png.name]) +b_png = tempfile.NamedTemporaryFile(suffix=".png") +b_pdf = args.b_pdf + "[" + args.page + "]" +run(["convert", "-density", args.density, b_pdf, "-colorspace", "RGB", b_png.name]) +composite_png = tempfile.NamedTemporaryFile(suffix=".png") +run(["convert", "-composite", a_png.name, b_png.name, composite_png.name]) +run(["convert", composite_png.name, "-background", "white", "-flatten", args.diff_png]) + +if __name__ == "__main__": +main() + +# vim:set shiftwidth=4 softtabstop=4 expandtab:
core.git: Branch 'distro/collabora/co-24.04' - sw/source sw/uiconfig
sw/source/ui/misc/pgfnote.cxx | 29 + sw/source/uibase/inc/pgfnote.hxx |4 sw/source/uibase/utlui/uitool.cxx |7 +++ sw/uiconfig/swriter/ui/footnoteareapage.ui |8 4 files changed, 44 insertions(+), 4 deletions(-) New commits: commit c080c2598537a7283849d344b61c1032e5cc7979 Author: Miklos Vajna AuthorDate: Fri May 31 16:11:42 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 4 14:53:29 2024 +0200 tdf#160984 sw continuous endnotes: hide not functional UI in this mode Previous commits bug have fixed cases where opening a Word document rendered a different foot/endnote separator than expected for Word. The followings were modified: - distance between body text and separator, between separator and first note - the vertical position of the line - the length of the line Now ODT files keep the original feature set and Word files look as expected, but a couple of UI controls are ignored by the layout, hide these as they intentionally don't do anything while we're in Word compat mode. (cherry picked from commit 8f3e11dc9a4b3fd9ad1985d88b241df7bcb66fec) Change-Id: I72a3dde637d3e224038886a79550fa069253a4f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168375 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Miklos Vajna diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 14eec4b21be1..8da1597882d7 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -99,13 +100,17 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p , m_xMaxHeightPageBtn(m_xBuilder->weld_radio_button("maxheightpage")) , m_xMaxHeightBtn(m_xBuilder->weld_radio_button("maxheight")) , m_xMaxHeightEdit(m_xBuilder->weld_metric_spin_button("maxheightsb", FieldUnit::CM)) +, m_xDistLabel(m_xBuilder->weld_label("spacetotextlabel")) , m_xDistEdit(m_xBuilder->weld_metric_spin_button("spacetotext", FieldUnit::CM)) +, m_xLinePosLabel(m_xBuilder->weld_label("positionlabel")) , m_xLinePosBox(m_xBuilder->weld_combo_box("position")) , m_xLineTypeBox(new SvtLineListBox(m_xBuilder->weld_menu_button("style"))) , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button("thickness", FieldUnit::POINT)) , m_xLineColorBox(new ColorListBox(m_xBuilder->weld_menu_button("color"), [this]{ return GetDialogController()->getDialog(); })) +, m_xLineLengthLabel(m_xBuilder->weld_label("lengthlabel")) , m_xLineLengthEdit(m_xBuilder->weld_metric_spin_button("length", FieldUnit::PERCENT)) +, m_xLineDistLabel(m_xBuilder->weld_label("spacingtocontentslabel")) , m_xLineDistEdit(m_xBuilder->weld_metric_spin_button("spacingtocontents", FieldUnit::CM)) { SetExchangeSupport(); @@ -116,6 +121,30 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); tools::Long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134; m_xMaxHeightEdit->set_value(m_xMaxHeightEdit->normalize(nHeightValue),FieldUnit::TWIP); + +bool bContinuousEndnotes = false; +if (const SfxGrabBagItem* pGragbagItem = rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG)) +{ +auto it = pGragbagItem->GetGrabBag().find("ContinuousEndnotes"); +if (it != pGragbagItem->GetGrabBag().end()) +{ +it->second >>= bContinuousEndnotes; +} +} + +if (bContinuousEndnotes) +{ +// These are ignored in SwFootnoteContFrame::Format() and SwFootnoteContFrame::PaintLine(), +// hide them. +m_xDistLabel->set_visible(false); +m_xDistEdit->set_visible(false); +m_xLinePosLabel->set_visible(false); +m_xLinePosBox->set_visible(false); +m_xLineLengthLabel->set_visible(false); +m_xLineLengthEdit->set_visible(false); +m_xLineDistLabel->set_visible(false); +m_xLineDistEdit->set_visible(false); +} } SwFootNotePage::~SwFootNotePage() diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx index c239f1ed292f..0abb09a80a9d 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -44,12 +44,16 @@ private: std::unique_ptr m_xMaxHeightPageBtn; std::unique_ptr m_xMaxHeightBtn; std::unique_ptr m_xMaxHeightEdit; +std::unique_ptr m_xDistLabel; std::unique_ptr
core.git: sw/qa sw/source
sw/qa/extras/ww8export/ww8export4.cxx | 31 +++ sw/source/filter/ww8/wrtww8.cxx | 13 + 2 files changed, 44 insertions(+) New commits: commit 24ab535087991f1ce8dee9a561476bc0a987bac5 Author: Miklos Vajna AuthorDate: Tue Jun 4 13:43:23 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 4 14:46:53 2024 +0200 tdf#161417 DOC export: handle endnotes at section ends Similar to commit 566c7017a84e3d573de85a6d986b81d3f59de0fa (tdf#160984 sw continuous endnotes: DOCX: export of pos == sectEnd, 2024-05-29), but this is for DOC, not DOCX. Change-Id: I4301d97115ba48f7ed1dacfdd5b29336bdaf9e63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168401 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index b52e2b8f77f1..187e18267463 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -36,6 +36,7 @@ #include #include #include +#include namespace { @@ -122,6 +123,36 @@ DECLARE_WW8EXPORT_TEST(testTdf141649_conditionalText, "tdf141649_conditionalText getParagraph(1, "trueResult"); } +CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndDOC) +{ +// Given a document, endnotes at collected at section end: +createSwDoc(); +{ +SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); +pWrtShell->SplitNode(); +pWrtShell->Up(/*bSelect=*/false); +pWrtShell->Insert("x"); +pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); +SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); +pWrtShell->StartAction(); +SfxItemSetFixed aSet(pWrtShell->GetAttrPool()); +aSet.Put(SwFormatEndAtTextEnd(FTNEND_ATTXTEND)); +pWrtShell->InsertSection(aSection, ); +pWrtShell->EndAction(); +pWrtShell->InsertFootnote(OUString(), /*bEndNote=*/true); +} + +// When saving to DOC: +saveAndReload("MS Word 97"); + +// Then make sure the endnote position is section end: +SwDoc* pDoc = getSwDoc(); +SwSectionFormats& rSections = pDoc->GetSections(); +SwSectionFormat* pFormat = rSections[0]; +// Without the accompanying fix in place, this test would have failed, endnotes were at doc end. +CPPUNIT_ASSERT(pFormat->GetEndAtTextEnd().IsAtEnd()); +} + DECLARE_WW8EXPORT_TEST(testTdf90408, "tdf90408.doc") { uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY_THROW); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index a14412469cf8..467a7c18949a 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -87,6 +87,7 @@ #include #include #include +#include #include "sprmids.hxx" #include @@ -493,6 +494,18 @@ static void WriteDop( WW8Export& rWrt ) rDop.cParas = rDStat.nPara; rDop.cLines = rDStat.nPara; +SwSectionFormats& rSections = rWrt.m_rDoc.GetSections(); +if (!rSections.empty()) +{ +SwSectionFormat* pFormat = rSections[0]; +bool bEndnAtEnd = pFormat->GetEndAtTextEnd().IsAtEnd(); +if (bEndnAtEnd) +{ +// DopBase.epc: this is normally 3 (end of document), change this to end of section. +rDop.epc = 0; +} +} + SwDocShell *pDocShell(rWrt.m_rDoc.GetDocShell()); OSL_ENSURE(pDocShell, "no SwDocShell"); uno::Reference xDocProps;
core.git: svtools/source
svtools/source/brwbox/brwbox1.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit 31490e9bd93bfd622ddda79e927114b3fafba6c1 Author: Miklos Vajna AuthorDate: Tue Jun 4 11:11:33 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 4 12:24:46 2024 +0200 Revert "svtools: fix crash in BrowseBox::GetControlArea()" This reverts commit ec5aa7e88b0d412041f8575111f0da295065cecb (svtools: fix crash in BrowseBox::GetControlArea(), 2024-06-04), not needed after commit 6f2b5043613bea755f01b413fd86ece0b3a29e5d (crashtesting: BrowseBox::GetControlArea crash, 2024-06-03). Change-Id: I1e86380041266b1fb83f11df37700f10cc88e5bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168399 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 0457d768ec98..982e00cfd388 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -2134,11 +2134,6 @@ bool BrowseBox::ReserveControlArea(sal_uInt16 nWidth) tools::Rectangle BrowseBox::GetControlArea() const { -if (!aHScroll) -{ -return tools::Rectangle(); -} - auto nHeight = aHScroll->GetSizePixel().Height(); auto nEndRight = aHScroll->GetPosPixel().X();
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/data/endnote-cont-separator.docx |binary sw/qa/core/layout/paintfrm.cxx | 27 + sw/source/core/inc/ftnfrm.hxx |1 sw/source/core/layout/findfrm.cxx | 11 sw/source/core/layout/paintfrm.cxx | 16 ++-- 5 files changed, 52 insertions(+), 3 deletions(-) New commits: commit 3939d516fd27759e779d72f70ceef1e8bb23fa00 Author: Miklos Vajna AuthorDate: Thu May 30 15:23:45 2024 +0200 Commit: Caolán McNamara CommitDate: Tue Jun 4 10:55:21 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote continuation separator len See e.g. <https://bug-attachments.documentfoundation.org/attachment.cgi?id=194455>, one remaining difference for the Word vs Writer note separator is the length of the endnote continuation separator: it's body frame width in Word, shorter in Writer. Seems this is specific to the endnote continuation separator, i.e. normal endnote separator, footnote separator and footnote continuation separator is not affected. Additionally, it's really footnote vs endnote: if you put footnotes to the end of the document in Word, it still doesn't make the separator longer. Fix the problem by extending SwFootnoteContFrame::PaintLine() to handle this: if in Word compat mode, first note frame is a follow endnote frame, then paint the longer separator. The usual render test way via SfxObjectShell::GetPreviewMetaFile() only works with 1st pages and we want to assert the 2nd page here, so go via DocumentToGraphicRenderer, similar to how EPUBExportFilter::CreateMetafiles() does it. (cherry picked from commit 6450159e0e7c5fac9c998087e99f3fec602ff84d) Change-Id: Ia0ba1138070f1a68f62ea6f5a6a85fbe0f76d482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168374 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/qa/core/layout/data/endnote-cont-separator.docx b/sw/qa/core/layout/data/endnote-cont-separator.docx new file mode 100644 index ..2e01a5c91354 Binary files /dev/null and b/sw/qa/core/layout/data/endnote-cont-separator.docx differ diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx index a5213c57d639..464979c988a6 100644 --- a/sw/qa/core/layout/paintfrm.cxx +++ b/sw/qa/core/layout/paintfrm.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -188,6 +189,32 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSeparatorPosition) // i.e. the separator wasn't 2 inches long, but was shorter vs Word. CPPUNIT_ASSERT_EQUAL(static_cast(2880), nEndnoteSeparatorLength); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnoteContSeparator) +{ +// Given a document with a Word-style endnote continuation separator: +createSwDoc("endnote-cont-separator.docx"); + +// When rendering page 2: +sal_Int32 nPage = 2; +DocumentToGraphicRenderer aRenderer(mxComponent, /*bSelectionOnly=*/false); +Size aSize = aRenderer.getDocumentSizeInPixels(nPage); +Graphic aGraphic = aRenderer.renderToGraphic(nPage, aSize, aSize, COL_WHITE, + /*bExtOutDevData=*/false); +auto& xMetaFile = const_cast(aGraphic.GetGDIMetaFile()); + +// Then make sure the separator length is correct: +MetafileXmlDump aDumper; +xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, xMetaFile); +auto nEndnoteSeparatorStart = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, "x"_ostr).toInt32(); +auto nEndnoteSeparatorEnd = getXPath(pXmlDoc, "//polygon/point[2]"_ostr, "x"_ostr).toInt32(); +sal_Int32 nEndnoteSeparatorLength = nEndnoteSeparatorEnd - nEndnoteSeparatorStart; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 9360 (page print area width) +// - Actual : 2880 (2 inches) +// i.e. the separator was too short vs Word. +CPPUNIT_ASSERT_EQUAL(static_cast(9360), nEndnoteSeparatorLength); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx index 558c4941bf06..7331ef07d100 100644 --- a/sw/source/core/inc/ftnfrm.hxx +++ b/sw/source/core/inc/ftnfrm.hxx @@ -51,6 +51,7 @@ public: SwFootnoteContFrame( SwFrameFormat*, SwFrame* ); const SwFootnoteFrame* FindFootNote() const; +const SwFootnoteFrame* FindEndNote() const; static inline SwFootnoteFrame* AppendChained(SwFrame* pThis, bool bDefaultFormat); static inline SwFootnoteFrame* PrependChained(SwFrame* pThis, bool bDefaultFormat); diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 4efa25e553e6..fc0293381168 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@
core.git: svtools/source
svtools/source/brwbox/brwbox1.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit ec5aa7e88b0d412041f8575111f0da295065cecb Author: Miklos Vajna AuthorDate: Tue Jun 4 08:54:29 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 4 09:58:09 2024 +0200 svtools: fix crash in BrowseBox::GetControlArea() UITest_writer_tests4 sometimes (but not always) crashes for me, typically not when it's execute alone, but when it's executed as part of 'make check'. The soffice process crashes on shutdown, after all tests passed without problems. coredumpctl gives this in gdb: Program terminated with signal SIGSEGV, Segmentation fault. #0 BrowseBox::GetControlArea (this=0x9bd3f90) at svtools/source/brwbox/brwbox1.cxx:2137 2137auto nHeight = aHScroll->GetSizePixel().Height(); (gdb) print aHScroll $1 = {m_rInnerRef = empty rtl::Reference} (gdb) bt #0 BrowseBox::GetControlArea() const (this=0x9bd3f90) at svtools/source/brwbox/brwbox1.cxx:2137 #1 0x7fbbd2022ed9 in DbGridControl::RearrangeHdl(Timer*) (this=0x9bd3f90) at svx/source/fmcomp/gridctrl.cxx:2646 #2 0x7fbbd2022ea3 in DbGridControl::LinkStubRearrangeHdl(void*, Timer*) (instance=0x9bd3f90, data=0x9bd4468) at svx/source/fmcomp/gridctrl.cxx:2643 #3 0x7fbbcedb8d79 in Link::Call(Timer*) const (this=0x9bd4488, data=0x9bd4468) at include/tools/link.hxx:111 #4 0x7fbbcedb8c01 in Timer::Invoke() (this=0x9bd4468) at vcl/source/app/timer.cxx:75 Let's assume the problem is that somehow we can get here after the VclPtr is already disposed and just return early to avoid the crash. Change-Id: Ic27727dc3622d8da88256c80f873dc79795864b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168393 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 982e00cfd388..0457d768ec98 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -2134,6 +2134,11 @@ bool BrowseBox::ReserveControlArea(sal_uInt16 nWidth) tools::Rectangle BrowseBox::GetControlArea() const { +if (!aHScroll) +{ +return tools::Rectangle(); +} + auto nHeight = aHScroll->GetSizePixel().Height(); auto nEndRight = aHScroll->GetPosPixel().X();
core.git: Branch 'distro/collabora/co-23.05' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx | 23 ++ writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx |binary writerfilter/source/dmapper/DomainMapper.cxx |4 - writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 ++ writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 + 5 files changed, 33 insertions(+), 2 deletions(-) New commits: commit ece1abdda6bc40e9911e07db66cecfc02e0c76df Author: Miklos Vajna AuthorDate: Fri May 31 09:00:18 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Jun 4 09:38:46 2024 +0200 tdf#161318 sw clearing break: fix this at section end Regression from commit 19bca24486315cc35f873486e6a2dd18394d0614 (tdf#126287: docx import: use defered linebreak, 2022-02-07), the bugdoc has a single paragraph in the first section, containing a clearing break, which is lost. This leads to overlapping text as the text is shifted up. Seems the intention was to avoid a line break at the very end of the document, as that can lead to an empty page with "next page" section breaks, with non-clearing line breaks. Fix the problem by only doing this for non-clearing line breaks: that keeps the old use-case working, but the new, clearing line break then shifts down the text, so no text overlap happens. Switching from appendTextPortion() to HandleLineBreak() helps because HandleLineBreak() does exactly appendTextPortion(" ") in the non-clearing case, but knows about the stream stack's line break clear status. (cherry picked from commit e00479404af5058b982c447e485af995d552e372) Conflicts: writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx writerfilter/source/dmapper/DomainMapper.cxx Change-Id: I38868eeeac55e20e86b668e9baf7e0d6a4976608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168361 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice (cherry picked from commit f1338ba7de2ab1abf98283f977605a9d1053b82d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168385 Reviewed-by: Miklos Vajna diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx index dc99e6ae2168..c299294d92cd 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx @@ -411,6 +411,29 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlinedShapeThenSdt) CPPUNIT_ASSERT_EQUAL(OUString("ContentControl"), xPortion->getPropertyValue("TextPortionType").get()); } + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakSectEnd) +{ +// Given a file with a single-paragraph section, ends with a clearing break: +// When importing that document: +loadFromURL(u"clearing-break-sect-end.docx"); + +// Then make sure the clearing break is not lost before a cont sect break: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +uno::Reference xPortionEnumAccess(xParaEnum->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortionEnum = xPortionEnumAccess->createEnumeration(); +uno::Reference xPortion(xPortionEnum->nextElement(), uno::UNO_QUERY); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: LineBreak +// - Actual : Text +// i.e. the clearing break at sect end was lost, leading to text overlap. +CPPUNIT_ASSERT_EQUAL(OUString("LineBreak"), + xPortion->getPropertyValue("TextPortionType").get()); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx b/writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx new file mode 100644 index ..5052b2dd1649 Binary files /dev/null and b/writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx differ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index f75e765ba07c..24c626fb83de 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -4165,13 +4165,13 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) else if (len == 1 && sText[0] == ' ') { // Clear "last" one linebreak at end of section -
core.git: Branch 'distro/collabora/libreoffice-7-5+backports' - sw/CppunitTest_sw_core_layout.mk sw/qa sw/source
sw/CppunitTest_sw_core_layout.mk |1 sw/qa/core/layout/data/table-print-area-left.docx |binary sw/qa/core/layout/tabfrm.cxx | 38 ++ sw/source/core/layout/tabfrm.cxx |7 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) New commits: commit 3b92f905115cd789a4dafb4e2ee8ee6043693ea8 Author: Miklos Vajna AuthorDate: Wed May 10 23:28:03 2023 +0100 Commit: Mike Kaganski CommitDate: Mon Jun 3 10:27:47 2024 +0500 tdf#154775 sw layout: fix unexpected large table print area left margin The bugdoc had 2 pages, but the second page's content was mostly a table. This table was rendered outside the page frame, so it was practically invisible. This started after commit fd7749fddc5a767461dfced55369af48e5a6d561 (sw: fix handling of table vs fly overlaps in the AddVerticalFlyOffsets case, 2020-02-14), and that behavior is still wanted to have correct table borders, but that change introduced an inconsistent case: we started to always accept an invalid frame area definition of the fly, but we only shifted the content down in the text::HoriOrientation::NONE case. Fix the problem by limiting the "accept invalid frame area definition" based on the horizontal orientation, so we either both ignore the validity flag & shift down or do none of this. This keeps the original bug fixed, but addresses the new "no visible table" problem. Note that this only fixes the regression part; once the image from the header is removed and undo is invoked, a similar problem still happens. But that is a pre-existing, separate problem. Change-Id: Id752c169b7c7fb6b75e6603ad29aaafbb676b8a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151652 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk index 9a7a4710dfb7..1c991f8c19ba 100644 --- a/sw/CppunitTest_sw_core_layout.mk +++ b/sw/CppunitTest_sw_core_layout.mk @@ -15,6 +15,7 @@ $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_layout)) $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_layout, \ sw/qa/core/layout/layout \ +sw/qa/core/layout/tabfrm \ )) $(eval $(call gb_CppunitTest_use_libraries,sw_core_layout, \ diff --git a/sw/qa/core/layout/data/table-print-area-left.docx b/sw/qa/core/layout/data/table-print-area-left.docx new file mode 100644 index ..e326bed82f39 Binary files /dev/null and b/sw/qa/core/layout/data/table-print-area-left.docx differ diff --git a/sw/qa/core/layout/tabfrm.cxx b/sw/qa/core/layout/tabfrm.cxx new file mode 100644 index ..4b991c27dbf8 --- /dev/null +++ b/sw/qa/core/layout/tabfrm.cxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +/// Covers sw/source/core/layout/tabfrm.cxx fixes. +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/core/layout/data/") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testTablePrintAreaLeft) +{ +// Given a document with a header containing an image, and also with an overlapping table: +createSwDoc("table-print-area-left.docx"); + +// When laying out that document & parsing the left margin of the table: +SwTwips nTablePrintLeft = parseDump("//tab/infos/prtBounds", "left").toInt32(); + +// Then make sure it has ~no left margin: +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 5 +// - Actual : 10646 +// i.e. the table was shifted outside the page, was invisible. +CPPUNIT_ASSERT_EQUAL(static_cast(5), nTablePrintLeft); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index d2e4618bf317..abf9fa1bb4f0 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2860,10 +2860,14 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, // at the page frame, the table is on, but it's anchor character // text frame has already changed its page. const SwTextFrame* pAnchorCharFrame = pFly->FindAnchorCharFrame(); +const SwFormatHoriOrient& rHori = pFly->GetFormat()->GetHoriOrient(); +// Only consider invalid Writer fly frames if they'll be shifted down. +bool bIgnoreFlyValidity += bAddVerticalFlyOffsets &&a
core.git: officecfg/registry sw/inc sw/source
officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |6 sw/inc/strings.hrc|3 +- sw/inc/viewsh.hxx |2 + sw/source/core/doc/DocumentSettingManager.cxx |1 sw/source/core/view/viewsh.cxx| 14 ++ sw/source/ui/config/optcomp.cxx |6 6 files changed, 31 insertions(+), 1 deletion(-) New commits: commit b79b50c8f06a5c977451995b2d632e5738d7d335 Author: Miklos Vajna AuthorDate: Mon Jun 3 17:01:20 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 18:34:02 2024 +0200 tdf#160984 sw continuous endnotes: add enable/disable option UI Doing this via a macro was possible already, but that didn't invalidate the endnote positions on the layout, so required a document reload, which was ugly. Implement the new SwViewShell::SetContinuousEndnotes() by removing the endnote frames in the document, so they'll be re-created at the expected place as the layout action ends. Change-Id: If96e70ab29c5a6c95fce36775e9a9a61277fc8a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168383 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs index 9bc722106070..c1fc01658ad3 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs @@ -158,6 +158,12 @@ false + + + Render endnotes at the end of the document inline, rather than on a separate page + +false + diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 6a36f4740926..298b861eecf6 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -1492,7 +1492,8 @@ #define STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER NC_("STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER", "Do not add an extra space after number in footnotes / endnotes with hanging first line") #define STR_COMPAT_OPT_TABSRELATIVETOINDENT NC_("STR_COMPAT_OPT_TABSRELATIVETOINDENT", "Set tabstops relative to indent of paragraph") #define STR_COMPAT_OPT_TABOVERMARGIN NC_("STR_COMPAT_OPT_TABOVERMARGIN", "Allow tabs to extend beyond the right margin") -#define STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS NC_("DO_NOT_MIRROR_RTL_DRAW_OBJS", "Do not mirror drawing objects anchored in paragraphs with an RTL writing direction") +#define STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS NC_("STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS", "Do not mirror drawing objects anchored in paragraphs with an RTL writing direction") +#define STR_COMPAT_OPT_CONTINUOUS_ENDNOTES NC_("STR_COMPAT_OPT_CONTINUOUS_ENDNOTES", "Render endnotes at the end of document inline, rather than on a separate page") #define STR_TABLE_PANEL_ALIGN_AUTO NC_("sidebartableedit|alignautolabel", "Automatic") #define STR_TABLE_PANEL_ALIGN_LEFT NC_("sidebartableedit|alignleftlabel", "Left") diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 18d33266b627..b53a3ed7b719 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -453,6 +453,8 @@ public: SW_DLLPUBLIC void SetDoNotMirrorRtlDrawObjs(bool bDoNotMirrorRtlDrawObjs); +SW_DLLPUBLIC void SetContinuousEndnotes(bool bContinuousEndnotes); + // DOCUMENT COMPATIBILITY FLAGS END // Calls Idle-formatter of Layout. diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 0a02eb5cb72f..52d609be2e78 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -141,6 +141,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc ) mbTabRelativeToIndent = aOptions.get(u"TabsRelativeToIndent"_ustr); mbTabOverMargin = aOptions.get(u"TabOverMargin"_ustr); mbDoNotMirrorRtlDrawObjs= aOptions.get(u"DoNotMirrorRtlDrawObjs"_ustr); +mbContinuousEndnotes= aOptions.get(u"ContinuousEndnotes"_ustr); } else { diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index ec29a15874c0..c4d9a551807c 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1094,6 +1094,20 @@ void SwViewShell::SetDoNotMirrorRtlDrawObjs(bool bDoNotMirrorRtlDrawObjs) } } +void SwViewShell::SetContinuousEndnotes(bool bContinuousEndnotes) +{ +IDocumentSettingAccess& rIDSA = getIDoc
core.git: Branch 'distro/collabora/co-24.04' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx | 23 ++ writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx |binary writerfilter/source/dmapper/DomainMapper.cxx |4 - writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 ++ writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 + 5 files changed, 33 insertions(+), 2 deletions(-) New commits: commit f1338ba7de2ab1abf98283f977605a9d1053b82d Author: Miklos Vajna AuthorDate: Fri May 31 09:00:18 2024 +0200 Commit: Caolán McNamara CommitDate: Mon Jun 3 16:08:02 2024 +0200 tdf#161318 sw clearing break: fix this at section end Regression from commit 19bca24486315cc35f873486e6a2dd18394d0614 (tdf#126287: docx import: use defered linebreak, 2022-02-07), the bugdoc has a single paragraph in the first section, containing a clearing break, which is lost. This leads to overlapping text as the text is shifted up. Seems the intention was to avoid a line break at the very end of the document, as that can lead to an empty page with "next page" section breaks, with non-clearing line breaks. Fix the problem by only doing this for non-clearing line breaks: that keeps the old use-case working, but the new, clearing line break then shifts down the text, so no text overlap happens. Switching from appendTextPortion() to HandleLineBreak() helps because HandleLineBreak() does exactly appendTextPortion(" ") in the non-clearing case, but knows about the stream stack's line break clear status. (cherry picked from commit e00479404af5058b982c447e485af995d552e372) Conflicts: writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx writerfilter/source/dmapper/DomainMapper.cxx Change-Id: I38868eeeac55e20e86b668e9baf7e0d6a4976608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168361 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx index 16aa5cbfb2df..d2388505d71d 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx @@ -411,6 +411,29 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlinedShapeThenSdt) CPPUNIT_ASSERT_EQUAL(u"ContentControl"_ustr, xPortion->getPropertyValue("TextPortionType").get()); } + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakSectEnd) +{ +// Given a file with a single-paragraph section, ends with a clearing break: +// When importing that document: +loadFromFile(u"clearing-break-sect-end.docx"); + +// Then make sure the clearing break is not lost before a cont sect break: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +uno::Reference xPortionEnumAccess(xParaEnum->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortionEnum = xPortionEnumAccess->createEnumeration(); +uno::Reference xPortion(xPortionEnum->nextElement(), uno::UNO_QUERY); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: LineBreak +// - Actual : Text +// i.e. the clearing break at sect end was lost, leading to text overlap. +CPPUNIT_ASSERT_EQUAL(u"LineBreak"_ustr, + xPortion->getPropertyValue("TextPortionType").get()); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx b/writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx new file mode 100644 index ..5052b2dd1649 Binary files /dev/null and b/writerfilter/qa/cppunittests/dmapper/data/clearing-break-sect-end.docx differ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index bfca0214a017..d206fa0b140f 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -4354,13 +4354,13 @@ void DomainMapper::lcl_utext(const sal_Unicode *const data_, size_t len) else if (len == 1 && sText[0] == ' ') { // Clear "last" one linebreak at end of section -if (m_pImpl->GetIsLastParagraphInSection() && m_pImpl->isBreakDeferred(LINE_BREAK)) +if (m_pImpl->GetIsLastParagraphInSection() && m_pImpl->
core.git: include/svx svx/source
include/svx/svdundo.hxx |6 +++--- svx/source/svdraw/svdundo.cxx | 28 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) New commits: commit 61f5006c18b3194f6aaa03e260425dc878cfff79 Author: Miklos Vajna AuthorDate: Mon Jun 3 09:32:38 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 12:24:08 2024 +0200 svx: prefix members of SdrUndoGeoObj See tdf#94879 for motivation. Change-Id: Ic34b5e1c7a1b73d688cc4dfc87c03417fe8e987b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168357 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index e1b778064e6d..bc15932fd81c 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -211,10 +211,10 @@ public: class SVXCORE_DLLPUBLIC SdrUndoGeoObj : public SdrUndoObj { -std::unique_ptr pUndoGeo; -std::unique_ptr pRedoGeo; +std::unique_ptr m_pUndoGeo; +std::unique_ptr m_pRedoGeo; // If we have a group object: -std::unique_ptr pUndoGroup; +std::unique_ptr m_pUndoGroup; /// If we have a table object, should its layout change? bool mbSkipChangeLayout; diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index c7bb38d81ada..7d98d21b7cb4 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -564,21 +564,21 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj) // this is a group object! // If this were 3D scene, we'd only add an Undo for the scene itself // (which we do elsewhere). -pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); +m_pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); for (const rtl::Reference& pObj : *pOL) -pUndoGroup->AddAction(std::make_unique(*pObj)); +m_pUndoGroup->AddAction(std::make_unique(*pObj)); } else { -pUndoGeo = mxObj->GetGeoData(); +m_pUndoGeo = mxObj->GetGeoData(); } } SdrUndoGeoObj::~SdrUndoGeoObj() { -pUndoGeo.reset(); -pRedoGeo.reset(); -pUndoGroup.reset(); +m_pUndoGeo.reset(); +m_pRedoGeo.reset(); +m_pUndoGroup.reset(); } void SdrUndoGeoObj::Undo() @@ -586,21 +586,21 @@ void SdrUndoGeoObj::Undo() // Trigger PageChangeCall ImpShowPageOfThisObject(); -if(pUndoGroup) +if(m_pUndoGroup) { -pUndoGroup->Undo(); +m_pUndoGroup->Undo(); // only repaint, no objectchange mxObj->ActionChanged(); } else { -pRedoGeo = mxObj->GetGeoData(); +m_pRedoGeo = mxObj->GetGeoData(); auto pTableObj = dynamic_cast(mxObj.get()); if (pTableObj && mbSkipChangeLayout) pTableObj->SetSkipChangeLayout(true); -mxObj->SetGeoData(*pUndoGeo); +mxObj->SetGeoData(*m_pUndoGeo); if (pTableObj && mbSkipChangeLayout) pTableObj->SetSkipChangeLayout(false); } @@ -608,17 +608,17 @@ void SdrUndoGeoObj::Undo() void SdrUndoGeoObj::Redo() { -if(pUndoGroup) +if(m_pUndoGroup) { -pUndoGroup->Redo(); +m_pUndoGroup->Redo(); // only repaint, no objectchange mxObj->ActionChanged(); } else { -pUndoGeo = mxObj->GetGeoData(); -mxObj->SetGeoData(*pRedoGeo); +m_pUndoGeo = mxObj->GetGeoData(); +mxObj->SetGeoData(*m_pRedoGeo); } // Trigger PageChangeCall
core.git: sw/source sw/uiconfig
sw/source/ui/misc/pgfnote.cxx | 29 + sw/source/uibase/inc/pgfnote.hxx |4 sw/source/uibase/utlui/uitool.cxx |7 +++ sw/uiconfig/swriter/ui/footnoteareapage.ui |8 4 files changed, 44 insertions(+), 4 deletions(-) New commits: commit 8f3e11dc9a4b3fd9ad1985d88b241df7bcb66fec Author: Miklos Vajna AuthorDate: Fri May 31 16:11:42 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 31 21:59:57 2024 +0200 tdf#160984 sw continuous endnotes: hide not functional UI in this mode Previous commits bug have fixed cases where opening a Word document rendered a different foot/endnote separator than expected for Word. The followings were modified: - distance between body text and separator, between separator and first note - the vertical position of the line - the length of the line Now ODT files keep the original feature set and Word files look as expected, but a couple of UI controls are ignored by the layout, hide these as they intentionally don't do anything while we're in Word compat mode. Change-Id: I72a3dde637d3e224038886a79550fa069253a4f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168295 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 0316f6251eaa..9ed64e3e3de6 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -99,13 +100,17 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p , m_xMaxHeightPageBtn(m_xBuilder->weld_radio_button("maxheightpage")) , m_xMaxHeightBtn(m_xBuilder->weld_radio_button("maxheight")) , m_xMaxHeightEdit(m_xBuilder->weld_metric_spin_button("maxheightsb", FieldUnit::CM)) +, m_xDistLabel(m_xBuilder->weld_label("spacetotextlabel")) , m_xDistEdit(m_xBuilder->weld_metric_spin_button("spacetotext", FieldUnit::CM)) +, m_xLinePosLabel(m_xBuilder->weld_label("positionlabel")) , m_xLinePosBox(m_xBuilder->weld_combo_box("position")) , m_xLineTypeBox(new SvtLineListBox(m_xBuilder->weld_menu_button("style"))) , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button("thickness", FieldUnit::POINT)) , m_xLineColorBox(new ColorListBox(m_xBuilder->weld_menu_button("color"), [this]{ return GetDialogController()->getDialog(); })) +, m_xLineLengthLabel(m_xBuilder->weld_label("lengthlabel")) , m_xLineLengthEdit(m_xBuilder->weld_metric_spin_button("length", FieldUnit::PERCENT)) +, m_xLineDistLabel(m_xBuilder->weld_label("spacingtocontentslabel")) , m_xLineDistEdit(m_xBuilder->weld_metric_spin_button("spacingtocontents", FieldUnit::CM)) { SetExchangeSupport(); @@ -116,6 +121,30 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); tools::Long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134; m_xMaxHeightEdit->set_value(m_xMaxHeightEdit->normalize(nHeightValue),FieldUnit::TWIP); + +bool bContinuousEndnotes = false; +if (const SfxGrabBagItem* pGragbagItem = rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG)) +{ +auto it = pGragbagItem->GetGrabBag().find("ContinuousEndnotes"); +if (it != pGragbagItem->GetGrabBag().end()) +{ +it->second >>= bContinuousEndnotes; +} +} + +if (bContinuousEndnotes) +{ +// These are ignored in SwFootnoteContFrame::Format() and SwFootnoteContFrame::PaintLine(), +// hide them. +m_xDistLabel->set_visible(false); +m_xDistEdit->set_visible(false); +m_xLinePosLabel->set_visible(false); +m_xLinePosBox->set_visible(false); +m_xLineLengthLabel->set_visible(false); +m_xLineLengthEdit->set_visible(false); +m_xLineDistLabel->set_visible(false); +m_xLineDistEdit->set_visible(false); +} } SwFootNotePage::~SwFootNotePage() diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx index c239f1ed292f..0abb09a80a9d 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -44,12 +44,16 @@ private: std::unique_ptr m_xMaxHeightPageBtn; std::unique_ptr m_xMaxHeightBtn; std::unique_ptr m_xMaxHeightEdit; +std::unique_ptr m_xDistLabel; std::unique_ptr m_xDistEdit; +std::unique_ptr m_xLinePosLabel; std::unique_ptr m_xLinePosBox; std::unique_ptr m_xLineTypeBox; std::u
core.git: sw/qa sw/source
sw/qa/core/layout/data/endnote-cont-separator.docx |binary sw/qa/core/layout/paintfrm.cxx | 27 + sw/source/core/inc/ftnfrm.hxx |1 sw/source/core/layout/findfrm.cxx | 11 sw/source/core/layout/paintfrm.cxx | 16 ++-- 5 files changed, 52 insertions(+), 3 deletions(-) New commits: commit 6450159e0e7c5fac9c998087e99f3fec602ff84d Author: Miklos Vajna AuthorDate: Thu May 30 15:23:45 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 31 17:01:33 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote continuation separator len See e.g. <https://bug-attachments.documentfoundation.org/attachment.cgi?id=194455>, one remaining difference for the Word vs Writer note separator is the length of the endnote continuation separator: it's body frame width in Word, shorter in Writer. Seems this is specific to the endnote continuation separator, i.e. normal endnote separator, footnote separator and footnote continuation separator is not affected. Additionally, it's really footnote vs endnote: if you put footnotes to the end of the document in Word, it still doesn't make the separator longer. Fix the problem by extending SwFootnoteContFrame::PaintLine() to handle this: if in Word compat mode, first note frame is a follow endnote frame, then paint the longer separator. The usual render test way via SfxObjectShell::GetPreviewMetaFile() only works with 1st pages and we want to assert the 2nd page here, so go via DocumentToGraphicRenderer, similar to how EPUBExportFilter::CreateMetafiles() does it. Change-Id: Ia0ba1138070f1a68f62ea6f5a6a85fbe0f76d482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168263 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/core/layout/data/endnote-cont-separator.docx b/sw/qa/core/layout/data/endnote-cont-separator.docx new file mode 100644 index ..2e01a5c91354 Binary files /dev/null and b/sw/qa/core/layout/data/endnote-cont-separator.docx differ diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx index a5213c57d639..464979c988a6 100644 --- a/sw/qa/core/layout/paintfrm.cxx +++ b/sw/qa/core/layout/paintfrm.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -188,6 +189,32 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSeparatorPosition) // i.e. the separator wasn't 2 inches long, but was shorter vs Word. CPPUNIT_ASSERT_EQUAL(static_cast(2880), nEndnoteSeparatorLength); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnoteContSeparator) +{ +// Given a document with a Word-style endnote continuation separator: +createSwDoc("endnote-cont-separator.docx"); + +// When rendering page 2: +sal_Int32 nPage = 2; +DocumentToGraphicRenderer aRenderer(mxComponent, /*bSelectionOnly=*/false); +Size aSize = aRenderer.getDocumentSizeInPixels(nPage); +Graphic aGraphic = aRenderer.renderToGraphic(nPage, aSize, aSize, COL_WHITE, + /*bExtOutDevData=*/false); +auto& xMetaFile = const_cast(aGraphic.GetGDIMetaFile()); + +// Then make sure the separator length is correct: +MetafileXmlDump aDumper; +xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, xMetaFile); +auto nEndnoteSeparatorStart = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, "x"_ostr).toInt32(); +auto nEndnoteSeparatorEnd = getXPath(pXmlDoc, "//polygon/point[2]"_ostr, "x"_ostr).toInt32(); +sal_Int32 nEndnoteSeparatorLength = nEndnoteSeparatorEnd - nEndnoteSeparatorStart; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 9360 (page print area width) +// - Actual : 2880 (2 inches) +// i.e. the separator was too short vs Word. +CPPUNIT_ASSERT_EQUAL(static_cast(9360), nEndnoteSeparatorLength); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx index 558c4941bf06..7331ef07d100 100644 --- a/sw/source/core/inc/ftnfrm.hxx +++ b/sw/source/core/inc/ftnfrm.hxx @@ -51,6 +51,7 @@ public: SwFootnoteContFrame( SwFrameFormat*, SwFrame* ); const SwFootnoteFrame* FindFootNote() const; +const SwFootnoteFrame* FindEndNote() const; static inline SwFootnoteFrame* AppendChained(SwFrame* pThis, bool bDefaultFormat); static inline SwFootnoteFrame* PrependChained(SwFrame* pThis, bool bDefaultFormat); diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index e83f4f8414a0..5f0cc8a0f256 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -698,6 +698,17 @@ const SwFootnoteFrame* SwFootnoteContFrame::FindFootNote() const retu
core.git: sw/qa sw/source
sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx | 23 +++ sw/qa/writerfilter/dmapper/data/clearing-break-sect-end.docx |binary sw/source/writerfilter/dmapper/DomainMapper.cxx |4 - sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |5 ++ sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx |3 + 5 files changed, 33 insertions(+), 2 deletions(-) New commits: commit e00479404af5058b982c447e485af995d552e372 Author: Miklos Vajna AuthorDate: Fri May 31 09:00:18 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 31 12:58:00 2024 +0200 tdf#161318 sw clearing break: fix this at section end Regression from commit 19bca24486315cc35f873486e6a2dd18394d0614 (tdf#126287: docx import: use defered linebreak, 2022-02-07), the bugdoc has a single paragraph in the first section, containing a clearing break, which is lost. This leads to overlapping text as the text is shifted up. Seems the intention was to avoid a line break at the very end of the document, as that can lead to an empty page with "next page" section breaks, with non-clearing line breaks. Fix the problem by only doing this for non-clearing line breaks: that keeps the old use-case working, but the new, clearing line break then shifts down the text, so no text overlap happens. Switching from appendTextPortion() to HandleLineBreak() helps because HandleLineBreak() does exactly appendTextPortion(" ") in the non-clearing case, but knows about the stream stack's line break clear status. Change-Id: I38868eeeac55e20e86b668e9baf7e0d6a4976608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168278 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx index 825e615fb574..963db22c4c28 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -411,6 +411,29 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlinedShapeThenSdt) CPPUNIT_ASSERT_EQUAL(u"ContentControl"_ustr, xPortion->getPropertyValue("TextPortionType").get()); } + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakSectEnd) +{ +// Given a file with a single-paragraph section, ends with a clearing break: +// When importing that document: +loadFromFile(u"clearing-break-sect-end.docx"); + +// Then make sure the clearing break is not lost before a cont sect break: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +uno::Reference xPortionEnumAccess(xParaEnum->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortionEnum = xPortionEnumAccess->createEnumeration(); +uno::Reference xPortion(xPortionEnum->nextElement(), uno::UNO_QUERY); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: LineBreak +// - Actual : Text +// i.e. the clearing break at sect end was lost, leading to text overlap. +CPPUNIT_ASSERT_EQUAL(u"LineBreak"_ustr, + xPortion->getPropertyValue("TextPortionType").get()); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/writerfilter/dmapper/data/clearing-break-sect-end.docx b/sw/qa/writerfilter/dmapper/data/clearing-break-sect-end.docx new file mode 100644 index ..5052b2dd1649 Binary files /dev/null and b/sw/qa/writerfilter/dmapper/data/clearing-break-sect-end.docx differ diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx index 9144acaf79f7..72f88fc2a1a3 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx @@ -4347,13 +4347,13 @@ void DomainMapper::lcl_utext(const sal_Unicode *const data_, size_t len) else if (len == 1 && sText[0] == ' ') { // Clear "last" one linebreak at end of section -if (m_pImpl->GetIsLastParagraphInSection() && m_pImpl->isBreakDeferred(LINE_BREAK)) +if (m_pImpl->GetIsLastParagraphInSection() && m_pImpl->isBreakDeferred(LINE_BREAK) && !m_pImpl->HasLineBreakClear()) m_pImpl->clearDeferredBreak(LINE_BREAK); // And emit all other linebreaks while (m_pImpl->isBreakDeferred(LINE_BREAK)) { m_pImpl->clearDeferredBreak(LINE_BREAK); -m_pImpl->appendTextPortion(u" "_ustr, m_pImp
ESC meeting minutes: 2024-05-30
* Present: + Heiko, Olivier, Eike, Ilmari, Jonathan, Michael W, Regina, Stephan, sockseight, Xisco, Thorsten, Caolan, Hossein, Cloph, Stephane, Miklos * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) + patch in gerrit pending CI * Release Engineering update (Cloph) + 24.2: 24.2.4 RC2 this week, to be tagged tomorrow + 24.8: + feature freeze (beta1) in 1 week + string / UI freeze 3 weeks after that + late features? + LET() Calc function (Thorsten) + Also, any idea when WASM TB will be upgraded? (Julien) + previously think it was a compiler failure (Cloph) + probably need a patch for lode.git first + wasn't aware of the tinderbox, doesn't send mails (Stephan) + can probably look at that next week + any reason why failure mails are not sent out? (Stephan) + nobody wanted to work on this (Cloph) + will turn it on, then (Stephan) + https://ci.libreoffice.org/view/tb%20platform%20status/ shows this as red as well (Miklos) + annoying vs useful ratio, probably useful to send mails failures for now (Thorsten) * Documentation (Olivier) + Helpcontents2 + Completion of new MS functions Help pages (ohallot) + XLOOKUP, RANDARRAY, SORTBY... + Updates and fixes (erack, S. Horacek, D. Maddern, A. Barrientos) + Guides + Work in progress. + Question1: Calc functions argument naming + Verbose? e.g. =FUNCTION (Argument one; Argument two,...) + Mnemonic? e.g. =FUNCTION (Arg1; Arg2;...) + no strong opinion (Thorsten) + tend to prefer the mnemonics, these have to fit into a tooltip (Eike) + the wizard & help pages should have the same name (Olivier) + prefer verbose (Heiko) + easier to understand that way + the one doing the work gets to decide (Cloph) + Question2: New dialog layout + Stability/rendering among OS's. + Screenshooting for documentation + see "Vertical tabpages state" below (Miklos) + Bugzilla Documentation statistics 245(245) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 17(1) 47(3) 113(1) 224(3) commented 20(-17) 89(-2)257(-19) 871(3) resolved 10(3) 30(3) 67(5) 131(7) + top 10 contributors: Dione Maddern made 53 changes in 1 month, and 84 changes in 1 year Olivier Hallot made 51 changes in 1 month, and 247 changes in 1 year Stéphane Guillou made 17 changes in 1 month, and 247 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 71 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year Ilmari Lauhakangas made 4 changes in 1 month, and 69 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 40(40) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 7(4) 13(3) 18(4) 25(3) commented 92(63) 226(67) 553(41)1757(47) removed 0(0) 1(-2) 5(0) 10(-1) resolved 6(1) 27(-1)80(1) 293(3) + top 10 contributors: Heiko Tietze made 109 changes in 1 month, and 965 changes in 1 year Stéphane Guillou made 97 changes in 1 month, and 671 changes in 1 year Vernon, Stuart Foote made 57 changes in 1 month, and 327 changes in 1 year Eyal Rozenberg made 53 changes in 1 month, and 166 changes in 1 year Dieter made 26 changes in 1 month, and 127 changes in 1 year Ady made 11 changes in 1 month, and 120 changes in 1 year m.a.riosv made 11 changes in 1 month, and 48 changes in 1 year Henschel, Regina made 11 changes in 1 month, and 38 changes in 1 year Jérôme made 10 changes in 1 month, and 14 changes in 1 year Rafael Lima made 10 changes in 1 month, and 59 changes in 1 year + [Bug 157580] Allow notebookbar and groupedbarcompact groups sections to be shown/hidden based on available space instead of only their order + [Bug 161304] context menu Column deletion duplicates Cut shortcut + [Bug 160999] Find sidebar results presented with huge gratuitous spaces + [Bug 161276] Add booklet option to print smaller format booklet -> + [Bug 161032] Allow removing bundled extensions + dictionaries in particular + [Bug
ESC meeting minutes: 2024-05-30
* Present: + Heiko, Olivier, Eike, Ilmari, Jonathan, Michael W, Regina, Stephan, sockseight, Xisco, Thorsten, Caolan, Hossein, Cloph, Stephane, Miklos * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) + patch in gerrit pending CI * Release Engineering update (Cloph) + 24.2: 24.2.4 RC2 this week, to be tagged tomorrow + 24.8: + feature freeze (beta1) in 1 week + string / UI freeze 3 weeks after that + late features? + LET() Calc function (Thorsten) + Also, any idea when WASM TB will be upgraded? (Julien) + previously think it was a compiler failure (Cloph) + probably need a patch for lode.git first + wasn't aware of the tinderbox, doesn't send mails (Stephan) + can probably look at that next week + any reason why failure mails are not sent out? (Stephan) + nobody wanted to work on this (Cloph) + will turn it on, then (Stephan) + https://ci.libreoffice.org/view/tb%20platform%20status/ shows this as red as well (Miklos) + annoying vs useful ratio, probably useful to send mails failures for now (Thorsten) * Documentation (Olivier) + Helpcontents2 + Completion of new MS functions Help pages (ohallot) + XLOOKUP, RANDARRAY, SORTBY... + Updates and fixes (erack, S. Horacek, D. Maddern, A. Barrientos) + Guides + Work in progress. + Question1: Calc functions argument naming + Verbose? e.g. =FUNCTION (Argument one; Argument two,...) + Mnemonic? e.g. =FUNCTION (Arg1; Arg2;...) + no strong opinion (Thorsten) + tend to prefer the mnemonics, these have to fit into a tooltip (Eike) + the wizard & help pages should have the same name (Olivier) + prefer verbose (Heiko) + easier to understand that way + the one doing the work gets to decide (Cloph) + Question2: New dialog layout + Stability/rendering among OS's. + Screenshooting for documentation + see "Vertical tabpages state" below (Miklos) + Bugzilla Documentation statistics 245(245) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 17(1) 47(3) 113(1) 224(3) commented 20(-17) 89(-2)257(-19) 871(3) resolved 10(3) 30(3) 67(5) 131(7) + top 10 contributors: Dione Maddern made 53 changes in 1 month, and 84 changes in 1 year Olivier Hallot made 51 changes in 1 month, and 247 changes in 1 year Stéphane Guillou made 17 changes in 1 month, and 247 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 71 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year Ilmari Lauhakangas made 4 changes in 1 month, and 69 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 40(40) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 7(4) 13(3) 18(4) 25(3) commented 92(63) 226(67) 553(41)1757(47) removed 0(0) 1(-2) 5(0) 10(-1) resolved 6(1) 27(-1)80(1) 293(3) + top 10 contributors: Heiko Tietze made 109 changes in 1 month, and 965 changes in 1 year Stéphane Guillou made 97 changes in 1 month, and 671 changes in 1 year Vernon, Stuart Foote made 57 changes in 1 month, and 327 changes in 1 year Eyal Rozenberg made 53 changes in 1 month, and 166 changes in 1 year Dieter made 26 changes in 1 month, and 127 changes in 1 year Ady made 11 changes in 1 month, and 120 changes in 1 year m.a.riosv made 11 changes in 1 month, and 48 changes in 1 year Henschel, Regina made 11 changes in 1 month, and 38 changes in 1 year Jérôme made 10 changes in 1 month, and 14 changes in 1 year Rafael Lima made 10 changes in 1 month, and 59 changes in 1 year + [Bug 157580] Allow notebookbar and groupedbarcompact groups sections to be shown/hidden based on available space instead of only their order + [Bug 161304] context menu Column deletion duplicates Cut shortcut + [Bug 160999] Find sidebar results presented with huge gratuitous spaces + [Bug 161276] Add booklet option to print smaller format booklet -> + [Bug 161032] Allow removing bundled extensions + dictionaries in particular + [Bug
core.git: Branch 'distro/collabora/co-23.05' - sw/CppunitTest_sw_core_text.mk sw/qa sw/source
sw/CppunitTest_sw_core_text.mk|1 sw/qa/core/text/data/clearing-break-wrap-through.docx |binary sw/qa/core/text/txtfly.cxx| 52 ++ sw/source/core/text/txtfly.cxx|7 ++ 4 files changed, 60 insertions(+) New commits: commit af5b508e92bd9df21ba821f266ec4ede606677aa Author: Miklos Vajna AuthorDate: Thu May 30 08:10:13 2024 +0200 Commit: Miklos Vajna CommitDate: Thu May 30 15:39:26 2024 +0200 tdf#161318 sw clearing break: ignore wrap-through anchored objects Import the bugdoc: we expect just a single page for the 2 paragraphs, but the second paragraph goes to a 2nd page. What seems to happen since commit f86d1482bef285f90079b5130e410646db96cf58 (sw clearing breaks: add DOCX import, 2022-03-08) is that on one hand, SwTextFly::ForEach() ignores wrap-through shapes, but at the same time SwTextFly::GetMaxBottom() did not, and this lead to a loop: the first paragraph kept growing till the shape was shifted to page 2, but then the same first paragraph was reduced to just 2 lines, goto 1. Fix the problem by extending SwTextFly::GetMaxBottom() to also ignore wrap-though shapes: this is the intention, just clearing breaks were not tested with wrap-though wrap mode before. This is a reduced bugdoc, the original one even produced warnings like: warn:legacy.osl:12034:12034:sw/source/core/layout/flowfrm.cxx:2667: - layout loop control for layout action applied! without the fix, and these are now gone. (cherry picked from commit 304cc248f15d795bc9fe8b751b0d98841b8ff5d1) Conflicts: sw/CppunitTest_sw_core_text.mk Change-Id: Iaf9849dbf8e1a8e5d625d3c19b99636247804cdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168254 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara (cherry picked from commit 317ca78624b1594a40c4917482e99d10bd8e2780) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168262 Reviewed-by: Miklos Vajna diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk index ce27696b3c4c..5e623d3b0cd0 100644 --- a/sw/CppunitTest_sw_core_text.mk +++ b/sw/CppunitTest_sw_core_text.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_text, \ sw/qa/core/text/porlay \ sw/qa/core/text/porrst \ sw/qa/core/text/text \ +sw/qa/core/text/txtfly \ )) $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \ diff --git a/sw/qa/core/text/data/clearing-break-wrap-through.docx b/sw/qa/core/text/data/clearing-break-wrap-through.docx new file mode 100644 index ..c96e8c27da5e Binary files /dev/null and b/sw/qa/core/text/data/clearing-break-wrap-through.docx differ diff --git a/sw/qa/core/text/txtfly.cxx b/sw/qa/core/text/txtfly.cxx new file mode 100644 index ..461ed81e2203 --- /dev/null +++ b/sw/qa/core/text/txtfly.cxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +namespace +{ +/// Covers sw/source/core/text/txtfly.cxx fixes. +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/core/text/data/") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakWrapThrough) +{ +// Given a document with a clearing break, then a shape in the next paragraph: +createSwDoc("clearing-break-wrap-through.docx"); + +// When laying out that document: +calcLayout(); + +// Then make sure we layout these 2 paragraphs on a single page, since there is enough space for +// them: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage); +// Without the accompanying fix in place, this test would have failed, we had an unexpected 2nd +// page. +CPPUNIT_ASSERT(!pPage->GetNext()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index a4f625651f1e..dc4d24f27aab 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -1043,6 +1043,13 @@ SwTwips SwTextFly::GetMaxBottom(const SwBreakPortion& rPortion, const SwTextForm continue; } +const SwFormatSurround& rSurround = pAnchoredObj->GetFrameFormat().GetSurround(); +if (rSurrou
core.git: Branch 'distro/collabora/co-24.04' - sw/CppunitTest_sw_core_text.mk sw/qa sw/source
sw/CppunitTest_sw_core_text.mk|1 sw/qa/core/text/data/clearing-break-wrap-through.docx |binary sw/qa/core/text/txtfly.cxx| 52 ++ sw/source/core/text/txtfly.cxx|7 ++ 4 files changed, 60 insertions(+) New commits: commit 317ca78624b1594a40c4917482e99d10bd8e2780 Author: Miklos Vajna AuthorDate: Thu May 30 08:10:13 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 30 14:09:53 2024 +0200 tdf#161318 sw clearing break: ignore wrap-through anchored objects Import the bugdoc: we expect just a single page for the 2 paragraphs, but the second paragraph goes to a 2nd page. What seems to happen since commit f86d1482bef285f90079b5130e410646db96cf58 (sw clearing breaks: add DOCX import, 2022-03-08) is that on one hand, SwTextFly::ForEach() ignores wrap-through shapes, but at the same time SwTextFly::GetMaxBottom() did not, and this lead to a loop: the first paragraph kept growing till the shape was shifted to page 2, but then the same first paragraph was reduced to just 2 lines, goto 1. Fix the problem by extending SwTextFly::GetMaxBottom() to also ignore wrap-though shapes: this is the intention, just clearing breaks were not tested with wrap-though wrap mode before. This is a reduced bugdoc, the original one even produced warnings like: warn:legacy.osl:12034:12034:sw/source/core/layout/flowfrm.cxx:2667: - layout loop control for layout action applied! without the fix, and these are now gone. (cherry picked from commit 304cc248f15d795bc9fe8b751b0d98841b8ff5d1) Conflicts: sw/CppunitTest_sw_core_text.mk Change-Id: Iaf9849dbf8e1a8e5d625d3c19b99636247804cdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168254 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk index ce27696b3c4c..5e623d3b0cd0 100644 --- a/sw/CppunitTest_sw_core_text.mk +++ b/sw/CppunitTest_sw_core_text.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_text, \ sw/qa/core/text/porlay \ sw/qa/core/text/porrst \ sw/qa/core/text/text \ +sw/qa/core/text/txtfly \ )) $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \ diff --git a/sw/qa/core/text/data/clearing-break-wrap-through.docx b/sw/qa/core/text/data/clearing-break-wrap-through.docx new file mode 100644 index ..c96e8c27da5e Binary files /dev/null and b/sw/qa/core/text/data/clearing-break-wrap-through.docx differ diff --git a/sw/qa/core/text/txtfly.cxx b/sw/qa/core/text/txtfly.cxx new file mode 100644 index ..461ed81e2203 --- /dev/null +++ b/sw/qa/core/text/txtfly.cxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +namespace +{ +/// Covers sw/source/core/text/txtfly.cxx fixes. +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/core/text/data/") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakWrapThrough) +{ +// Given a document with a clearing break, then a shape in the next paragraph: +createSwDoc("clearing-break-wrap-through.docx"); + +// When laying out that document: +calcLayout(); + +// Then make sure we layout these 2 paragraphs on a single page, since there is enough space for +// them: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage); +// Without the accompanying fix in place, this test would have failed, we had an unexpected 2nd +// page. +CPPUNIT_ASSERT(!pPage->GetNext()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 7c4d9a2e160d..45eea853 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -1051,6 +1051,13 @@ SwTwips SwTextFly::GetMaxBottom(const SwBreakPortion& rPortion, const SwTextForm continue; } +const SwFormatSurround& rSurround = pAnchoredObj->GetFrameFormat()->GetSurround(); +if (rSurround.GetValue() == text::WrapTextMode_THROUGH) +{ +// Wrap through has no influence on clearing breaks. +continue; +} + S
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/filter/ww8/ww8.cxx | 30 +++ sw/source/filter/ww8/docxattributeoutput.cxx | 13 +++ sw/source/filter/ww8/docxattributeoutput.hxx |2 - sw/source/filter/ww8/docxexport.cxx |4 +-- 4 files changed, 46 insertions(+), 3 deletions(-) New commits: commit d0ee0c93d6145542d82ba62887f4e5a3691333fe Author: Miklos Vajna AuthorDate: Wed May 29 13:34:25 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 30 14:08:24 2024 +0200 tdf#160984 sw continuous endnotes: DOCX: export of pos == sectEnd In case a DOCX file is re-exported to Word and it collected endnotes at section end, this setting was lost on save. The relevant markup seems to be -> , though that's a per-section setting in Writer, and is a per-doc setting in Word. Fix the problem by doing it similar to DocxExport::WriteDocumentBackgroundFill(), which takes the first page style in a similar case; here we take the first section format. This is meant to be good enough for the DOCX editing case, where we know all sections have the same endnote position properties anyway. (cherry picked from commit 566c7017a84e3d573de85a6d986b81d3f59de0fa) Change-Id: I95508296e31c9be34196bdc0da2177101647abf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168241 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index 4cbbfe5fbf31..070565345a2d 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -32,6 +32,7 @@ #include #include #include +#include namespace { @@ -564,6 +565,35 @@ CPPUNIT_TEST_FIXTURE(Test, testNullPointerDereference) createSwDoc("null-pointer-dereference.doc"); CPPUNIT_ASSERT_EQUAL(6, getPages()); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) +{ +// Given a document, endnotes at collected at section end: +createSwDoc(); +SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); +pWrtShell->SplitNode(); +pWrtShell->Up(/*bSelect=*/false); +pWrtShell->Insert("x"); +pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); +SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); +pWrtShell->StartAction(); +SfxItemSetFixed aSet(pWrtShell->GetAttrPool()); +aSet.Put(SwFormatEndAtTextEnd(FTNEND_ATTXTEND)); +pWrtShell->InsertSection(aSection, ); +pWrtShell->EndAction(); +pWrtShell->InsertFootnote(OUString(), /*bEndNote=*/true); + +// When saving to DOCX: +save("Office Open XML Text"); + +// Then make sure the endnote position is section end: +xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); +OUString aPos = getXPath(pXmlDoc, "/w:settings/w:endnotePr/w:pos"_ostr, "val"_ostr); +// Without the accompanying fix in place, this test would have failed with: +// - XPath '/w:settings/w:endnotePr/w:pos' number of nodes is incorrect +// i.e. the default position was used: document end. +CPPUNIT_ASSERT_EQUAL(OUString("sectEnd"), aPos); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 3201321a6328..2f77cf07b06a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -127,6 +127,7 @@ #include #include #include +#include #include #include #include @@ -8786,6 +8787,18 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const SwEndNoteInfo& info, int listtag ) { fs->startElementNS(XML_w, tag); + +SwSectionFormats& rSections = m_rExport.m_rDoc.GetSections(); +if (!rSections.empty()) +{ +SwSectionFormat* pFormat = rSections[0]; +bool bEndnAtEnd = pFormat->GetEndAtTextEnd().IsAtEnd(); +if (bEndnAtEnd) +{ +fs->singleElementNS(XML_w, XML_pos, FSNS(XML_w, XML_val), "sectEnd"); +} +} + OString aCustomFormat; OString fmt = lcl_ConvertNumberingType(info.m_aFormat.GetNumberingType(), nullptr, aCustomFormat); if (!fmt.isEmpty() && aCustomFormat.isEmpty()) diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 10f39debc2a0..b23f5b98ee7e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -1109,7 +1109,7 @@ public: void FootnotesEndnotes( bool bFootnotes ); /// writes the footnotePr/endnotePr (depending on tag) section -static void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const & fs, int tag, const SwEndNoteInfo& info, int listtag ); +void Writ
core.git: sw/CppunitTest_sw_core_text.mk sw/qa sw/source
sw/CppunitTest_sw_core_text.mk|1 sw/qa/core/text/data/clearing-break-wrap-through.docx |binary sw/qa/core/text/txtfly.cxx| 52 ++ sw/source/core/text/txtfly.cxx|7 ++ 4 files changed, 60 insertions(+) New commits: commit 304cc248f15d795bc9fe8b751b0d98841b8ff5d1 Author: Miklos Vajna AuthorDate: Thu May 30 08:10:13 2024 +0200 Commit: Miklos Vajna CommitDate: Thu May 30 13:30:40 2024 +0200 tdf#161318 sw clearing break: ignore wrap-through anchored objects Import the bugdoc: we expect just a single page for the 2 paragraphs, but the second paragraph goes to a 2nd page. What seems to happen since commit f86d1482bef285f90079b5130e410646db96cf58 (sw clearing breaks: add DOCX import, 2022-03-08) is that on one hand, SwTextFly::ForEach() ignores wrap-through shapes, but at the same time SwTextFly::GetMaxBottom() did not, and this lead to a loop: the first paragraph kept growing till the shape was shifted to page 2, but then the same first paragraph was reduced to just 2 lines, goto 1. Fix the problem by extending SwTextFly::GetMaxBottom() to also ignore wrap-though shapes: this is the intention, just clearing breaks were not tested with wrap-though wrap mode before. This is a reduced bugdoc, the original one even produced warnings like: warn:legacy.osl:12034:12034:sw/source/core/layout/flowfrm.cxx:2667: - layout loop control for layout action applied! without the fix, and these are now gone. Change-Id: Iaf9849dbf8e1a8e5d625d3c19b99636247804cdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168239 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk index 95b69b90113b..8c215dfab4e1 100644 --- a/sw/CppunitTest_sw_core_text.mk +++ b/sw/CppunitTest_sw_core_text.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_text, \ sw/qa/core/text/porlay \ sw/qa/core/text/porrst \ sw/qa/core/text/text \ +sw/qa/core/text/txtfly \ sw/qa/core/text/widorp \ )) diff --git a/sw/qa/core/text/data/clearing-break-wrap-through.docx b/sw/qa/core/text/data/clearing-break-wrap-through.docx new file mode 100644 index ..c96e8c27da5e Binary files /dev/null and b/sw/qa/core/text/data/clearing-break-wrap-through.docx differ diff --git a/sw/qa/core/text/txtfly.cxx b/sw/qa/core/text/txtfly.cxx new file mode 100644 index ..461ed81e2203 --- /dev/null +++ b/sw/qa/core/text/txtfly.cxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +namespace +{ +/// Covers sw/source/core/text/txtfly.cxx fixes. +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/core/text/data/") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testClearingBreakWrapThrough) +{ +// Given a document with a clearing break, then a shape in the next paragraph: +createSwDoc("clearing-break-wrap-through.docx"); + +// When laying out that document: +calcLayout(); + +// Then make sure we layout these 2 paragraphs on a single page, since there is enough space for +// them: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage); +// Without the accompanying fix in place, this test would have failed, we had an unexpected 2nd +// page. +CPPUNIT_ASSERT(!pPage->GetNext()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 7c4d9a2e160d..45eea853 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -1051,6 +1051,13 @@ SwTwips SwTextFly::GetMaxBottom(const SwBreakPortion& rPortion, const SwTextForm continue; } +const SwFormatSurround& rSurround = pAnchoredObj->GetFrameFormat()->GetSurround(); +if (rSurround.GetValue() == text::WrapTextMode_THROUGH) +{ +// Wrap through has no influence on clearing breaks. +continue; +} + SwRect aRect(pAnchoredObj->GetObjRectWithSpaces()); if (m_pCurrFrame->IsVertical())
core.git: Branch 'distro/collabora/co-24.04' - libreofficekit/README.md
libreofficekit/README.md | 14 ++ 1 file changed, 14 insertions(+) New commits: commit fd22acaf8914b11962d6667eacfc47e514fc7b43 Author: Miklos Vajna AuthorDate: Wed May 29 08:21:37 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 30 10:24:35 2024 +0200 lok: document some guidelines on how to not end up with too many callbacks In general, the existing command dispatch, command value getter & command state callback is meant to be enough for most needs. (cherry picked from commit ff0cb77a6c9fec7127c26f63a420e877ac4f852e) Change-Id: Ibba5455b461a8eac052f17ac5e824ddea42755f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168240 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/libreofficekit/README.md b/libreofficekit/README.md index 95a33707a28a..148879ec57fc 100644 --- a/libreofficekit/README.md +++ b/libreofficekit/README.md @@ -81,6 +81,20 @@ once a feature works there, then implement the Android part, with its slower development iteration (slow uploading to the device, the need to link all object files into a single `.so`, etc). +### LOK API guidelines + +Introducing explicit new API under `include/LibreOfficeKit/` adds type safety but listing each & +every micro-feature in those headers don't scale. Before extending those headers, consider using one +of the following alternatives, which require no changes to these headers: + +- LOK client → core direction: use `postUnoCommand()` to dispatch an UNO command, optionally with + parameters. +- core → LOK client direction: + - Use `getCommandValues()` when this is initiated by the LOK client. + - Use `LOK_CALLBACK_STATE_CHANGED` with a JSON payload when this is initiated by core. + +It's useful to stick to these if possible, only add new C++ API when these are not a good fit. + * Debugging with gdb and `gtktiledviewer` To run `gtktiledviewer`:
core.git: sw/qa sw/source
sw/qa/filter/ww8/ww8.cxx | 30 +++ sw/source/filter/ww8/docxattributeoutput.cxx | 13 +++ sw/source/filter/ww8/docxattributeoutput.hxx |2 - sw/source/filter/ww8/docxexport.cxx |4 +-- 4 files changed, 46 insertions(+), 3 deletions(-) New commits: commit 566c7017a84e3d573de85a6d986b81d3f59de0fa Author: Miklos Vajna AuthorDate: Wed May 29 13:34:25 2024 +0200 Commit: Miklos Vajna CommitDate: Wed May 29 20:10:50 2024 +0200 tdf#160984 sw continuous endnotes: DOCX: export of pos == sectEnd In case a DOCX file is re-exported to Word and it collected endnotes at section end, this setting was lost on save. The relevant markup seems to be -> , though that's a per-section setting in Writer, and is a per-doc setting in Word. Fix the problem by doing it similar to DocxExport::WriteDocumentBackgroundFill(), which takes the first page style in a similar case; here we take the first section format. This is meant to be good enough for the DOCX editing case, where we know all sections have the same endnote position properties anyway. Change-Id: I95508296e31c9be34196bdc0da2177101647abf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168187 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index 4cbbfe5fbf31..070565345a2d 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -32,6 +32,7 @@ #include #include #include +#include namespace { @@ -564,6 +565,35 @@ CPPUNIT_TEST_FIXTURE(Test, testNullPointerDereference) createSwDoc("null-pointer-dereference.doc"); CPPUNIT_ASSERT_EQUAL(6, getPages()); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) +{ +// Given a document, endnotes at collected at section end: +createSwDoc(); +SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); +pWrtShell->SplitNode(); +pWrtShell->Up(/*bSelect=*/false); +pWrtShell->Insert("x"); +pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); +SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); +pWrtShell->StartAction(); +SfxItemSetFixed aSet(pWrtShell->GetAttrPool()); +aSet.Put(SwFormatEndAtTextEnd(FTNEND_ATTXTEND)); +pWrtShell->InsertSection(aSection, ); +pWrtShell->EndAction(); +pWrtShell->InsertFootnote(OUString(), /*bEndNote=*/true); + +// When saving to DOCX: +save("Office Open XML Text"); + +// Then make sure the endnote position is section end: +xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); +OUString aPos = getXPath(pXmlDoc, "/w:settings/w:endnotePr/w:pos"_ostr, "val"_ostr); +// Without the accompanying fix in place, this test would have failed with: +// - XPath '/w:settings/w:endnotePr/w:pos' number of nodes is incorrect +// i.e. the default position was used: document end. +CPPUNIT_ASSERT_EQUAL(OUString("sectEnd"), aPos); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 1532ecf72c81..971f27df0314 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -127,6 +127,7 @@ #include #include #include +#include #include #include #include @@ -8780,6 +8781,18 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const SwEndNoteInfo& info, int listtag ) { fs->startElementNS(XML_w, tag); + +SwSectionFormats& rSections = m_rExport.m_rDoc.GetSections(); +if (!rSections.empty()) +{ +SwSectionFormat* pFormat = rSections[0]; +bool bEndnAtEnd = pFormat->GetEndAtTextEnd().IsAtEnd(); +if (bEndnAtEnd) +{ +fs->singleElementNS(XML_w, XML_pos, FSNS(XML_w, XML_val), "sectEnd"); +} +} + OString aCustomFormat; OString fmt = lcl_ConvertNumberingType(info.m_aFormat.GetNumberingType(), nullptr, aCustomFormat); if (!fmt.isEmpty() && aCustomFormat.isEmpty()) diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index b1da698c3dec..063cb02bbc69 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -1109,7 +1109,7 @@ public: void FootnotesEndnotes( bool bFootnotes ); /// writes the footnotePr/endnotePr (depending on tag) section -static void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const & fs, int tag, const SwEndNoteInfo& info, int listtag ); +void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const & fs, int tag, const SwEndNoteInfo&
core.git: libreofficekit/README.md
libreofficekit/README.md | 14 ++ 1 file changed, 14 insertions(+) New commits: commit ff0cb77a6c9fec7127c26f63a420e877ac4f852e Author: Miklos Vajna AuthorDate: Wed May 29 08:21:37 2024 +0200 Commit: Miklos Vajna CommitDate: Wed May 29 19:32:19 2024 +0200 lok: document some guidelines on how to not end up with too many callbacks In general, the existing command dispatch, command value getter & command state callback is meant to be enough for most needs. Change-Id: Ibba5455b461a8eac052f17ac5e824ddea42755f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168178 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/libreofficekit/README.md b/libreofficekit/README.md index 95a33707a28a..148879ec57fc 100644 --- a/libreofficekit/README.md +++ b/libreofficekit/README.md @@ -81,6 +81,20 @@ once a feature works there, then implement the Android part, with its slower development iteration (slow uploading to the device, the need to link all object files into a single `.so`, etc). +### LOK API guidelines + +Introducing explicit new API under `include/LibreOfficeKit/` adds type safety but listing each & +every micro-feature in those headers don't scale. Before extending those headers, consider using one +of the following alternatives, which require no changes to these headers: + +- LOK client → core direction: use `postUnoCommand()` to dispatch an UNO command, optionally with + parameters. +- core → LOK client direction: + - Use `getCommandValues()` when this is initiated by the LOK client. + - Use `LOK_CALLBACK_STATE_CHANGED` with a JSON payload when this is initiated by core. + +It's useful to stick to these if possible, only add new C++ API when these are not a good fit. + * Debugging with gdb and `gtktiledviewer` To run `gtktiledviewer`:
ESC meeting agenda: 2024-05-30 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC2 this week? + 24.8: + feature freeze (beta1) in 1 week + string / UI freeze 3 weeks after that * Documentation (Olivier) + Bugzilla Documentation statistics 245(245) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 17(1) 47(3) 113(1) 224(3) commented 20(-17) 89(-2)257(-19) 871(3) resolved 10(3) 30(3) 67(5) 131(7) + top 10 contributors: Dione Maddern made 53 changes in 1 month, and 84 changes in 1 year Olivier Hallot made 51 changes in 1 month, and 247 changes in 1 year Stéphane Guillou made 17 changes in 1 month, and 247 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 71 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year Ilmari Lauhakangas made 4 changes in 1 month, and 69 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 40(40) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 7(4) 13(3) 18(4) 25(3) commented 92(63) 226(67) 553(41)1757(47) removed 0(0) 1(-2) 5(0) 10(-1) resolved 6(1) 27(-1)80(1) 293(3) + top 10 contributors: Heiko Tietze made 109 changes in 1 month, and 965 changes in 1 year Stéphane Guillou made 97 changes in 1 month, and 671 changes in 1 year Vernon, Stuart Foote made 57 changes in 1 month, and 327 changes in 1 year Eyal Rozenberg made 53 changes in 1 month, and 166 changes in 1 year Dieter made 26 changes in 1 month, and 127 changes in 1 year Ady made 11 changes in 1 month, and 120 changes in 1 year m.a.riosv made 11 changes in 1 month, and 48 changes in 1 year Henschel, Regina made 11 changes in 1 month, and 38 changes in 1 year Jérôme made 10 changes in 1 month, and 14 changes in 1 year Rafael Lima made 10 changes in 1 month, and 59 changes in 1 year * Vertical tabpages state (Samuel) + review the state this week * Crash Testing (Caolan) + 24(+1) import failure, 20(+2) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.1.177(+0) + 24.2.1.215782(+611) + 24.2.2.212792(+1102) + 24.2.3.25213(+2237) * Mentoring (Hossein) committer... 1 week 1 month 3 months 12 months open 94(38) 183(37) 183(36) 183(36) reviews 300(-62) 1310(-12) 3386(-152) 12504(18) merged 217(-37) 1245(-59) 3239(-146) 12693(-25) abandoned 7(-3) 48(-5) 162(-13) 659(0) own commits 160(-17)899(-47) 2328(-72) 9268(-5) review commits 52(-20)229(-4) 795(-25) 3008(3) contributor... 1 week 1 month 3 months 12 months open 36(0) 100(5) 102(6)102(6) reviews 696(-34) 3110(-22) 7580(-246) 29560(10) merged 16(-9) 82(-8) 347(-19) 1575(-14) abandoned 8(1) 27(-1) 140(-140) 710(6) own commits 17(-18)101(-6) 397(-16) 1141(4) review commits 0(0)0(0)0(0) 0(0) + easyHack statistics: needsDevEval 9(9) needsUXEval 1(1) cleanup_comments 328(328) total 410(410) assigned 28(28) open 348(348) + top 10 contributors: Dione Maddern made 21 patches in 1 month, and 55 patches in 1 year Weblate made 5 patches in 1 month, and 27 patches in 1 year Jakub Kościelak made 4 patches in 1 month, and 7 patches in 1 year LeSasse made 4 patches in 1 month, and 23 patches in 1 year made 3 patches in 1 month, and 8 patches in 1 year Hubert Figuière made 3 patches in 1 month, and 8 patches in 1 year
ESC meeting agenda: 2024-05-30 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC2 this week? + 24.8: + feature freeze (beta1) in 1 week + string / UI freeze 3 weeks after that * Documentation (Olivier) + Bugzilla Documentation statistics 245(245) bugs open + Updates: BZ changes 1 week1 month 3 months 12 months created 17(1) 47(3) 113(1) 224(3) commented 20(-17) 89(-2)257(-19) 871(3) resolved 10(3) 30(3) 67(5) 131(7) + top 10 contributors: Dione Maddern made 53 changes in 1 month, and 84 changes in 1 year Olivier Hallot made 51 changes in 1 month, and 247 changes in 1 year Stéphane Guillou made 17 changes in 1 month, and 247 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 71 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Bogdan B made 4 changes in 1 month, and 13 changes in 1 year Ilmari Lauhakangas made 4 changes in 1 month, and 69 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 40(40) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 7(4) 13(3) 18(4) 25(3) commented 92(63) 226(67) 553(41)1757(47) removed 0(0) 1(-2) 5(0) 10(-1) resolved 6(1) 27(-1)80(1) 293(3) + top 10 contributors: Heiko Tietze made 109 changes in 1 month, and 965 changes in 1 year Stéphane Guillou made 97 changes in 1 month, and 671 changes in 1 year Vernon, Stuart Foote made 57 changes in 1 month, and 327 changes in 1 year Eyal Rozenberg made 53 changes in 1 month, and 166 changes in 1 year Dieter made 26 changes in 1 month, and 127 changes in 1 year Ady made 11 changes in 1 month, and 120 changes in 1 year m.a.riosv made 11 changes in 1 month, and 48 changes in 1 year Henschel, Regina made 11 changes in 1 month, and 38 changes in 1 year Jérôme made 10 changes in 1 month, and 14 changes in 1 year Rafael Lima made 10 changes in 1 month, and 59 changes in 1 year * Vertical tabpages state (Samuel) + review the state this week * Crash Testing (Caolan) + 24(+1) import failure, 20(+2) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.1.177(+0) + 24.2.1.215782(+611) + 24.2.2.212792(+1102) + 24.2.3.25213(+2237) * Mentoring (Hossein) committer... 1 week 1 month 3 months 12 months open 94(38) 183(37) 183(36) 183(36) reviews 300(-62) 1310(-12) 3386(-152) 12504(18) merged 217(-37) 1245(-59) 3239(-146) 12693(-25) abandoned 7(-3) 48(-5) 162(-13) 659(0) own commits 160(-17)899(-47) 2328(-72) 9268(-5) review commits 52(-20)229(-4) 795(-25) 3008(3) contributor... 1 week 1 month 3 months 12 months open 36(0) 100(5) 102(6)102(6) reviews 696(-34) 3110(-22) 7580(-246) 29560(10) merged 16(-9) 82(-8) 347(-19) 1575(-14) abandoned 8(1) 27(-1) 140(-140) 710(6) own commits 17(-18)101(-6) 397(-16) 1141(4) review commits 0(0)0(0)0(0) 0(0) + easyHack statistics: needsDevEval 9(9) needsUXEval 1(1) cleanup_comments 328(328) total 410(410) assigned 28(28) open 348(348) + top 10 contributors: Dione Maddern made 21 patches in 1 month, and 55 patches in 1 year Weblate made 5 patches in 1 month, and 27 patches in 1 year Jakub Kościelak made 4 patches in 1 month, and 7 patches in 1 year LeSasse made 4 patches in 1 month, and 23 patches in 1 year made 3 patches in 1 month, and 8 patches in 1 year Hubert Figuière made 3 patches in 1 month, and 8 patches in 1 year
core.git: Branch 'distro/collabora/co-24.04' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/dmapper/SettingsTable.cxx| 22 ++ writerfilter/qa/cppunittests/dmapper/data/endnote-at-section-end.docx |binary writerfilter/source/dmapper/PropertyMap.cxx |7 ++- writerfilter/source/dmapper/SettingsTable.cxx | 13 + writerfilter/source/dmapper/SettingsTable.hxx |2 5 files changed, 43 insertions(+), 1 deletion(-) New commits: commit 812d5e98dc2a96e9b7351d19ab33031af7d90221 Author: Miklos Vajna AuthorDate: Tue May 28 13:26:05 2024 +0200 Commit: Caolán McNamara CommitDate: Wed May 29 09:16:13 2024 +0200 tdf#160984 sw continuous endnotes: DOCX: import pos == sectEnd Word can have per-section endnotes, but if endnotes are collected at the end of the section vs document end is a per-document setting. The DOC import already handles this in wwSectionManager::InsertSection() when it constructs an SwFormatEndAtTextEnd with FTNEND_ATTXTEND. Fix the problem by doing the same in writerfilter: in case settings.xml wants at-section-end endnotes, set EndnoteIsCollectAtTextEnd to true when applying section properties. The export side still needs doing. (cherry picked from commit 2d2dd56e0b2dc708f1f758d7fc9a1263ff09b83c) Conflicts: writerfilter/source/dmapper/PropertyMap.cxx Change-Id: Ibad9c2d62a2945ee42877c849482feee60a50178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168179 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/writerfilter/qa/cppunittests/dmapper/SettingsTable.cxx b/writerfilter/qa/cppunittests/dmapper/SettingsTable.cxx index 52814727f91c..bf7a4e48de49 100644 --- a/writerfilter/qa/cppunittests/dmapper/SettingsTable.cxx +++ b/writerfilter/qa/cppunittests/dmapper/SettingsTable.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -87,6 +88,27 @@ CPPUNIT_TEST_FIXTURE(Test, testAddVerticalFrameOffsetsRTF) // i.e. table top should be ~2748, but was less, leading to an overlap. CPPUNIT_ASSERT_GREATER(nFlyBottom, nTableTop); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnoteAtSectionEnd) +{ +// Given a document with at-section-end endnotes enabled: +loadFromFile(u"endnote-at-section-end.docx"); + +// Go to the second paragraph, which is inside Word's second section: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +xParaEnum->nextElement(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xSection; +xPara->getPropertyValue("TextSection") >>= xSection; +bool bEndnoteIsCollectAtTextEnd = false; +xSection->getPropertyValue("EndnoteIsCollectAtTextEnd") >>= bEndnoteIsCollectAtTextEnd; +// Without the accompanying fix in place, this test would have failed, endnotes were always at +// document end. +CPPUNIT_ASSERT(bEndnoteIsCollectAtTextEnd); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/qa/cppunittests/dmapper/data/endnote-at-section-end.docx b/writerfilter/qa/cppunittests/dmapper/data/endnote-at-section-end.docx new file mode 100644 index ..cf61262c7d59 Binary files /dev/null and b/writerfilter/qa/cppunittests/dmapper/data/endnote-at-section-end.docx differ diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 73d53a7e7c96..14299eaf7a88 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -749,7 +749,7 @@ void SectionPropertyMap::DontBalanceTextColumns() } } -void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XPropertySet >& xSection, DomainMapper_Impl& /*rDM_Impl*/ ) +void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XPropertySet >& xSection, DomainMapper_Impl& rDM_Impl ) { try { @@ -758,6 +758,11 @@ void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XP std::optional< PropertyMap::Property > pProp = getProperty( PROP_WRITING_MODE ); if ( pProp ) xSection->setPropertyValue( "WritingMode", pProp->second ); + +if (rDM_Impl.GetSettingsTable()->GetEndnoteIsCollectAtSectionEnd()) +{ +xSection->setPropertyValue("EndnoteIsCollectAtTextEnd", uno::Any(true)); +} } } catch ( uno::Exception& ) diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilt
core.git: sw/qa sw/source
sw/qa/writerfilter/dmapper/SettingsTable.cxx| 22 sw/qa/writerfilter/dmapper/data/endnote-at-section-end.docx |binary sw/source/writerfilter/dmapper/PropertyMap.cxx |9 sw/source/writerfilter/dmapper/SettingsTable.cxx| 13 +++ sw/source/writerfilter/dmapper/SettingsTable.hxx|2 + 5 files changed, 45 insertions(+), 1 deletion(-) New commits: commit 2d2dd56e0b2dc708f1f758d7fc9a1263ff09b83c Author: Miklos Vajna AuthorDate: Tue May 28 13:26:05 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 28 17:13:08 2024 +0200 tdf#160984 sw continuous endnotes: DOCX: import pos == sectEnd Word can have per-section endnotes, but if endnotes are collected at the end of the section vs document end is a per-document setting. The DOC import already handles this in wwSectionManager::InsertSection() when it constructs an SwFormatEndAtTextEnd with FTNEND_ATTXTEND. Fix the problem by doing the same in writerfilter: in case settings.xml wants at-section-end endnotes, set EndnoteIsCollectAtTextEnd to true when applying section properties. The export side still needs doing. Change-Id: Ibad9c2d62a2945ee42877c849482feee60a50178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168148 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/writerfilter/dmapper/SettingsTable.cxx b/sw/qa/writerfilter/dmapper/SettingsTable.cxx index 503b28d45c95..ef94a60fc544 100644 --- a/sw/qa/writerfilter/dmapper/SettingsTable.cxx +++ b/sw/qa/writerfilter/dmapper/SettingsTable.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -87,6 +88,27 @@ CPPUNIT_TEST_FIXTURE(Test, testAddVerticalFrameOffsetsRTF) // i.e. table top should be ~2748, but was less, leading to an overlap. CPPUNIT_ASSERT_GREATER(nFlyBottom, nTableTop); } + +CPPUNIT_TEST_FIXTURE(Test, testEndnoteAtSectionEnd) +{ +// Given a document with at-section-end endnotes enabled: +loadFromFile(u"endnote-at-section-end.docx"); + +// Go to the second paragraph, which is inside Word's second section: +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); +uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +xParaEnum->nextElement(); +uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +uno::Reference xSection; +xPara->getPropertyValue("TextSection") >>= xSection; +bool bEndnoteIsCollectAtTextEnd = false; +xSection->getPropertyValue("EndnoteIsCollectAtTextEnd") >>= bEndnoteIsCollectAtTextEnd; +// Without the accompanying fix in place, this test would have failed, endnotes were always at +// document end. +CPPUNIT_ASSERT(bEndnoteIsCollectAtTextEnd); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/writerfilter/dmapper/data/endnote-at-section-end.docx b/sw/qa/writerfilter/dmapper/data/endnote-at-section-end.docx new file mode 100644 index ..cf61262c7d59 Binary files /dev/null and b/sw/qa/writerfilter/dmapper/data/endnote-at-section-end.docx differ diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx b/sw/source/writerfilter/dmapper/PropertyMap.cxx index f52d37764402..02951c73cbcd 100644 --- a/sw/source/writerfilter/dmapper/PropertyMap.cxx +++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx @@ -74,6 +74,8 @@ #include #include +#include + using namespace com::sun::star; namespace writerfilter::dmapper { @@ -756,7 +758,7 @@ void SectionPropertyMap::DontBalanceTextColumns() } } -void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XPropertySet >& xSection, DomainMapper_Impl& /*rDM_Impl*/ ) +void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XPropertySet >& xSection, DomainMapper_Impl& rDM_Impl ) { try { @@ -765,6 +767,11 @@ void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XP std::optional< PropertyMap::Property > pProp = getProperty( PROP_WRITING_MODE ); if ( pProp ) xSection->setPropertyValue( "WritingMode", pProp->second ); + +if (rDM_Impl.GetSettingsTable()->GetEndnoteIsCollectAtSectionEnd()) +{ + xSection->setPropertyValue(UNO_NAME_ENDNOTE_IS_COLLECT_AT_TEXT_END, uno::Any(true)); +} } } catch ( uno::Exception& ) diff --git a/sw/source/writerfilter/dmapper/SettingsTable.cxx b/sw/source/writerfilter/dmapper/SettingsTable.cxx index 4d6fe6b13441..57f6566c2135 100644 --- a/sw/source/writerfilter/dmapper/SettingsTable.cxx +++ b/sw/source/write
core.git: sw/inc sw/source
sw/inc/fmtftntx.hxx |1 + sw/source/core/layout/atrfrm.cxx |8 2 files changed, 9 insertions(+) New commits: commit f4ec4f6068a1ca265dd25c479cc40c546ae9223e Author: Miklos Vajna AuthorDate: Tue May 28 09:51:56 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 28 15:11:34 2024 +0200 sw doc model xml dump: show SwFormatEndAtTextEnd Decides if endnotes are collected at section end or the normal doc end. Previously only the pool item name was visible, not the value. Change-Id: I141a687764b2069e2ddf65cbfdec514a4a0eb1e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168137 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/inc/fmtftntx.hxx b/sw/inc/fmtftntx.hxx index a5de432ccad7..16e63657abf7 100644 --- a/sw/inc/fmtftntx.hxx +++ b/sw/inc/fmtftntx.hxx @@ -110,6 +110,7 @@ public: } virtual SwFormatEndAtTextEnd* Clone( SfxItemPool *pPool = nullptr ) const override; +void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; inline const SwFormatFootnoteAtTextEnd ::GetFootnoteAtTextEnd(bool bInP) const diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 67047d7b0bf9..0dee2d60520f 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1993,6 +1993,14 @@ SwFormatEditInReadonly* SwFormatEditInReadonly::Clone( SfxItemPool* ) const return new SwFormatEditInReadonly( *this ); } +void SwFormatEndAtTextEnd::dumpAsXml(xmlTextWriterPtr pWriter) const +{ +(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatEndAtTextEnd")); +(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); +(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); +(void)xmlTextWriterEndElement(pWriter); +} + SwFormatLayoutSplit* SwFormatLayoutSplit::Clone( SfxItemPool* ) const { return new SwFormatLayoutSplit( *this );
core.git: sw/source
sw/source/core/txtnode/thints.cxx |4 ++-- sw/source/core/unocore/unoportenum.cxx |2 +- sw/source/core/unocore/unotext.cxx |4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 350a2dfa74bbc9d82f6555c0f3d679b6c53fe353 Author: Miklos Vajna AuthorDate: Mon May 27 11:05:37 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 28 00:21:50 2024 +0200 sw: rename SwIndexes to SwContentIndexes in comments Leftover from commit 9fdb06d65a8f2c3401392bffee9c4639e178aada (rename SwIndex->SwContentIndex, 2022-07-25). Change-Id: I68e5f64b57e629c6e6ddc2fed0326410facb3954 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168085 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 5da054405ef5..729a5443b03b 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1421,7 +1421,7 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode ) assert(CH_TXTATR_BREAKWORD == m_Text[pAttr->GetStart()] || CH_TXTATR_INWORD == m_Text[pAttr->GetStart()]); m_Text = m_Text.replaceAt(pAttr->GetStart(), 1, u""); -// Update SwIndexes +// Update SwContentIndexes SwContentIndex aTmpIdx( this, pAttr->GetStart() ); Update(aTmpIdx, 1, UpdateMode::Negative); } @@ -1461,7 +1461,7 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode ) assert(CH_TXTATR_BREAKWORD == m_Text[pAttr->GetStart()] || CH_TXTATR_INWORD == m_Text[pAttr->GetStart()]); m_Text = m_Text.replaceAt(pAttr->GetStart(), 1, u""); -// Update SwIndexes +// Update SwContentIndexes SwContentIndex aTmpIdx( this, pAttr->GetStart() ); Update(aTmpIdx, 1, UpdateMode::Negative); } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 58657677429c..d975f3c20960 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -200,7 +200,7 @@ namespace SwTextNode* pTextNode = rUnoCursor.GetPoint()->GetNode().GetTextNode(); assert(pTextNode); -// A text node already knows its marks via its SwIndexes. +// A text node already knows its marks via its SwContentIndexes. o3tl::sorted_vector aSeenMarks; for (const SwContentIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext()) { diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 39b2016335ba..fd2811f05743 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1664,7 +1664,7 @@ SwXText::convertToTextFrame( xNewFrame->SwXFrame::setPropertyValue(rValue.Name, rValue.Value); } -{ // has to be in a block to remove the SwIndexes before +{ // has to be in a block to remove the SwContentIndexes before // DelFullPara is called const uno::Reference< text::XTextRange> xInsertTextRange = new SwXTextRange(*pStartPam, this); @@ -1677,7 +1677,7 @@ SwXText::convertToTextFrame( assert(pTextNode); if (!pTextNode || !pTextNode->Len()) // don't remove if it contains text! { -{ // has to be in a block to remove the SwIndexes before +{ // has to be in a block to remove the SwContentIndexes before // DelFullPara is called SwPaM aMovePam( pStartPam->GetPointNode() ); if (aMovePam.Move( fnMoveForward, GoInContent ))
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/data/inline-endnote-section-delete.docx |binary sw/qa/core/layout/ftnfrm.cxx | 31 ++ sw/source/core/layout/ftnfrm.cxx |4 + 3 files changed, 34 insertions(+), 1 deletion(-) New commits: commit ba0f1432e2162d32103e20d2030cf79b3dd4e2f7 Author: Miklos Vajna AuthorDate: Mon May 27 09:41:18 2024 +0200 Commit: Caolán McNamara CommitDate: Mon May 27 14:31:05 2024 +0200 tdf#160984 sw continuous endnotes: fix crash on loading forum-mso-en-7731.docx Regression from commit 1ae5ea3f78cca11ba18f2dd1a06f875263336a3b (tdf#160984 sw continuous endnotes: enable DOCX import, 2024-05-21), the bugdoc crashed in SwSectionFrame::GetEndSectFormat_(). What seems to happen is that the first endnote is added to page 1, then more content is inserted, so the endnote is moved to page 2, which leaves an empty endnote section on page 1, which is marked for deletion in SwSectionFrame::MakeAll(), and will be deleted in SwRootFrame::DeleteEmptySct_(). At some point (after marking for deletion, before deletion) SwFootnoteBossFrame::AppendFootnote() tries to find the first endnote section in the layout, and finds this section, but it crashes because there is no SwSection attached to it, as marking for deletion in SwSectionFrame::DelEmpty() clears that. Fix the problem by ignoring to-be-deleted sections in SwFootnoteBossFrame::AppendFootnote(): this way a new, usable section will be created and the to-be-deleted section go away as the layout finishes. An alternative would be to check for SwSectionFrame::GetSection() earlier, as we iterate on pages (hoping that this way we find a later page that has a not-dead endnote section), but that leads to 6 pages instead of 4 pages for the bugdoc, so don't go that way. (cherry picked from commit 3f2d0414686a8f9a042413c47c4c8ffa5d61f436) Change-Id: I9a21cbccb5a088314520c7ade55dbdf9966d1265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168099 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/qa/core/layout/data/inline-endnote-section-delete.docx b/sw/qa/core/layout/data/inline-endnote-section-delete.docx new file mode 100644 index ..bf3d3e60d890 Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-section-delete.docx differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index a7640e26ca9a..98387be6a983 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -17,6 +17,8 @@ #include #include #include +#include +#include /// Covers sw/source/core/layout/ftnfrm.cxx fixes. class Test : public SwModelTestBase @@ -122,4 +124,33 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnotePosition) CPPUNIT_ASSERT_EQUAL(static_cast(269), nEndnoteContTopMargin); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSectionDelete) +{ +// Given a document, ContinuousEndnotes is true, 3 pages, endnodes start on page 2: +// When laying out that document: +createSwDoc("inline-endnote-section-delete.docx"); + +// First page: just body text: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +auto pBodyFrame = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(!pBodyFrame->GetLastLower()->IsSctFrame()); +// Second page: ends with endnotes: +pPage = pPage->GetNext()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +pBodyFrame = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(pBodyFrame->GetLastLower()->IsSctFrame()); +auto pSection = static_cast(pBodyFrame->GetLastLower()); +CPPUNIT_ASSERT(pSection->IsEndNoteSection()); +// Third page: just endnotes: +pPage = pPage->GetNext()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +pBodyFrame = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(pBodyFrame->GetLower()->IsSctFrame()); +pSection = static_cast(pBodyFrame->GetLower()); +CPPUNIT_ASSERT(pSection->IsEndNoteSection()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 46312f9f4e89..1c6b221cf511 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1601,7 +1601,9 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame *pRef, SwTextFootnote * pEndnoteSection = pPage->GetEndNoteSection(); } // If there are no endnotes sections yet, create one at the end of the document. -if (!pEndnoteSection) +
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/paintfrm.cxx | 10 ++ sw/source/core/layout/paintfrm.cxx |9 - 2 files changed, 18 insertions(+), 1 deletion(-) New commits: commit 69bbd6378ed7a7b7765948d5ec08673866947d5d Author: Miklos Vajna AuthorDate: Fri May 24 10:51:31 2024 +0200 Commit: Caolán McNamara CommitDate: Mon May 27 14:30:44 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote separator length See <https://bug-attachments.documentfoundation.org/attachment.cgi?id=194324>, Word has a longer separator line for the foot/endnote than Writer for this bugdoc. Writer defaults to 25% of the body frame width in the SwPageFootnoteInfo ctor, and we don't seem to change that in the DOCX import. Word has a static 2 inches setting, which is only reduced if it would go outside the body frame. Fix the problem by extending SwFootnoteContFrame::PaintLine() in the DocumentSettingId::CONTINUOUS_ENDNOTES case to do the same. I searched the OOXML spec and the MS implementer notes, they don't specify this 2 inches length, but it seems static: the value doesn't change with the page size. With this, the single-section bugdoc is now rendered fine. (cherry picked from commit 755f3bebd96ec7ae43b1dcf247f907b9c15c1995) Change-Id: I3bb23680937580179b8d37c940ea14e0f80fc7f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168088 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx index 8e7154db2501..a5213c57d639 100644 --- a/sw/qa/core/layout/paintfrm.cxx +++ b/sw/qa/core/layout/paintfrm.cxx @@ -177,6 +177,16 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSeparatorPosition) // - Actual : 2060 // i.e. the upper spacing was too low. CPPUNIT_ASSERT_EQUAL(static_cast(2164), nEndnoteSeparatorY); + +// Also make sure the separator length is correct: +auto nEndnoteSeparatorStart = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, "x"_ostr).toInt32(); +auto nEndnoteSeparatorEnd = getXPath(pXmlDoc, "//polygon/point[2]"_ostr, "x"_ostr).toInt32(); +sal_Int32 nEndnoteSeparatorLength = nEndnoteSeparatorEnd - nEndnoteSeparatorStart; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2880 +// - Actual : 2340 +// i.e. the separator wasn't 2 inches long, but was shorter vs Word. +CPPUNIT_ASSERT_EQUAL(static_cast(2880), nEndnoteSeparatorLength); } } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index b45226bbbcb6..89ea71f9acb7 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5777,7 +5777,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, SwTwips nPrtWidth = aRectFnSet.GetWidth(getFramePrintArea()); Fraction aFract( nPrtWidth, 1 ); aFract *= rInf.GetWidth(); -const SwTwips nWidth = static_cast(aFract); +SwTwips nWidth = static_cast(aFract); SwTwips nX = aRectFnSet.GetPrtLeft(*this); switch ( rInf.GetAdj() ) @@ -5808,6 +5808,13 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, // Word style: instead of fixed value, upper spacing is 60% of all space. auto nPrintAreaTop = static_cast(getFramePrintArea().Top()); aPoint.setY(getFrameArea().Pos().Y() + nPrintAreaTop * 0.6); + +// Length is 2 inches, but don't paint outside the container frame. +nWidth = o3tl::convert(2, o3tl::Length::in, o3tl::Length::twip); +if (nWidth > nPrtWidth) +{ +nWidth = nPrtWidth; +} } oLineRect.emplace(aPoint, Size(nWidth, rInf.GetLineWidth())); }
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/paintfrm.cxx | 20 sw/source/core/layout/paintfrm.cxx | 27 --- 2 files changed, 40 insertions(+), 7 deletions(-) New commits: commit 461447cfdca85298435b0e029b1c1418789618ad Author: Miklos Vajna AuthorDate: Thu May 23 15:31:05 2024 +0200 Commit: Caolán McNamara CommitDate: Mon May 27 14:30:26 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote separator position See <https://bugs.documentfoundation.org/attachment.cgi?id=194306>, the total height of the endnote separator is now correct, but the distribution of upper space, line width, lower space is still bad, when compared to Word. Our model is 2 spacings and a line width, while Word seems to simply split the amount of available space: 60% goes above the separator and the rest goes below. Fix the problem by breaking up the monster expression for the separator rectangle in SwFootnoteContFrame::PaintLine(), and then the compat + horizontal case can do the 60% spacing in the Word compat mode. The width of the separator is still not correct. (cherry picked from commit f1d0b4e34a1f467e9f54baa7ac31ca28fdae3efb) Change-Id: Ic065c138041892225b3c1b7d4bd64d4f1c625611 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168007 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx index b5990648b20f..8e7154db2501 100644 --- a/sw/qa/core/layout/paintfrm.cxx +++ b/sw/qa/core/layout/paintfrm.cxx @@ -158,6 +158,26 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitTableMergedBorder) // bottom border. CPPUNIT_ASSERT_EQUAL(static_cast(2), aHorizontalBorderEnds.size()); } + +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSeparatorPosition) +{ +// Given a document with a Word-style endnote separator: +createSwDoc("inline-endnote-position.docx"); +SwDocShell* pDocShell = getSwDocShell(); + +// When rendering that document: +std::shared_ptr xMetaFile = pDocShell->GetPreviewMetaFile(); + +// Then make sure the separator upper spacing is 60% of all space, matching Word: +MetafileXmlDump aDumper; +xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile); +auto nEndnoteSeparatorY = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, "y"_ostr).toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2164 +// - Actual : 2060 +// i.e. the upper spacing was too low. +CPPUNIT_ASSERT_EQUAL(static_cast(2164), nEndnoteSeparatorY); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index ff5abcfcf898..b45226bbbcb6 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5793,13 +5793,26 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, assert(false); } SwTwips nLineWidth = rInf.GetLineWidth(); -const SwRect aLineRect = aRectFnSet.IsVert() ? -SwRect( Point(getFrameArea().Left()+getFrameArea().Width()-rInf.GetTopDist()-nLineWidth, - nX), Size( nLineWidth, nWidth ) ) -: SwRect( Point( nX, getFrameArea().Pos().Y() + rInf.GetTopDist() ), -Size( nWidth, rInf.GetLineWidth())); -if ( aLineRect.HasArea() && rInf.GetLineStyle() != SvxBorderLineStyle::NONE) -PaintBorderLine( rRect, aLineRect , pPage, (), +std::optional oLineRect; +if (aRectFnSet.IsVert()) +{ + oLineRect.emplace(Point(getFrameArea().Left()+getFrameArea().Width()-rInf.GetTopDist()-nLineWidth, + nX), Size( nLineWidth, nWidth ) ); +} +else +{ +Point aPoint(nX, getFrameArea().Pos().Y() + rInf.GetTopDist()); +const IDocumentSettingAccess& rIDSA = GetFormat()->getIDocumentSettingAccess(); +if (rIDSA.get(DocumentSettingId::CONTINUOUS_ENDNOTES)) +{ +// Word style: instead of fixed value, upper spacing is 60% of all space. +auto nPrintAreaTop = static_cast(getFramePrintArea().Top()); +aPoint.setY(getFrameArea().Pos().Y() + nPrintAreaTop * 0.6); +} +oLineRect.emplace(aPoint, Size(nWidth, rInf.GetLineWidth())); +} +if ( oLineRect->HasArea() && rInf.GetLineStyle() != SvxBorderLineStyle::NONE) +PaintBorderLine( rRect, *oLineRect , pPage, (), rInf.GetLineStyle() ); }
core.git: sw/qa sw/source
sw/qa/core/layout/data/inline-endnote-section-delete.docx |binary sw/qa/core/layout/ftnfrm.cxx | 31 ++ sw/source/core/layout/ftnfrm.cxx |4 + 3 files changed, 34 insertions(+), 1 deletion(-) New commits: commit 3f2d0414686a8f9a042413c47c4c8ffa5d61f436 Author: Miklos Vajna AuthorDate: Mon May 27 09:41:18 2024 +0200 Commit: Miklos Vajna CommitDate: Mon May 27 11:27:34 2024 +0200 tdf#160984 sw continuous endnotes: fix crash on loading forum-mso-en-7731.docx Regression from commit 1ae5ea3f78cca11ba18f2dd1a06f875263336a3b (tdf#160984 sw continuous endnotes: enable DOCX import, 2024-05-21), the bugdoc crashed in SwSectionFrame::GetEndSectFormat_(). What seems to happen is that the first endnote is added to page 1, then more content is inserted, so the endnote is moved to page 2, which leaves an empty endnote section on page 1, which is marked for deletion in SwSectionFrame::MakeAll(), and will be deleted in SwRootFrame::DeleteEmptySct_(). At some point (after marking for deletion, before deletion) SwFootnoteBossFrame::AppendFootnote() tries to find the first endnote section in the layout, and finds this section, but it crashes because there is no SwSection attached to it, as marking for deletion in SwSectionFrame::DelEmpty() clears that. Fix the problem by ignoring to-be-deleted sections in SwFootnoteBossFrame::AppendFootnote(): this way a new, usable section will be created and the to-be-deleted section go away as the layout finishes. An alternative would be to check for SwSectionFrame::GetSection() earlier, as we iterate on pages (hoping that this way we find a later page that has a not-dead endnote section), but that leads to 6 pages instead of 4 pages for the bugdoc, so don't go that way. Change-Id: I9a21cbccb5a088314520c7ade55dbdf9966d1265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168084 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/layout/data/inline-endnote-section-delete.docx b/sw/qa/core/layout/data/inline-endnote-section-delete.docx new file mode 100644 index ..bf3d3e60d890 Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-section-delete.docx differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index a7640e26ca9a..98387be6a983 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -17,6 +17,8 @@ #include #include #include +#include +#include /// Covers sw/source/core/layout/ftnfrm.cxx fixes. class Test : public SwModelTestBase @@ -122,4 +124,33 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnotePosition) CPPUNIT_ASSERT_EQUAL(static_cast(269), nEndnoteContTopMargin); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSectionDelete) +{ +// Given a document, ContinuousEndnotes is true, 3 pages, endnodes start on page 2: +// When laying out that document: +createSwDoc("inline-endnote-section-delete.docx"); + +// First page: just body text: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); +auto pPage = pLayout->Lower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +auto pBodyFrame = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(!pBodyFrame->GetLastLower()->IsSctFrame()); +// Second page: ends with endnotes: +pPage = pPage->GetNext()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +pBodyFrame = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(pBodyFrame->GetLastLower()->IsSctFrame()); +auto pSection = static_cast(pBodyFrame->GetLastLower()); +CPPUNIT_ASSERT(pSection->IsEndNoteSection()); +// Third page: just endnotes: +pPage = pPage->GetNext()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +pBodyFrame = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(pBodyFrame->GetLower()->IsSctFrame()); +pSection = static_cast(pBodyFrame->GetLower()); +CPPUNIT_ASSERT(pSection->IsEndNoteSection()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 548d8228063e..bb35d1c1025c 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1626,7 +1626,9 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame *pRef, SwTextFootnote * pEndnoteSection = pPage->GetEndNoteSection(); } // If there are no endnotes sections yet, create one at the end of the document. -if (!pEndnoteSection) +// Ignore sections which are already marked for deletion, they don't have an SwSection +
core.git: include/svx svx/source
include/svx/fmview.hxx | 10 ++-- svx/source/form/fmview.cxx | 106 ++--- 2 files changed, 58 insertions(+), 58 deletions(-) New commits: commit 2ef33247b7a3c07dde18d3cd6fd989fcb8ea4ddc Author: Miklos Vajna AuthorDate: Mon May 27 08:11:33 2024 +0200 Commit: Miklos Vajna CommitDate: Mon May 27 10:45:40 2024 +0200 svx: prefix members of FmFormView See tdf#94879 for motivation. Change-Id: I142e2259e150fd0247193dcb941fb2fe37018486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168083 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index a1a08de5e56b..e601047eff00 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -53,8 +53,8 @@ namespace com::sun::star::form { class SVXCORE_DLLPUBLIC FmFormView : public E3dView { -rtl::Reference pImpl; -FmFormShell*pFormShell; +rtl::Reference m_pImpl; +FmFormShell*m_pFormShell; void Init(); @@ -128,11 +128,11 @@ public: SVX_DLLPRIVATE void ChangeDesignMode(bool bDesign); -SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl.get(); } -SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; } +SVX_DLLPRIVATE FmXFormView* GetImpl() const { return m_pImpl.get(); } +SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return m_pFormShell; } struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } }; - void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; } + void SetFormShell( FmFormShell* pShell, FormShellAccess ) { m_pFormShell = pShell; } struct ImplAccess { friend class FmXFormView; private: ImplAccess() { } }; void SetMoveOutside( bool _bMoveOutside, ImplAccess ) { E3dView::SetMoveOutside( _bMoveOutside ); } diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 2a07073d66b9..a26895653833 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -72,8 +72,8 @@ FmFormView::FmFormView( void FmFormView::Init() { -pFormShell = nullptr; -pImpl = new FmXFormView(this); +m_pFormShell = nullptr; +m_pImpl = new FmXFormView(this); // set model SdrModel* pModel = (); @@ -114,10 +114,10 @@ void FmFormView::Init() FmFormView::~FmFormView() { -if (pFormShell) -suppress_fun_call_w_exception(pFormShell->SetView(nullptr)); +if (m_pFormShell) +suppress_fun_call_w_exception(m_pFormShell->SetView(nullptr)); -pImpl->notifyViewDying(); +m_pImpl->notifyViewDying(); } FmFormPage* FmFormView::GetCurPage() @@ -131,23 +131,23 @@ void FmFormView::MarkListHasChanged() { E3dView::MarkListHasChanged(); -if ( !(pFormShell && IsDesignMode()) ) +if ( !(m_pFormShell && IsDesignMode()) ) return; FmFormObj* pObj = getMarkedGrid(); -if ( pImpl->m_pMarkedGrid && pImpl->m_pMarkedGrid != pObj ) +if ( m_pImpl->m_pMarkedGrid && m_pImpl->m_pMarkedGrid != pObj ) { -pImpl->m_pMarkedGrid = nullptr; -if ( pImpl->m_xWindow.is() ) +m_pImpl->m_pMarkedGrid = nullptr; +if ( m_pImpl->m_xWindow.is() ) { -pImpl->m_xWindow->removeFocusListener(pImpl); -pImpl->m_xWindow = nullptr; +m_pImpl->m_xWindow->removeFocusListener(m_pImpl); +m_pImpl->m_xWindow = nullptr; } SetMoveOutside(false); //OLMRefreshAllIAOManagers(); } -pFormShell->GetImpl()->SetSelectionDelayed_Lock(); +m_pFormShell->GetImpl()->SetSelectionDelayed_Lock(); } namespace @@ -179,7 +179,7 @@ void FmFormView::AddDeviceToPaintView(OutputDevice& rNewDev, vcl::Window* pWindo // #i39269# / 2004-12-20 / frank.schoenh...@sun.com const SdrPageWindow* pPageWindow = findPageWindow( this, ); if ( pPageWindow ) -pImpl->addWindow( *pPageWindow ); +m_pImpl->addWindow( *pPageWindow ); } @@ -187,7 +187,7 @@ void FmFormView::DeleteDeviceFromPaintView(OutputDevice& rNewDev) { const SdrPageWindow* pPageWindow = findPageWindow( this, ); if ( pPageWindow ) -pImpl->removeWindow( pPageWindow->GetControlContainer() ); +m_pImpl->removeWindow( pPageWindow->GetControlContainer() ); E3dView::DeleteDeviceFromPaintView(rNewDev); } @@ -211,10 +211,10 @@ void FmFormView::ChangeDesignMode(bool bDesign) DeactivateControls( GetSdrPageView() ); // --- 2. simulate a deactivation (the shell will handle some things there ...?) -if ( pFormShell && pFormShell->GetImpl() ) -pFormShell->GetImpl()->viewDeactivated_Lock(*this); +if ( m_pFormShell && m_pFormShell->GetImpl() ) +m_pFormShell->GetImpl()->viewDeactivated
core.git: sw/CppunitTest_sw_writerfilter_dmapper.mk sw/CppunitTest_sw_writerfilter_filter.mk sw/CppunitTest_sw_writerfilter_filters_test.mk sw/CppunitTest_sw_writerfilter_misc.mk sw/CppunitTest_sw_wri
sw/CppunitTest_sw_writerfilter_dmapper.mk | 22 sw/CppunitTest_sw_writerfilter_filter.mk|2 - sw/CppunitTest_sw_writerfilter_filters_test.mk |2 - sw/CppunitTest_sw_writerfilter_misc.mk |2 - sw/CppunitTest_sw_writerfilter_ooxml.mk |2 - sw/CppunitTest_sw_writerfilter_rtftok.mk| 14 +- sw/qa/writerfilter/dmapper/CellColorHandler.cxx |2 - sw/qa/writerfilter/dmapper/DomainMapper.cxx |2 - sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx |2 - sw/qa/writerfilter/dmapper/DomainMapperTableManager.cxx |2 - sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx|2 - sw/qa/writerfilter/dmapper/GraphicImport.cxx|2 - sw/qa/writerfilter/dmapper/PropertyMap.cxx |2 - sw/qa/writerfilter/dmapper/SdtHelper.cxx|2 - sw/qa/writerfilter/dmapper/SettingsTable.cxx|2 - sw/qa/writerfilter/dmapper/TableManager.cxx |2 - sw/qa/writerfilter/dmapper/TextEffectsHandler.cxx |2 - sw/qa/writerfilter/filter/WriterFilter.cxx |2 - sw/qa/writerfilter/filters-test/filters-test.cxx|3 -- sw/qa/writerfilter/ooxml/ooxml.cxx |2 - sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx |2 - sw/qa/writerfilter/rtftok/rtfdispatchsymbol.cxx |2 - sw/qa/writerfilter/rtftok/rtfdispatchvalue.cxx |2 - sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx |2 - sw/qa/writerfilter/rtftok/rtfsdrimport.cxx |2 - sw/qa/writerfilter/rtftok/rtfsprm.cxx |2 - sw/qa/writerfilter/rtftok/rtftokenizer.cxx |2 - 27 files changed, 43 insertions(+), 44 deletions(-) New commits: commit 8112883acf0015066f21dece7e1109dbda3e4cae Author: Miklos Vajna AuthorDate: Fri May 24 16:07:55 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 24 17:34:09 2024 +0200 sw qa: rename writerfilter/cppunittests to just writerfilter 15:47 noelgrandin: any objections to go further with your writerfilter rename and turn sw/qa/writerfilter/cppunittests/* into sw/qa/writerfilter/* ? (suggest to either do it now or not at all if we're past the libreoffice-24-8 branch-off) 15:59 vmiklos, not at all, go for it Change-Id: Ic0eb6907463389f3be326cdf183002f1bfcb42be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168024 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/CppunitTest_sw_writerfilter_dmapper.mk b/sw/CppunitTest_sw_writerfilter_dmapper.mk index ecae5cf7db7e..d865706c2b50 100644 --- a/sw/CppunitTest_sw_writerfilter_dmapper.mk +++ b/sw/CppunitTest_sw_writerfilter_dmapper.mk @@ -17,17 +17,17 @@ $(eval $(call gb_CppunitTest_use_externals,sw_writerfilter_dmapper,\ )) $(eval $(call gb_CppunitTest_add_exception_objects,sw_writerfilter_dmapper, \ -sw/qa/writerfilter/cppunittests/dmapper/CellColorHandler \ -sw/qa/writerfilter/cppunittests/dmapper/DomainMapperTableHandler \ -sw/qa/writerfilter/cppunittests/dmapper/DomainMapperTableManager \ -sw/qa/writerfilter/cppunittests/dmapper/DomainMapper \ -sw/qa/writerfilter/cppunittests/dmapper/DomainMapper_Impl \ -sw/qa/writerfilter/cppunittests/dmapper/GraphicImport \ -sw/qa/writerfilter/cppunittests/dmapper/TableManager \ -sw/qa/writerfilter/cppunittests/dmapper/TextEffectsHandler \ -sw/qa/writerfilter/cppunittests/dmapper/PropertyMap \ -sw/qa/writerfilter/cppunittests/dmapper/SdtHelper \ -sw/qa/writerfilter/cppunittests/dmapper/SettingsTable \ +sw/qa/writerfilter/dmapper/CellColorHandler \ +sw/qa/writerfilter/dmapper/DomainMapperTableHandler \ +sw/qa/writerfilter/dmapper/DomainMapperTableManager \ +sw/qa/writerfilter/dmapper/DomainMapper \ +sw/qa/writerfilter/dmapper/DomainMapper_Impl \ +sw/qa/writerfilter/dmapper/GraphicImport \ +sw/qa/writerfilter/dmapper/TableManager \ +sw/qa/writerfilter/dmapper/TextEffectsHandler \ +sw/qa/writerfilter/dmapper/PropertyMap \ +sw/qa/writerfilter/dmapper/SdtHelper \ +sw/qa/writerfilter/dmapper/SettingsTable \ )) $(eval $(call gb_CppunitTest_use_libraries,sw_writerfilter_dmapper, \ diff --git a/sw/CppunitTest_sw_writerfilter_filter.mk b/sw/CppunitTest_sw_writerfilter_filter.mk index ad61c66f1ed4..e627d43d2180 100644 --- a/sw/CppunitTest_sw_writerfilter_filter.mk +++ b/sw/CppunitTest_sw_writerfilter_filter.mk @@ -17,7 +17,7 @@ $(eval $(call gb_CppunitTest_use_externals,sw_writerfilter_filter,\ )) $(eval $(call gb_CppunitTest_add_exception_objects,sw_writerfilter_filter, \ -sw/qa/writerfilter/cppunittests/filter/WriterFilter \ +sw/qa/writerfilter/filter/WriterFilter \ )) $(eval $(call gb_CppunitTest_use_libraries,sw_writerfilter_filter, \ diff --git a/sw/CppunitTest_sw_writerfilter_filters_test.mk b/sw
core.git: sw/inc sw/source
sw/inc/contentindex.hxx|2 +- sw/source/core/txtnode/ndtxt.cxx |2 +- sw/source/core/unocore/unotext.cxx |4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 6de49dee825c6bd093007b4c954f97812c3fdb47 Author: Miklos Vajna AuthorDate: Fri May 24 13:09:36 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 24 14:22:07 2024 +0200 sw: rename SwIndex to SwContentIndex in comments Leftover from commit 9fdb06d65a8f2c3401392bffee9c4639e178aada (rename SwIndex->SwContentIndex, 2022-07-25). Change-Id: I9a410e9b9ca8529454c50e93afd48b731a0fa320 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168018 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/inc/contentindex.hxx b/sw/inc/contentindex.hxx index 873e1512ca4f..ea54b1c052a2 100644 --- a/sw/inc/contentindex.hxx +++ b/sw/inc/contentindex.hxx @@ -44,7 +44,7 @@ private: SwContentIndex * m_pNext; SwContentIndex * m_pPrev; -/// points to the SwRangeRedline (if any) that contains this SwIndex, via SwPosition and SwPaM +/// points to the SwRangeRedline (if any) that contains this SwContentIndex, via SwPosition and SwPaM SwRangeRedline * m_pRangeRedline = nullptr; /// Pointer to a mark that owns this position to allow fast lookup of marks of an SwContentIndexReg. diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 34619f0c7dfb..1d71a1cd8169 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1455,7 +1455,7 @@ void SwTextNode::Update( if (!(eMode & UpdateMode::Negative) && !(eMode & UpdateMode::Delete)) { std::vector vMyRedlines; -// walk the list of SwIndex attached to me and see if any of them are redlines +// walk the list of SwContentIndex attached to me and see if any of them are redlines const SwContentIndex* pContentNodeIndex = GetFirstIndex(); while (pContentNodeIndex) { diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 50d9f75db63f..39b2016335ba 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1579,7 +1579,7 @@ SwXText::convertToTextFrame( (pStartStartNode != GetStartNode())) { // if not - remove the additional paragraphs and throw -oAnchorCheckPam.reset(); // clear SwIndex before deleting nodes +oAnchorCheckPam.reset(); // clear SwContentIndex before deleting nodes if (bParaBeforeInserted) { SwCursor aDelete(*pStartPam->GetPoint(), nullptr); @@ -1653,7 +1653,7 @@ SwXText::convertToTextFrame( } } } -oAnchorCheckPam.reset(); // clear SwIndex before deleting nodes +oAnchorCheckPam.reset(); // clear SwContentIndex before deleting nodes const rtl::Reference xNewFrame = SwXTextFrame::CreateXTextFrame(*m_pImpl->m_pDoc, nullptr);
core.git: sw/qa sw/source
sw/qa/uitest/data/keep-aspect-ratio.odt |binary sw/qa/uitest/ui/frmdlg/frmdlg.py| 20 sw/source/ui/frmdlg/frmpage.cxx |6 +- sw/source/uibase/inc/frmpage.hxx|1 + 4 files changed, 26 insertions(+), 1 deletion(-) New commits: commit a3150fc8a59662ce8630cfc64fec9cd083ac7d36 Author: Miklos Vajna AuthorDate: Fri May 24 12:06:55 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 24 13:58:07 2024 +0200 tdf#145972 sw image dialog: fix bad rel width w/ pt units and kept aspect ratio Regression from commit 02c435082058ecf7f9d4d73cb47d31d0218dc10d (sw keep aspect ratio: add filter for this setting, 2021-06-07), once UI units are set to poins (instead of cms), the image dialog for the bugdoc was showing 5% width instead of 48%. 48% is roughtly correct, visually the image is taking half of the body frame width. Previously the bad rel size didn't happen because we didn't save the "keep aspect ratio" to documents, so it was off by the time the dialog was initialized. Fix the problem by introducing a new flag, so we can differentiate between the user changine the width or height vs the dialog being initialized. RelSizeClickHdl() is meant to adjust the other axis in the user case, and this is not wanted in the init case. A higher level fix would be to make sure once aspect ratio is kept, that ratio is stored in documents explicitly, so we can say 50% wide with e.g. 4:3 ratio, that would avoid all this trouble by even looking at the calculated sizes when we want to work with percents. This storing of the aspect ratio is not done here. Change-Id: I901e7f6d5e6f7f1349d7beeb05985ddbf99a34a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168015 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/uitest/data/keep-aspect-ratio.odt b/sw/qa/uitest/data/keep-aspect-ratio.odt new file mode 100644 index ..2545b34e91f7 Binary files /dev/null and b/sw/qa/uitest/data/keep-aspect-ratio.odt differ diff --git a/sw/qa/uitest/ui/frmdlg/frmdlg.py b/sw/qa/uitest/ui/frmdlg/frmdlg.py index aa2d4fba7aff..a37062c1d392 100644 --- a/sw/qa/uitest/ui/frmdlg/frmdlg.py +++ b/sw/qa/uitest/ui/frmdlg/frmdlg.py @@ -150,4 +150,24 @@ class Test(UITestCase): # complexity. self.assertEqual(visible, "false") +def test_keep_aspect_ratio_init(self): +# Change from inch to pt to hit the rounding error. 6 means Point, see +# officecfg/registry/schema/org/openoffice/Office/Writer.xcs. +with self.ui_test.set_config('/org.openoffice.Office.Writer/Layout/Other/MeasureUnit', 6): +# Given a document with an image, width is relative: +with self.ui_test.load_file(get_url_for_data_file("keep-aspect-ratio.odt")) as xComponent: +xComponent.CurrentController.select(xComponent.DrawPage[0]) +# Wait until SwTextShell is replaced with SwDrawShell after 120 ms, as set in the SwView +# ctor. +time.sleep(0.2) +# When opening the image properties dialog: +with self.ui_test.execute_dialog_through_command(".uno:FrameDialog") as xDialog: +xWidth = xDialog.getChild("width") +frame_width = get_state_as_dict(xWidth)["Value"] +# Then make sure the width is 48%: +# Without the accompanying fix in place, this test would have failed with: +# AssertionError: '5' != '48' +# i.e. the reported size was close to zero instead of ~half of the page width. +self.assertEqual(frame_width, "48") + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 589af7dbb0a0..bd58f2ab7246 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2182,7 +2182,7 @@ IMPL_LINK( SwFramePage, ModifyHdl, weld::MetricSpinButton&, rEdit, void ) { SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP))); SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP))); -if (m_xFixedRatioCB->get_active()) +if (m_xFixedRatioCB->get_active() && !m_bIgnoreFixedRatio) { if ( == m_xWidthED->get()) { @@ -2385,14 +2385,18 @@ void SwFramePage::Init(const SfxItemSet& rSet) !m_xRelWidthCB->get_active()) { m_xRelWidthCB->set_active(true); +m_bIgnoreFixedRatio = true; RelSizeClickHdl(*m_xRelWidthCB); +m_bIgnoreFixedRatio = false; m_xWidthED->set_value(rSize.GetWidthPe
core.git: sw/qa sw/source
sw/qa/core/layout/paintfrm.cxx | 10 ++ sw/source/core/layout/paintfrm.cxx |9 - 2 files changed, 18 insertions(+), 1 deletion(-) New commits: commit 755f3bebd96ec7ae43b1dcf247f907b9c15c1995 Author: Miklos Vajna AuthorDate: Fri May 24 10:51:31 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 24 12:36:21 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote separator length See <https://bug-attachments.documentfoundation.org/attachment.cgi?id=194324>, Word has a longer separator line for the foot/endnote than Writer for this bugdoc. Writer defaults to 25% of the body frame width in the SwPageFootnoteInfo ctor, and we don't seem to change that in the DOCX import. Word has a static 2 inches setting, which is only reduced if it would go outside the body frame. Fix the problem by extending SwFootnoteContFrame::PaintLine() in the DocumentSettingId::CONTINUOUS_ENDNOTES case to do the same. I searched the OOXML spec and the MS implementer notes, they don't specify this 2 inches length, but it seems static: the value doesn't change with the page size. With this, the single-section bugdoc is now rendered fine. Change-Id: I3bb23680937580179b8d37c940ea14e0f80fc7f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168009 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx index 8e7154db2501..a5213c57d639 100644 --- a/sw/qa/core/layout/paintfrm.cxx +++ b/sw/qa/core/layout/paintfrm.cxx @@ -177,6 +177,16 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSeparatorPosition) // - Actual : 2060 // i.e. the upper spacing was too low. CPPUNIT_ASSERT_EQUAL(static_cast(2164), nEndnoteSeparatorY); + +// Also make sure the separator length is correct: +auto nEndnoteSeparatorStart = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, "x"_ostr).toInt32(); +auto nEndnoteSeparatorEnd = getXPath(pXmlDoc, "//polygon/point[2]"_ostr, "x"_ostr).toInt32(); +sal_Int32 nEndnoteSeparatorLength = nEndnoteSeparatorEnd - nEndnoteSeparatorStart; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2880 +// - Actual : 2340 +// i.e. the separator wasn't 2 inches long, but was shorter vs Word. +CPPUNIT_ASSERT_EQUAL(static_cast(2880), nEndnoteSeparatorLength); } } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index b139a75094da..a0d5f0d8a629 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5772,7 +5772,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, SwTwips nPrtWidth = aRectFnSet.GetWidth(getFramePrintArea()); Fraction aFract( nPrtWidth, 1 ); aFract *= rInf.GetWidth(); -const SwTwips nWidth = static_cast(aFract); +SwTwips nWidth = static_cast(aFract); SwTwips nX = aRectFnSet.GetPrtLeft(*this); switch ( rInf.GetAdj() ) @@ -5803,6 +5803,13 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, // Word style: instead of fixed value, upper spacing is 60% of all space. auto nPrintAreaTop = static_cast(getFramePrintArea().Top()); aPoint.setY(getFrameArea().Pos().Y() + nPrintAreaTop * 0.6); + +// Length is 2 inches, but don't paint outside the container frame. +nWidth = o3tl::convert(2, o3tl::Length::in, o3tl::Length::twip); +if (nWidth > nPrtWidth) +{ +nWidth = nPrtWidth; +} } oLineRect.emplace(aPoint, Size(nWidth, rInf.GetLineWidth())); }
ESC meeting minutes: 2024-05-23
* Present: + sockseight, Heiko, Michael W, Ilmari, Jonathan, Caolan, Hossein, Eike, Moritz, Cloph, Xisco, Miklos * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC1 was tagged this week, 24.2.4 RC2 next week + 24.8: + feature freeze (beta1) in 2 weeks + string / UI freeze 3 weeks after that * Documentation (Olivier) + Missing Olivier + Bugzilla Documentation statistics 255(255) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 16(4)44(-2)112(5) 221(1) commented 37(25) 91(21)276(31)868(31) resolved 7(1)27(-1) 62(5) 124(1) + top 10 contributors: Olivier Hallot made 46 changes in 1 month, and 243 changes in 1 year Dione Maddern made 28 changes in 1 month, and 59 changes in 1 year Stéphane Guillou made 24 changes in 1 month, and 247 changes in 1 year Vernon, Stuart Foote made 23 changes in 1 month, and 107 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Heiko Tietze made 10 changes in 1 month, and 77 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 69 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year Cor Nouws made 6 changes in 1 month, and 9 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 37(37) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-4) 10(-3) 14(-4) 22(-3) commented 29(-31) 159(-47) 512(-48) 1710(-47) removed 0(0) 3(-1) 5(0) 11(0) resolved 5(-3) 28(-4) 79(-1) 290(-7) + top 10 contributors: Heiko Tietze made 94 changes in 1 month, and 956 changes in 1 year Vernon, Stuart Foote made 65 changes in 1 month, and 312 changes in 1 year Eyal Rozenberg made 58 changes in 1 month, and 171 changes in 1 year Stéphane Guillou made 48 changes in 1 month, and 624 changes in 1 year Dieter made 16 changes in 1 month, and 124 changes in 1 year Weghorn, Michael made 8 changes in 1 month, and 23 changes in 1 year Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year Jakub Kościelak made 6 changes in 1 month, and 6 changes in 1 year Henschel, Regina made 6 changes in 1 month, and 33 changes in 1 year Roman Kuznetsov made 5 changes in 1 month, and 41 changes in 1 year + [Bug 161234] Issues with the new cell outline in Calc 24.8 + [Bug 161223] basic HTML cell render + [Bug 161218] Inconsistent and confusing Text Flow | Break options in Table Properties + [Bug 161204] UI - dashed outline for active cell border + [Bug 161205] Font selection dialog doesn't persist choice of RTL-CTL + auto-chooses CJK + [Bug 161203] When applying a style by double-clicking it in sidebar style list, keep list scroll position + [Bug 160896] Allow referencing Column & Row with Base 1 instead of 0 in Basic + [Bug 161149] Cancel all ability to apply direct formatting, and only allow formatting via styles + [Bug 160881] Forms: Checkboxes and Radiobuttons couldn't set readonly, only could set disabled + [Bug 160874] Calc fails to suggest correction for formula cell without equal sign * Vertical tabpages state (Samuel) + review the state in 1 week + no news (Heiko) * Crash Testing (Caolan) + 23(-2) import failure, 18(-1) export failures - https://wiki.documentfoundation.org/Development/Crashtesting - https://bugs.documentfoundation.org/show_bug.cgi?id=161232 - https://bugs.documentfoundation.org/show_bug.cgi?id=160862 + 0 coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 7.6.6.36050(+937) + 7.6.7.2457(+354) + 24.2.0.318611(+663) + 24.2.1.215171(+694) + 24.2.2.211690(+1291) + 24.2.3.22976(+1539) + new in 24.2: https://crashreport.libreoffice.org/stats/signature/SfxItemPool::unregisterSfxPoolItem(SfxPoolItem%20const%20&) * Mentoring (Hossein) + Reviewed submissions from newcomers + New EasyHack around QueryWizard tdf#161144 - Query wizard confuses columns with the same name in different tables https://bugs.documentfoundation.org/show_bug.cgi?id=161144 => Will create a project on VolunteerMatch for porting it to Python (hopefully after GSoC) committer... 1 week
ESC meeting minutes: 2024-05-23
* Present: + sockseight, Heiko, Michael W, Ilmari, Jonathan, Caolan, Hossein, Eike, Moritz, Cloph, Xisco, Miklos * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC1 was tagged this week, 24.2.4 RC2 next week + 24.8: + feature freeze (beta1) in 2 weeks + string / UI freeze 3 weeks after that * Documentation (Olivier) + Missing Olivier + Bugzilla Documentation statistics 255(255) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 16(4)44(-2)112(5) 221(1) commented 37(25) 91(21)276(31)868(31) resolved 7(1)27(-1) 62(5) 124(1) + top 10 contributors: Olivier Hallot made 46 changes in 1 month, and 243 changes in 1 year Dione Maddern made 28 changes in 1 month, and 59 changes in 1 year Stéphane Guillou made 24 changes in 1 month, and 247 changes in 1 year Vernon, Stuart Foote made 23 changes in 1 month, and 107 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Heiko Tietze made 10 changes in 1 month, and 77 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 69 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year Cor Nouws made 6 changes in 1 month, and 9 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 37(37) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-4) 10(-3) 14(-4) 22(-3) commented 29(-31) 159(-47) 512(-48) 1710(-47) removed 0(0) 3(-1) 5(0) 11(0) resolved 5(-3) 28(-4) 79(-1) 290(-7) + top 10 contributors: Heiko Tietze made 94 changes in 1 month, and 956 changes in 1 year Vernon, Stuart Foote made 65 changes in 1 month, and 312 changes in 1 year Eyal Rozenberg made 58 changes in 1 month, and 171 changes in 1 year Stéphane Guillou made 48 changes in 1 month, and 624 changes in 1 year Dieter made 16 changes in 1 month, and 124 changes in 1 year Weghorn, Michael made 8 changes in 1 month, and 23 changes in 1 year Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year Jakub Kościelak made 6 changes in 1 month, and 6 changes in 1 year Henschel, Regina made 6 changes in 1 month, and 33 changes in 1 year Roman Kuznetsov made 5 changes in 1 month, and 41 changes in 1 year + [Bug 161234] Issues with the new cell outline in Calc 24.8 + [Bug 161223] basic HTML cell render + [Bug 161218] Inconsistent and confusing Text Flow | Break options in Table Properties + [Bug 161204] UI - dashed outline for active cell border + [Bug 161205] Font selection dialog doesn't persist choice of RTL-CTL + auto-chooses CJK + [Bug 161203] When applying a style by double-clicking it in sidebar style list, keep list scroll position + [Bug 160896] Allow referencing Column & Row with Base 1 instead of 0 in Basic + [Bug 161149] Cancel all ability to apply direct formatting, and only allow formatting via styles + [Bug 160881] Forms: Checkboxes and Radiobuttons couldn't set readonly, only could set disabled + [Bug 160874] Calc fails to suggest correction for formula cell without equal sign * Vertical tabpages state (Samuel) + review the state in 1 week + no news (Heiko) * Crash Testing (Caolan) + 23(-2) import failure, 18(-1) export failures - https://wiki.documentfoundation.org/Development/Crashtesting - https://bugs.documentfoundation.org/show_bug.cgi?id=161232 - https://bugs.documentfoundation.org/show_bug.cgi?id=160862 + 0 coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 7.6.6.36050(+937) + 7.6.7.2457(+354) + 24.2.0.318611(+663) + 24.2.1.215171(+694) + 24.2.2.211690(+1291) + 24.2.3.22976(+1539) + new in 24.2: https://crashreport.libreoffice.org/stats/signature/SfxItemPool::unregisterSfxPoolItem(SfxPoolItem%20const%20&) * Mentoring (Hossein) + Reviewed submissions from newcomers + New EasyHack around QueryWizard tdf#161144 - Query wizard confuses columns with the same name in different tables https://bugs.documentfoundation.org/show_bug.cgi?id=161144 => Will create a project on VolunteerMatch for porting it to Python (hopefully after GSoC) committer... 1 week
core.git: sw/qa sw/source
sw/qa/core/layout/paintfrm.cxx | 20 sw/source/core/layout/paintfrm.cxx | 27 --- 2 files changed, 40 insertions(+), 7 deletions(-) New commits: commit f1d0b4e34a1f467e9f54baa7ac31ca28fdae3efb Author: Miklos Vajna AuthorDate: Thu May 23 15:31:05 2024 +0200 Commit: Miklos Vajna CommitDate: Thu May 23 21:01:31 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote separator position See <https://bugs.documentfoundation.org/attachment.cgi?id=194306>, the total height of the endnote separator is now correct, but the distribution of upper space, line width, lower space is still bad, when compared to Word. Our model is 2 spacings and a line width, while Word seems to simply split the amount of available space: 60% goes above the separator and the rest goes below. Fix the problem by breaking up the monster expression for the separator rectangle in SwFootnoteContFrame::PaintLine(), and then the compat + horizontal case can do the 60% spacing in the Word compat mode. The width of the separator is still not correct. Change-Id: Ic065c138041892225b3c1b7d4bd64d4f1c625611 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167990 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx index b5990648b20f..8e7154db2501 100644 --- a/sw/qa/core/layout/paintfrm.cxx +++ b/sw/qa/core/layout/paintfrm.cxx @@ -158,6 +158,26 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitTableMergedBorder) // bottom border. CPPUNIT_ASSERT_EQUAL(static_cast(2), aHorizontalBorderEnds.size()); } + +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteSeparatorPosition) +{ +// Given a document with a Word-style endnote separator: +createSwDoc("inline-endnote-position.docx"); +SwDocShell* pDocShell = getSwDocShell(); + +// When rendering that document: +std::shared_ptr xMetaFile = pDocShell->GetPreviewMetaFile(); + +// Then make sure the separator upper spacing is 60% of all space, matching Word: +MetafileXmlDump aDumper; +xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile); +auto nEndnoteSeparatorY = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, "y"_ostr).toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2164 +// - Actual : 2060 +// i.e. the upper spacing was too low. +CPPUNIT_ASSERT_EQUAL(static_cast(2164), nEndnoteSeparatorY); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 8c0f4f876847..b139a75094da 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5788,13 +5788,26 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, assert(false); } SwTwips nLineWidth = rInf.GetLineWidth(); -const SwRect aLineRect = aRectFnSet.IsVert() ? -SwRect( Point(getFrameArea().Left()+getFrameArea().Width()-rInf.GetTopDist()-nLineWidth, - nX), Size( nLineWidth, nWidth ) ) -: SwRect( Point( nX, getFrameArea().Pos().Y() + rInf.GetTopDist() ), -Size( nWidth, rInf.GetLineWidth())); -if ( aLineRect.HasArea() && rInf.GetLineStyle() != SvxBorderLineStyle::NONE) -PaintBorderLine( rRect, aLineRect , pPage, (), +std::optional oLineRect; +if (aRectFnSet.IsVert()) +{ + oLineRect.emplace(Point(getFrameArea().Left()+getFrameArea().Width()-rInf.GetTopDist()-nLineWidth, + nX), Size( nLineWidth, nWidth ) ); +} +else +{ +Point aPoint(nX, getFrameArea().Pos().Y() + rInf.GetTopDist()); +const IDocumentSettingAccess& rIDSA = GetFormat()->getIDocumentSettingAccess(); +if (rIDSA.get(DocumentSettingId::CONTINUOUS_ENDNOTES)) +{ +// Word style: instead of fixed value, upper spacing is 60% of all space. +auto nPrintAreaTop = static_cast(getFramePrintArea().Top()); +aPoint.setY(getFrameArea().Pos().Y() + nPrintAreaTop * 0.6); +} +oLineRect.emplace(aPoint, Size(nWidth, rInf.GetLineWidth())); +} +if ( oLineRect->HasArea() && rInf.GetLineStyle() != SvxBorderLineStyle::NONE) +PaintBorderLine( rRect, *oLineRect , pPage, (), rInf.GetLineStyle() ); }
core.git: Branch 'distro/collabora/co-24.04' - sw/inc sw/qa sw/source
sw/inc/pagedesc.hxx |2 sw/qa/core/layout/data/inline-endnote-position.docx |binary sw/qa/core/layout/ftnfrm.cxx| 20 sw/source/core/layout/ftnfrm.cxx| 49 +++- sw/source/filter/ww8/docxattributeoutput.cxx| 10 +++- 5 files changed, 77 insertions(+), 4 deletions(-) New commits: commit dbc5e22e4e1ae730f70664472a3d4d72688d629e Author: Miklos Vajna AuthorDate: Wed May 22 13:56:40 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 23 17:10:31 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote container's top margin Comparing the Word vs Writer output for the bugdoc, the vertical position of the endnote text is not correct: the y pos should be larger than it is, see the red reference at e.g. <https://bug-attachments.documentfoundation.org/attachment.cgi?id=194265>. Seems this is caused by the different height of the rectangle around the endnote separator: the top margin is 124 twips in Writer, which is a hardcoded default from the SwPageFootnoteInfo ctor, while Word has this separator as a special character, inside a paragraph, which inherits the height of the default paragraph style. Fix the problem by extending sw::FootnoteSeparatorHeight() to also work from RES_POOLCOLL_STANDARD in the Word compat case. Note that it's not enough to take the font size (11pt in this case) from the paragraph style, we want to work with the real font, which knows the spacing between lines (15% in this case). SwFont::GetHeight() has this logic, it's also what e.g. SwTextFrame::FormatEmpty() uses. Note that footnotes have the same problem, but given that they grow from the bottom of the page, the text position was correct, even if the separator height is incorrect. Also, the separator line itself is not changed in this commit, we just make sure that the height is OK, so text below the line has the correct position. (cherry picked from commit d1ddd136a1b0e452492464d58715eaec144fd811) Change-Id: If1f4757908355abc81ee711de5ab9db4c751354c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167984 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index ddc7e659a5bb..d9b58a4bb357 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -399,7 +399,7 @@ public: namespace sw { class PageFootnoteHint final : public SfxHint {}; -SW_DLLPUBLIC SwTwips FootnoteSeparatorHeight(SwPageFootnoteInfo const&); +SW_DLLPUBLIC SwTwips FootnoteSeparatorHeight(SwDoc& rDoc, SwPageFootnoteInfo const&); } typedef boost::multi_index_container< diff --git a/sw/qa/core/layout/data/inline-endnote-position.docx b/sw/qa/core/layout/data/inline-endnote-position.docx new file mode 100644 index ..3905208f9f0e Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-position.docx differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index 1cf31809e5a7..a7640e26ca9a 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -102,4 +102,24 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndSection) CPPUNIT_ASSERT_EQUAL(2, nToplevelSections); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnotePosition) +{ +// Given a document, ContinuousEndnotes is true: +createSwDoc("inline-endnote-position.docx"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure the endnote separator (line + spacing around it) is large enough, so the +// endnote text below the separator has the correct position: +sal_Int32 nEndnoteContTopMargin += parseDump("//column/ftncont/infos/prtBounds"_ostr, "top"_ostr).toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 269 +// - Actual : 124 +// i.e. the top margin wasn't the default font size with its spacing, but the Writer default, +// which shifted endnote text up, incorrectly. +CPPUNIT_ASSERT_EQUAL(static_cast(269), nEndnoteContTopMargin); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 61a8385d51fc..46312f9f4e89 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -42,9 +42,41 @@ #include #include #include +#include +#include +#include +#include +#include #define ENDNOTE 0x8000 +namespace +{ +/// Calculates the height of the line that hosts the separator line (the top margin of the +/// container), based on the default paragraph style in rDoc. +bool FootnoteSeparatorHeightFromParagraph(SwDoc& rDo
core.git: Branch 'distro/collabora/co-24.04' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/filter/WriterFilter.cxx | 26 ++ writerfilter/qa/cppunittests/filter/data/inline-endnote-and-footnote.docx |binary writerfilter/source/filter/WriterFilter.cxx | 1 3 files changed, 27 insertions(+) New commits: commit 10b1f037288f107357bd4402ff65528f76544b0c Author: Miklos Vajna AuthorDate: Tue May 21 08:15:53 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 23 15:59:22 2024 +0200 tdf#160984 sw continuous endnotes: enable DOCX import This was working for DOC already. For DOCX, this was already enabled once with commit f9982c24066d6dd2f938cc20176af0f196bc018f (tdf#58521 DOCX import: enable ContinuousEndnotes compat flag, 2021-07-13), but then it was reverted later with commit commit eeda1b35a6e87d5349545464da33d997c52f15e3 (Revert "tdf#58521 DOCX import: enable ContinuousEndnotes compat flag", 2021-08-10), because of tdf#143456. Enable it again, now that the section-based layout seems good enough to handle larger number of endnotes, e.g. the 48 endnotes from tdf#143456. (cherry picked from commit 1ae5ea3f78cca11ba18f2dd1a06f875263336a3b) Change-Id: Id221f31f9208e84db2c358546d4d6ceea991b6b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167924 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/writerfilter/qa/cppunittests/filter/WriterFilter.cxx b/writerfilter/qa/cppunittests/filter/WriterFilter.cxx index ae741085277c..be9139c5c229 100644 --- a/writerfilter/qa/cppunittests/filter/WriterFilter.cxx +++ b/writerfilter/qa/cppunittests/filter/WriterFilter.cxx @@ -50,6 +50,32 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjs) // i.e. the shape was on the left margin. CPPUNIT_ASSERT_GREATER(nBodyRight, nShapeLeft); } + +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnoteDOCX) +{ +// Given a DOCX file with an endnote and then a footnote: +loadFromFile(u"inline-endnote-and-footnote.docx"); + +// When laying out that document: +uno::Reference xModel(mxComponent, uno::UNO_QUERY); +css::uno::Reference xDumper(xModel->getCurrentController(), uno::UNO_QUERY); +OString aDump = xDumper->dump("layout").toUtf8(); +auto pCharBuffer = reinterpret_cast(aDump.getStr()); +xmlDocUniquePtr pXmlDoc(xmlParseDoc(pCharBuffer)); + +// Then make sure the footnote is below the endnote: +// Without the accompanying fix in place, this test would have failed with: +// - xpath should match exactly 1 node +// i.e. the endnote was also in the footnote container, not at the end of the body text. +sal_Int32 nEndnoteTop += getXPath(pXmlDoc, "/root/page/body/section/column/ftncont/ftn/infos/bounds"_ostr, + "top"_ostr) + .toInt32(); +sal_Int32 nFootnoteTop += getXPath(pXmlDoc, "/root/page/ftncont/ftn/infos/bounds"_ostr, "top"_ostr).toInt32(); +// Endnote at the end of body text, footnote at page bottom. +CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/qa/cppunittests/filter/data/inline-endnote-and-footnote.docx b/writerfilter/qa/cppunittests/filter/data/inline-endnote-and-footnote.docx new file mode 100644 index ..84343b8afa45 Binary files /dev/null and b/writerfilter/qa/cppunittests/filter/data/inline-endnote-and-footnote.docx differ diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 44efc0c42cfc..f7654681f6ee 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -332,6 +332,7 @@ void WriterFilter::setTargetDocument(const uno::Reference& xDo // rely on default for HyphenateURLs=false // rely on default for APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH=true xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true)); +xSettings->setPropertyValue("ContinuousEndnotes", uno::Any(true)); } void WriterFilter::setSourceDocument(const uno::Reference& xDoc)
core.git: sw/qa
sw/qa/extras/rtfexport/rtfexport8.cxx | 540 -- 1 file changed, 322 insertions(+), 218 deletions(-) New commits: commit a4ec8307e342bd83e287b197ffac822ac7e9f599 Author: Miklos Vajna AuthorDate: Thu May 23 08:06:53 2024 +0200 Commit: Miklos Vajna CommitDate: Thu May 23 09:46:38 2024 +0200 CppunitTest_sw_rtfexport8: avoid DECLARE_RTFEXPORT_TEST No need to go via Writer-specific macros here. Change-Id: I10256d2cd8d214489b52600ccbb45b0ba1526950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167979 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index e05eb817d07f..33219edcfe9d 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -53,133 +53,191 @@ public: } }; -DECLARE_RTFEXPORT_TEST(testTdf155663, "piccrop.rtf") +CPPUNIT_TEST_FIXTURE(Test, testTdf155663) { -auto const xShape(getShape(1)); -if (!isExported()) -{ -CPPUNIT_ASSERT_EQUAL(sal_Int32(2004), xShape->getSize().Height); -CPPUNIT_ASSERT_EQUAL(sal_Int32(2004), xShape->getSize().Width); -} -else // bit of rounding loss? -{ -CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Height); -CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Width); -} -CPPUNIT_ASSERT_EQUAL(sal_Int32(123), getProperty(xShape, "GraphicCrop").Top); -CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Bottom); -CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Left); -CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Right); +auto verify = [this]() { +auto const xShape(getShape(1)); +if (!isExported()) +{ +CPPUNIT_ASSERT_EQUAL(sal_Int32(2004), xShape->getSize().Height); +CPPUNIT_ASSERT_EQUAL(sal_Int32(2004), xShape->getSize().Width); +} +else // bit of rounding loss? +{ +CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Height); +CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Width); +} +CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty(xShape, "GraphicCrop").Top); +CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty(xShape, "GraphicCrop").Bottom); +CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty(xShape, "GraphicCrop").Left); +CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty(xShape, "GraphicCrop").Right); +}; +createSwDoc("piccrop.rtf"); +verify(); +saveAndReload(mpFilter); +verify(); } -DECLARE_RTFEXPORT_TEST(testTdf158586_0, "tdf158586_pageBreak0.rtf") +CPPUNIT_TEST_FIXTURE(Test, testTdf158586_0) { -// The specified page break must be lost because it is in a text frame -CPPUNIT_ASSERT_EQUAL(1, getPages()); -CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); - -// There should be no empty paragraph at the start -xmlDocUniquePtr pLayout = parseLayoutDump(); -assertXPath(pLayout, "//anchored"_ostr, 1); -assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); +auto verify = [this]() { +// The specified page break must be lost because it is in a text frame +CPPUNIT_ASSERT_EQUAL(1, getPages()); +CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); + +// There should be no empty paragraph at the start +xmlDocUniquePtr pLayout = parseLayoutDump(); +assertXPath(pLayout, "//anchored"_ostr, 1); +assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); +}; +createSwDoc("tdf158586_pageBreak0.rtf"); +verify(); +saveAndReload(mpFilter); +verify(); } -DECLARE_RTFEXPORT_TEST(testTdf158586_0B, "tdf158586_pageBreak0B.rtf") +CPPUNIT_TEST_FIXTURE(Test, testTdf158586_0B) { -// The specified page break must be lost because it is in a text frame -CPPUNIT_ASSERT_EQUAL(1, getPages()); -CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); - -// There should be no empty paragraph at the start -xmlDocUniquePtr pLayout = parseLayoutDump(); -assertXPath(pLayout, "//anchored"_ostr, 1); -assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); +auto verify = [this]() { +// The specified page break must be lost because it is in a text frame +CPPUNIT_ASSERT_EQUAL(1, getPages()); +CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); + +
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source xmloff/qa
sw/qa/core/layout/data/fly-rel-width-rounding.odt |binary sw/qa/core/layout/fly.cxx | 25 ++ sw/source/core/layout/fly.cxx |5 ++-- xmloff/qa/unit/text.cxx |4 +-- 4 files changed, 30 insertions(+), 4 deletions(-) New commits: commit 991341f9f69fded9c9573d91b2d65fc6a37b3132 Author: Miklos Vajna AuthorDate: Wed May 22 08:47:32 2024 +0200 Commit: Miklos Vajna CommitDate: Thu May 23 09:20:46 2024 +0200 Related: tdf#145972 sw images: fix rounding error in relative size calculation Open the bugdoc, see that the image is roughly half of the page width, right click, properties, UI shows that the width of the image is 5% of the width of the entire page. This only happens if tools -> options -> writer -> general sets the UI units to points, the default cm case is fine. This went wrong with commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (sw image dialog: fix fallback width/height for images with relative sizes, 2022-03-17), because the layout size started to matter more after that commit. This lead to the nWidth != m_xWidthED->get_value(FieldUnit::TWIP) check in SwFramePage::Init() to be true, because 11906 * 0.48 is 5714.88, so you got 5714 in the layout, but got 5715 with rounding in SwFramePage::Reset() (which tries to calc the page width based on the 48% and the fly width). And once we had that mismatch, we went down the wrong path. Fix the problem by using rtl::math::round() in SwFlyFrame::CalcRel(), so the relative width twips value is 5715 everywhere: once we have consisteny, the UI value is correct, too. Note that the original bugdoc needs more fixing, this just fixes the bugdoc where KeepRatio is false. Change-Id: I1e8782c95a0cf9d97375c36d41134735c01f3e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167916 Tested-by: Jenkins Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167926 (cherry picked from commit 3046bd0e30406d37813ce3eaa65f71f5ed10ab13) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167980 Tested-by: Jenkins CollaboraOffice diff --git a/sw/qa/core/layout/data/fly-rel-width-rounding.odt b/sw/qa/core/layout/data/fly-rel-width-rounding.odt new file mode 100644 index ..b70b9e51a917 Binary files /dev/null and b/sw/qa/core/layout/data/fly-rel-width-rounding.odt differ diff --git a/sw/qa/core/layout/fly.cxx b/sw/qa/core/layout/fly.cxx index 47cfb40fa6e7..81df20af3b35 100644 --- a/sw/qa/core/layout/fly.cxx +++ b/sw/qa/core/layout/fly.cxx @@ -86,6 +86,31 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyNegativeHeight) } } } + +CPPUNIT_TEST_FIXTURE(Test, testFlyRelWithRounding) +{ +// Given a document where page width is 21.001cm (11906 twips), and the image width is 48% of +// the page width: +createSwDoc("fly-rel-width-rounding.odt"); + +// When laying out that document: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + +// Then make sure that we calculate the width of the fly correctly: +auto pPage = pLayout->GetLower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetSortedObjs()); +SwSortedObjs& rPageObjs = *pPage->GetSortedObjs(); +CPPUNIT_ASSERT_EQUAL(static_cast(1), rPageObjs.size()); +auto pFly = rPageObjs[0]->DynCastFlyFrame()->DynCastFlyAtContentFrame(); +CPPUNIT_ASSERT(pFly); +tools::Long nFlyWidth = pFly->getFrameArea().Width(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 5715 +// - Actual : 5714 +// i.e. 5714.88 was truncated, not rounded. +CPPUNIT_ASSERT_EQUAL(static_cast(5715), nFlyWidth); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index b454bd95917f..fd95ce192cf7 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -2845,9 +2846,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize ) const } if ( rSz.GetWidthPercent() && rSz.GetWidthPercent() != SwFormatFrameSize::SYNCED ) -aRet.setWidth( nRelWidth * rSz.GetWidthPercent() / 100 ); +aRet.setWidth(rtl::math::round(double(nRelWidth) * rSz.GetWidthPercent() / 100)); if ( rSz.GetHeightPercent() && rSz.GetHeightPercent() != SwFormatFrameSize::SYNCED ) -aRet.setHeight( nRelHeight * rSz.GetHeightPercent() / 100 ); +aRet.setHeight(rtl::math::round(double(nRelHeight) * rSz.GetHeightPercent() / 100)); if ( rSz.GetHeight() && rSz.GetWidthPercent() == SwF
core.git: sw/inc sw/qa sw/source
sw/inc/pagedesc.hxx |2 sw/qa/core/layout/data/inline-endnote-position.docx |binary sw/qa/core/layout/ftnfrm.cxx| 20 sw/source/core/layout/ftnfrm.cxx| 49 +++- sw/source/filter/ww8/docxattributeoutput.cxx| 10 +++- 5 files changed, 77 insertions(+), 4 deletions(-) New commits: commit d1ddd136a1b0e452492464d58715eaec144fd811 Author: Miklos Vajna AuthorDate: Wed May 22 13:56:40 2024 +0200 Commit: Miklos Vajna CommitDate: Wed May 22 17:50:10 2024 +0200 tdf#160984 sw continuous endnotes: fix the endnote container's top margin Comparing the Word vs Writer output for the bugdoc, the vertical position of the endnote text is not correct: the y pos should be larger than it is, see the red reference at e.g. <https://bug-attachments.documentfoundation.org/attachment.cgi?id=194265>. Seems this is caused by the different height of the rectangle around the endnote separator: the top margin is 124 twips in Writer, which is a hardcoded default from the SwPageFootnoteInfo ctor, while Word has this separator as a special character, inside a paragraph, which inherits the height of the default paragraph style. Fix the problem by extending sw::FootnoteSeparatorHeight() to also work from RES_POOLCOLL_STANDARD in the Word compat case. Note that it's not enough to take the font size (11pt in this case) from the paragraph style, we want to work with the real font, which knows the spacing between lines (15% in this case). SwFont::GetHeight() has this logic, it's also what e.g. SwTextFrame::FormatEmpty() uses. Note that footnotes have the same problem, but given that they grow from the bottom of the page, the text position was correct, even if the separator height is incorrect. Also, the separator line itself is not changed in this commit, we just make sure that the height is OK, so text below the line has the correct position. Change-Id: If1f4757908355abc81ee711de5ab9db4c751354c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167959 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 3ec919ce3c83..a8241f15f6f0 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -399,7 +399,7 @@ public: namespace sw { class PageFootnoteHint final : public SfxHint {}; -SW_DLLPUBLIC SwTwips FootnoteSeparatorHeight(SwPageFootnoteInfo const&); +SW_DLLPUBLIC SwTwips FootnoteSeparatorHeight(SwDoc& rDoc, SwPageFootnoteInfo const&); } typedef boost::multi_index_container< diff --git a/sw/qa/core/layout/data/inline-endnote-position.docx b/sw/qa/core/layout/data/inline-endnote-position.docx new file mode 100644 index ..3905208f9f0e Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-position.docx differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index 1cf31809e5a7..a7640e26ca9a 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -102,4 +102,24 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndSection) CPPUNIT_ASSERT_EQUAL(2, nToplevelSections); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnotePosition) +{ +// Given a document, ContinuousEndnotes is true: +createSwDoc("inline-endnote-position.docx"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure the endnote separator (line + spacing around it) is large enough, so the +// endnote text below the separator has the correct position: +sal_Int32 nEndnoteContTopMargin += parseDump("//column/ftncont/infos/prtBounds"_ostr, "top"_ostr).toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 269 +// - Actual : 124 +// i.e. the top margin wasn't the default font size with its spacing, but the Writer default, +// which shifted endnote text up, incorrectly. +CPPUNIT_ASSERT_EQUAL(static_cast(269), nEndnoteContTopMargin); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index b7851a131e44..548d8228063e 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -42,9 +42,41 @@ #include #include #include +#include +#include +#include +#include +#include #define ENDNOTE 0x8000 +namespace +{ +/// Calculates the height of the line that hosts the separator line (the top margin of the +/// container), based on the default paragraph style in rDoc. +bool FootnoteSeparatorHeightFromParagraph(SwDoc& rDoc, SwTwips& rHeight) +{ +const SwTextFormatColl* pDefaultParaFormat += rDoc.getIDocument
ESC meeting agenda: 2024-05-23 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC2 next week? + 24.8: + feature freeze in 2 weeks? + string / UI freeze 3 weeks after that * Documentation (Olivier) + Bugzilla Documentation statistics 255(255) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 16(4)44(-2)112(5) 221(1) commented 37(25) 91(21)276(31)868(31) resolved 7(1)27(-1) 62(5) 124(1) + top 10 contributors: Olivier Hallot made 46 changes in 1 month, and 243 changes in 1 year Dione Maddern made 28 changes in 1 month, and 59 changes in 1 year Stéphane Guillou made 24 changes in 1 month, and 247 changes in 1 year Vernon, Stuart Foote made 23 changes in 1 month, and 107 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Heiko Tietze made 10 changes in 1 month, and 77 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 69 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year Cor Nouws made 6 changes in 1 month, and 9 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 37(37) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-4) 10(-3) 14(-4) 22(-3) commented 29(-31) 159(-47) 512(-48) 1710(-47) removed 0(0) 3(-1) 5(0) 11(0) resolved 5(-3) 28(-4) 79(-1) 290(-7) + top 10 contributors: Heiko Tietze made 94 changes in 1 month, and 956 changes in 1 year Vernon, Stuart Foote made 65 changes in 1 month, and 312 changes in 1 year Eyal Rozenberg made 58 changes in 1 month, and 171 changes in 1 year Stéphane Guillou made 48 changes in 1 month, and 624 changes in 1 year Dieter made 16 changes in 1 month, and 124 changes in 1 year Weghorn, Michael made 8 changes in 1 month, and 23 changes in 1 year Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year Jakub Kościelak made 6 changes in 1 month, and 6 changes in 1 year Henschel, Regina made 6 changes in 1 month, and 33 changes in 1 year Roman Kuznetsov made 5 changes in 1 month, and 41 changes in 1 year * Vertical tabpages state (Samuel) + review the state in 1 week * Crash Testing (Caolan) + 23(-2) import failure, 18(-1) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.0.2174(+1) + 24.2.0.318611(+663) + 24.2.1.177(+4) + 24.2.1.215171(+694) + 24.2.2.211690(+1291) + 24.2.3.22976(+1539) * Mentoring (Hossein) committer... 1 week 1 month 3 months12 months open 56(-33)146(-14)147(-13) 147(-13) reviews 362(44)1322(72)3538(-56) 12486(28) merged 254(-56) 1304(60)3385(-38) 12718(4) abandoned 10(-5) 53(-8) 175(1) 659(-2) own commits 177(-50)946(33)2400(20) 9273(-1) review commits 72(34) 233(15) 820(-19)3005(11) contributor... 1 week 1 month3 months 12 months open 36(-19) 95(-8) 96(-7)96(-7) reviews 730(-164) 3132(82) 7826(-104) 29550(-24) merged 25(10) 90(4) 366(-11) 1589(6) abandoned 7(7)28(-5)280(1)704(5) own commits 35(21) 107(10)413(-16) 1137(23) review commits 0(0) 0(0) 0(0) 0(0) + easyHack statistics: needsDevEval 9(9) needsUXEval 1(1) cleanup_comments 326(326) total 410(410) assigned 27(27) open 348(348) + top 10 contributors: Dione Maddern made 11 patches in 1 month, and 45 patches in 1 year Jakub Kościelak made 7 patches in 1 month, and 7 patches in 1 year Stéphane Guillou made 5 patches in 1 month, and 60 patches in 1 year Weblate made 4 patches in 1 month, and 25 patches in 1 year made 4 patches in 1 month,
ESC meeting agenda: 2024-05-23 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + MAR update: include OS info in the user agent or file a bug to do it (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC2 next week? + 24.8: + feature freeze in 2 weeks? + string / UI freeze 3 weeks after that * Documentation (Olivier) + Bugzilla Documentation statistics 255(255) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 16(4)44(-2)112(5) 221(1) commented 37(25) 91(21)276(31)868(31) resolved 7(1)27(-1) 62(5) 124(1) + top 10 contributors: Olivier Hallot made 46 changes in 1 month, and 243 changes in 1 year Dione Maddern made 28 changes in 1 month, and 59 changes in 1 year Stéphane Guillou made 24 changes in 1 month, and 247 changes in 1 year Vernon, Stuart Foote made 23 changes in 1 month, and 107 changes in 1 year Dieter made 13 changes in 1 month, and 18 changes in 1 year Heiko Tietze made 10 changes in 1 month, and 77 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 69 changes in 1 year Óvári made 10 changes in 1 month, and 13 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year Cor Nouws made 6 changes in 1 month, and 9 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 37(37) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week1 month3 months 12 months added 3(-4) 10(-3) 14(-4) 22(-3) commented 29(-31) 159(-47) 512(-48) 1710(-47) removed 0(0) 3(-1) 5(0) 11(0) resolved 5(-3) 28(-4) 79(-1) 290(-7) + top 10 contributors: Heiko Tietze made 94 changes in 1 month, and 956 changes in 1 year Vernon, Stuart Foote made 65 changes in 1 month, and 312 changes in 1 year Eyal Rozenberg made 58 changes in 1 month, and 171 changes in 1 year Stéphane Guillou made 48 changes in 1 month, and 624 changes in 1 year Dieter made 16 changes in 1 month, and 124 changes in 1 year Weghorn, Michael made 8 changes in 1 month, and 23 changes in 1 year Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year Jakub Kościelak made 6 changes in 1 month, and 6 changes in 1 year Henschel, Regina made 6 changes in 1 month, and 33 changes in 1 year Roman Kuznetsov made 5 changes in 1 month, and 41 changes in 1 year * Vertical tabpages state (Samuel) + review the state in 1 week * Crash Testing (Caolan) + 23(-2) import failure, 18(-1) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.0.2174(+1) + 24.2.0.318611(+663) + 24.2.1.177(+4) + 24.2.1.215171(+694) + 24.2.2.211690(+1291) + 24.2.3.22976(+1539) * Mentoring (Hossein) committer... 1 week 1 month 3 months12 months open 56(-33)146(-14)147(-13) 147(-13) reviews 362(44)1322(72)3538(-56) 12486(28) merged 254(-56) 1304(60)3385(-38) 12718(4) abandoned 10(-5) 53(-8) 175(1) 659(-2) own commits 177(-50)946(33)2400(20) 9273(-1) review commits 72(34) 233(15) 820(-19)3005(11) contributor... 1 week 1 month3 months 12 months open 36(-19) 95(-8) 96(-7)96(-7) reviews 730(-164) 3132(82) 7826(-104) 29550(-24) merged 25(10) 90(4) 366(-11) 1589(6) abandoned 7(7)28(-5)280(1)704(5) own commits 35(21) 107(10)413(-16) 1137(23) review commits 0(0) 0(0) 0(0) 0(0) + easyHack statistics: needsDevEval 9(9) needsUXEval 1(1) cleanup_comments 326(326) total 410(410) assigned 27(27) open 348(348) + top 10 contributors: Dione Maddern made 11 patches in 1 month, and 45 patches in 1 year Jakub Kościelak made 7 patches in 1 month, and 7 patches in 1 year Stéphane Guillou made 5 patches in 1 month, and 60 patches in 1 year Weblate made 4 patches in 1 month, and 25 patches in 1 year made 4 patches in 1 month,
core.git: Branch 'libreoffice-24-2' - sw/qa sw/source xmloff/qa
sw/qa/core/layout/data/fly-rel-width-rounding.odt |binary sw/qa/core/layout/fly.cxx | 25 ++ sw/source/core/layout/fly.cxx |5 ++-- xmloff/qa/unit/text.cxx |4 +-- 4 files changed, 30 insertions(+), 4 deletions(-) New commits: commit 3046bd0e30406d37813ce3eaa65f71f5ed10ab13 Author: Miklos Vajna AuthorDate: Wed May 22 08:47:32 2024 +0200 Commit: Xisco Fauli CommitDate: Wed May 22 13:44:49 2024 +0200 Related: tdf#145972 sw images: fix rounding error in relative size calculation Open the bugdoc, see that the image is roughly half of the page width, right click, properties, UI shows that the width of the image is 5% of the width of the entire page. This only happens if tools -> options -> writer -> general sets the UI units to points, the default cm case is fine. This went wrong with commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (sw image dialog: fix fallback width/height for images with relative sizes, 2022-03-17), because the layout size started to matter more after that commit. This lead to the nWidth != m_xWidthED->get_value(FieldUnit::TWIP) check in SwFramePage::Init() to be true, because 11906 * 0.48 is 5714.88, so you got 5714 in the layout, but got 5715 with rounding in SwFramePage::Reset() (which tries to calc the page width based on the 48% and the fly width). And once we had that mismatch, we went down the wrong path. Fix the problem by using rtl::math::round() in SwFlyFrame::CalcRel(), so the relative width twips value is 5715 everywhere: once we have consisteny, the UI value is correct, too. Note that the original bugdoc needs more fixing, this just fixes the bugdoc where KeepRatio is false. Change-Id: I1e8782c95a0cf9d97375c36d41134735c01f3e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167916 Tested-by: Jenkins Reviewed-by: Miklos Vajna Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167926 diff --git a/sw/qa/core/layout/data/fly-rel-width-rounding.odt b/sw/qa/core/layout/data/fly-rel-width-rounding.odt new file mode 100644 index ..b70b9e51a917 Binary files /dev/null and b/sw/qa/core/layout/data/fly-rel-width-rounding.odt differ diff --git a/sw/qa/core/layout/fly.cxx b/sw/qa/core/layout/fly.cxx index 47cfb40fa6e7..81df20af3b35 100644 --- a/sw/qa/core/layout/fly.cxx +++ b/sw/qa/core/layout/fly.cxx @@ -86,6 +86,31 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyNegativeHeight) } } } + +CPPUNIT_TEST_FIXTURE(Test, testFlyRelWithRounding) +{ +// Given a document where page width is 21.001cm (11906 twips), and the image width is 48% of +// the page width: +createSwDoc("fly-rel-width-rounding.odt"); + +// When laying out that document: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + +// Then make sure that we calculate the width of the fly correctly: +auto pPage = pLayout->GetLower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetSortedObjs()); +SwSortedObjs& rPageObjs = *pPage->GetSortedObjs(); +CPPUNIT_ASSERT_EQUAL(static_cast(1), rPageObjs.size()); +auto pFly = rPageObjs[0]->DynCastFlyFrame()->DynCastFlyAtContentFrame(); +CPPUNIT_ASSERT(pFly); +tools::Long nFlyWidth = pFly->getFrameArea().Width(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 5715 +// - Actual : 5714 +// i.e. 5714.88 was truncated, not rounded. +CPPUNIT_ASSERT_EQUAL(static_cast(5715), nFlyWidth); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index b454bd95917f..fd95ce192cf7 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -2845,9 +2846,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize ) const } if ( rSz.GetWidthPercent() && rSz.GetWidthPercent() != SwFormatFrameSize::SYNCED ) -aRet.setWidth( nRelWidth * rSz.GetWidthPercent() / 100 ); +aRet.setWidth(rtl::math::round(double(nRelWidth) * rSz.GetWidthPercent() / 100)); if ( rSz.GetHeightPercent() && rSz.GetHeightPercent() != SwFormatFrameSize::SYNCED ) -aRet.setHeight( nRelHeight * rSz.GetHeightPercent() / 100 ); +aRet.setHeight(rtl::math::round(double(nRelHeight) * rSz.GetHeightPercent() / 100)); if ( rSz.GetHeight() && rSz.GetWidthPercent() == SwFormatFrameSize::SYNCED ) { diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx index e6433b2b70f9..2da04387d707 100644 --- a/xmloff/qa/unit/text.cx
core.git: sw/qa sw/source xmloff/qa
sw/qa/core/layout/data/fly-rel-width-rounding.odt |binary sw/qa/core/layout/fly.cxx | 25 ++ sw/source/core/layout/fly.cxx |5 ++-- xmloff/qa/unit/text.cxx |4 +-- 4 files changed, 30 insertions(+), 4 deletions(-) New commits: commit 080afd6a345e5dffd924100b5a3ff9c028f5b094 Author: Miklos Vajna AuthorDate: Wed May 22 08:47:32 2024 +0200 Commit: Miklos Vajna CommitDate: Wed May 22 10:27:36 2024 +0200 Related: tdf#145972 sw images: fix rounding error in relative size calculation Open the bugdoc, see that the image is roughly half of the page width, right click, properties, UI shows that the width of the image is 5% of the width of the entire page. This only happens if tools -> options -> writer -> general sets the UI units to points, the default cm case is fine. This went wrong with commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (sw image dialog: fix fallback width/height for images with relative sizes, 2022-03-17), because the layout size started to matter more after that commit. This lead to the nWidth != m_xWidthED->get_value(FieldUnit::TWIP) check in SwFramePage::Init() to be true, because 11906 * 0.48 is 5714.88, so you got 5714 in the layout, but got 5715 with rounding in SwFramePage::Reset() (which tries to calc the page width based on the 48% and the fly width). And once we had that mismatch, we went down the wrong path. Fix the problem by using rtl::math::round() in SwFlyFrame::CalcRel(), so the relative width twips value is 5715 everywhere: once we have consisteny, the UI value is correct, too. Note that the original bugdoc needs more fixing, this just fixes the bugdoc where KeepRatio is false. Change-Id: I1e8782c95a0cf9d97375c36d41134735c01f3e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167916 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/core/layout/data/fly-rel-width-rounding.odt b/sw/qa/core/layout/data/fly-rel-width-rounding.odt new file mode 100644 index ..b70b9e51a917 Binary files /dev/null and b/sw/qa/core/layout/data/fly-rel-width-rounding.odt differ diff --git a/sw/qa/core/layout/fly.cxx b/sw/qa/core/layout/fly.cxx index 47cfb40fa6e7..81df20af3b35 100644 --- a/sw/qa/core/layout/fly.cxx +++ b/sw/qa/core/layout/fly.cxx @@ -86,6 +86,31 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyNegativeHeight) } } } + +CPPUNIT_TEST_FIXTURE(Test, testFlyRelWithRounding) +{ +// Given a document where page width is 21.001cm (11906 twips), and the image width is 48% of +// the page width: +createSwDoc("fly-rel-width-rounding.odt"); + +// When laying out that document: +SwDoc* pDoc = getSwDoc(); +SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + +// Then make sure that we calculate the width of the fly correctly: +auto pPage = pLayout->GetLower()->DynCastPageFrame(); +CPPUNIT_ASSERT(pPage->GetSortedObjs()); +SwSortedObjs& rPageObjs = *pPage->GetSortedObjs(); +CPPUNIT_ASSERT_EQUAL(static_cast(1), rPageObjs.size()); +auto pFly = rPageObjs[0]->DynCastFlyFrame()->DynCastFlyAtContentFrame(); +CPPUNIT_ASSERT(pFly); +tools::Long nFlyWidth = pFly->getFrameArea().Width(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 5715 +// - Actual : 5714 +// i.e. 5714.88 was truncated, not rounded. +CPPUNIT_ASSERT_EQUAL(static_cast(5715), nFlyWidth); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 549681ca7227..a3c9ac84e7c2 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -2845,9 +2846,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize ) const } if ( rSz.GetWidthPercent() && rSz.GetWidthPercent() != SwFormatFrameSize::SYNCED ) -aRet.setWidth( nRelWidth * rSz.GetWidthPercent() / 100 ); +aRet.setWidth(rtl::math::round(double(nRelWidth) * rSz.GetWidthPercent() / 100)); if ( rSz.GetHeightPercent() && rSz.GetHeightPercent() != SwFormatFrameSize::SYNCED ) -aRet.setHeight( nRelHeight * rSz.GetHeightPercent() / 100 ); +aRet.setHeight(rtl::math::round(double(nRelHeight) * rSz.GetHeightPercent() / 100)); if ( rSz.GetHeight() && rSz.GetWidthPercent() == SwFormatFrameSize::SYNCED ) { diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx index 1679af04bc1f..f95e07e42578 100644 --- a/xmloff/qa/unit/text.cxx +++ b/xmloff/qa/unit/text.cxx @@ -508,11 +508,11 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRelat
core.git: include/svx svx/source
include/svx/svdundo.hxx |2 +- svx/source/svdraw/svdundo.cxx | 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit f2ba39c5e7ae28a832e707667a0a61736f65ebda Author: Miklos Vajna AuthorDate: Tue May 21 08:32:27 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 21 13:05:42 2024 +0200 svx: prefix members of SdrUndoDelPage See tdf#94879 for motivation. Change-Id: I6ef4ca1df66f22e4fb6a13a7b39ca0152484fd6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167883 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 5af5c584eda1..e1b778064e6d 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -594,7 +594,7 @@ class SVXCORE_DLLPUBLIC SdrUndoDelPage final : public SdrUndoPageList { // When deleting a MasterPage, we remember all relations of the // Character Page with the MasterPage in this UndoGroup. -std::unique_ptr pUndoGroup; +std::unique_ptr m_pUndoGroup; std::unique_ptr mpFillBitmapItem; bool mbHasFillBitmap; diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 1b52ee945957..bec090c6339c 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1408,12 +1408,12 @@ SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) if(mxPage.get() == ) { -if(!pUndoGroup) +if(!m_pUndoGroup) { -pUndoGroup.reset( new SdrUndoGroup(m_rMod) ); +m_pUndoGroup.reset( new SdrUndoGroup(m_rMod) ); } - pUndoGroup->AddAction(m_rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage)); + m_pUndoGroup->AddAction(m_rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage)); } } } @@ -1428,10 +1428,10 @@ void SdrUndoDelPage::Undo() if (bool(mpFillBitmapItem)) restoreFillBitmap(); ImpInsertPage(nPageNum); -if (pUndoGroup!=nullptr) +if (m_pUndoGroup!=nullptr) { // recover master page relationships -pUndoGroup->Undo(); +m_pUndoGroup->Undo(); } }
core.git: sw/qa sw/source
sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx | 26 ++ sw/qa/writerfilter/cppunittests/filter/data/inline-endnote-and-footnote.docx |binary sw/source/writerfilter/filter/WriterFilter.cxx | 1 3 files changed, 27 insertions(+) New commits: commit 1ae5ea3f78cca11ba18f2dd1a06f875263336a3b Author: Miklos Vajna AuthorDate: Tue May 21 08:15:53 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 21 10:42:40 2024 +0200 tdf#160984 sw continuous endnotes: enable DOCX import This was working for DOC already. For DOCX, this was already enabled once with commit f9982c24066d6dd2f938cc20176af0f196bc018f (tdf#58521 DOCX import: enable ContinuousEndnotes compat flag, 2021-07-13), but then it was reverted later with commit commit eeda1b35a6e87d5349545464da33d997c52f15e3 (Revert "tdf#58521 DOCX import: enable ContinuousEndnotes compat flag", 2021-08-10), because of tdf#143456. Enable it again, now that the section-based layout seems good enough to handle larger number of endnotes, e.g. the 48 endnotes from tdf#143456. Change-Id: Id221f31f9208e84db2c358546d4d6ceea991b6b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167881 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx b/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx index 10b8cab57a45..e084f0fa52ee 100644 --- a/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx +++ b/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx @@ -50,6 +50,32 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjs) // i.e. the shape was on the left margin. CPPUNIT_ASSERT_GREATER(nBodyRight, nShapeLeft); } + +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnoteDOCX) +{ +// Given a DOCX file with an endnote and then a footnote: +loadFromFile(u"inline-endnote-and-footnote.docx"); + +// When laying out that document: +uno::Reference xModel(mxComponent, uno::UNO_QUERY); +css::uno::Reference xDumper(xModel->getCurrentController(), uno::UNO_QUERY); +OString aDump = xDumper->dump("layout").toUtf8(); +auto pCharBuffer = reinterpret_cast(aDump.getStr()); +xmlDocUniquePtr pXmlDoc(xmlParseDoc(pCharBuffer)); + +// Then make sure the footnote is below the endnote: +// Without the accompanying fix in place, this test would have failed with: +// - xpath should match exactly 1 node +// i.e. the endnote was also in the footnote container, not at the end of the body text. +sal_Int32 nEndnoteTop += getXPath(pXmlDoc, "/root/page/body/section/column/ftncont/ftn/infos/bounds"_ostr, + "top"_ostr) + .toInt32(); +sal_Int32 nFootnoteTop += getXPath(pXmlDoc, "/root/page/ftncont/ftn/infos/bounds"_ostr, "top"_ostr).toInt32(); +// Endnote at the end of body text, footnote at page bottom. +CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/writerfilter/cppunittests/filter/data/inline-endnote-and-footnote.docx b/sw/qa/writerfilter/cppunittests/filter/data/inline-endnote-and-footnote.docx new file mode 100644 index ..84343b8afa45 Binary files /dev/null and b/sw/qa/writerfilter/cppunittests/filter/data/inline-endnote-and-footnote.docx differ diff --git a/sw/source/writerfilter/filter/WriterFilter.cxx b/sw/source/writerfilter/filter/WriterFilter.cxx index 742ae2bbeee2..ee8131f95ae3 100644 --- a/sw/source/writerfilter/filter/WriterFilter.cxx +++ b/sw/source/writerfilter/filter/WriterFilter.cxx @@ -333,6 +333,7 @@ void WriterFilter::setTargetDocument(const uno::Reference& xDo // rely on default for HyphenateURLs=false // rely on default for APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH=true xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true)); +xSettings->setPropertyValue("ContinuousEndnotes", uno::Any(true)); } void WriterFilter::setSourceDocument(const uno::Reference& xDoc)
core.git: Branch 'distro/collabora/co-24.04' - desktop/source
desktop/source/lib/init.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 63ba90e6aea1554d6ee2d50b9439312a4b7ee483 Author: Miklos Vajna AuthorDate: Fri May 17 13:54:26 2024 +0200 Commit: Caolán McNamara CommitDate: Fri May 17 15:24:31 2024 +0200 desktop: fix warning C4100: 'pThis': unreferenced formal parameter SAL_UNUSED_PARAMETER expands to nothing in the Windows case, though not sure why this started to matter only now. Change-Id: I7f7369c650af0585cb742c1fb4e7a111e270df63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167775 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8edd138cc907..a61eb3ff0879 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7289,7 +7289,7 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p } } -static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, const bool readOnly) +static void doc_setViewReadOnly(LibreOfficeKitDocument* /*pThis*/, int nId, const bool readOnly) { comphelper::ProfileZone aZone("doc_setViewReadOnly"); @@ -7299,7 +7299,7 @@ static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pTh SfxLokHelper::setViewReadOnly(nId, readOnly); } -static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, const bool allow) +static void doc_setAllowChangeComments(LibreOfficeKitDocument* /*pThis*/, int nId, const bool allow) { comphelper::ProfileZone aZone("doc_setAllowChangeComments");
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/filter/ww8/ww8.cxx |7 ++- sw/source/core/inc/frame.hxx |3 +++ sw/source/core/layout/findfrm.cxx | 11 +++ sw/source/filter/ww8/ww8par.cxx |7 --- 4 files changed, 20 insertions(+), 8 deletions(-) New commits: commit 135e86e7e3bafdb0ab39a372a989854eefefe30c Author: Miklos Vajna AuthorDate: Thu May 16 08:46:36 2024 +0200 Commit: Caolán McNamara CommitDate: Fri May 17 12:03:49 2024 +0200 tdf#160984 sw continuous endnotes, DOC import: enable this unconditionally DOC files with <= 2 endnotes were imported fine, but not if they had more endnotes. This was added in commit dc11f5b151e1a2ea2623fc8cf806a400763955d9 (tdf#143445 DOC import: limit the usage of the CONTINUOUS_ENDNOTES compat flag, 2023-05-23), because mapping endnotes to footnotes was a dead-end. The limitation can be dropped: I checked that the tdf#143445 bugdoc with all its 72 endnotes is laid out reasonably. Also add a new SwFrame::DynCastColumnFrame() to easily get a column frame from a frame using our own RTTI, if we have it anyway. (cherry picked from commit d74fb6b571304b41c13b7a6dcdd2b853bfca7210) Change-Id: If7fd856f5dc5f1feb1366fca69a2ad6b3602044d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167763 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index af19051a03e5..4cbbfe5fbf31 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -30,6 +30,8 @@ #include #include #include +#include +#include namespace { @@ -298,7 +300,10 @@ CPPUNIT_TEST_FIXTURE(Test, test3Endnotes) SwDoc* pDoc = getSwDoc(); SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); SwPageFrame* pPage = pLayout->GetLastPage(); -SwFootnoteContFrame* pFootnoteCont = pPage->FindFootnoteCont(); +SwContentFrame* pLastContent = pPage->FindLastBodyContent(); +SwFrame* pSectionFrame = pLastContent->GetNext(); +auto pColumnFrame = pSectionFrame->GetLower()->DynCastColumnFrame(); +SwFootnoteContFrame* pFootnoteCont = pColumnFrame->FindFootnoteCont(); int nEndnotes = 0; for (SwFrame* pLower = pFootnoteCont->GetLower(); pLower; pLower = pLower->GetNext()) { diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index a86358508182..b662adc89086 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -40,6 +40,7 @@ namespace drawinglayer::processor2d { class BaseProcessor2D; } class SwLayoutFrame; class SwRootFrame; class SwPageFrame; +class SwColumnFrame; class SwBodyFrame; class SwFlyFrame; class SwSectionFrame; @@ -876,6 +877,8 @@ public: const SwTextFrame* DynCastTextFrame() const; SwPageFrame* DynCastPageFrame(); const SwPageFrame* DynCastPageFrame() const; +SwColumnFrame* DynCastColumnFrame(); +const SwColumnFrame* DynCastColumnFrame() const; inline bool IsNoTextFrame() const; // Frames where its PrtArea depends on their neighbors and that are // positioned in the content flow diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 378e451b9f89..4efa25e553e6 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -1973,4 +1974,14 @@ const SwPageFrame* SwFrame::DynCastPageFrame() const return IsPageFrame() ? static_cast(this) : nullptr; } +SwColumnFrame* SwFrame::DynCastColumnFrame() +{ +return IsColumnFrame() ? static_cast(this) : nullptr; +} + +const SwColumnFrame* SwFrame::DynCastColumnFrame() const +{ +return IsColumnFrame() ? static_cast(this) : nullptr; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index c88990a5f663..3f18c2058122 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5195,13 +5195,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) if( m_xWDop->nEdn ) aInfo.m_nFootnoteOffset = m_xWDop->nEdn - 1; m_rDoc.SetEndNoteInfo( aInfo ); - -if (m_xSBase->GetEndnoteCount() > 2) -{ -// This compatibility flag only works in easy cases, disable it for anything non-trivial -// for now. - m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::CONTINUOUS_ENDNOTES, false); -} } if (m_xWwFib->m_lcbPlcfhdd)
core.git: Branch 'libreoffice-24-2' - sw/qa sw/source
sw/qa/core/layout/calcmove.cxx | 24 +++ sw/qa/core/layout/data/ignore-top-margin-fly.odt |binary sw/source/core/layout/calcmove.cxx |6 + 3 files changed, 30 insertions(+) New commits: commit 9b508c45a7c30a5c1847b7d93f2a26a653102588 Author: Miklos Vajna AuthorDate: Fri May 17 08:07:23 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 17 11:00:10 2024 +0200 tdf#160952 sw: ignore top margin only at page top, not in fly See <https://gerrit.libreoffice.org/c/core/+/167671/2#message-8603b129dd8bd72608259571056ded950182ca96>, multi-column shape text can't appear in DOCX files, so collapsing upper spacing in that case is not correct, avoid it. Change-Id: Icf69c8d84fdd15d6e3289ff614b2f6ba7cee1e0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167758 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit b969e692000f50aafacc2eb577f545b8836dcc26) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167683 Reviewed-by: Michael Stahl diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index a44dc1256b83..ad53df9bd0f4 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -58,6 +58,30 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable) // i.e. the top margin in B1's first paragraph was ignored, but not in Word. CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin); } + +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginFly) +{ +// Given a document with compat flags like DOCX (>= Word 2013), 2 pages, multi-col fly frame on +// page 2: +createSwDoc("ignore-top-margin-fly.odt"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure that the top margin is not ignored inside shape text: +sal_Int32 nParaTopMargin += getXPath( + pXmlDoc, + "/root/page[2]/body/section/column[2]/body/txt/anchored/fly/column/body/txt/infos/prtBounds"_ostr, + "top"_ostr) + .toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 4000 +// - Actual : 0 +// i.e. the top margin was ignored inside shape text for Word compat, while multi-col shape text +// is a Writer feature. +CPPUNIT_ASSERT_EQUAL(static_cast(4000), nParaTopMargin); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/layout/data/ignore-top-margin-fly.odt b/sw/qa/core/layout/data/ignore-top-margin-fly.odt new file mode 100644 index ..51bda8fe40a9 Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-fly.odt differ diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 63c774c25cd6..f358d74af0bd 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1092,6 +1092,12 @@ bool SwFrame::IsCollapseUpper() const return false; } +if (IsInFly()) +{ +// Not in a page's body. +return false; +} + // Word >= 2013 style: when we're at the top of the page's body, but not on the first page, then // ignore the upper margin for paragraphs. if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())
core.git: sw/qa sw/source
sw/qa/core/layout/calcmove.cxx | 24 +++ sw/qa/core/layout/data/ignore-top-margin-fly.odt |binary sw/source/core/layout/calcmove.cxx |6 + 3 files changed, 30 insertions(+) New commits: commit b969e692000f50aafacc2eb577f545b8836dcc26 Author: Miklos Vajna AuthorDate: Fri May 17 08:07:23 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 17 09:21:37 2024 +0200 tdf#160952 sw: ignore top margin only at page top, not in fly See <https://gerrit.libreoffice.org/c/core/+/167671/2#message-8603b129dd8bd72608259571056ded950182ca96>, multi-column shape text can't appear in DOCX files, so collapsing upper spacing in that case is not correct, avoid it. Change-Id: Icf69c8d84fdd15d6e3289ff614b2f6ba7cee1e0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167758 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index a44dc1256b83..ad53df9bd0f4 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -58,6 +58,30 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable) // i.e. the top margin in B1's first paragraph was ignored, but not in Word. CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin); } + +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginFly) +{ +// Given a document with compat flags like DOCX (>= Word 2013), 2 pages, multi-col fly frame on +// page 2: +createSwDoc("ignore-top-margin-fly.odt"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure that the top margin is not ignored inside shape text: +sal_Int32 nParaTopMargin += getXPath( + pXmlDoc, + "/root/page[2]/body/section/column[2]/body/txt/anchored/fly/column/body/txt/infos/prtBounds"_ostr, + "top"_ostr) + .toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 4000 +// - Actual : 0 +// i.e. the top margin was ignored inside shape text for Word compat, while multi-col shape text +// is a Writer feature. +CPPUNIT_ASSERT_EQUAL(static_cast(4000), nParaTopMargin); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/layout/data/ignore-top-margin-fly.odt b/sw/qa/core/layout/data/ignore-top-margin-fly.odt new file mode 100644 index ..51bda8fe40a9 Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-fly.odt differ diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index ea27716aaeed..6e8112308002 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1092,6 +1092,12 @@ bool SwFrame::IsCollapseUpper() const return false; } +if (IsInFly()) +{ +// Not in a page's body. +return false; +} + // Word >= 2013 style: when we're at the top of the page's body, but not on the first page, then // ignore the upper margin for paragraphs. if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())
ESC meeting minutes: 2024-05-16
* Present: + Heiko, Olivier, Thorsten, Cloph, Hossein, Ilmari, Jonathan, Michael W, Xisco, Michael S, Caolan, Stephane, Miklos * Completed Action Items: + tdf#99528 Vertical tabs: invite Samuel next week if there are still burning fires (Heiko) + Samuel says not needed + revert for 24.8 if needed + unfortunately couldn't make it to the call (Thorsten) + the intention is to fix this, so it doesn't look broken + suggest to have a week before UI freeze to see where we are + original idea came from UX + afraid to wait for too long (Heiko) + if the change is controversial, agree (Thorsten) + if desirable: try to fix it + committed to put some effort into this + no very strong opinion on this + 4 high severity bugs for this topic so far (Xisco) + feels broken in its current state (Heiko) + except on gtk3 + suggest to review the state in 2 weeks and see the direction (Miklos) + like the idea + a recurring item (Xisco) + send welcome mail for Jonathan (Xisco) + enable the commit bit for Jonathan (Cloph) * Pending Action Items: * Release Engineering update (Cloph) + 24.2: 24.2.4 RC1 this week, today evening + 24.8: alpha was tagged earlier this week + feature freeze in 3 weeks + string / UI freeze 4 weeks after that + bug with Linux packaging: missing mapping, locally patched for now + if you have a late feature proposal, announce that here + MAR updater: + 2 channels? + keep on the old channel as long as possible? + update to the new channel as soon as possible? + stick to how the old update notification did it? + could also provide a dummy update to stop updates + context (Thorsten) + plan: 24.8 is enabled by default, without any user interaction + channel name is baked into the version + can tell people to edit some files + easiest is to decide on one policy and go with that + if we stop supporting a Windows version, there is no good option to do that + least bad: product is discontinued, then no obligation to have working LO there + perhaps update Windows requirement for 24.8, then we're good for the next few years + last time an ICU update triggered the Windows bump (Cloph) + concern: we ship an update then the new version can't be launched anymore + or only partially + if we stick to just 1 policy, then dummy update is a trick + if the update check sends OS info, it's easier + if single channel, which variant to use? (Cloph) + switch later, sooner, something in-between? + play it safe and start with the in-branch update first and only do major updates in the next cycle? + what browsers do (Hossein) + Chrome has 3 channels: stable, dev, canary + Firefox: minor versions (automatic) and then a major version (manually) + and now just similar to Chrome (automatic for all) + look at if this is relevant for us + browers always try to get to the latest (Thorsten) + for us: when a major update the least distruptive + can decide later when to cross-update (Cloph) + mid-cycle or when EOL is reached? + care about: the expecation is that EOL version is automatically updated (Thorsten) + stop running unmaintained, insecure software + run update in the background, then user decides if update now or later? (Hossein) + strongly feel against the idea of keep running insecure version (Thorsten) + default should be to update (unless you go via tools -> options) + agree, default to update is good (Hossein) + include OS info in the user agent? (Cloph) + like the idea (Thorsten) AI: do this or file a bug to do it (Cloph) * Documentation (Olivier) + Helpcontent2 + Help for RANDARRAY (ohallot, fito, Balasz) + Updates and fixes (ohallot) + Extended tips + Calc option view page (D. Maddern) + Guides + Work in progress. + IMpress 24.2 soon to be announced + Bugzilla Documentation statistics 257(257) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 12(-2) 46(7) 107(0) 220(-5) commented 12(-8) 70(9) 245(-10) 837(-17) resolved 6(-1) 28(5) 57(3) 123(2) + top 10 contributors: Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 year
ESC meeting minutes: 2024-05-16
* Present: + Heiko, Olivier, Thorsten, Cloph, Hossein, Ilmari, Jonathan, Michael W, Xisco, Michael S, Caolan, Stephane, Miklos * Completed Action Items: + tdf#99528 Vertical tabs: invite Samuel next week if there are still burning fires (Heiko) + Samuel says not needed + revert for 24.8 if needed + unfortunately couldn't make it to the call (Thorsten) + the intention is to fix this, so it doesn't look broken + suggest to have a week before UI freeze to see where we are + original idea came from UX + afraid to wait for too long (Heiko) + if the change is controversial, agree (Thorsten) + if desirable: try to fix it + committed to put some effort into this + no very strong opinion on this + 4 high severity bugs for this topic so far (Xisco) + feels broken in its current state (Heiko) + except on gtk3 + suggest to review the state in 2 weeks and see the direction (Miklos) + like the idea + a recurring item (Xisco) + send welcome mail for Jonathan (Xisco) + enable the commit bit for Jonathan (Cloph) * Pending Action Items: * Release Engineering update (Cloph) + 24.2: 24.2.4 RC1 this week, today evening + 24.8: alpha was tagged earlier this week + feature freeze in 3 weeks + string / UI freeze 4 weeks after that + bug with Linux packaging: missing mapping, locally patched for now + if you have a late feature proposal, announce that here + MAR updater: + 2 channels? + keep on the old channel as long as possible? + update to the new channel as soon as possible? + stick to how the old update notification did it? + could also provide a dummy update to stop updates + context (Thorsten) + plan: 24.8 is enabled by default, without any user interaction + channel name is baked into the version + can tell people to edit some files + easiest is to decide on one policy and go with that + if we stop supporting a Windows version, there is no good option to do that + least bad: product is discontinued, then no obligation to have working LO there + perhaps update Windows requirement for 24.8, then we're good for the next few years + last time an ICU update triggered the Windows bump (Cloph) + concern: we ship an update then the new version can't be launched anymore + or only partially + if we stick to just 1 policy, then dummy update is a trick + if the update check sends OS info, it's easier + if single channel, which variant to use? (Cloph) + switch later, sooner, something in-between? + play it safe and start with the in-branch update first and only do major updates in the next cycle? + what browsers do (Hossein) + Chrome has 3 channels: stable, dev, canary + Firefox: minor versions (automatic) and then a major version (manually) + and now just similar to Chrome (automatic for all) + look at if this is relevant for us + browers always try to get to the latest (Thorsten) + for us: when a major update the least distruptive + can decide later when to cross-update (Cloph) + mid-cycle or when EOL is reached? + care about: the expecation is that EOL version is automatically updated (Thorsten) + stop running unmaintained, insecure software + run update in the background, then user decides if update now or later? (Hossein) + strongly feel against the idea of keep running insecure version (Thorsten) + default should be to update (unless you go via tools -> options) + agree, default to update is good (Hossein) + include OS info in the user agent? (Cloph) + like the idea (Thorsten) AI: do this or file a bug to do it (Cloph) * Documentation (Olivier) + Helpcontent2 + Help for RANDARRAY (ohallot, fito, Balasz) + Updates and fixes (ohallot) + Extended tips + Calc option view page (D. Maddern) + Guides + Work in progress. + IMpress 24.2 soon to be announced + Bugzilla Documentation statistics 257(257) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 12(-2) 46(7) 107(0) 220(-5) commented 12(-8) 70(9) 245(-10) 837(-17) resolved 6(-1) 28(5) 57(3) 123(2) + top 10 contributors: Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 year
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/data/inline-endnote-and-section.odt |binary sw/qa/core/layout/ftnfrm.cxx | 18 ++ sw/source/core/layout/ftnfrm.cxx | 16 +++- 3 files changed, 33 insertions(+), 1 deletion(-) New commits: commit a8216967ebe242c379b7df1267836c4ec5a566a4 Author: Miklos Vajna AuthorDate: Wed May 15 13:25:13 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 16 16:02:17 2024 +0200 tdf#161083 sw continuous endnotes: fix layout with a section at doc end Open the bugdoc, notice warnings like: warn:legacy.osl:15059:15059:sw/source/core/layout/wsfrm.cxx:910: Frame tree is inconsistent. Which means we try to insert the new section frame under body frame, but the insert point is behind a frame which is not a direct child of the body frame. This went wrong in commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a (tdf#160984 sw continuous endnotes: switch to a section-based layout, 2024-05-14), where I didn't consider the case of having a continuous section break at the Word doc end, which maps to a section frame before the section frame of the endnotes in Writer. Fix the problem by walking up the parent chain till we find the last direct child of the body frame, which is typically not required, except when having one or more (nested) section frames at the end of the document. Interestingly tdf#143456 had the same problem, which was the bugdoc to trigger the revert of the old continuous endnotes code for DOCX in eeda1b35a6e87d5349545464da33d997c52f15e3 (Revert "tdf#58521 DOCX import: enable ContinuousEndnotes compat flag", 2021-08-10). (cherry picked from commit 82dd81a9d2049ac95535880fc67c1867f90e1427) Change-Id: I664672b91087217008a42120e8201c39e2a0a423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167728 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/sw/qa/core/layout/data/inline-endnote-and-section.odt b/sw/qa/core/layout/data/inline-endnote-and-section.odt new file mode 100644 index ..4518904f6009 Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-and-section.odt differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index 71fd3fd67150..1cf31809e5a7 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -84,4 +84,22 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote) CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndSection) +{ +// Given a document ending with a section, ContinuousEndnotes is true: +createSwDoc("inline-endnote-and-section.odt"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure the endnote section is after the section at the end of the document, not +// inside it: +int nToplevelSections = countXPathNodes(pXmlDoc, "/root/page/body/section"_ostr); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2 +// - Actual : 1 +// and we even crashed on shutdown. +CPPUNIT_ASSERT_EQUAL(2, nToplevelSections); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 4be87ee57ccd..61a8385d51fc 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1560,7 +1560,21 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame *pRef, SwTextFootnote * { SwSection* pSwSection = pDoc->GetEndNoteInfo().GetSwSection(*pDoc); pEndnoteSection = new SwSectionFrame(*pSwSection, pPage); -pEndnoteSection->InsertBehind(pPage->FindBodyCont(), pPage->FindLastBodyContent()); +SwLayoutFrame* pParent = pPage->FindBodyCont(); +SwFrame* pBefore = pPage->FindLastBodyContent(); +while (pBefore) +{ +// Check if the last content frame is directly under the body frame or there is +// something in-between, e.g. a section frame. +if (pBefore->GetUpper() == pParent) +{ +break; +} + +// If so, insert behind the parent of the content frame, not inside the parent. +pBefore = pBefore->GetUpper(); +} +pEndnoteSection->InsertBehind(pParent, pBefore); pEndnoteSection->Init(); pEndnoteSection->SetEndNoteSection(true); }
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/data/inline-endnote-and-footnote.doc |binary sw/qa/core/layout/ftnfrm.cxx | 21 +++ sw/source/core/layout/flowfrm.cxx | 37 - sw/source/core/layout/ftnfrm.cxx | 45 ++--- sw/source/core/text/txtftn.cxx | 10 --- 5 files changed, 83 insertions(+), 30 deletions(-) New commits: commit ad3586d6c6b03d588a45610e1f091f83b16b83a2 Author: Miklos Vajna AuthorDate: Tue May 14 08:28:33 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 16 15:57:41 2024 +0200 tdf#160984 sw continuous endnotes: switch to a section-based layout The original layout added in commit 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add ContinuousEndnotes layout compat option, 2019-09-30) puts endnotes to the footnote container on the last page, which fixes the page count but the endnote position is wrong: should be after the body text, not at the bottom of the page. Now that we can have an endnote section (with one or more section frames at a layout level), we have a container that can span over multiple pages, is at the end of the document and is inline. Fix the bad position by: 1) Reverting the layout changes from the old approach, which gives us a bad position for the endnote. 2) Creating an endnote section frame on demand in SwFootnoteBossFrame::AppendFootnote(). 3) Moving part of the endnote to a next page works out of the box, but moving part of the endnote to a previous page needs explicit handling in SwFlowFrame::MoveBwd(), similar to how SwFrame::GetPrevSctLeaf() does this in the simple section case. This needs explicit handling, because the body frame of the endnote section is empty, all content goes to its endnote container. Note that this just reimplements the compat flag, but its enablement (only for DOC import, only for <= 2 endnotes) stays unchanged for now. (cherry picked from commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a) Change-Id: I8b271895aeff378418aed8705fe6b99a69232bd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167727 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/qa/core/layout/data/inline-endnote-and-footnote.doc b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc new file mode 100644 index ..39c5636e1e12 Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index 4c874202da3f..71fd3fd67150 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -63,4 +63,25 @@ CPPUNIT_TEST_FIXTURE(Test, testFlySplitFootnoteLayout) CPPUNIT_ASSERT(pPage->FindFootnoteCont()); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote) +{ +// Given a DOC file with an endnote and then a footnote: +createSwDoc("inline-endnote-and-footnote.doc"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure the footnote is below the endnote: +// Without the accompanying fix in place, this test would have failed with: +// - xpath should match exactly 1 node +// i.e. the endnote was also in the footnote container, not at the end of the body text. +sal_Int32 nEndnoteTop += parseDump("/root/page/body/section/column/ftncont/ftn/infos/bounds"_ostr, "top"_ostr) + .toInt32(); +sal_Int32 nFootnoteTop += parseDump("/root/page/ftncont/ftn/infos/bounds"_ostr, "top"_ostr).toInt32(); +// Endnote at the end of body text, footnote at page bottom. +CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 37fd20b323d7..1cb5cf7bf47a 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2257,18 +2257,47 @@ bool SwFlowFrame::MoveBwd( bool ) const bool bEndnote = pFootnote->GetAttr()->GetFootnote().IsEndNote(); const IDocumentSettingAccess& rSettings = pFootnote->GetAttrSet()->GetDoc()->getIDocumentSettingAccess(); -if( bEndnote && pFootnote->IsInSct() ) +bool bContEndnotes = rSettings.get(DocumentSettingId::CONTINUOUS_ENDNOTES); +if( bEndnote && pFootnote->IsInSct() && !bContEndnotes) { SwSectionFrame* pSect = pFootnote->FindSctFrame(); if( pSect->IsEndnAtEnd() ) // Endnotes at the end of the section. pRef = pSect->FindLastContent( SwFindMode::LastCnt
core.git: Branch 'libreoffice-24-2' - sw/qa sw/source
sw/qa/core/layout/calcmove.cxx | 19 +++ sw/qa/core/layout/data/ignore-top-margin-table.docx |binary sw/source/core/layout/calcmove.cxx |6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) New commits: commit ed4316d109841c31de49493092d82b40259e818a Author: Miklos Vajna AuthorDate: Tue May 14 13:49:51 2024 +0200 Commit: Michael Stahl CommitDate: Thu May 16 09:40:52 2024 +0200 tdf#160952 sw: ignore top margin only at page top, not e.g. table top The bugdoc has a table at the top of the 2nd page and we ignored the top margin inside the table cell (for the first paragraph), while this doesn't happen in Word. As mentioned at <https://gerrit.libreoffice.org/c/core/+/167221/3#message-c03abf8e8e3cd20d49006058e6b3eb130585ff8f>, the old code assumed "top of the page" for all frames not having a previous frame, while that code was only tested with text frames directly in the body frame of a page frame. Fix the problem by limiting this "collapse upper spacing" behavior to frames directly in body frames. This keeps the old bugdoc working, but is meant to restore the old, wanted behavior in other cases like e.g. in table cells. If later it's discovered that upper spacing collapsing is wanted in other contexts, those are best added on a case by case basis. Change-Id: Ieb93facd8b2e7f6412fd20873c10ce6c8b775619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167631 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit 6025ac371bd5cd07c0af550d78db323ad394173b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167671 Reviewed-by: Michael Stahl diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index 3e4deec52ae8..a44dc1256b83 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -39,6 +39,25 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin) // i.e. the top margin in the first para of a non-first page wasn't ignored, like in Word. CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin); } + +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable) +{ +// Given a DOCX (>= Word 2013) file, with 2 pages: +// When loading that document: +createSwDoc("ignore-top-margin-table.docx"); + +// Then make sure that the paragraph on the 2nd page in B1 has a top margin: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +sal_Int32 nParaTopMargin += getXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt/infos/prtBounds"_ostr, + "top"_ostr) + .toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2000 +// - Actual : 0 +// i.e. the top margin in B1's first paragraph was ignored, but not in Word. +CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/layout/data/ignore-top-margin-table.docx b/sw/qa/core/layout/data/ignore-top-margin-table.docx new file mode 100644 index ..c82f6d63c13f Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-table.docx differ diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 081472b98ee3..63c774c25cd6 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1092,9 +1092,9 @@ bool SwFrame::IsCollapseUpper() const return false; } -// Word >= 2013 style: when we're at the top of the page, but not on the first page, then ignore -// the upper margin for paragraphs. -if (GetPrev()) +// Word >= 2013 style: when we're at the top of the page's body, but not on the first page, then +// ignore the upper margin for paragraphs. +if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame()) { return false; }
core.git: sw/qa
sw/qa/extras/rtfexport/rtfexport7.cxx | 1348 -- 1 file changed, 822 insertions(+), 526 deletions(-) New commits: commit 55eb6fc8b83fe2f846a4f7448271a5b0fe03fbfc Author: Miklos Vajna AuthorDate: Thu May 16 08:00:20 2024 +0200 Commit: Miklos Vajna CommitDate: Thu May 16 08:48:06 2024 +0200 CppunitTest_sw_rtfexport7: avoid DECLARE_RTFEXPORT_TEST No need to go via Writer-specific macros here. Change-Id: Ib8badf6c7a75ee58bace05dfc3ef8732fd8bc264 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167719 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx b/sw/qa/extras/rtfexport/rtfexport7.cxx index d0803d6bcb74..57162cf30df1 100644 --- a/sw/qa/extras/rtfexport/rtfexport7.cxx +++ b/sw/qa/extras/rtfexport/rtfexport7.cxx @@ -43,29 +43,41 @@ public: } }; -DECLARE_RTFEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.rtf") +CPPUNIT_TEST_FIXTURE(Test, testPictureWrapPolygon) { -// The problem was that the wrap polygon was ignored during import. -drawing::PointSequenceSequence aSeqSeq -= getProperty(getShape(1), "ContourPolyPolygon"); -// This was 0: the polygon list was empty. -CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength()); - -drawing::PointSequence aSeq = aSeqSeq[0]; -CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength()); - -// The shape also didn't have negative top / left coordinates. -CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-1177)), - getProperty(getShape(1), "HoriOrientPosition")); -CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)), - getProperty(getShape(1), "VertOrientPosition")); +auto verify = [this]() { +// The problem was that the wrap polygon was ignored during import. +drawing::PointSequenceSequence aSeqSeq += getProperty(getShape(1), "ContourPolyPolygon"); +// This was 0: the polygon list was empty. +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength()); + +drawing::PointSequence aSeq = aSeqSeq[0]; +CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength()); + +// The shape also didn't have negative top / left coordinates. +CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-1177)), + getProperty(getShape(1), "HoriOrientPosition")); +CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)), + getProperty(getShape(1), "VertOrientPosition")); +}; +createSwDoc("picture-wrap-polygon.rtf"); +verify(); +saveAndReload(mpFilter); +verify(); } -DECLARE_RTFEXPORT_TEST(testTdf113408, "tdf113408.rtf") +CPPUNIT_TEST_FIXTURE(Test, testTdf113408) { -// This was 0, left margin was not inherited from style properly. -CPPUNIT_ASSERT_EQUAL(static_cast(1270), - getProperty(getParagraph(1), "ParaLeftMargin")); +auto verify = [this]() { +// This was 0, left margin was not inherited from style properly. +CPPUNIT_ASSERT_EQUAL(static_cast(1270), + getProperty(getParagraph(1), "ParaLeftMargin")); +}; +createSwDoc("tdf113408.rtf"); +verify(); +saveAndReload(mpFilter); +verify(); } CPPUNIT_TEST_FIXTURE(Test, testAbi10039) @@ -85,30 +97,42 @@ CPPUNIT_TEST_FIXTURE(Test, testAbi10076) // Just make sure that we don't crash after exporting a fully calculated layout. } -DECLARE_RTFEXPORT_TEST(testEm, "em.rtf") +CPPUNIT_TEST_FIXTURE(Test, testEm) { -// Test all possible cc* control words. -CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE, - getProperty(getRun(getParagraph(1), 1), "CharEmphasis")); -CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE, - getProperty(getRun(getParagraph(1), 2), "CharEmphasis")); -CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::ACCENT_ABOVE, - getProperty(getRun(getParagraph(1), 3), "CharEmphasis")); -// This was missing. -CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::CIRCLE_ABOVE, - getProperty(getRun(getParagraph(1), 4), "CharEmphasis")); -// This one, too. -CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_BELOW, - getProperty(getRun(getParagraph(1), 5), "CharEmphasis")); +auto verify = [this]() { +// Test all possible cc* control words. +CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE, + getProperty(getRun(getParagraph(1), 1), "CharEmphasis")); +CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE, + getProperty(getRun(getParagraph(1), 2), "Cha
core.git: sw/qa sw/source
sw/qa/core/layout/data/inline-endnote-and-section.odt |binary sw/qa/core/layout/ftnfrm.cxx | 18 ++ sw/source/core/layout/ftnfrm.cxx | 16 +++- 3 files changed, 33 insertions(+), 1 deletion(-) New commits: commit 82dd81a9d2049ac95535880fc67c1867f90e1427 Author: Miklos Vajna AuthorDate: Wed May 15 13:25:13 2024 +0200 Commit: Miklos Vajna CommitDate: Wed May 15 16:54:05 2024 +0200 tdf#161083 sw continuous endnotes: fix layout with a section at doc end Open the bugdoc, notice warnings like: warn:legacy.osl:15059:15059:sw/source/core/layout/wsfrm.cxx:910: Frame tree is inconsistent. Which means we try to insert the new section frame under body frame, but the insert point is behind a frame which is not a direct child of the body frame. This went wrong in commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a (tdf#160984 sw continuous endnotes: switch to a section-based layout, 2024-05-14), where I didn't consider the case of having a continuous section break at the Word doc end, which maps to a section frame before the section frame of the endnotes in Writer. Fix the problem by walking up the parent chain till we find the last direct child of the body frame, which is typically not required, except when having one or more (nested) section frames at the end of the document. Interestingly tdf#143456 had the same problem, which was the bugdoc to trigger the revert of the old continuous endnotes code for DOCX in eeda1b35a6e87d5349545464da33d997c52f15e3 (Revert "tdf#58521 DOCX import: enable ContinuousEndnotes compat flag", 2021-08-10). Change-Id: I664672b91087217008a42120e8201c39e2a0a423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167691 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/core/layout/data/inline-endnote-and-section.odt b/sw/qa/core/layout/data/inline-endnote-and-section.odt new file mode 100644 index ..4518904f6009 Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-and-section.odt differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index 71fd3fd67150..1cf31809e5a7 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -84,4 +84,22 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote) CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndSection) +{ +// Given a document ending with a section, ContinuousEndnotes is true: +createSwDoc("inline-endnote-and-section.odt"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure the endnote section is after the section at the end of the document, not +// inside it: +int nToplevelSections = countXPathNodes(pXmlDoc, "/root/page/body/section"_ostr); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2 +// - Actual : 1 +// and we even crashed on shutdown. +CPPUNIT_ASSERT_EQUAL(2, nToplevelSections); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index e03519ed3040..b7851a131e44 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1585,7 +1585,21 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame *pRef, SwTextFootnote * { SwSection* pSwSection = pDoc->GetEndNoteInfo().GetSwSection(*pDoc); pEndnoteSection = new SwSectionFrame(*pSwSection, pPage); -pEndnoteSection->InsertBehind(pPage->FindBodyCont(), pPage->FindLastBodyContent()); +SwLayoutFrame* pParent = pPage->FindBodyCont(); +SwFrame* pBefore = pPage->FindLastBodyContent(); +while (pBefore) +{ +// Check if the last content frame is directly under the body frame or there is +// something in-between, e.g. a section frame. +if (pBefore->GetUpper() == pParent) +{ +break; +} + +// If so, insert behind the parent of the content frame, not inside the parent. +pBefore = pBefore->GetUpper(); +} +pEndnoteSection->InsertBehind(pParent, pBefore); pEndnoteSection->Init(); pEndnoteSection->SetEndNoteSection(true); }
ESC meeting agenda: 2024-05-16 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + tdf#99528 Vertical tabs: invite Samuel next week if there are still burning fires (Heiko) + send welcome mail for Jonathan (Xisco) + enable the commit bit for Jonathan (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC1 this week? + 24.8: feature freeze in 3 weeks + string / UI freeze 4 weeks after that + if you have a late feature proposal, announce that here * Documentation (Olivier) + Bugzilla Documentation statistics 257(257) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 12(-2) 46(7) 107(0) 220(-5) commented 12(-8) 70(9) 245(-10) 837(-17) resolved 6(-1) 28(5) 57(3) 123(2) + top 10 contributors: Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 year Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year nobu made 4 changes in 1 month, and 16 changes in 1 year Dieter made 3 changes in 1 month, and 8 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 39(39) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 7(3) 13(3) 18(3) 25(4) commented 60(-4) 206(20) 560(35)1757(-4) removed 0(0) 4(0) 5(0) 11(-1) resolved 8(0) 32(1) 80(1) 297(-11) + top 10 contributors: Heiko Tietze made 111 changes in 1 month, and 986 changes in 1 year Vernon, Stuart Foote made 105 changes in 1 month, and 329 changes in 1 year Eyal Rozenberg made 45 changes in 1 month, and 160 changes in 1 year Stéphane Guillou made 40 changes in 1 month, and 612 changes in 1 year Dieter made 32 changes in 1 month, and 147 changes in 1 year Cor Nouws made 21 changes in 1 month, and 32 changes in 1 year Ilmari Lauhakangas made 12 changes in 1 month, and 129 changes in 1 year Roman Kuznetsov made 9 changes in 1 month, and 45 changes in 1 year Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year Aron Budea made 6 changes in 1 month, and 22 changes in 1 year * Crash Testing (Caolan) + 25(+1) import failure, 19(-1) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.1.173(+0) + 24.2.1.214477(+739) + 24.2.2.210399(+1469) + 24.2.3.21437(+950) * Mentoring (Hossein) committer... 1 week 1 month 3 months 12 months open 89(8) 160(18) 160(-18) 160(-18) reviews 318(-132) 1250(44)3594(-124) 12458(-4) merged 310(-40)1244(104) 3423(54) 12714(121) abandoned 15(2)61(6) 174(2)661(5) own commits 227(-23) 913(86)2380(77) 9274(45) review commits 38(-13) 218(-6) 839(-32) 2994(-18) contributor... 1 week 1 month 3 months12 months open 55(18) 103(26) 103(0) 103(0) reviews 894(-68) 3050(276) 7930(24)29574(52) merged 15(-8) 86(-12)377(-8) 1583(-52) abandoned 0(-9) 33(-16)279(-9) 699(-5) own commits 14(-11) 97(-8) 429(-20)1114(-12) review commits 0(0)0(0)0(0) 0(0) + easyHack statistics: needsDevEval 8(8) needsUXEval 1(1) cleanup_comments 326(326) total 409(409) assigned 26(26) open 349(349) + top 10 contributors: Jakub Kościelak made 5 patches in 1 month, and 5 patches in 1 year made 4 patches in 1 month, and 7 patches in 1 year Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year Armin Le Grand (allotropia) made 4 patches in 1 month, and 86 patches in 1 year
ESC meeting agenda: 2024-05-16 16:00 CEST
Hi, The prototype agenda is below. Extra items are appreciated either in this document or as a reply to this mail: https://pad.documentfoundation.org/p/esc You can join using Jitsi here: https://jitsi.documentfoundation.org/esc Regards, Miklos --- * Present: + * Completed Action Items: * Pending Action Items: + tdf#99528 Vertical tabs: invite Samuel next week if there are still burning fires (Heiko) + send welcome mail for Jonathan (Xisco) + enable the commit bit for Jonathan (Cloph) * Release Engineering update (Cloph) + 24.2: 24.2.4 RC1 this week? + 24.8: feature freeze in 3 weeks + string / UI freeze 4 weeks after that + if you have a late feature proposal, announce that here * Documentation (Olivier) + Bugzilla Documentation statistics 257(257) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 12(-2) 46(7) 107(0) 220(-5) commented 12(-8) 70(9) 245(-10) 837(-17) resolved 6(-1) 28(5) 57(3) 123(2) + top 10 contributors: Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 year Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year nobu made 4 changes in 1 month, and 16 changes in 1 year Dieter made 3 changes in 1 month, and 8 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 39(39) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 7(3) 13(3) 18(3) 25(4) commented 60(-4) 206(20) 560(35)1757(-4) removed 0(0) 4(0) 5(0) 11(-1) resolved 8(0) 32(1) 80(1) 297(-11) + top 10 contributors: Heiko Tietze made 111 changes in 1 month, and 986 changes in 1 year Vernon, Stuart Foote made 105 changes in 1 month, and 329 changes in 1 year Eyal Rozenberg made 45 changes in 1 month, and 160 changes in 1 year Stéphane Guillou made 40 changes in 1 month, and 612 changes in 1 year Dieter made 32 changes in 1 month, and 147 changes in 1 year Cor Nouws made 21 changes in 1 month, and 32 changes in 1 year Ilmari Lauhakangas made 12 changes in 1 month, and 129 changes in 1 year Roman Kuznetsov made 9 changes in 1 month, and 45 changes in 1 year Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year Aron Budea made 6 changes in 1 month, and 22 changes in 1 year * Crash Testing (Caolan) + 25(+1) import failure, 19(-1) export failures + ??? coverity issues + Google / ossfuzz: ?? fuzzers active now * Crash Reporting (Xisco) + 24.2.1.173(+0) + 24.2.1.214477(+739) + 24.2.2.210399(+1469) + 24.2.3.21437(+950) * Mentoring (Hossein) committer... 1 week 1 month 3 months 12 months open 89(8) 160(18) 160(-18) 160(-18) reviews 318(-132) 1250(44)3594(-124) 12458(-4) merged 310(-40)1244(104) 3423(54) 12714(121) abandoned 15(2)61(6) 174(2)661(5) own commits 227(-23) 913(86)2380(77) 9274(45) review commits 38(-13) 218(-6) 839(-32) 2994(-18) contributor... 1 week 1 month 3 months12 months open 55(18) 103(26) 103(0) 103(0) reviews 894(-68) 3050(276) 7930(24)29574(52) merged 15(-8) 86(-12)377(-8) 1583(-52) abandoned 0(-9) 33(-16)279(-9) 699(-5) own commits 14(-11) 97(-8) 429(-20)1114(-12) review commits 0(0)0(0)0(0) 0(0) + easyHack statistics: needsDevEval 8(8) needsUXEval 1(1) cleanup_comments 326(326) total 409(409) assigned 26(26) open 349(349) + top 10 contributors: Jakub Kościelak made 5 patches in 1 month, and 5 patches in 1 year made 4 patches in 1 month, and 7 patches in 1 year Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year Armin Le Grand (allotropia) made 4 patches in 1 month, and 86 patches in 1 year
core.git: Branch 'distro/collabora/co-24.04' - sw/qa sw/source
sw/qa/core/layout/calcmove.cxx | 19 +++ sw/qa/core/layout/data/ignore-top-margin-table.docx |binary sw/source/core/layout/calcmove.cxx |6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) New commits: commit 07c93a65d2c8579adb100b7ae0c312e1872a1f37 Author: Miklos Vajna AuthorDate: Tue May 14 13:49:51 2024 +0200 Commit: Caolán McNamara CommitDate: Wed May 15 13:45:49 2024 +0200 tdf#160952 sw: ignore top margin only at page top, not e.g. table top The bugdoc has a table at the top of the 2nd page and we ignored the top margin inside the table cell (for the first paragraph), while this doesn't happen in Word. As mentioned at <https://gerrit.libreoffice.org/c/core/+/167221/3#message-c03abf8e8e3cd20d49006058e6b3eb130585ff8f>, the old code assumed "top of the page" for all frames not having a previous frame, while that code was only tested with text frames directly in the body frame of a page frame. Fix the problem by limiting this "collapse upper spacing" behavior to frames directly in body frames. This keeps the old bugdoc working, but is meant to restore the old, wanted behavior in other cases like e.g. in table cells. If later it's discovered that upper spacing collapsing is wanted in other contexts, those are best added on a case by case basis. (cherry picked from commit 6025ac371bd5cd07c0af550d78db323ad394173b) Change-Id: Ieb93facd8b2e7f6412fd20873c10ce6c8b775619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167690 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index 3e4deec52ae8..a44dc1256b83 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -39,6 +39,25 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin) // i.e. the top margin in the first para of a non-first page wasn't ignored, like in Word. CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin); } + +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable) +{ +// Given a DOCX (>= Word 2013) file, with 2 pages: +// When loading that document: +createSwDoc("ignore-top-margin-table.docx"); + +// Then make sure that the paragraph on the 2nd page in B1 has a top margin: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +sal_Int32 nParaTopMargin += getXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt/infos/prtBounds"_ostr, + "top"_ostr) + .toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2000 +// - Actual : 0 +// i.e. the top margin in B1's first paragraph was ignored, but not in Word. +CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/layout/data/ignore-top-margin-table.docx b/sw/qa/core/layout/data/ignore-top-margin-table.docx new file mode 100644 index ..c82f6d63c13f Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-table.docx differ diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 081472b98ee3..63c774c25cd6 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1092,9 +1092,9 @@ bool SwFrame::IsCollapseUpper() const return false; } -// Word >= 2013 style: when we're at the top of the page, but not on the first page, then ignore -// the upper margin for paragraphs. -if (GetPrev()) +// Word >= 2013 style: when we're at the top of the page's body, but not on the first page, then +// ignore the upper margin for paragraphs. +if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame()) { return false; }
core.git: sw/qa sw/source
sw/qa/core/layout/calcmove.cxx | 19 +++ sw/qa/core/layout/data/ignore-top-margin-table.docx |binary sw/source/core/layout/calcmove.cxx |6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) New commits: commit 6025ac371bd5cd07c0af550d78db323ad394173b Author: Miklos Vajna AuthorDate: Tue May 14 13:49:51 2024 +0200 Commit: Miklos Vajna CommitDate: Wed May 15 13:08:02 2024 +0200 tdf#160952 sw: ignore top margin only at page top, not e.g. table top The bugdoc has a table at the top of the 2nd page and we ignored the top margin inside the table cell (for the first paragraph), while this doesn't happen in Word. As mentioned at <https://gerrit.libreoffice.org/c/core/+/167221/3#message-c03abf8e8e3cd20d49006058e6b3eb130585ff8f>, the old code assumed "top of the page" for all frames not having a previous frame, while that code was only tested with text frames directly in the body frame of a page frame. Fix the problem by limiting this "collapse upper spacing" behavior to frames directly in body frames. This keeps the old bugdoc working, but is meant to restore the old, wanted behavior in other cases like e.g. in table cells. If later it's discovered that upper spacing collapsing is wanted in other contexts, those are best added on a case by case basis. Change-Id: Ieb93facd8b2e7f6412fd20873c10ce6c8b775619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167631 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index 3e4deec52ae8..a44dc1256b83 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -39,6 +39,25 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin) // i.e. the top margin in the first para of a non-first page wasn't ignored, like in Word. CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin); } + +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable) +{ +// Given a DOCX (>= Word 2013) file, with 2 pages: +// When loading that document: +createSwDoc("ignore-top-margin-table.docx"); + +// Then make sure that the paragraph on the 2nd page in B1 has a top margin: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +sal_Int32 nParaTopMargin += getXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt/infos/prtBounds"_ostr, + "top"_ostr) + .toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2000 +// - Actual : 0 +// i.e. the top margin in B1's first paragraph was ignored, but not in Word. +CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/layout/data/ignore-top-margin-table.docx b/sw/qa/core/layout/data/ignore-top-margin-table.docx new file mode 100644 index ..c82f6d63c13f Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-table.docx differ diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 50dd45579e4b..ea27716aaeed 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1092,9 +1092,9 @@ bool SwFrame::IsCollapseUpper() const return false; } -// Word >= 2013 style: when we're at the top of the page, but not on the first page, then ignore -// the upper margin for paragraphs. -if (GetPrev()) +// Word >= 2013 style: when we're at the top of the page's body, but not on the first page, then +// ignore the upper margin for paragraphs. +if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame()) { return false; }
core.git: sw/qa sw/source
sw/qa/core/layout/data/inline-endnote-and-footnote.doc |binary sw/qa/core/layout/ftnfrm.cxx | 21 +++ sw/source/core/layout/flowfrm.cxx | 37 - sw/source/core/layout/ftnfrm.cxx | 45 ++--- sw/source/core/text/txtftn.cxx | 10 --- 5 files changed, 83 insertions(+), 30 deletions(-) New commits: commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a Author: Miklos Vajna AuthorDate: Tue May 14 08:28:33 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 14 12:08:31 2024 +0200 tdf#160984 sw continuous endnotes: switch to a section-based layout The original layout added in commit 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add ContinuousEndnotes layout compat option, 2019-09-30) puts endnotes to the footnote container on the last page, which fixes the page count but the endnote position is wrong: should be after the body text, not at the bottom of the page. Now that we can have an endnote section (with one or more section frames at a layout level), we have a container that can span over multiple pages, is at the end of the document and is inline. Fix the bad position by: 1) Reverting the layout changes from the old approach, which gives us a bad position for the endnote. 2) Creating an endnote section frame on demand in SwFootnoteBossFrame::AppendFootnote(). 3) Moving part of the endnote to a next page works out of the box, but moving part of the endnote to a previous page needs explicit handling in SwFlowFrame::MoveBwd(), similar to how SwFrame::GetPrevSctLeaf() does this in the simple section case. This needs explicit handling, because the body frame of the endnote section is empty, all content goes to its endnote container. Note that this just reimplements the compat flag, but its enablement (only for DOC import, only for <= 2 endnotes) stays unchanged for now. Change-Id: I8b271895aeff378418aed8705fe6b99a69232bd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167616 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/core/layout/data/inline-endnote-and-footnote.doc b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc new file mode 100644 index ..39c5636e1e12 Binary files /dev/null and b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc differ diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx index 4c874202da3f..71fd3fd67150 100644 --- a/sw/qa/core/layout/ftnfrm.cxx +++ b/sw/qa/core/layout/ftnfrm.cxx @@ -63,4 +63,25 @@ CPPUNIT_TEST_FIXTURE(Test, testFlySplitFootnoteLayout) CPPUNIT_ASSERT(pPage->FindFootnoteCont()); } +CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote) +{ +// Given a DOC file with an endnote and then a footnote: +createSwDoc("inline-endnote-and-footnote.doc"); + +// When laying out that document: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + +// Then make sure the footnote is below the endnote: +// Without the accompanying fix in place, this test would have failed with: +// - xpath should match exactly 1 node +// i.e. the endnote was also in the footnote container, not at the end of the body text. +sal_Int32 nEndnoteTop += parseDump("/root/page/body/section/column/ftncont/ftn/infos/bounds"_ostr, "top"_ostr) + .toInt32(); +sal_Int32 nFootnoteTop += parseDump("/root/page/ftncont/ftn/infos/bounds"_ostr, "top"_ostr).toInt32(); +// Endnote at the end of body text, footnote at page bottom. +CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 37fd20b323d7..1cb5cf7bf47a 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2257,18 +2257,47 @@ bool SwFlowFrame::MoveBwd( bool ) const bool bEndnote = pFootnote->GetAttr()->GetFootnote().IsEndNote(); const IDocumentSettingAccess& rSettings = pFootnote->GetAttrSet()->GetDoc()->getIDocumentSettingAccess(); -if( bEndnote && pFootnote->IsInSct() ) +bool bContEndnotes = rSettings.get(DocumentSettingId::CONTINUOUS_ENDNOTES); +if( bEndnote && pFootnote->IsInSct() && !bContEndnotes) { SwSectionFrame* pSect = pFootnote->FindSctFrame(); if( pSect->IsEndnAtEnd() ) // Endnotes at the end of the section. pRef = pSect->FindLastContent( SwFindMode::LastCnt ); } -else if (bEndnote && rSettings.get(DocumentSettingId::CONTINUOUS_ENDNOTES)) +else if (
core.git: Branch 'libreoffice-24-2' - sw/CppunitTest_sw_core_layout.mk sw/qa sw/source
sw/CppunitTest_sw_core_layout.mk |1 sw/qa/core/layout/calcmove.cxx| 44 ++ sw/qa/core/layout/data/ignore-top-margin.docx |binary sw/source/core/inc/frame.hxx |3 + sw/source/core/layout/calcmove.cxx| 32 ++ sw/source/core/layout/flowfrm.cxx |5 ++ 6 files changed, 85 insertions(+) New commits: commit abd90828cf101581a07b9d1c371a8c3156521e9f Author: Miklos Vajna AuthorDate: Tue May 7 08:13:37 2024 +0200 Commit: Michael Stahl CommitDate: Tue May 14 11:15:21 2024 +0200 tdf#160952 sw: ignore top margin of para on non-first pages with newer DOCX The 2nd page of the bugdoc has a single paragraph, with a non-zero top margin. This is ignored in Word, but wasn't ignored in Writer. Experimenting with the document, it looks like old Word files also don't ignore this top margin: it started when the compat mode is upgraded (from binary DOC or Word 2010) to Word 2023 or newer. Also the top margin is only ignored for the first paragraph on the page, and only in case it's not on the first page. Fix the problem by introducing a new SwFrame::IsCollapseUpper() function to decide if the upper margin should be collapsed or not, and then by using it in SwFlowFrame::CalcUpperSpace() at one place where we read the top margin from the doc model. Take advantage of the fact that we have related, existing compat flags that tell us if we're in "Word >= 2013" compat mode: see e.g. GetFlyAnchorBottom(), which explains DocumentSettingId::TAB_OVER_MARGIN is a good indicator that this is a "Word <= 2010" document. Also, DocumentSettingId::TAB_OVER_SPACING is an indicator that this is a Word document, so we want the "TabOverSpacing && !TabOverMargin" case. This doesn't change all reads of the upper spacing of a text node, but is enough to avoid the unwanted top spacing, as demonstrated by the bugdoc. Change-Id: Ibdebdf5f0555256a0b6ed85d07079f14ef69a576 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167252 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit 6200d89b905d51776ff4f3c8a84f338655ffaa7f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167221 Reviewed-by: Michael Stahl diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk index 5eb874400d53..d64a43f7d3fb 100644 --- a/sw/CppunitTest_sw_core_layout.mk +++ b/sw/CppunitTest_sw_core_layout.mk @@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_core_layout)) $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_layout)) $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_layout, \ +sw/qa/core/layout/calcmove \ sw/qa/core/layout/fly \ sw/qa/core/layout/flycnt \ sw/qa/core/layout/frmtool \ diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx new file mode 100644 index ..3e4deec52ae8 --- /dev/null +++ b/sw/qa/core/layout/calcmove.cxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +namespace +{ +/// Covers sw/source/core/layout/calcmove.cxx fixes. +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/core/layout/data/") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin) +{ +// Given a DOCX (>= Word 2013) file, with 2 pages: +// When loading that document: +createSwDoc("ignore-top-margin.docx"); + +// Then make sure that the paragraph on the 2nd page has no top margin: +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +sal_Int32 nParaTopMargin += getXPath(pXmlDoc, "/root/page[2]/body/txt/infos/prtBounds"_ostr, "top"_ostr).toInt32(); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 0 +// - Actual : 2400 +// i.e. the top margin in the first para of a non-first page wasn't ignored, like in Word. +CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/layout/data/ignore-top-margin.docx b/sw/qa/core/layout/data/ignore-top-margin.docx new file mode 100644 index ..d05a1358db1e Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin.docx differ diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 604488a18c9f..a86358508182 100644 --- a/sw/source/core/inc/fra
core.git: Branch 'distro/collabora/co-24.04' - sw/qa
sw/qa/extras/layout/layout3.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 48ee8fb96540e68a17599b5db505f9b056dc09f3 Author: Miklos Vajna AuthorDate: Mon May 13 08:37:22 2024 +0200 Commit: Caolán McNamara CommitDate: Tue May 14 10:25:05 2024 +0200 tdf#160984 sw continuous endnotes: fix CppunitTest_sw_layoutwriter3 These are similar to commit ab3416cad1dd4e706432f9b1a3592cec823c76b0 (tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards, 2024-05-10). I've manually verified that the use-case still works as intended, so fix the failing tests by relaxing the assert a bit: now we accept endnotes directly under the page frame or under the column frame as well. This way these tests won't break when we switch to section-based continuous endnotes. (cherry picked from commit 9c7acbc937b3b341c10187b837e09cc20399f04e) Change-Id: Ib98d6277534cc2e934595f19927836744eec64d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167624 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 98c77b18ecdf..d553162f1636 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -1315,7 +1315,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601) // i.e. there was a separate endnote page, even when the ContinuousEndnotes compat option was // on. assertXPath(pXmlDoc, "/root/page"_ostr, 2); -assertXPath(pXmlDoc, "/root/page[2]/ftncont"_ostr, 1); +assertXPath(pXmlDoc, "/root/page[2]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b) @@ -1425,7 +1425,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesInsertPageAtStart) // - Expected: 1 // - Actual : 0 // i.e. the footnote container remained on page 2. -assertXPath(pXmlDoc, "/root/page[3]/ftncont"_ostr, 1); +assertXPath(pXmlDoc, "/root/page[3]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart) @@ -1452,7 +1452,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart) // - Actual : 2 // i.e. the endnote remained on an (otherwise) empty 2nd page. assertXPath(pXmlDoc, "/root/page"_ostr, 1); -assertXPath(pXmlDoc, "/root/page[1]/ftncont"_ostr, 1); +assertXPath(pXmlDoc, "/root/page[1]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128399)
core.git: sw/qa
sw/qa/extras/layout/layout3.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 9c7acbc937b3b341c10187b837e09cc20399f04e Author: Miklos Vajna AuthorDate: Mon May 13 08:37:22 2024 +0200 Commit: Miklos Vajna CommitDate: Mon May 13 12:15:08 2024 +0200 tdf#160984 sw continuous endnotes: fix CppunitTest_sw_layoutwriter3 These are similar to commit ab3416cad1dd4e706432f9b1a3592cec823c76b0 (tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards, 2024-05-10). I've manually verified that the use-case still works as intended, so fix the failing tests by relaxing the assert a bit: now we accept endnotes directly under the page frame or under the column frame as well. This way these tests won't break when we switch to section-based continuous endnotes. Change-Id: Ib98d6277534cc2e934595f19927836744eec64d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167567 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index e907f6bc8ebf..329c81847313 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -1444,7 +1444,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601) // i.e. there was a separate endnote page, even when the ContinuousEndnotes compat option was // on. assertXPath(pXmlDoc, "/root/page"_ostr, 2); -assertXPath(pXmlDoc, "/root/page[2]/ftncont"_ostr, 1); +assertXPath(pXmlDoc, "/root/page[2]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b) @@ -1554,7 +1554,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesInsertPageAtStart) // - Expected: 1 // - Actual : 0 // i.e. the footnote container remained on page 2. -assertXPath(pXmlDoc, "/root/page[3]/ftncont"_ostr, 1); +assertXPath(pXmlDoc, "/root/page[3]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart) @@ -1581,7 +1581,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart) // - Actual : 2 // i.e. the endnote remained on an (otherwise) empty 2nd page. assertXPath(pXmlDoc, "/root/page"_ostr, 1); -assertXPath(pXmlDoc, "/root/page[1]/ftncont"_ostr, 1); +assertXPath(pXmlDoc, "/root/page[1]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128399)
core.git: Branch 'distro/collabora/co-24.04' - sw/qa
sw/qa/core/layout/layout.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit b6f42a6006dd0b0e4234ed5e0f536b7f4d8a Author: Miklos Vajna AuthorDate: Fri May 10 08:07:41 2024 +0200 Commit: Caolán McNamara CommitDate: Mon May 13 12:06:55 2024 +0200 tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards Once continuous endnotes are in a section, this failed, even if the generated layout is an improvement. The layout will put the endnotes to a section, which will be directly after the end of the body text, which is closer to what Word does, but makes the test fail, since the foot/endnote container is no longer directly under the page frame (the new tree is page -> body -> section -> column -> ftncont). Fix the problem by relaxing the assert to only check which pages have footnote containers, which passes with and without the move to section-based continuous endnotes, but still fails if endnotes go to their own page, which was the original problem to be tested (endnotes remained on page 3 and didn't move backwards). The assert for the number of pages can remain unchanged. (cherry picked from commit ab3416cad1dd4e706432f9b1a3592cec823c76b0) Change-Id: I9a46803463c82dac317c303721de30fae48c6924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167579 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index 5971e870304d..9cae825b38b4 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -179,9 +179,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards) // - Expected: 0 // - Actual : 1 // i.e. there were unexpected endnotes on page 1. -assertXPath(pLayout, "/root/page[1]/ftncont"_ostr, 0); +assertXPath(pLayout, "/root/page[1]//ftncont"_ostr, 0); // All endnotes are in a container on page 2. -assertXPath(pLayout, "/root/page[2]/ftncont"_ostr, 1); +assertXPath(pLayout, "/root/page[2]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)
core.git: include/svx svx/source
include/svx/svdundo.hxx | 10 +++ svx/source/svdraw/svdundo.cxx | 56 +- 2 files changed, 33 insertions(+), 33 deletions(-) New commits: commit 74bd51629eed7eb34aef9acbb93c110525f8ef7d Author: Miklos Vajna AuthorDate: Mon May 13 08:33:27 2024 +0200 Commit: Miklos Vajna CommitDate: Mon May 13 10:32:50 2024 +0200 svx: prefix members of SdrUndoAttrObj See tdf#94879 for motivation. Change-Id: Icecf1b75055c9f487d35ae72589ccb6197cfeaff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167566 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 824f36f06efc..5af5c584eda1 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -155,17 +155,17 @@ class SVXCORE_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj // FIXME: Or should we better remember the StyleSheetNames? rtl::Reference< SfxStyleSheet > mxUndoStyleSheet; rtl::Reference< SfxStyleSheet > mxRedoStyleSheet; -bool bStyleSheet; -bool bHaveToTakeRedoSet; +bool m_bStyleSheet; +bool m_bHaveToTakeRedoSet; // When assigning TextItems to a drawing object with text: -std::optional pTextUndo; +std::optional m_pTextUndo; // #i8508# // The text rescue mechanism needs also to be implemented for redo actions. -std::optional pTextRedo; +std::optional m_pTextRedo; // If we have a group object: -std::unique_ptr pUndoGroup; +std::unique_ptr m_pUndoGroup; protected: // Helper to ensure StyleSheet is in pool (provided by SdrModel from SdrObject) diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 18b248ba5960..1b52ee945957 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -250,9 +250,9 @@ void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSaveText) : SdrUndoObj(rNewObj) -, bHaveToTakeRedoSet(true) +, m_bHaveToTakeRedoSet(true) { -bStyleSheet = bStyleSheet1; +m_bStyleSheet = bStyleSheet1; SdrObjList* pOL = rNewObj.GetSubList(); bool bIsGroup(pOL!=nullptr && pOL->GetObjCount()); @@ -261,11 +261,11 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave if(bIsGroup) { // it's a group object! -pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); +m_pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); for (const rtl::Reference& pObj : *pOL) { -pUndoGroup->AddAction( +m_pUndoGroup->AddAction( std::make_unique(*pObj, bStyleSheet1)); } } @@ -275,14 +275,14 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave moUndoSet.emplace( mxObj->GetMergedItemSet() ); -if(bStyleSheet) +if(m_bStyleSheet) mxUndoStyleSheet = mxObj->GetStyleSheet(); if(bSaveText) { auto p = mxObj->GetOutlinerParaObject(); if(p) -pTextUndo = *p; +m_pTextUndo = *p; } } @@ -290,9 +290,9 @@ SdrUndoAttrObj::~SdrUndoAttrObj() { moUndoSet.reset(); moRedoSet.reset(); -pUndoGroup.reset(); -pTextUndo.reset(); -pTextRedo.reset(); +m_pUndoGroup.reset(); +m_pTextUndo.reset(); +m_pTextRedo.reset(); } void SdrUndoAttrObj::Undo() @@ -303,27 +303,27 @@ void SdrUndoAttrObj::Undo() // Trigger PageChangeCall ImpShowPageOfThisObject(); -if(!pUndoGroup || bIs3DScene) +if(!m_pUndoGroup || bIs3DScene) { -if(bHaveToTakeRedoSet) +if(m_bHaveToTakeRedoSet) { -bHaveToTakeRedoSet = false; +m_bHaveToTakeRedoSet = false; moRedoSet.emplace( mxObj->GetMergedItemSet() ); -if(bStyleSheet) +if(m_bStyleSheet) mxRedoStyleSheet = mxObj->GetStyleSheet(); -if(pTextUndo) +if(m_pTextUndo) { // #i8508# auto p = mxObj->GetOutlinerParaObject(); if(p) -pTextRedo = *p; +m_pTextRedo = *p; } } -if(bStyleSheet) +if(m_bStyleSheet) { mxRedoStyleSheet = mxObj->GetStyleSheet(); SfxStyleSheet* pSheet = mxUndoStyleSheet.get(); @@ -392,15 +392,15 @@ void SdrUndoAttrObj::Undo() mxObj->GetProperties().BroadcastItemChange(aItemChange); -if(pTextUndo) +if(m_pTextUndo) { -mxObj->SetOutlinerParaObject(*pTextUndo); +mxObj->SetOutlinerParaObject(*m_pTextUndo); } } -if(pUndoGroup)
core.git: Branch 'distro/collabora/co-24.04' - sw/source
sw/source/core/inc/pagefrm.hxx|1 + sw/source/core/inc/sectfrm.hxx|4 sw/source/core/layout/findfrm.cxx | 23 +++ sw/source/core/layout/sectfrm.cxx |1 + 4 files changed, 29 insertions(+) New commits: commit e747e6df648a7ff076663ab376a4dbbc041b5180 Author: Miklos Vajna AuthorDate: Thu May 9 08:20:21 2024 +0200 Commit: Caolán McNamara CommitDate: Fri May 10 16:03:56 2024 +0200 tdf#160984 sw continuous endnotes: add a way to find the endnote section start 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. (cherry picked from commit 8bae684c93bd23bbe98707ba9cf75d1a39427131) Change-Id: Ib08267f9bf6c7b06576624e3fa8e90e8b8b1b232 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167478 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 54458032f188..054495eeea80 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -204,6 +204,7 @@ public: bool IsEndNotePage() const { return m_bEndNotePage; } void SetFootnotePage( bool b ) { m_bFootnotePage = b; } void SetEndNotePage( bool b ) { m_bEndNotePage = b; } +SwSectionFrame* GetEndNoteSection(); sal_uInt16 GetPhyPageNum() const{ return m_nPhyPageNum;} void SetPhyPageNum( sal_uInt16 nNum ) { m_nPhyPageNum = nNum;} diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index 3debf367f05a..ac57bd815d5f 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -52,6 +52,8 @@ class SW_DLLPUBLIC SwSectionFrame final: public SwLayoutFrame, public SwFlowFram SwSection* m_pSection; bool m_bFootnoteAtEnd; // footnotes at the end of section bool m_bEndnAtEnd; // endnotes at the end of section +/// If this is a section for endnotes, then the SwSection is not backed by an SwSectionNode. +bool m_bEndNoteSection = false; bool m_bContentLock; // content locked bool m_bOwnFootnoteNum; // special numbering of footnotes bool m_bFootnoteLock; // ftn, don't leave this section bwd @@ -171,6 +173,8 @@ public: void SetFootnoteLock( bool bNew ) { m_bFootnoteLock = bNew; } bool IsFootnoteLock() const { return m_bFootnoteLock; } +void SetEndNoteSection(bool bEndNoteSection) { m_bEndNoteSection = bEndNoteSection; } +bool IsEndNoteSection() const { return m_bEndNoteSection; } }; inline const SwSectionFrame *SwSectionFrame::GetFollow() const diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 0dd64c6aecff..378e451b9f89 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -65,6 +65,29 @@ SwContentFrame *SwPageFrame::FindLastBodyContent() return pRet; } +SwSectionFrame* SwPageFrame::GetEndNoteSection() +{ +SwLayoutFrame* pBody = FindBodyCont(); +if (!pBody) +{ +return nullptr; +} + +SwFrame* pLast = pBody->GetLastLower(); +if (!pLast || !pLast->IsSctFrame()) +{ +return nullptr; +} + +auto pLastSection = static_cast(pLast); +if (!pLastSection->IsEndNoteSection()) +{ +return nullptr; +} + +return pLastSection; +} + /** * Checks if the frame contains one or more ContentFrame's anywhere in his * subsidiary structure; if so the first found ContentFrame is returned. diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 3967a1f56442..78278da9cb38 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -94,6 +94,7 @@ SwSectionFrame::SwSectionFrame( SwSectionFrame , bool bMaster ) : m_bOwnFootnoteNum( false ), m_bFootnoteLock( false ) { +m_bEndNoteSection = rSect.m_bEndNoteSection; StartListening(rSect.GetFormat()->GetNotifier()); mnFrameType = SwFrameType::Section;
core.git: sw/qa
sw/qa/core/layout/layout.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit ab3416cad1dd4e706432f9b1a3592cec823c76b0 Author: Miklos Vajna AuthorDate: Fri May 10 08:07:41 2024 +0200 Commit: Miklos Vajna CommitDate: Fri May 10 09:05:24 2024 +0200 tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards Once continuous endnotes are in a section, this failed, even if the generated layout is an improvement. The layout will put the endnotes to a section, which will be directly after the end of the body text, which is closer to what Word does, but makes the test fail, since the foot/endnote container is no longer directly under the page frame (the new tree is page -> body -> section -> column -> ftncont). Fix the problem by relaxing the assert to only check which pages have footnote containers, which passes with and without the move to section-based continuous endnotes, but still fails if endnotes go to their own page, which was the original problem to be tested (endnotes remained on page 3 and didn't move backwards). The assert for the number of pages can remain unchanged. Change-Id: I9a46803463c82dac317c303721de30fae48c6924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167425 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index 5971e870304d..9cae825b38b4 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -179,9 +179,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards) // - Expected: 0 // - Actual : 1 // i.e. there were unexpected endnotes on page 1. -assertXPath(pLayout, "/root/page[1]/ftncont"_ostr, 0); +assertXPath(pLayout, "/root/page[1]//ftncont"_ostr, 0); // All endnotes are in a container on page 2. -assertXPath(pLayout, "/root/page[2]/ftncont"_ostr, 1); +assertXPath(pLayout, "/root/page[2]//ftncont"_ostr, 1); } CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)
core.git: Branch 'distro/collabora/co-24.04' - sw/inc sw/source
sw/inc/ftninfo.hxx|5 + sw/source/core/doc/docftn.cxx | 19 +++ sw/source/core/doc/docnew.cxx |1 + 3 files changed, 25 insertions(+) New commits: commit 3ac458599fd3dd532c9b4cc02ffa446d1a0e3dc2 Author: Miklos Vajna AuthorDate: Wed May 8 08:59:47 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 9 17:12:24 2024 +0200 tdf#160984 sw continuous endnotes: introduce an endnote section Word lays out endnotes at the end of the document inline after body text, Writer puts them on one or more separate endnote pages. There was already an attempt in the past to resolve this difference, see commit 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add ContinuousEndnotes layout compat option, 2019-09-30). The approach back then was to map such endnotes to footnotes, so the extra, unwanted page doesn't appear. This turned out to be not working too well, the compat option is only enabled for DOC, and even there commit dc11f5b151e1a2ea2623fc8cf806a400763955d9 (tdf#143445 DOC import: limit the usage of the CONTINUOUS_ENDNOTES compat flag, 2023-05-23) limited the usage of the compat flag to 1 or 2 endnotes only. Coming back to this, try a new approach: create a section that more or less exists only at a layout level and put endnotes into that section. This allows reusing all the complex logic on how to lay out endnotes inline, on one or more pages. The plan is that this new approach is more robust, can replace the old continuous endnotes layout code and then can be enabled for DOCX as well. This commit just introduces the backing section format and SwSection for that special "endnotes section" (it's special because SwSection is usually owned by an SwSectionNode, but here there is no doc model node for the SwSection), SwFootnoteBossFrame::AppendFootnote() doesn't try to use the new SwEndNoteInfo::GetSwSection() yet. (cherry picked from commit 90f19126fa405a0632eae4ee8525b66bbce12625) Change-Id: Ib32f04ceb6f46c682a5d36bdcea206d2c4017227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167387 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx index 17742687c944..c5490ed885d0 100644 --- a/sw/inc/ftninfo.hxx +++ b/sw/inc/ftninfo.hxx @@ -28,12 +28,14 @@ class SwTextFormatColl; class SwPageDesc; class SwCharFormat; class SwDoc; +class SwSection; class SW_DLLPUBLIC SwEndNoteInfo : public SwClient { mutable sw::WriterMultiListener m_aDepends; mutable SwTextFormatColl* m_pTextFormatColl; mutable SwPageDesc* m_pPageDesc; +mutable std::unique_ptr m_pSwSection; mutable SwCharFormat* m_pCharFormat; mutable SwCharFormat* m_pAnchorFormat; OUString m_sPrefix; @@ -51,6 +53,9 @@ public: bool KnowsPageDesc() const; bool DependsOn(const SwPageDesc*) const; +SwSection* GetSwSection(SwDoc& rDoc) const; +void ResetSwSection(); + void SetFootnoteTextColl(SwTextFormatColl& rColl); SwTextFormatColl* GetFootnoteTextColl() const { return m_pTextFormatColl; } // can be 0. diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 16f6694c94c5..f211dcdcc9f4 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -35,6 +35,8 @@ #include #include #include +#include +#include SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo) { @@ -130,6 +132,23 @@ void SwEndNoteInfo::ChgPageDesc(SwPageDesc* pDesc) m_aDepends.StartListening(m_pPageDesc); } +SwSection* SwEndNoteInfo::GetSwSection(SwDoc& rDoc) const +{ +if (!m_pSwSection) +{ +SwSectionFormat* pFormat = rDoc.MakeSectionFormat(); +pFormat->SetFormatName(UNO_NAME_ENDNOTE); +pFormat->SetFormatAttr(SwFormatEndAtTextEnd(FTNEND_ATTXTEND)); +m_pSwSection.reset(new SwSection(SectionType::Content, pFormat->GetName(), *pFormat)); +} +return m_pSwSection.get(); +} + +void SwEndNoteInfo::ResetSwSection() +{ +m_pSwSection.reset(); +} + void SwEndNoteInfo::SetFootnoteTextColl(SwTextFormatColl& rFormat) { m_aDepends.EndListening(m_pTextFormatColl); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index d6e885e8219a..bb0cd32d2c19 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -503,6 +503,7 @@ SwDoc::~SwDoc() // do not have any dependencies anymore. m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() ); rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() ); +mpEndNoteInfo->ResetSwSection(); // clear TOX after nodes - TOXMarks are gone now so SwTOXType has no clients for (const auto& pType : *mpTOXTypes)
ESC meeting minutes: 2024-05-09
* Present: + Cloph, Gabriel, Heiko, Hossein, Ilmari, Jonathan, Olivier, Xisco, sockseight, Caolan, Stephane, Miklos * Completed Action Items: * Pending Action Items: * Release Engineering update (Cloph) + 7.6: 7.6.7 release: this week, tomorrow + 24.2: 24.2.4 RC1 in 1 week + 24.8: first alpha this week, from master, tomorrow + week 23 is the feature freeze, 4 weeks + string / UI freeze 4 weeks after that + if you have a late feature proposal, announce that here + MAR-based updater will be enabled by default on Windows, but not Linux (Hossein) + rpm/deb update is handled by distro packages + for the ones taking binaries from TDF + TDF to provide rpm/deb repos? + the files are hosted already + just the repo defs are missing + suggesting to provide these repos + proposal is to povide repos and ignore MAR on Linux for now + interested in doing the scripting work? (Miklos) + the important part is the description / dependencies (Hossein) + willing to help + linux downloads are 2% of TDF downloads (Cloph) + so not a huge amount, but not objecting + only the the ones which are covered by rpm/deb binaries + what is the lag between Ubuntu-provided packages / TDF releases? (Olivier) + the package from Ubuntu follows TDF quickly + similar with Debian, thanks to Rene (Cloph) + with actively supported versions + see LibreOffice 7.3.7 for Ubuntu 22.04 https://packages.ubuntu.com/jammy/libreoffice (Hossein) * Documentation (Olivier) + Helpcontents2 + Updates and fixes (A Gelmini. S. Horacek, fitoshido) + Changes in makefiles (cloph) + Updates in doc properties (Dublin Core) by Dione Maddern + Core + Extended tips for sparklines + Guides + important fix by M. Stahl will trigger format review + in all guides, + starting after LO 24.2.4 + tdf#159366 + bugs with >20 comments + hard to follow, to understand what is the actual request + sometimes asking: if this feature is still used + thanks to the precise bugreports + Bugzilla Documentation statistics 263(263) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 14(5)39(2) 107(7) 225(4) commented 20(10) 61(0) 255(5) 854(6) resolved 7(2)23(5) 54(6) 121(4) + top 10 contributors: Olivier Hallot made 42 changes in 1 month, and 239 changes in 1 year Stéphane Guillou made 28 changes in 1 month, and 253 changes in 1 year Vernon, Stuart Foote made 22 changes in 1 month, and 107 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 year Kaganski, Mike made 8 changes in 1 month, and 74 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year Heiko Tietze made 4 changes in 1 month, and 76 changes in 1 year nobu made 4 changes in 1 month, and 16 changes in 1 year Kira Tubo made 2 changes in 1 month, and 2 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 35(35) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 4(-1)10(1) 15(-1) 21(-3) commented 64(48) 186(30) 525(-6)1761(-60) removed 0(-2) 4(-1) 5(0) 12(-1) resolved 8(2) 31(1) 79(-2) 308(-7) + top 10 contributors: Heiko Tietze made 110 changes in 1 month, and 1031 changes in 1 year Vernon, Stuart Foote made 108 changes in 1 month, and 317 changes in 1 year Stéphane Guillou made 51 changes in 1 month, and 621 changes in 1 year Cor Nouws made 21 changes in 1 month, and 33 changes in 1 year Dieter made 18 changes in 1 month, and 139 changes in 1 year Ilmari Lauhakangas made 16 changes in 1 month, and 131 changes in 1 year Eyal Rozenberg made 10 changes in 1 month, and 125 changes in 1 year Ady made 6 changes in 1 month, and 122 changes in 1 year jan d made 5 changes in 1 month, and 5 changes in 1 year *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year + [Bug 161002] Missing item "Insert/Filed/More Fields.." in LibreOffice Draw + [Bug 160986] show 'X %' instead of 'X%' + [Bug 153309] Prevent direct formatting on writer by a password. -> + [Bug 98902] Right clicking on selected text unselects it if the cursor is on a misspelled word + [Bug 160955] When selecting an alternative link target for an OLE object, button says
ESC meeting minutes: 2024-05-09
* Present: + Cloph, Gabriel, Heiko, Hossein, Ilmari, Jonathan, Olivier, Xisco, sockseight, Caolan, Stephane, Miklos * Completed Action Items: * Pending Action Items: * Release Engineering update (Cloph) + 7.6: 7.6.7 release: this week, tomorrow + 24.2: 24.2.4 RC1 in 1 week + 24.8: first alpha this week, from master, tomorrow + week 23 is the feature freeze, 4 weeks + string / UI freeze 4 weeks after that + if you have a late feature proposal, announce that here + MAR-based updater will be enabled by default on Windows, but not Linux (Hossein) + rpm/deb update is handled by distro packages + for the ones taking binaries from TDF + TDF to provide rpm/deb repos? + the files are hosted already + just the repo defs are missing + suggesting to provide these repos + proposal is to povide repos and ignore MAR on Linux for now + interested in doing the scripting work? (Miklos) + the important part is the description / dependencies (Hossein) + willing to help + linux downloads are 2% of TDF downloads (Cloph) + so not a huge amount, but not objecting + only the the ones which are covered by rpm/deb binaries + what is the lag between Ubuntu-provided packages / TDF releases? (Olivier) + the package from Ubuntu follows TDF quickly + similar with Debian, thanks to Rene (Cloph) + with actively supported versions + see LibreOffice 7.3.7 for Ubuntu 22.04 https://packages.ubuntu.com/jammy/libreoffice (Hossein) * Documentation (Olivier) + Helpcontents2 + Updates and fixes (A Gelmini. S. Horacek, fitoshido) + Changes in makefiles (cloph) + Updates in doc properties (Dublin Core) by Dione Maddern + Core + Extended tips for sparklines + Guides + important fix by M. Stahl will trigger format review + in all guides, + starting after LO 24.2.4 + tdf#159366 + bugs with >20 comments + hard to follow, to understand what is the actual request + sometimes asking: if this feature is still used + thanks to the precise bugreports + Bugzilla Documentation statistics 263(263) bugs open + Updates: BZ changes 1 week 1 month 3 months 12 months created 14(5)39(2) 107(7) 225(4) commented 20(10) 61(0) 255(5) 854(6) resolved 7(2)23(5) 54(6) 121(4) + top 10 contributors: Olivier Hallot made 42 changes in 1 month, and 239 changes in 1 year Stéphane Guillou made 28 changes in 1 month, and 253 changes in 1 year Vernon, Stuart Foote made 22 changes in 1 month, and 107 changes in 1 year Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 year Kaganski, Mike made 8 changes in 1 month, and 74 changes in 1 year Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year Heiko Tietze made 4 changes in 1 month, and 76 changes in 1 year nobu made 4 changes in 1 month, and 16 changes in 1 year Kira Tubo made 2 changes in 1 month, and 2 changes in 1 year * UX Update (Heiko) + Bugzilla (topicUI) statistics 240(240) (topicUI) bugs open, 35(35) (needsUXEval) needs to be evaluated by the UXteam + Updates: BZ changes 1 week 1 month 3 months 12 months added 4(-1)10(1) 15(-1) 21(-3) commented 64(48) 186(30) 525(-6)1761(-60) removed 0(-2) 4(-1) 5(0) 12(-1) resolved 8(2) 31(1) 79(-2) 308(-7) + top 10 contributors: Heiko Tietze made 110 changes in 1 month, and 1031 changes in 1 year Vernon, Stuart Foote made 108 changes in 1 month, and 317 changes in 1 year Stéphane Guillou made 51 changes in 1 month, and 621 changes in 1 year Cor Nouws made 21 changes in 1 month, and 33 changes in 1 year Dieter made 18 changes in 1 month, and 139 changes in 1 year Ilmari Lauhakangas made 16 changes in 1 month, and 131 changes in 1 year Eyal Rozenberg made 10 changes in 1 month, and 125 changes in 1 year Ady made 6 changes in 1 month, and 122 changes in 1 year jan d made 5 changes in 1 month, and 5 changes in 1 year *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year + [Bug 161002] Missing item "Insert/Filed/More Fields.." in LibreOffice Draw + [Bug 160986] show 'X %' instead of 'X%' + [Bug 153309] Prevent direct formatting on writer by a password. -> + [Bug 98902] Right clicking on selected text unselects it if the cursor is on a misspelled word + [Bug 160955] When selecting an alternative link target for an OLE object, button says
core.git: Branch 'distro/collabora/co-24.04' - sw/source
sw/source/uibase/shells/drwbassh.cxx | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 0f7127aa6019363d15a167ab492ba06e0347174a Author: Miklos Vajna AuthorDate: Thu May 9 13:09:43 2024 +0200 Commit: Caolán McNamara CommitDate: Thu May 9 14:59:53 2024 +0200 sw: fix -Wshadow warnings /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx: In lambda function: /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:656:38: error: declaration of ‘aTitle’ shadows a previous local [-Werror=shadow] 656 | OUString aTitle; | ^~ /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:643:26: note: shadowed declaration is here 643 | OUString aTitle(pSelected->GetTitle()); | ^~ /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:657:38: error: declaration of ‘aDescription’ shadows a previous local [-Werror=shadow] 657 | OUString aDescription; | ^~~~ /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:644:26: note: shadowed declaration is here 644 | OUString aDescription(pSelected->GetDescription()); | ^~~~ /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:658:34: error: declaration of ‘isDecorative’ shadows a previous local [-Werror=shadow] 658 | bool isDecorative; | ^~~~ /home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:645:22: note: shadowed declaration is here 645 | bool isDecorative(pSelected->IsDecorative()); | ^~~~ cc1plus: all warnings being treated as errors Change-Id: I9f62f028d29a4014628435163f8ff9174251bfb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167382 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index ebd1eb3ce705..c98e97eb7aba 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -653,17 +653,17 @@ void SwDrawBaseShell::Execute(SfxRequest const ) { if (nResult == RET_OK) { -OUString aTitle; -OUString aDescription; -bool isDecorative; +OUString aNewTitle; +OUString aNewDescription; +bool newIsDecorative; -pDlg->GetTitle(aTitle); -pDlg->GetDescription(aDescription); -pDlg->IsDecorative(isDecorative); +pDlg->GetTitle(aNewTitle); +pDlg->GetDescription(aNewDescription); +pDlg->IsDecorative(newIsDecorative); -pSelected->SetTitle(aTitle); -pSelected->SetDescription(aDescription); -pSelected->SetDecorative(isDecorative); +pSelected->SetTitle(aNewTitle); +pSelected->SetDescription(aNewDescription); +pSelected->SetDecorative(newIsDecorative); pSh->SetModified(); }