/source/tg/svtools/

ader'> cgit logo index : lo/core
LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sw/qa/core/header_footer/HeaderFooterTest.cxx
AgeCommit message (Collapse)Author
2025-01-18tdf#164748 writerfilter: fix missing even/odd header propertiesJustin Luth
Lots of header/footer page style properties are ignored if the header/footer is not first enabled. So copying propertyList MUST follow completeCopyHeaderFooter() [which is where all those settings are turned on]. However, copying properties AFTER turning on the header/footer was Exception'ing when trying to copy BottomMarginComplexColor as void(). So ignore any property-copy errors, and then everything should work in theory... ...and it seems to. make CppunitTest_sw_core_header_footer \ CPPUNIT_TEST_NAME=testBnc519228OddBreaks make CppunitTest_sw_rtfexport8 \ CPPUNIT_TEST_NAME=testTdf160976_headerFooter Change-Id: Iecf0a070e77525c04b44c4fc38efa0f9d558eca5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180417 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-10-16SwModelTestBase: drop isExportedXisco Fauli
Change-Id: I4eb169909abff3eba935e4ad5ff7875b1b122953 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175019 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-10-05Use good old string literals in assertXPath and friendsMike Kaganski
These are only sent to an external API expecting char*-like strings, or for comparison. Having every assertXPath having three of _[ou]str is too much syntactic noise, making the unit tests almost unreadable. Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-09-12Temporarily skip unit tests on native arm64 buildBalazs Varga
which indicating unit test fails. Change-Id: I2689b0dda888e15e52ca60cc18e1705a1aefe968 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173143 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de> Tested-by: Jenkins
2024-07-30sw: get rid of parseDumpXisco Fauli
So parseLayoutDump is only called once per test Change-Id: Ia199e0a7eeac26fbde94f6450d2aa49828940806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171219 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-07-16Revert "tdf#159013 writerfilter: link to the correct first-page header"Justin Luth
This reverts commit 25.2 358ac0da827f908ce312c6d392a3d9102f36428e. which was backported to 24.8 Although this patch made the situation "better than it was" for most cases, it will inevitably make some documents worse. Ultimately, this approach is wrong. See tdf#158977's 158977_linkNonEmptyFirst.docx. We can't only copy from the styles that "express" a H/F (and UNO doesn't let us copy from styles that hide it). A COPY appropach would need to ALWAYS import every header/footer into a dedicated "header/footer repository" page style, and every page style would need to copy its "expressed" headers/footers from the repository to its page style. That would mean our copy procedure would need to be very robust, and all of this is way too big for a bug-fixer like me to consider. I don't want to be the one on the hook expected to fix it properly. Change-Id: I2af4a03a219daabf186473839ba444ff9797ec2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170530 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-07-11tdf#159013 writerfilter: link to the correct first-page headerJustin Luth
We have always done this wrong, but previous to quikee's 24.2 4b0fa253a4540f5461397815d290586f9ddabe61 it left the first page blank (I expect), while recently it was copying the "normal" header. In order to avoid a UNO copy assert (if copying an empty footer) track the header and footer style separately. Alternatively I could have probably removed the UNO assert. Alternatively, I could track if we ever had a first header and a first footer - at that point they will be copied to same style. make CppunitTest_sw_core_header_footer \ CPPUNIT_TEST_NAME=testTdf1159013_firstHeaderCopy Change-Id: I7c5046731766a70625b1a6a8696239297369e2c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170259 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-06-06loplugin:ostr in sw/qa/coreNoel Grandin
Change-Id: Iaafc85d9b9042769f30c5662dbc9bf8c0e415312 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168487 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-05tdf#158814 DOCX import: fix unwanted header with type="first" & no titlePgMiklos Vajna
The bugdoc had no header in Word, but had one in Writer, since commit 17e51f427b3f0cec74ac8e0a1b3f51189006ae6f (DOCX import: first page header should always set default headers as well, 2014-11-21). The code has changed a log in the meantime, today we import first page headers and left/right page headers as a single page style, but still code was missing to detect the case when <w:headerReference w:type="first"> was not followed by <w:titlePg>, which is an indicator that the first page header/footer should be used. Fix the problem by new flags to SectionPropertyMap to track if we ever seen a first/left/right header. This allows making an informed decision in SectionPropertyMap::setHeaderFooterProperties(): if the header is on, but we effectively don't have none of a first, left or right header, then it's time to turn it off, similar to what the DOC import does. Note that this only changes behavior for headers, but if there is a practical need, then the same could be also done for footers as well. Instead of adding a new test, notice that testTdf112694 in CppunitTest_sw_core_header_footer explicitly tests this case: a first header which is not a title page. So change that testcase to assert the behavior now matches Word and drop the FIXME. Change-Id: Ib604e786d7a5a197d4b562533326206697de882a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162992 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-12-01Fix typoAndrea Gelmini
Change-Id: Iae999cd64ca73f178e4e1148af71b47fe03c8e2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160206 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-01tdf#136472 adjust ooxml import to handle first header/footerTomaž Vajngerl
Previously the ooxml import added a new page style when the first header or footer was detected. Since then we gained support to add first page header/footer in an existing page style so we don't need to import it like that anymore. This changes the import code so that the old complication to add "First Page" page style is removed and it always just uses the "Standard" page style for all 3 cases: first, left and right headers and footers. This also adjusts the existing tests to align with this change. Change-Id: Ibf69597e6990499ac520ea9e323a5f73f429800b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157860 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-12-01sw: fix issue with copying stashed frame formatTomaž Vajngerl
When the PageDesc is copied from one document to another, we don't make sure the stashed FrameFormat(s) are also properly copied to the new document (which can happen at copy/paste). This can cause a crash if the stashed FrameFormats are accessed or destructed after the original document is destroyed. This fixes the issue so that when we detect the PageDesc belong to different documents, the stashed FrameFormats are copied just like the non-stashed FrameFormats (used for headers and footers). Change-Id: I948068dba4d39bb47c3725dfa8491c53c5833c7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160065 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-11-28sw: move header/footer tests to own class in core testsTomaž Vajngerl
In addition add some more basic header/footer tests. This makes refactoring of header and footer OOXML import much easier. Change-Id: I5b3b3714656ba2f7b1dda8d8f067c3bfe68857a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159946 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>