summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export
AgeCommit message (Collapse)AuthorFilesLines
7 daysAdd a unit test for commit 3f0220f18a66630e06e3c128980f21a5722f49caMike Kaganski2-0/+24
(Handle empty range properly, 2024-04-18) Change-Id: Ifea60ace8ff864ef092e6a62177d5926ceb60de3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166278 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-13address nit: use xmlDocUniquePtr, not const auto&Justin Luth1-1/+1
Miklos "nitted" me that I should NOT use const auto& in this context. Obviously anything I do is simply copy/paste, so lets make sure that this "bad example" is removed from all unit tests. Change-Id: I9b76aeafc5848637e8ebd523a7a550789bd991c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160993 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2024-03-06tdf#160049 doc import: use margins with left/right HoriOrientRelationJustin Luth2-0/+10
No interesting existing unit tests. make CppunitTest_sw_ww8export4 \ CPPUNIT_TEST_NAME=testTdf160049_anchorMargin Change-Id: Ib855d9f35db9e0f47aff18400b69a990cd1ad5ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164444 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-02-27Related: tdf#150408 DOC filter: handle legal numberingMiklos Vajna2-0/+24
The bugdoc's 2nd para started with 'Sect I.01', while Word rendered this as 'Sect 1.01'. The reason for this difference is that there is an "is legal" boolean property on the numbering that we ignored from [MS-DOC] during import/export. Fix the problem by WW8ListManager::ReadLVL() and WW8AttributeOutput::NumberingLevel() to handle this, building on top of the existing DOCX work. RTF still needs doing. Change-Id: I57ec402c1dd829251afa639ddfa7fc6620da1125 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164000 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-02-26related tdf#126533 doc export: don't lose "tiled" aspect of image fill.Justin Luth1-0/+7
This affects patterns as well as textures/images. make CppunitTest_sw_ww8export3 CPPUNIT_TEST_NAME=testTdf101826_xattrTextBoxFill Change-Id: I2742a6f333fc6688b3570772a1dbc8371741f210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163948 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-02-15CppunitTest_sw_ww8export4: turn on set_non_application_font_useMiklos Vajna2-0/+0
Similar to commit dc4d7500c9d283e26d1553ce11366a217cf1f69d (Fix CppunitTest_sd_import_tests-smartart non_application_font_use, 2023-10-23). - sw/qa/extras/ww8export/data/tdf77964.doc: 微软雅黑 -> Liberation Sans - sw/qa/extras/ww8export/data/tdf90408B.doc: Times New Roman -> Liberation Serif Change-Id: I08ebe00c4cedf4e755f8d634ce089ac3b9bb5f05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163420 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-12-21address nit: put unit tests in anonymouse namespaceJustin Luth1-1/+4
https://gerrit.libreoffice.org/c/core/+/160655/5/sw/qa/extras/rtfexport/rtfexport8.cxx Miklos "nitted" me that I didn't wrap this test in an anonymous namespace. Obviously anything I do is simply copy/paste, so lets make sure that at least the latest and greatest versions of each series of unit tests are done "correctly". Change-Id: I699c8d70e4f587373918e27f08304a0fe815bff4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160991 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-12-14CppunitTest_sw_ww8export: avoid external fontsMiklos Vajna18-0/+0
- sw/qa/extras/ww8export/data/cell-bg-color.odt: - missing font: 'Helvetica' try: Liberation Sans instead - sw/qa/extras/ww8export/data/tdf46441-2.odt: - missing font: 'Times Regular' try: Noto Sans instead - sw/qa/extras/ww8export/data/ooo92948-1.doc: - missing font: 'Baskerville MT' try: Noto Sans instead - missing font: 'Futura Book' try: Noto Sans instead - sw/qa/extras/ww8export/data/i120158.doc: - missing font: 'SimSun' try: Noto Serif instead - sw/qa/extras/ww8export/data/fdo68967.doc: - missing font: 'Arial Rounded MT Bold' try: Noto Sans instead - sw/qa/extras/ww8export/data/n760294.doc: - missing font: 'Thorndale AMT' try: Liberation Serif instead - sw/qa/extras/ww8export/data/new-page-styles.doc: - missing font: 'Raytheon Corporate Logo' try: Noto Sans instead - sw/qa/extras/ww8export/data/redline-export-1.odt: - missing font: 'Helvetica' try: Liberation Sans instead - sw/qa/extras/ww8export/data/redline-export-2.odt: - missing font: 'Helvetica' try: Liberation Sans instead - sw/qa/extras/ww8export/data/redline-export-3.odt: - missing font: 'Helvetica' try: Liberation Sans instead - sw/qa/extras/ww8export/data/tdf118564.doc: - missing font: 'FangSong_GB2312' try: Noto Sans instead - missing font: 'SimSun' try: Noto Serif instead - missing font: 'FangSong' try: Noto Sans instead - sw/qa/extras/ww8export/data/tdf130262.doc: - missing font: 'Univers' try: Noto Sans instead - sw/qa/extras/ww8export/data/tdf59896.doc (WW6): - missing font: 'MS Sans Serif' try: DejaVu Sans instead - sw/qa/extras/ww8export/data/tdf95576.doc: - missing font: 'Calibri Light' try: Noto Sans instead - sw/qa/extras/ww8export/data/cjklist30.doc: - missing font: '新細明體' try: Noto Sans instead - missing font: 'PMingLiU' try: Noto Sans instead - sw/qa/extras/ww8export/data/cjklist31.doc: - missing font: '新細明體' try: Noto Sans instead - missing font: 'PMingLiU' try: Noto Sans instead - sw/qa/extras/ww8export/data/cjklist34.doc: - missing font: '新細明體' try: Noto Sans instead - missing font: 'PMingLiU' try: Noto Sans instead - sw/qa/extras/ww8export/data/cjklist35.doc: - missing font: '新細明體' try: Noto Sans instead - missing font: 'PMingLiU' try: Noto Sans instead The .doc files are edited with Word (convert to DOCX, edit there, convert back), the single WW6 file is binary patched, using spaces as padding for the shorter new font name. Change-Id: Ic023a0ba6e542ac0f3782dfef5986bdcf69f3056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160713 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-28sw: move header/footer tests to own class in core testsTomaž Vajngerl2-20/+0
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>
2023-11-19Extended loplugin:ostr: swStephan Bergmann4-56/+56
Change-Id: I210f61f6d90776b086b7058fb1a831d235699fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159670 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann3-3/+3
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-08-14sw floattable: handle AllowOverlap==false in the DOC filterMiklos Vajna1-0/+50
Map sprmTFNoAllowOverlap to SwFormatWrapInfluenceOnObjPos::mbAllowOverlap on import, and do the opposite on export. Change-Id: Id61be49adb39862e30ffb2da9ff9aabae11f7d83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155650 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-07-19sw: Add test for continuous section breaks not adding page breaksParis Oplopoios2-0/+11
Change-Id: I1dbaa0075ff33012c7cc94f1aa82dd992dd0e680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154588 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
2023-07-19Fix inline page breaks not imported correctly from .doc filesParis Oplopoios3-0/+61
The way we handle page breaks is by creating new paragraphs. This visually looks fine until the imported file has stuff like first line indentation. Change-Id: I26d5bbc1ce8b0ff4492b099305f0ff22de41e4cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154358 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
2023-06-01SwModelTestBase: simplify code a bitXisco Fauli4-15/+15
and rename reload method to saveAndReload to unify code and use it everywhere Change-Id: I7c0f4e8d2feb7a0f9ca28df4b6dddd7a11b2e57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152455 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-01tdf#104704 tdf#145998 doc/rtf import: don't lose section page breakJustin Luth2-0/+5
This fixes a LO 7.5 regression from commit c37f62b71fa59917ef85ff98480dff18aa936e41 That 7.5 fix focused on DOCX, and didn't realize that the doc/rtf path couldn't handle the same logic. Just reverting to previous behaviour for DOC/RTF for now. (It is too hard to find relevant documents because any document starting with a section break on the first paragraph [and there are MANY of these - an ODT default], and that scenario harmlessly matches this code path.) Change-Id: I82cfe10e217269448d38df0ca03ce6cae3536e56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152467 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-05-31SwModelTestBase: get rid of mustValidateXisco Fauli1-33/+0
and remove duplicated save method Change-Id: I9bdf0e28d59ae281fccbafd266b86cdf89c112da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152421 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-05-30tdf#140508 doc import: auto-contour for textboxesJustin Luth1-0/+1
This fixes a 6.3.1 regression. The problem was that contour was turned off despite settings indicating that it should be on. An earlier patchset contains the results of a make sw.check assert. make CppunitTest_sw_ww8export3 CPPUNIT_TEST_NAME=testTdf79186_noLayoutInCell Change-Id: Ib3df022a1430649b271083f343b470798f4a08c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152398 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-05-29tdf#36711 doc import: special case when DyaAbs is zeroJustin Luth2-0/+5
One existing unit test found, but the frame was non-functional. Noted in an earlier patchset. make CppunitTest_sw_ww8export CPPUNIT_TEST_NAME=testTdf36711_inlineFrames Change-Id: I9bc4064b6564b327614e44112304adef59490078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152346 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-05-26tdf#60683 tdf#55946 doc import: use style's anchor infoJustin Luth1-1/+1
make CppunitTest_sw_ww8export CPPUNIT_TEST_NAME=testBnc787942 Change-Id: Ie1dc179fc3954b5eed73f3ee1f6dc95f4785f3e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152331 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-05-26tdf#133504 doc import: set the correct wrapJustin Luth2-0/+8
Umm, I'm amazed that 1.) this hasn't been a bigger, burning issue, and 2.) that no one has ever investigated or fixed this. It was super easy. The code is mind boggling though. "Auto" and "Not Beside" are NONE, but around, none, tight, and through are "Optimal"? How about auto is optimal, around/tight are parallel, none is none, and through is through. Lets try that and see how it works. Prior patchsets submitted searched for existing examples. They suggest that MS Word's UI only allows for notBeside and around, but I kept the others there just in case something can trigger them. Change-Id: I893dfd66737bcc3148b48c68cb6df778d3f528c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152286 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-05-26sw floattable: handle fDontBreakWrappedTables in the DOC filterMiklos Vajna1-0/+22
This is the binary DOC import/export for the functionality added in commit 08fa2903df1a7cf9a1647fcf967e4c8b57dad793 (sw floattable: add a DoNotBreakWrappedTables compat flag, 2023-05-24). Change-Id: I91c29b9049e8e9079ed16b1beeefddfa2f6e9a6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152291 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-05-24tdf#155465 doc export: handle para last line - justifyJustin Luth2-0/+19
This was already OK for import in OOo 3.3, but never exported. DOCX export landed in 2019 (no bug report). No existing unit tests matched for DOC. make CppunitTest_sw_ww8export4 \ CPPUNIT_TEST_NAME=testTdf155465_paraAdjustDistribute Change-Id: Iaea149c21259fe2a9002c8ce7c023327bbd13746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152199 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-05-20tdf#90408 Revert #i79169# save/apply attributes of macrobutton textJustin Luth3-0/+26
This reverts ancient commit a79a0101f114e0fcac40503220c5d34750124367. I'm not sure what problem it was trying to solve, but it doesn't seem necessary now. At least, I took my unit test and set some different font sizes to them, and they correctly got those attributes. This was the original file that needed to be fixed: make CppunitTest_sw_ww8export4 CPPUNIT_TEST_NAME=testTdf90408 This is for the current bug report: make CppunitTest_sw_ww8export4 CPPUNIT_TEST_NAME=testTdf90408B Change-Id: I09fb3bd12d645318f1024ac78a9b3154a1fcd078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152025 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-04-28Revert "Revert "introduce sw::SpzFrameFormat ...""Bjoern Michaelsen1-2/+2
apparently, in SwHistoryChangeFlyAnchor::SetInDoc, m_rFormat might actually reference a DrawFormat, not a FlyFormat, and that is likely fundamentally broken. But for now, lets just make m_rFormat a sw::SpzFrameFormat -- this already removes some pointless up and downcasting. This reverts commit 52acefd6024ec79f8333ba40eef83816eda3046f. Change-Id: I040d98548bf9ac1c25b93214224eb0812f8cb653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151150 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2023-04-27Revert "introduce sw::SpzFrameFormat ..."Stephan Bergmann1-2/+2
This reverts commit 09cdcb5f37bb4e42da7b28db6e757b9f2affed14. It broke at least CppunitTest_sw_uiwriter3 (<https://ci.libreoffice.org//job/lo_ubsan/2756/>), > /sw/source/core/undo/rolbck.cxx:938:46: runtime error: downcast of address 0x61300041fd00 which does not point to an object of type 'SwFlyFrameFormat' > 0x61300041fd00: note: object is of type 'SwDrawFrameFormat' > 00 00 00 00 70 83 cf 09 25 7f 00 00 00 83 47 00 30 61 00 00 40 e5 43 00 30 61 00 00 80 66 5d 00 > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'SwDrawFrameFormat' > #0 0x7f24fca9c5b9 in SwHistoryChangeFlyAnchor::SetInDoc(SwDoc*, bool) /sw/source/core/undo/rolbck.cxx:938:46 > #1 0x7f24fca880f3 in SwHistory::Rollback(SwDoc*, unsigned short) /sw/source/core/undo/rolbck.cxx:1208:15 > #2 0x7f24fcb47832 in SwUndoDelete::UndoImpl(sw::UndoRedoContext&) /sw/source/core/undo/undel.cxx:1031:33 > #3 0x7f24fcb703c2 in SwUndo::UndoWithContext(SfxUndoContext&) /sw/source/core/undo/undobj.cxx:225:5 > #4 0x7f2543b8b57c in SfxUndoManager::ImplUndo(SfxUndoContext*) /svl/source/undo/undo.cxx:712:22 > #5 0x7f2543b8c4f8 in SfxUndoManager::UndoWithContext(SfxUndoContext&) /svl/source/undo/undo.cxx:664:12 > #6 0x7f24fca6a074 in sw::UndoManager::impl_DoUndoRedo(sw::UndoManager::UndoOrRedoType, unsigned long) /sw/source/core/undo/docundo.cxx:696:32 > #7 0x7f24fca6b38f in sw::UndoManager::UndoWithOffset(unsigned long) /sw/source/core/undo/docundo.cxx:731:16 > #8 0x7f24fa830b18 in SwEditShell::Undo(unsigned short, unsigned short) /sw/source/core/edit/edundo.cxx:141:57 > #9 0x7f250088f448 in SwWrtShell::Do(SwWrtShell::DoType, unsigned short, unsigned short) /sw/source/uibase/wrtsh/wrtundo.cxx:45:26 > #10 0x7f24ff7f16e2 in SwBaseShell::ExecUndo(SfxRequest&) /sw/source/uibase/shells/basesh.cxx:651:27 > #11 0x7f24ff7eea14 in SfxStubSwBaseShellExecUndo(SfxShell*, SfxRequest&) /workdir/SdiTarget/sw/sdi/swslots.hxx:2203:1 > #12 0x7f2523fbc059 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) /sfx2/source/control/dispatch.cxx:254:9 > #13 0x7f2523fd1ced in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) /sfx2/source/control/dispatch.cxx:753:9 > #14 0x7f2523f61333 in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) /sfx2/source/control/bindings.cxx:1060:22 > #15 0x7f252437496b in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:688:53 > #16 0x7f2524377211 in SfxOfficeDispatch::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:266:16 > #17 0x7f24cad28dd6 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatch> const&, com::sun::star::util::URL const&, bool, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:163:30 > #18 0x7f24cad27cb2 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:120:16 > #19 0x7f24cad29684 in non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx > #20 0x7f24e91d386d in unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:94:33 > #21 0x7f25319b2012 in testTdf132321::TestBody() /sw/qa/extras/uiwriter/uiwriter3.cxx:982:5 Change-Id: Ibeb181bc38cd6f88df76403cca8a15b45090633f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151027 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-24introduce sw::SpzFrameFormat ...Bjoern Michaelsen1-2/+2
- ... as a base class of frame formats allowed into the spz frame format container - with a private ctor and friends SwDrawFrameFormat and SwFlyFrameFormat so only these two classes derive from it - with that, switch over the SpzFrameFormats to only ever allow these types into the container - in followups, likely quite a bit of stronger typing can be introduced. - ultimately, it would be nice to have each SwDrawFrameFormats and SwFlyFrameFormats in their own strongly typed container in the end. Change-Id: Ic30efc1220aded701533c9ca5003d2aaf8bbdaec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150452 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2023-04-24sw floattable: remove no longer needed ImportFloatingTableAsSplitFly settingMiklos Vajna2-9/+0
This was useful while developing the DOCX and DOC filters, but those are now enabled by default, so this can be removed. Change-Id: I0ebde6ec5e1a84f368d35b362bd1c3b1aabc9d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150895 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-19sw floattable: fix CppunitTest_sw_ww8export2's testTdf80635_pageRightRTLMiklos Vajna1-9/+13
Assert that the fly is aligned to the right of the page instead of testing it's not floating (even if sprmPPc is present in the document). Change-Id: Ibf160d02ca6ee997edf6232e5569c90d9b570c48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150603 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-19sw floattable: fix CppunitTest_sw_ww8export2's testTdf80635_pageLeftMiklos Vajna1-7/+13
Assert that the left of the floating table is around the page edge, not some larger value from the left of the body frame. Change-Id: Ibb5ddf64706dc2296b0aaf2273d216ee63fae63f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150600 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-19sw floattable: fix CppunitTest_sw_ww8export2's testTdf80635_marginRTLMiklos Vajna1-7/+11
The rendering is unchanged, but now the fly is positioned, the inner table doesn't have an own orientation. Also, this way the exported result is correct, so assert that, too. Change-Id: I158a856fd1e3712749867e6882b36974c0dfc3e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150592 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-18sw floattable: fix CppunitTest_sw_ww8export2's testTdf80635_marginLeftMiklos Vajna1-7/+15
The rendering is unchanged, but now the fly is positioned, the inner table doesn't have an own offset. Change-Id: I6ffaeb2672e04b3b855cbcb63ceba6506b970399 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150545 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-18sw floattable: fix CppunitTest_sw_ww8export's testTdf112346Miklos Vajna1-3/+10
Assert the layout, not the doc model, then this still passes. Change-Id: I5172fbc97547310f26cdf364191f404d875b3ff8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150540 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-18sw floattable, layout: don't split inside headers/footersMiklos Vajna1-7/+16
CppunitTest_sw_ww8export2's testTdf128700_relativeTableWidth had a layout loop in the SW_FORCE_FLY_SPLIT=1 case. This seems to happen because the footer had a big floating table, which doesn't fit the anchor's upper, but adding more pages won't help the table to fit. Fix the problem by not trying to split floating tables in headers/footers. An alternative would be to filter this out at import time, but then we would loose the setting on DOCX/DOC roundtrip, which is not ideal. Change-Id: Ice97159563812acee823dbd00b364601db293ed9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150535 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-17sw floatable: teach the DOC export about SwFormatFlySplitMiklos Vajna1-32/+26
Floating tables were always written back as a shape, containing a table, which can't split over pages, not even in Word. Now that we have split flys, we know that floating tables are mapped to split flys, so we can map split flys back to floating tables on export. The following SPRMs need writing, which are more or less the equivalent to DOCX's <w:tblpPr> attributes: - sprmTPc: relation orient for positioning the table - sprmTDyaFromText, sprmTDyaFromTextBottom: top/bottom margin - sprmTDxaFromText, sprmTDxaFromTextRight: left/right margin - sprmTDxaAbs: horizontal orientation - sprmTDyaAbs: vertical orientation With this, testTdf107773 passes in the SW_FORCE_FLY_SPLIT=1 case, while previously only the import side worked. Change-Id: Id534c1497eb56f9268bf49d2a19764051397bb18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150464 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-04-14sw floattable: unconditionally map DOC table pos props to SwFormatFlySplitMiklos Vajna1-1/+35
Previously we only mapped DOC floating tables to split fly frames when the heuristics asked for a fly frame, this goes further. Also add a testcase that shows that the import now works, but the export needs more work. In other words, this disables heuristics when the feature flag is on. Change-Id: I65018fef7994b283a60b0c38b22c16e2277cb80f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150410 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-03-29tdf#124472 DOCX import: fix broken field command by skipping delInstrTextCzeber László Ádám1-1/+0
Process only inserted and not tracked parts of the (partially) tracked field commands to avoid of broken fields, e.g. hyperlinks with bad URLs. For example, instead of the previous bad URL 'https://www.libreoffice.org/"HYPERLINK https://bugs.libreoffice.org/', now the hypertext field of the test document imported with the correct URL 'https://www.libreoffice.org/'. Field commands have change tracking in OOXML, but not in ODF/Writer. OOXML delInstrText, i.e. deleted part of the field commands was imported as part of the actual command, resulting broken fields, e.g. hyperlinks. FieldCommand was splitted into two parts, deleted and non-deleted elements. This way the commands do not get mixed up if the order is changed and no fragmentation of deleted items occurs (otherwise it could fail on the test of tdf#150086). Change-Id: I97d22e5ee1fe647715206f86c4160ebcc4b9cca0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148528 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-02-09tdf#153042 doc/x/rtf: pre-emptive unit tests for numbering tabstopJustin Luth1-0/+5
These existing unit tests need to have a tabstop in the front. Although different versions of MS Word can handle similar situations differently (regardless of compatibility settings - i.e. buggy) in these cases they are all rendered the same way by Word 2003/2010/2019. make CppunitTest_sw_rtfimport CPPUNIT_TEST_NAME=testTdf78506 make CppunitTest_sw_rtfimport CPPUNIT_TEST_NAME=testTdf116265 In this one, LO's chapter numbering defaults to none-numbering followed by a tabstop. The tabstop should not be there/never become visible. make CppunitTest_sw_ww8export3 CPPUNIT_TEST_NAME=testPresetDash For this added test, older versions of Word 2010/2003 don't show a tabstop. According to MS Word 2019 however, this should have a tabstop in the front. make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf153042_largeTab ... but this nearly identical file does not display with any tabstop, and looks the same in all versions of Word. make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf153042_noTab Change-Id: I59d904ef7dd37b694b02f57d6743ee5b232b42a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146731 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-08Revert "tdf#148360 doc import: add NO_NUMBERING_SHOW_FOLLOWBY(true)"Justin Luth2-11/+0
This reverts commit 2405a36f3bcd43f80371ccaed47f7523ff0d8757 which was backported to 7.4.1. This solves the regression report for DOC in tdf#153042. The problem is that the tab-without-numbering is displaying in cases where it shouldn't (i.e. when the tabstop position matches the first line indent). Although the patch itself is fine (DOC should do the same thing as DOCX) the feature is incomplete, even for DOCX/RTF. So just remove DOC from this mix - especially since there seem to be a LOT more instances of DOC files that need the incomplete aspect. Once it is proven to work OK for DOCX, we can add DOC back in. Change-Id: I3c550fc2ca29cf1490ec0a5e3979a6acbd102385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146670 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
2023-01-27sw: avoid copy&paste in SwFieldPortion::dumpAsXml()Miklos Vajna2-2/+2
Improve SwFont::dumpAsXml() a little, then we can just call it. Change-Id: I581445230cd0732819e1bbb45727cf59231c5f47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146191 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-19tdf#141649 doc import: do not duplicate conditional textJustin Luth2-0/+9
This patch is a mixed blessing. It will be a regression if an IF FIELD was bogus, and the user only wanted to see the modified, unrefreshed text. That is because in MS Word, most fields do not update automatically, but require the user to press F9 to refresh the contents. The contents are also editable, so the result might not match either the true or false result-string. However, in LO the IF FIELD is always refreshed, and thus will never display any bogus hand-modifications. The import of these IF fields started in DOC in LO 6.1, but it was never correct and immediately duplicated content. Additionally, DOC format didn't export at all, so anything to do with IF FIELDS was lost - meaning that after a round-trip the result was the same as what MS Word last saw with the field gone. So in the eyes of the user, the fixing of import and export might be causing a regression of changed text. So be it. I can only assume that in most cases the use of an IF FIELD is intentional and that it would be desirsable to have it working. Change-Id: If90f6f4cddcefebf379352aac6519595c1bf2b23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145821 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-12-26tdf#151548 ww8export: export formfield namesJustin Luth2-0/+13
This should have been looking for ODF_FORMCHECKBOX_NAME for checkboxes instead of a never-created grabbag "name". In any case, since LO 7.5 all the three true formfields preserve their name in the name property, so no grabbags are necessary any more. Unforunately the unit test is not very good. I copied it from the DOCX case, but I just can't get it to fail - even without any patching. Yet I know it is broken b/c it is broken in MS Word 2010, but now it isn't broken after the patch round-trips it. Change-Id: I88e92d4c6d0b0e26ba80c428e06e63859941a3ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144815 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-12-23Fix typoAndrea Gelmini2-1/+1
Thanks a lot Julien! Change-Id: I987a37519228ad0771565fa59d55d6e50a0d3c81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144743 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-11-25SwModelTestBase: use createSwDocXisco Fauli1-1/+1
in order to unify the code Change-Id: Iedeff59cc45775c80844e8e030f61354325399da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143282 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-17CppunitTest_sw_layoutwriter: use more SwParaPortion::dumpAsXml()Miklos Vajna3-7/+7
See commit feeed3e762cf077fbd9cf48f82e949365108ccc1 (CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing, 2022-04-07) for motivation. Change-Id: I3c5d53dc33112f7d8c46cf2baf35ba03ff7fa3fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142790 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-11SwModelTestBase: use createSwDoc everywhereXisco Fauli2-4/+4
In order to unify the code Also call getSwDoc only when it's needed so move it outside createSwDoc Change-Id: I082d46108581e8f2e2e430e854980035f471ceac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142586 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-11SwModelTestBase: remove duplicated methodXisco Fauli1-2/+2
Change-Id: I343fe2711e232ffbdec13f0072ee31a7549f7da8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142546 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-09CppunitTest_sw_ww8export4: remove not needed mustTestImportOf()Miklos Vajna1-6/+0
Input was always DOC, so no need to filter out non-DOC. And if there will be a non-DOC, we can use CPPUNIT_TEST_FIXTURE(). Change-Id: I74d20b750e1ebe3449f1454b8772fae691bf78e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142467 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-08swmodeltestbase: make mbExported privateXisco Fauli2-12/+12
Change-Id: Idff0960c05f2330ce746147f0b3a2e0aa3b7c6fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142410 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-04SwModelTestBase: make mpTestDocumentPath privateXisco Fauli2-4/+4
in preparation for future inheritance from UnoApiTest Change-Id: Ie5dee5af3609d8490d7d7bad0d6dbc4c8fc17bb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142280 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>