summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/api/SwXDocumentSettings.cxx2
-rw-r--r--sw/qa/api/SwXTextField.cxx1
-rw-r--r--sw/qa/api/SwXTextTable.cxx1
-rw-r--r--sw/qa/api/terminate.cxx1
-rw-r--r--sw/qa/core/Test-BigPtrArray.cxx18
-rw-r--r--sw/qa/core/data/README16
-rw-r--r--sw/qa/core/draw/data/textbox-undo-ordnum.docxbin0 -> 21223 bytes
-rw-r--r--sw/qa/core/draw/draw.cxx52
-rw-r--r--sw/qa/core/fields/fields.cxx69
-rw-r--r--sw/qa/core/frmedt/frmedt.cxx2
-rw-r--r--sw/qa/core/layout/data/tdf122894-4.docbin0 -> 214528 bytes
-rw-r--r--sw/qa/core/layout/data/tdf45908_invoice.odtbin0 -> 8555 bytes
-rw-r--r--sw/qa/core/layout/data/vmerge-cell-border.docxbin0 -> 13610 bytes
-rw-r--r--sw/qa/core/layout/layout.cxx251
-rw-r--r--sw/qa/core/macros-test.cxx7
-rw-r--r--sw/qa/core/objectpositioning/data/inside-outside-vert-align.docxbin15838 -> 17252 bytes
-rw-r--r--sw/qa/core/objectpositioning/objectpositioning.cxx50
-rw-r--r--sw/qa/core/test_ToxLinkProcessor.cxx18
-rw-r--r--sw/qa/core/text/data/tabovermargin-section.fodt50
-rw-r--r--sw/qa/core/text/text.cxx66
-rw-r--r--sw/qa/core/tox/tox.cxx256
-rw-r--r--sw/qa/core/undo/data/table-copy-redline.odtbin0 -> 32554 bytes
-rw-r--r--sw/qa/core/undo/undo.cxx19
-rw-r--r--sw/qa/core/unocore/unocore.cxx14
-rw-r--r--sw/qa/core/uwriter.cxx172
-rw-r--r--sw/qa/extras/globalfilter/globalfilter.cxx2
-rw-r--r--sw/qa/extras/htmlexport/data/ole1-pres-data-wmf.odtbin0 -> 41595 bytes
-rw-r--r--sw/qa/extras/htmlexport/data/reqif-aschar-objsize.odtbin0 -> 70411 bytes
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx164
-rw-r--r--sw/qa/extras/htmlexport/xhtmlexport.cxx2
-rw-r--r--sw/qa/extras/layout/data/tdf116486.docxbin22455 -> 22470 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf138465min.docxbin0 -> 19431 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf138951.odtbin0 -> 9894 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf141079.odtbin0 -> 8787 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf40260.odtbin0 -> 17192 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf72727.odtbin0 -> 13943 bytes
-rw-r--r--sw/qa/extras/layout/layout2.cxx171
-rw-r--r--sw/qa/extras/mailmerge/mailmerge.cxx3
-rw-r--r--sw/qa/extras/odfexport/data/Formcontrol needs high z-index.odtbin0 -> 25828 bytes
-rw-r--r--sw/qa/extras/odfexport/data/MadeByLO7.odtbin0 -> 17354 bytes
-rw-r--r--sw/qa/extras/odfexport/data/gutter-left.odtbin0 -> 8519 bytes
-rw-r--r--sw/qa/extras/odfexport/data/pagestyle_background_lo64.odtbin0 -> 9947 bytes
-rw-r--r--sw/qa/extras/odfexport/data/pagestyle_background_lo70.odtbin0 -> 10125 bytes
-rw-r--r--sw/qa/extras/odfexport/data/pagestyle_background_ooo33.odtbin0 -> 9127 bytes
-rw-r--r--sw/qa/extras/odfexport/data/tdf115815.odtbin0 -> 9809 bytes
-rw-r--r--sw/qa/extras/odfexport/data/tdf140437.odtbin0 -> 8641 bytes
-rw-r--r--sw/qa/extras/odfexport/data/tdf95806.docxbin0 -> 16907 bytes
-rw-r--r--sw/qa/extras/odfexport/data/testTdf52065_centerTabs.odtbin0 -> 11274 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx388
-rw-r--r--sw/qa/extras/odfexport/odfexport2.cxx45
-rw-r--r--sw/qa/extras/odfimport/data/tdf128737.odtbin0 -> 18111 bytes
-rw-r--r--sw/qa/extras/odfimport/data/vmerge-cell-border.odtbin0 -> 8996 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx41
-rw-r--r--sw/qa/extras/ooxmlexport/data/controlshape.fodt182
-rw-r--r--sw/qa/extras/ooxmlexport/data/effect-extent-line-width.docxbin0 -> 23257 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/effectextent-margin.docxbin13219 -> 13144 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/fly_fieldmark.fodt60
-rw-r--r--sw/qa/extras/ooxmlexport/data/footer-margin-lost.docxbin0 -> 21058 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/gutter-left.docxbin0 -> 11860 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/gutter-top.docxbin0 -> 13032 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/rtl-gutter.docxbin0 -> 8843 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt185
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf118535.odtbin0 -> 12032 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf121666_lostPage.docxbin0 -> 20235 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odtbin0 -> 9122 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odtbin0 -> 9164 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf125936_numberingSuperscript.docxbin0 -> 25589 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf133045_TestShapeAlignmentRelativeFromTopMargin.docxbin19650 -> 19805 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf133473.docxbin0 -> 83030 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf134619_numberingProps.docbin0 -> 75264 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf134951_duplicates.odtbin0 -> 59225 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docxbin0 -> 9989 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf135774_numberingShading.docxbin0 -> 5435 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf136059.odtbin0 -> 17964 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf136841.docxbin0 -> 15697 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf137655.docxbin0 -> 33098 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf138345_numberingHighlight.docxbin0 -> 5752 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf138771.docxbin0 -> 26757 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf138780.odtbin0 -> 9383 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf140137.docxbin0 -> 28792 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf140182_extraPagebreak.docxbin0 -> 34729 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf140336_paraNoneShading.odtbin0 -> 10529 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf140572_docDefault_superscript.docxbin0 -> 16387 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf140597.docxbin0 -> 13966 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf140668.docxbin0 -> 14629 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf141172.docxbin0 -> 16286 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf141173_missingFrames.rtf61
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf141231_arabicHebrewNumbering.docxbin0 -> 20367 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf141660.docxbin0 -> 35150 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf88126.docxbin40642 -> 0 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/textframe-gradient.docxbin10916 -> 13655 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx16
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx15
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx40
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport12.cxx35
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx27
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx71
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx29
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx252
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx31
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx10
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx17
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport6.cxx18
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx9
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx12
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf118693.docxbin0 -> 26072 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf122717.docxbin0 -> 4940 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docxbin0 -> 12600 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx53
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx61
-rw-r--r--sw/qa/extras/rtfexport/data/gutter-left.rtf4
-rw-r--r--sw/qa/extras/rtfexport/data/gutter-top.rtf4
-rw-r--r--sw/qa/extras/rtfexport/data/rtl-gutter.rtf4
-rw-r--r--sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf38
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx32
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx82
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx29
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx18
-rw-r--r--sw/qa/extras/tiledrendering/data/cond-coll-copy.odtbin0 -> 7351 bytes
-rw-r--r--sw/qa/extras/tiledrendering/data/tdf114799_highlight.docxbin0 -> 29040 bytes
-rw-r--r--sw/qa/extras/tiledrendering/data/tdf114799_shd.docx (renamed from sw/qa/extras/tiledrendering/data/tdf114799.docx)bin29049 -> 29049 bytes
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx205
-rw-r--r--sw/qa/extras/uiwriter/data/AsCharTxBxTest.docxbin0 -> 19888 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/AtPageTextBoxCrash.odt (renamed from sw/qa/extras/uiwriter/data3/AtPageTextBoxCrash.odt)bin9880 -> 9880 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/floating-table-position.docx (renamed from sw/qa/extras/uiwriter/data2/floating-table-position.docx)bin13236 -> 13236 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/frame_size_export.docx (renamed from sw/qa/extras/uiwriter/data2/frame_size_export.docx)bin13929 -> 13929 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/image-comment-at-char.odt (renamed from sw/qa/extras/uiwriter/data2/image-comment-at-char.odt)bin9985 -> 9985 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/image-comment.odt (renamed from sw/qa/extras/uiwriter/data2/image-comment.odt)bin9847 -> 9847 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/lorem.fodt (renamed from sw/qa/extras/uiwriter/data2/lorem.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/num-parent-style.docx (renamed from sw/qa/extras/uiwriter/data2/num-parent-style.docx)bin14002 -> 14002 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/ofz18563.docx (renamed from sw/qa/extras/uiwriter/data2/ofz18563.docx)bin7102 -> 7102 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/ole-save-while-edit.odt (renamed from sw/qa/extras/uiwriter/data2/ole-save-while-edit.odt)bin14547 -> 14547 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/redline-para-join.docx (renamed from sw/qa/extras/uiwriter/data2/redline-para-join.docx)bin13090 -> 13090 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/shape-page-move.odt (renamed from sw/qa/extras/uiwriter/data2/shape-page-move.odt)bin10137 -> 10137 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf100018-1.odt (renamed from sw/qa/extras/uiwriter/data3/tdf100018-1.odt)bin18795 -> 18795 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf100691.fodt (renamed from sw/qa/extras/uiwriter/data3/tdf100691.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf101534.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf101534.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf104649.docx (renamed from sw/qa/extras/uiwriter/data3/tdf104649.docx)bin75971 -> 75971 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf105330.odt (renamed from sw/qa/extras/uiwriter/data2/tdf105330.odt)bin8970 -> 8970 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf105413.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf105413.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf106843.docx (renamed from sw/qa/extras/uiwriter/data2/tdf106843.docx)bin13936 -> 13936 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf107893.odt (renamed from sw/qa/extras/uiwriter/data3/tdf107893.odt)bin9133 -> 9133 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf107975.odt (renamed from sw/qa/extras/uiwriter/data3/tdf107975.odt)bin10312 -> 10312 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf108124.odt (renamed from sw/qa/uitest/data/tdf108124.odt)bin21575 -> 21575 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf108687_tabstop.odt (renamed from sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt)bin12847 -> 12847 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf112342.docx (renamed from sw/qa/extras/uiwriter/data3/tdf112342.docx)bin19601 -> 19601 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf115815.odtbin0 -> 9809 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf117923.docx (renamed from sw/qa/extras/uiwriter/data2/tdf117923.docx)bin21227 -> 21227 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf118311.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf118311.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf118699.docx (renamed from sw/qa/extras/uiwriter/data2/tdf118699.docx)bin21417 -> 21417 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf119019.docx (renamed from sw/qa/extras/uiwriter/data2/tdf119019.docx)bin13665 -> 13665 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf120336.docx (renamed from sw/qa/extras/uiwriter/data2/tdf120336.docx)bin21892 -> 21892 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf120338.docx (renamed from sw/qa/extras/uiwriter/data2/tdf120338.docx)bin14898 -> 14898 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf122942.odt (renamed from sw/qa/extras/uiwriter/data2/tdf122942.odt)bin9864 -> 9864 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf123102.odt (renamed from sw/qa/extras/uiwriter/data2/tdf123102.odt)bin13674 -> 13674 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf123285.odt (renamed from sw/qa/extras/uiwriter/data3/tdf123285.odt)bin11762 -> 11762 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf124261.docx (renamed from sw/qa/extras/uiwriter/data2/tdf124261.docx)bin22327 -> 22327 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf124397.docx (renamed from sw/qa/extras/uiwriter/data3/tdf124397.docx)bin29518 -> 29518 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf124722.rtf (renamed from sw/qa/extras/uiwriter/data3/tdf124722.rtf)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf125261.odt (renamed from sw/qa/extras/uiwriter/data3/tdf125261.odt)bin8900 -> 8900 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf125310.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf125310.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf125310b.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf125310b.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf125881.docx (renamed from sw/qa/extras/uiwriter/data2/tdf125881.docx)bin34448 -> 34448 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf125916.docx (renamed from sw/qa/extras/uiwriter/data2/tdf125916.docx)bin40570 -> 40570 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf126206.docx (renamed from sw/qa/extras/uiwriter/data2/tdf126206.docx)bin12509 -> 12509 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf126340.odt (renamed from sw/qa/extras/uiwriter/data3/tdf126340.odt)bin9910 -> 9910 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf126504.odt (renamed from sw/qa/extras/uiwriter/data3/tdf126504.odt)bin9266 -> 9266 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf126626.docx (renamed from sw/qa/extras/uiwriter/data3/tdf126626.docx)bin16513 -> 16513 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf126784_distributeSelectedColumns.odt (renamed from sw/qa/extras/uiwriter/data2/tdf126784_distributeSelectedColumns.odt)bin21302 -> 21302 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf127652.odt (renamed from sw/qa/extras/uiwriter/data3/tdf127652.odt)bin26963 -> 26963 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf128335.odt (renamed from sw/qa/extras/uiwriter/data2/tdf128335.odt)bin10391 -> 10391 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf128603.odt (renamed from sw/qa/extras/uiwriter/data2/tdf128603.odt)bin10391 -> 10391 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf128739.docx (renamed from sw/qa/extras/uiwriter/data3/tdf128739.docx)bin4375 -> 4375 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf128782.odt (renamed from sw/qa/extras/uiwriter/data3/tdf128782.odt)bin8817 -> 8817 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf129382.docx (renamed from sw/qa/extras/uiwriter/data3/tdf129382.docx)bin112383 -> 112383 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf129655-vtextbox.odt (renamed from sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt)bin9958 -> 9958 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf129805.docx (renamed from sw/qa/extras/uiwriter/data3/tdf129805.docx)bin20783 -> 20783 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf130680.odt (renamed from sw/qa/extras/uiwriter/data3/tdf130680.odt)bin97412 -> 97412 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf130685.odt (renamed from sw/qa/extras/uiwriter/data3/tdf130685.odt)bin24714 -> 24714 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf130746.odt (renamed from sw/qa/extras/uiwriter/data3/tdf130746.odt)bin9378 -> 9378 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf130805.odt (renamed from sw/qa/extras/uiwriter/data3/tdf130805.odt)bin9392 -> 9392 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf131684.docx (renamed from sw/qa/extras/uiwriter/data3/tdf131684.docx)bin6506 -> 6506 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf131963.docx (renamed from sw/qa/extras/uiwriter/data3/tdf131963.docx)bin34251 -> 34251 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132160.odt (renamed from sw/qa/extras/uiwriter/data2/tdf132160.odt)bin9501 -> 9501 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132187.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132187.odt)bin10580 -> 10580 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132236.odt (renamed from sw/qa/extras/uiwriter/data2/tdf132236.odt)bin10140 -> 10140 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132321.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132321.odt)bin9045 -> 9045 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132420.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132420.odt)bin11766 -> 11766 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132596.docx (renamed from sw/qa/extras/uiwriter/data3/tdf132596.docx)bin11062 -> 11062 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132597.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132597.odt)bin132875 -> 132875 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132637_protectTrackChanges.doc (renamed from sw/qa/extras/uiwriter/data3/tdf132637_protectTrackChanges.doc)bin26624 -> 26624 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132725.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132725.odt)bin73108 -> 73108 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132744.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132744.odt)bin465501 -> 465501 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132911.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132911.odt)bin10980 -> 10980 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf132944.odt (renamed from sw/qa/extras/uiwriter/data3/tdf132944.odt)bin9682 -> 9682 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf133477.fodt (renamed from sw/qa/extras/uiwriter/data3/tdf133477.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf133490.odt (renamed from sw/qa/extras/uiwriter/data3/tdf133490.odt)bin9606 -> 9606 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf133967.odt (renamed from sw/qa/extras/uiwriter/data3/tdf133967.odt)bin16689 -> 16689 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf133982.docx (renamed from sw/qa/extras/uiwriter/data3/tdf133982.docx)bin11705 -> 11705 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf133990.odt (renamed from sw/qa/extras/uiwriter/data3/tdf133990.odt)bin17859 -> 17859 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf134021.docx (renamed from sw/qa/extras/uiwriter/data3/tdf134021.docx)bin23096 -> 23096 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf134227.docx (renamed from sw/qa/extras/uiwriter/data3/tdf134227.docx)bin19455 -> 19455 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf134253.odt (renamed from sw/qa/extras/uiwriter/data3/tdf134253.odt)bin46144 -> 46144 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf134404.odt (renamed from sw/qa/extras/uiwriter/data3/tdf134404.odt)bin9928 -> 9928 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf134626.odt (renamed from sw/qa/extras/uiwriter/data3/tdf134626.odt)bin9136 -> 9136 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf134931.odt (renamed from sw/qa/extras/uiwriter/data3/tdf134931.odt)bin9962 -> 9962 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf135056.odt (renamed from sw/qa/extras/uiwriter/data3/tdf135056.odt)bin19293 -> 19293 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf135412.docx (renamed from sw/qa/extras/uiwriter/data3/tdf135412.docx)bin22923 -> 22923 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf135623.docx (renamed from sw/qa/extras/uiwriter/data3/tdf135623.docx)bin25768 -> 25768 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf135661.odt (renamed from sw/qa/extras/uiwriter/data3/tdf135661.odt)bin10800 -> 10800 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf135662.odtbin0 -> 13627 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf135733.odt (renamed from sw/qa/extras/uiwriter/data3/tdf135733.odt)bin11211 -> 11211 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf136385.odt (renamed from sw/qa/extras/uiwriter/data3/tdf136385.odt)bin8759 -> 8759 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf136778.docxbin0 -> 11761 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf137964.odt (renamed from sw/qa/extras/uiwriter/data3/tdf137964.odt)bin9332 -> 9332 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf138130.docx (renamed from sw/qa/extras/uiwriter/data3/tdf138130.docx)bin8977 -> 8977 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf138482.docxbin0 -> 18955 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf139127.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf139127.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf140828.docxbin0 -> 5393 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf39721.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf39721.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf47471_paraStyleBackground.odt (renamed from sw/qa/extras/uiwriter/data2/tdf47471_paraStyleBackground.odt)bin13816 -> 13816 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf52391.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf52391.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf54819.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf54819.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf54819b.odt (renamed from sw/qa/extras/uiwriter/data2/tdf54819b.odt)bin17538 -> 17538 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf61154.fodt (renamed from sw/qa/extras/uiwriter/data3/tdf61154.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf64242_optimizeTable.odt (renamed from sw/qa/extras/uiwriter/data2/tdf64242_optimizeTable.odt)bin11060 -> 11060 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf76636.doc (renamed from sw/qa/extras/uiwriter/data3/tdf76636.doc)bin13824 -> 13824 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf76817.docx (renamed from sw/qa/extras/uiwriter/data2/tdf76817.docx)bin18584 -> 18584 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/tdf76817.fodt (renamed from sw/qa/extras/uiwriter/data2/tdf76817.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/tdf90069.docx (renamed from sw/qa/extras/uiwriter/data2/tdf90069.docx)bin4737 -> 4737 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/try2.fodt (renamed from sw/qa/extras/uiwriter/data2/try2.fodt)0
-rw-r--r--sw/qa/extras/uiwriter/data/txbx_crash.odt (renamed from sw/qa/extras/uiwriter/data3/txbx_crash.odt)bin9369 -> 9369 bytes
-rw-r--r--sw/qa/extras/uiwriter/data/udindex3.odtbin0 -> 11068 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx101
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx193
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx490
-rw-r--r--sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt87
-rw-r--r--sw/qa/extras/unowriter/unowriter.cxx73
-rw-r--r--sw/qa/extras/ww8export/data/gutter-left.docbin0 -> 22528 bytes
-rw-r--r--sw/qa/extras/ww8export/data/gutter-top.docbin0 -> 22528 bytes
-rw-r--r--sw/qa/extras/ww8export/data/rtl-gutter.docbin0 -> 22528 bytes
-rw-r--r--sw/qa/extras/ww8export/data/tdf100961_fixedDateTime.docbin0 -> 19968 bytes
-rw-r--r--sw/qa/extras/ww8export/data/tdf120003.docbin0 -> 10752 bytes
-rw-r--r--sw/qa/extras/ww8export/data/tdf139495_tinyHeader.docbin0 -> 22016 bytes
-rw-r--r--sw/qa/extras/ww8export/data/tdf81705_outlineLevel.docbin0 -> 29696 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx33
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx77
-rw-r--r--sw/qa/extras/ww8import/data/tdf120768_zOrder.docbin0 -> 53760 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx12
-rw-r--r--sw/qa/python/check_cross_references.py11
-rw-r--r--sw/qa/python/check_indexed_property_values.py3
-rw-r--r--sw/qa/python/check_named_property_values.py4
-rw-r--r--sw/qa/python/check_range_properties.py5
-rw-r--r--sw/qa/python/check_styles.py3
-rw-r--r--sw/qa/python/check_xautotextcontainer.py1
-rw-r--r--sw/qa/python/check_xautotextgroup.py1
-rw-r--r--sw/qa/python/check_xmodel.py2
-rw-r--r--sw/qa/python/text_portion_enumeration_test.py12
-rw-r--r--sw/qa/python/xcontrolshape.py2
-rw-r--r--sw/qa/python/xstyleloader.py3
-rw-r--r--sw/qa/python/xtext.py1
-rw-r--r--sw/qa/python/xtextcursor.py3
-rwxr-xr-xsw/qa/python/xtextfieldssupplier.py2
-rw-r--r--sw/qa/python/xtextrange.py3
-rw-r--r--sw/qa/uibase/dochdl/dochdl.cxx30
-rw-r--r--sw/qa/uibase/shells/shells.cxx40
-rw-r--r--sw/qa/uibase/uno/uno.cxx43
-rw-r--r--sw/qa/uitest/chapterNumbering/chapterNumbering.py24
-rw-r--r--sw/qa/uitest/chapterNumbering/tdf123547.py4
-rw-r--r--sw/qa/uitest/chapterNumbering/tdf140528.py60
-rw-r--r--sw/qa/uitest/classification/classification.py20
-rw-r--r--sw/qa/uitest/data/TestHiddenHeadersFooters.docxbin0 -> 18063 bytes
-rw-r--r--sw/qa/uitest/data/metadata.odtbin0 -> 10066 bytes
-rw-r--r--sw/qa/uitest/data/tdf104795.odtbin0 -> 10947 bytes
-rw-r--r--sw/qa/uitest/data/tdf122780.docxbin0 -> 93731 bytes
-rw-r--r--sw/qa/uitest/data/tdf127166_prstDash_Word97.docxbin0 -> 6300 bytes
-rw-r--r--sw/qa/uitest/data/tdf137803.odtbin0 -> 9416 bytes
-rw-r--r--sw/qa/uitest/data/tdf138271.odtbin0 -> 8763 bytes
-rw-r--r--sw/qa/uitest/data/tdf140117.fodt95
-rw-r--r--sw/qa/uitest/data/tdf140198.odtbin0 -> 8667 bytes
-rw-r--r--sw/qa/uitest/data/tdf140239.odtbin0 -> 9021 bytes
-rw-r--r--sw/qa/uitest/data/tdf140486.odtbin0 -> 8783 bytes
-rw-r--r--sw/qa/uitest/data/tdf140661.odtbin0 -> 13854 bytes
-rw-r--r--sw/qa/uitest/data/tdf40427_SectionPositions.odtbin0 -> 11351 bytes
-rw-r--r--sw/qa/uitest/data/tdf46561.odtbin0 -> 8798 bytes
-rw-r--r--sw/qa/uitest/data/tdf49683.rtf81
-rw-r--r--sw/qa/uitest/findBar/findbar.py14
-rw-r--r--sw/qa/uitest/findBar/tdf136941.py8
-rw-r--r--sw/qa/uitest/findBar/tdf138232.py4
-rw-r--r--sw/qa/uitest/findBar/tdf88608.py4
-rw-r--r--sw/qa/uitest/findReplace/findReplace.py3
-rw-r--r--sw/qa/uitest/findReplace/tdf106099.py12
-rw-r--r--sw/qa/uitest/findReplace/tdf118208.py6
-rw-r--r--sw/qa/uitest/findReplace/tdf119462.py6
-rw-r--r--sw/qa/uitest/findSimilarity/findSimilarity.py5
-rw-r--r--sw/qa/uitest/librelogo/compile.py7
-rw-r--r--sw/qa/uitest/librelogo/run.py8
-rw-r--r--sw/qa/uitest/macro_tests/tdf124413.py2
-rw-r--r--sw/qa/uitest/macro_tests/tdf64690.py79
-rw-r--r--sw/qa/uitest/navigator/tdf114724.py30
-rw-r--r--sw/qa/uitest/navigator/tdf137274.py8
-rw-r--r--sw/qa/uitest/navigator/tdf140257.py115
-rw-r--r--sw/qa/uitest/navigator/tdf140661.py61
-rw-r--r--sw/qa/uitest/navigator/tdf40427.py81
-rw-r--r--sw/qa/uitest/options/tdf78133.py2
-rw-r--r--sw/qa/uitest/sidebar/stylesSidebar.py5
-rw-r--r--sw/qa/uitest/sidebar/tdf135590.py81
-rw-r--r--sw/qa/uitest/sidebar/tdf99711.py8
-rw-r--r--sw/qa/uitest/styleInspector/styleInspector.py74
-rw-r--r--sw/qa/uitest/styleInspector/tdf137513.py58
-rw-r--r--sw/qa/uitest/table/sheetToTable.py3
-rw-r--r--sw/qa/uitest/table/splitTable.py6
-rw-r--r--sw/qa/uitest/table/tableProperties.py17
-rw-r--r--sw/qa/uitest/table/tableToText.py5
-rw-r--r--sw/qa/uitest/table/tdf115026.py1
-rw-r--r--sw/qa/uitest/table/tdf116737.py2
-rwxr-xr-xsw/qa/uitest/table/tdf128593.py1
-rw-r--r--sw/qa/uitest/table/tdf134881_colProportionalAdjust.py2
-rw-r--r--sw/qa/uitest/table/tdf81292.py3
-rw-r--r--sw/qa/uitest/table/tdf99334.py3
-rw-r--r--sw/qa/uitest/table/textToTable.py5
-rw-r--r--sw/qa/uitest/ui/fmtui/fmtui.py2
-rw-r--r--sw/qa/uitest/writer_dialogs/openDialogs.py3
-rw-r--r--sw/qa/uitest/writer_tests/comments.py29
-rw-r--r--sw/qa/uitest/writer_tests/insertCaption.py3
-rw-r--r--sw/qa/uitest/writer_tests/tdf134734.py92
-rw-r--r--sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py14
-rw-r--r--sw/qa/uitest/writer_tests/tdf53460.py1
-rw-r--r--sw/qa/uitest/writer_tests/tdf78068.py8
-rw-r--r--sw/qa/uitest/writer_tests/tdf81457.py18
-rw-r--r--sw/qa/uitest/writer_tests/watermark.py3
-rw-r--r--sw/qa/uitest/writer_tests2/asianPhoneticGuide.py17
-rw-r--r--sw/qa/uitest/writer_tests2/bookmark.py2
-rw-r--r--sw/qa/uitest/writer_tests2/deleteAllComments.py6
-rw-r--r--sw/qa/uitest/writer_tests2/documentProperties.py28
-rw-r--r--sw/qa/uitest/writer_tests2/exchangeDatabase.py5
-rw-r--r--sw/qa/uitest/writer_tests2/fontworks.py5
-rw-r--r--sw/qa/uitest/writer_tests2/formatBulletsNumbering.py22
-rw-r--r--sw/qa/uitest/writer_tests2/formatCharacter.py14
-rw-r--r--sw/qa/uitest/writer_tests2/formatParagraph.py47
-rw-r--r--sw/qa/uitest/writer_tests2/horizontalLine.py2
-rw-r--r--sw/qa/uitest/writer_tests2/insertFootnote.py5
-rw-r--r--sw/qa/uitest/writer_tests2/tdf116474.py3
-rw-r--r--sw/qa/uitest/writer_tests3/autoredactDialog.py4
-rw-r--r--sw/qa/uitest/writer_tests3/hyperlinkdialog.py35
-rw-r--r--sw/qa/uitest/writer_tests3/insertEndnote.py5
-rw-r--r--sw/qa/uitest/writer_tests3/insertEnvelope.py2
-rw-r--r--sw/qa/uitest/writer_tests3/insertFootEndnote.py4
-rw-r--r--sw/qa/uitest/writer_tests3/insertQrCodeGen.py7
-rw-r--r--sw/qa/uitest/writer_tests3/insertSignatureLine.py2
-rw-r--r--sw/qa/uitest/writer_tests3/lineNumbering.py20
-rw-r--r--sw/qa/uitest/writer_tests3/pageDialog.py2
-rw-r--r--sw/qa/uitest/writer_tests3/sort.py12
-rw-r--r--sw/qa/uitest/writer_tests3/specialCharacter.py98
-rw-r--r--sw/qa/uitest/writer_tests3/tdf79236.py3
-rw-r--r--sw/qa/uitest/writer_tests4/spellDialog.py3
-rw-r--r--sw/qa/uitest/writer_tests4/start.py2
-rw-r--r--sw/qa/uitest/writer_tests4/tdf108124.py42
-rw-r--r--sw/qa/uitest/writer_tests4/tdf113252.py7
-rw-r--r--sw/qa/uitest/writer_tests4/tdf115088.py4
-rw-r--r--sw/qa/uitest/writer_tests4/tdf115572.py5
-rw-r--r--sw/qa/uitest/writer_tests4/tdf115573.py5
-rw-r--r--sw/qa/uitest/writer_tests4/tdf122449.py2
-rw-r--r--sw/qa/uitest/writer_tests4/tdf134439.py9
-rw-r--r--sw/qa/uitest/writer_tests4/tdf135636.py6
-rw-r--r--sw/qa/uitest/writer_tests4/tdf136578.py10
-rw-r--r--sw/qa/uitest/writer_tests4/tdf138546.py8
-rw-r--r--sw/qa/uitest/writer_tests4/tdf51352.py1
-rw-r--r--sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py1
-rw-r--r--sw/qa/uitest/writer_tests5/autocorrectOptions.py2
-rw-r--r--sw/qa/uitest/writer_tests5/columns.py4
-rw-r--r--sw/qa/uitest/writer_tests5/tdf107494.py5
-rw-r--r--sw/qa/uitest/writer_tests5/tdf117039.py3
-rw-r--r--sw/qa/uitest/writer_tests5/tdf118540.py5
-rw-r--r--sw/qa/uitest/writer_tests5/tdf121591.py41
-rw-r--r--sw/qa/uitest/writer_tests5/tdf122045.py1
-rw-r--r--sw/qa/uitest/writer_tests5/tdf122722.py4
-rw-r--r--sw/qa/uitest/writer_tests5/tdf123446.py5
-rw-r--r--sw/qa/uitest/writer_tests5/titlePage.py5
-rw-r--r--sw/qa/uitest/writer_tests5/titlePageWizard.py81
-rw-r--r--sw/qa/uitest/writer_tests5/titlePageWizard2.py136
-rw-r--r--sw/qa/uitest/writer_tests5/xwindow.py3
-rw-r--r--sw/qa/uitest/writer_tests5/zoom.py3
-rw-r--r--sw/qa/uitest/writer_tests6/tdf107847.py4
-rw-r--r--sw/qa/uitest/writer_tests6/tdf120731.py6
-rw-r--r--sw/qa/uitest/writer_tests6/tdf124586.py11
-rw-r--r--sw/qa/uitest/writer_tests6/tdf124675.py5
-rw-r--r--sw/qa/uitest/writer_tests6/tdf125104.py5
-rw-r--r--sw/qa/uitest/writer_tests6/tdf126017.py5
-rw-r--r--sw/qa/uitest/writer_tests6/tdf126168.py4
-rw-r--r--sw/qa/uitest/writer_tests6/tdf126627.py5
-rw-r--r--sw/qa/uitest/writer_tests6/tdf128431.py7
-rw-r--r--sw/qa/uitest/writer_tests6/tdf44837.py4
-rw-r--r--sw/qa/uitest/writer_tests7/forms.py214
-rw-r--r--sw/qa/uitest/writer_tests7/tdf104795.py (renamed from sw/qa/uitest/writer_tests4/tdf49683.py)19
-rw-r--r--sw/qa/uitest/writer_tests7/tdf115853.py44
-rw-r--r--sw/qa/uitest/writer_tests7/tdf119661.py93
-rw-r--r--sw/qa/uitest/writer_tests7/tdf122780.py28
-rw-r--r--sw/qa/uitest/writer_tests7/tdf130629.py43
-rw-r--r--sw/qa/uitest/writer_tests7/tdf131936.py1
-rw-r--r--sw/qa/uitest/writer_tests7/tdf132169.py7
-rw-r--r--sw/qa/uitest/writer_tests7/tdf137802.py6
-rw-r--r--sw/qa/uitest/writer_tests7/tdf137803.py52
-rw-r--r--sw/qa/uitest/writer_tests7/tdf139301.py42
-rw-r--r--sw/qa/uitest/writer_tests7/tdf140117.py63
-rw-r--r--sw/qa/uitest/writer_tests7/tdf140863.py75
-rw-r--r--sw/qa/uitest/writer_tests7/tdf141158.py41
-rw-r--r--sw/qa/uitest/writer_tests7/tdf46561.py100
-rw-r--r--sw/qa/unit/swmodeltestbase.cxx77
409 files changed, 6332 insertions, 1284 deletions
diff --git a/sw/qa/api/SwXDocumentSettings.cxx b/sw/qa/api/SwXDocumentSettings.cxx
index 6345a053adc4..da2b366dae94 100644
--- a/sw/qa/api/SwXDocumentSettings.cxx
+++ b/sw/qa/api/SwXDocumentSettings.cxx
@@ -74,8 +74,6 @@ void SwXDocumentSettings::tearDown()
uno::Reference<uno::XInterface> SwXDocumentSettings::init()
{
mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
- CPPUNIT_ASSERT(mxComponent.is());
-
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<lang::XMultiServiceFactory> xFactory(xTextDocument, uno::UNO_QUERY_THROW);
diff --git a/sw/qa/api/SwXTextField.cxx b/sw/qa/api/SwXTextField.cxx
index 7bd56f809468..27a6eb40891c 100644
--- a/sw/qa/api/SwXTextField.cxx
+++ b/sw/qa/api/SwXTextField.cxx
@@ -73,7 +73,6 @@ void SwXTextField::triggerDesktopTerminate() { mxDesktop->terminate(); }
Reference<XInterface> SwXTextField::init()
{
component_ = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
- CPPUNIT_ASSERT(component_.is());
Reference<text::XTextDocument> xTextDocument(component_, UNO_QUERY_THROW);
Reference<lang::XMultiServiceFactory> xMSF(component_, UNO_QUERY_THROW);
diff --git a/sw/qa/api/SwXTextTable.cxx b/sw/qa/api/SwXTextTable.cxx
index 8f8f18062e7e..71a3a502cabc 100644
--- a/sw/qa/api/SwXTextTable.cxx
+++ b/sw/qa/api/SwXTextTable.cxx
@@ -69,7 +69,6 @@ void SwXTextTable::triggerDesktopTerminate() { mxDesktop->terminate(); }
Reference<XInterface> SwXTextTable::init()
{
component_ = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
- CPPUNIT_ASSERT(component_.is());
Reference<text::XTextDocument> xTextDocument(component_, UNO_QUERY_THROW);
Reference<lang::XMultiServiceFactory> xMSF(component_, UNO_QUERY_THROW);
Reference<text::XText> xText = xTextDocument->getText();
diff --git a/sw/qa/api/terminate.cxx b/sw/qa/api/terminate.cxx
index 5f077d0aa1f8..9a0e26d4d7e2 100644
--- a/sw/qa/api/terminate.cxx
+++ b/sw/qa/api/terminate.cxx
@@ -53,7 +53,6 @@ css::uno::Reference<css::uno::XInterface> TerminateTest::init()
{
auto const component
= loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
- CPPUNIT_ASSERT(component.is());
css::uno::Reference<css::text::XTextDocument> xTextDocument(component,
css::uno::UNO_QUERY_THROW);
css::uno::Reference<css::lang::XMultiServiceFactory> xMSF(component, css::uno::UNO_QUERY_THROW);
diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index ea70a74aaccb..24c09a493d26 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -142,10 +142,15 @@ public:
bparr.Insert(new BigPtrEntryMock(NUM_ENTRIES), bparr.Count() / 2);
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "test_insert_entries_in_the_middle failed",
+ oldCount + 1, bparr.Count()
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"test_insert_entries_in_the_middle failed",
- (oldCount + 1 == bparr.Count() && static_cast<BigPtrEntryMock*>(bparr[bparr.Count() / 2])->getCount() == NUM_ENTRIES)
+ NUM_ENTRIES, static_cast<BigPtrEntryMock*>(bparr[bparr.Count() / 2])->getCount()
);
CPPUNIT_ASSERT_MESSAGE
@@ -204,10 +209,15 @@ public:
sal_uLong oldCount = bparr.Count();
bparr.Insert(new BigPtrEntryMock(NUM_ENTRIES), bparr.Count());
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
+ (
+ "test_insert_at_end failed",
+ oldCount + 1, bparr.Count()
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"test_insert_at_end failed",
- (oldCount + 1 == bparr.Count() && static_cast<BigPtrEntryMock*>(bparr[bparr.Count()-1])->getCount() == NUM_ENTRIES)
+ NUM_ENTRIES, static_cast<BigPtrEntryMock*>(bparr[bparr.Count()-1])->getCount()
);
CPPUNIT_ASSERT_MESSAGE
diff --git a/sw/qa/core/data/README b/sw/qa/core/data/README
index 2cc9fb3cb58f..a147d4be4c6a 100644
--- a/sw/qa/core/data/README
+++ b/sw/qa/core/data/README
@@ -5,3 +5,19 @@ mdecrypt --bare -a arcfour -o hex -k 435645 -s 3 foo.doc # to unencrypt
mcrypt --bare -a arcfour -o hex -k 435645 -s 3 foo.doc # to create new tests
to get access to the plain files for manual testing.
+
+
+The files in these subdirectories are tested to
+ensure that they import without crashing or hanging.
+Files that crash during export should go into exportdata.
+
+Both data and exportdata are tested with
+make CppunitTest_sw_filters_test or
+make CppunitTest_sw_filters_test2 for ww6.
+
+Files that hang interactively, but pass filters_test
+might be failing because of layout issues. See core/layout.
+
+pass: these files now load - without the fix they crashed or hung.
+fail: these files still fail to load, but not because of crashing or hanging.
+indeterminate: untested temporary holding area - to be sorted as pass/fail.
diff --git a/sw/qa/core/draw/data/textbox-undo-ordnum.docx b/sw/qa/core/draw/data/textbox-undo-ordnum.docx
new file mode 100644
index 000000000000..96b00973289a
--- /dev/null
+++ b/sw/qa/core/draw/data/textbox-undo-ordnum.docx
Binary files differ
diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx
index b8544022589a..97b6a2bb7d79 100644
--- a/sw/qa/core/draw/draw.cxx
+++ b/sw/qa/core/draw/draw.cxx
@@ -15,6 +15,8 @@
#include <docsh.hxx>
#include <drawdoc.hxx>
#include <wrtsh.hxx>
+#include <frameformats.hxx>
+#include <textboxhelper.hxx>
constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/draw/data/";
@@ -46,6 +48,56 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTextboxDeleteAsChar)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nActual);
}
+CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTextboxUndoOrdNum)
+{
+ // Given a document with 5 frame formats:
+ // - picture
+ // - draw format + fly format and a picture in it
+ // - picture
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "textbox-undo-ordnum.docx");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ // Test the state before del + undo.
+ for (const auto& pFormat : rFormats)
+ {
+ const SwFrameFormat* pFlyFormat
+ = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT);
+ if (!pFlyFormat)
+ {
+ continue;
+ }
+
+ sal_Int32 nDrawOrdNum = pFormat->FindRealSdrObject()->GetOrdNum();
+ sal_Int32 nFlyOrdNum = pFlyFormat->FindRealSdrObject()->GetOrdNum();
+ CPPUNIT_ASSERT_EQUAL(nDrawOrdNum + 1, nFlyOrdNum);
+ }
+
+ // When selecting the first page, deleting the selection and undoing:
+ pWrtShell->Down(true, 3);
+ pWrtShell->DelLeft();
+ pWrtShell->Undo();
+
+ // Then the z-order of the fly format should be still the z-order of the draw format + 1, when
+ // the fly and draw formats form a textbox pair.
+ for (const auto& pFormat : rFormats)
+ {
+ const SwFrameFormat* pFlyFormat
+ = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT);
+ if (!pFlyFormat)
+ {
+ continue;
+ }
+
+ sal_Int32 nDrawOrdNum = pFormat->FindRealSdrObject()->GetOrdNum();
+ sal_Int32 nFlyOrdNum = pFlyFormat->FindRealSdrObject()->GetOrdNum();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 4
+ // - Actual : 2
+ // i.e. the fly format was behind the draw format, not visible.
+ CPPUNIT_ASSERT_EQUAL(nDrawOrdNum + 1, nFlyOrdNum);
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/fields/fields.cxx b/sw/qa/core/fields/fields.cxx
new file mode 100644
index 000000000000..74b94d7a3f8e
--- /dev/null
+++ b/sw/qa/core/fields/fields.cxx
@@ -0,0 +1,69 @@
+/* -*- 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 <swmodeltestbase.hxx>
+
+#include <com/sun/star/text/XTextDocument.hpp>
+
+#include <comphelper/propertyvalue.hxx>
+
+#include <authfld.hxx>
+#include <docsh.hxx>
+#include <rootfrm.hxx>
+#include <wrtsh.hxx>
+#include <ndtxt.hxx>
+
+namespace
+{
+/// Covers sw/source/core/fields/ fixes.
+class Test : public SwModelTestBase
+{
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testAuthorityTooltip)
+{
+ // Create a document with a bibliography reference in it.
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("Identifier", OUString("ARJ00")),
+ comphelper::makePropertyValue("Author", OUString("Ar, J")),
+ comphelper::makePropertyValue("Title", OUString("mytitle")),
+ comphelper::makePropertyValue("Year", OUString("2020")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+
+ // Get the tooltip of the field.
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
+ SwPaM* pCursor = pWrtShell->GetCursor();
+ auto pField = dynamic_cast<SwAuthorityField*>(
+ SwCursorShell::GetFieldAtCursor(pCursor, /*bIncludeInputFieldAtStart=*/true));
+ CPPUNIT_ASSERT(pField);
+ SwTextNode* pTextNode = pCursor->GetNode().GetTextNode();
+ const SwTextAttr* pTextAttr = pTextNode->GetSwpHints().Get(0);
+ const SwRootFrame* pLayout = pWrtShell->GetLayout();
+ OUString aTooltip = pField->GetAuthority(pTextAttr, pLayout);
+
+ // Without the accompanying fix in place, generating this tooltip text was not possible without
+ // first inserting an empty bibliography table into the document.
+ CPPUNIT_ASSERT_EQUAL(OUString("ARJ00: Ar, J, mytitle, 2020"), aTooltip);
+}
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx
index 097db6402ae1..174fb70486f2 100644
--- a/sw/qa/core/frmedt/frmedt.cxx
+++ b/sw/qa/core/frmedt/frmedt.cxx
@@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testPasteFlyInTextBox)
rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
pTransfer->Cut();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pDoc->GetSpzFrameFormats()->GetFormatCount());
- TransferableDataHelper aHelper(pTransfer.get());
+ TransferableDataHelper aHelper(pTransfer);
// When pasting that to an empty document.
SwTransferable::Paste(*pWrtShell, aHelper);
diff --git a/sw/qa/core/layout/data/tdf122894-4.doc b/sw/qa/core/layout/data/tdf122894-4.doc
new file mode 100644
index 000000000000..4ebdb53de04f
--- /dev/null
+++ b/sw/qa/core/layout/data/tdf122894-4.doc
Binary files differ
diff --git a/sw/qa/core/layout/data/tdf45908_invoice.odt b/sw/qa/core/layout/data/tdf45908_invoice.odt
new file mode 100644
index 000000000000..37b76928cbf9
--- /dev/null
+++ b/sw/qa/core/layout/data/tdf45908_invoice.odt
Binary files differ
diff --git a/sw/qa/core/layout/data/vmerge-cell-border.docx b/sw/qa/core/layout/data/vmerge-cell-border.docx
new file mode 100644
index 000000000000..11d7a76d22ec
--- /dev/null
+++ b/sw/qa/core/layout/data/vmerge-cell-border.docx
Binary files differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 6fe44dae97b6..f1880bffab67 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -9,6 +9,8 @@
#include <swmodeltestbase.hxx>
+#include <com/sun/star/style/PageStyleLayout.hpp>
+
#include <vcl/gdimtf.hxx>
#include <svx/svdpage.hxx>
@@ -161,12 +163,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)
load(DATA_DIRECTORY, "tdf134783_testAnchorPositionBasedOnParagraph.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[1]/bounds", "top", "1671");
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[1]/bounds", "bottom", "1732");
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[2]/bounds", "top", "1947");
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[2]/bounds", "bottom", "2008");
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[3]/bounds", "top", "3783");
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[3]/bounds", "bottom", "3844");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "top", "1671");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "bottom", "1732");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds", "top", "1947");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds", "bottom", "2008");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds", "top", "3783");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds", "bottom", "3844");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxStaysInsideShape)
@@ -179,8 +181,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxStaysInsideShape)
// Without the fix in place, this test would have failed with
// - Expected: 1932
// - Actual : 7476
- assertXPath(pXmlDoc, "//fly/infos/bounds", "top", "1932");
- assertXPath(pXmlDoc, "//fly/infos/bounds", "bottom", "7184");
+ assertXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top", "1932");
+ assertXPath(pXmlDoc, "//anchored/fly/infos/bounds", "bottom", "7184");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen)
@@ -208,10 +210,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical)
discardDumpedLayout();
xmlDocUniquePtr pLayout = parseLayoutDump();
CPPUNIT_ASSERT(pLayout);
- sal_Int32 nFlyLeft = getXPath(pLayout, "//fly/infos/bounds", "left").toInt32();
- sal_Int32 nFlyTop = getXPath(pLayout, "//fly/infos/bounds", "top").toInt32();
- sal_Int32 nFlyRight = getXPath(pLayout, "//fly/infos/bounds", "right").toInt32();
- sal_Int32 nFlyBottom = getXPath(pLayout, "//fly/infos/bounds", "bottom").toInt32();
+ sal_Int32 nFlyLeft = getXPath(pLayout, "//anchored/fly/infos/bounds", "left").toInt32();
+ sal_Int32 nFlyTop = getXPath(pLayout, "//anchored/fly/infos/bounds", "top").toInt32();
+ sal_Int32 nFlyRight = getXPath(pLayout, "//anchored/fly/infos/bounds", "right").toInt32();
+ sal_Int32 nFlyBottom = getXPath(pLayout, "//anchored/fly/infos/bounds", "bottom").toInt32();
tools::Rectangle aFlyRect(nFlyLeft, nFlyTop, nFlyRight, nFlyBottom);
// Without the accompanying fix in place, this test would have failed, as aFlyRect was too wide,
// so it was not inside aShapeRect anymore.
@@ -272,6 +274,231 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testKeepwithnextFullheight)
assertXPath(pXmlDoc, "//page[2]/body/txt/anchored/fly", 1);
}
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMargin)
+{
+ // Create a document, remember the old left edge of the page print area (the rectangle that is
+ // inside margins).
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ SwFrame* pPage = pLayout->GetLower();
+ tools::Long nOldLeft = pPage->getFramePrintArea().Left();
+
+ // Set the gutter margin to 2cm.
+ sal_Int32 nGutterMm100 = 2000;
+ xStandard->setPropertyValue("GutterMargin", uno::makeAny(nGutterMm100));
+
+ // Verify that the new left edge is larger.
+ tools::Long nNewLeft = pPage->getFramePrintArea().Left();
+ tools::Long nGutterTwips = convertMm100ToTwip(nGutterMm100);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1134
+ // - Actual : 0
+ // i.e. the gutter was not added to the left margin.
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nNewLeft - nOldLeft);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterTopMargin)
+{
+ // Create a document, remember the old top edge of the page print area (the rectangle that is
+ // inside margins).
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xSettings(
+ xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ xSettings->setPropertyValue("GutterAtTop", uno::makeAny(true));
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ SwFrame* pPage = pLayout->GetLower();
+ tools::Long nOldTop = pPage->getFramePrintArea().Top();
+
+ // Set the gutter margin to 2cm.
+ sal_Int32 nGutterMm100 = 2000;
+ xStandard->setPropertyValue("GutterMargin", uno::makeAny(nGutterMm100));
+
+ // Verify that the new top edge is larger.
+ tools::Long nNewTop = pPage->getFramePrintArea().Top();
+ tools::Long nGutterTwips = convertMm100ToTwip(nGutterMm100);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1134
+ // - Actual : 0
+ // i.e. the gutter was not added to the left margin.
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nNewTop - nOldTop);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMirrorMargin)
+{
+ SwDoc* pDoc = createSwDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->InsertPageBreak();
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ SwFrame* pPage = pLayout->GetLower();
+ tools::Long nOldLeft = pPage->getFramePrintArea().Left();
+ SwFrame* pPage2 = pPage->GetNext();
+ tools::Long nOldRight = pPage2->getFramePrintArea().Right();
+
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ xStandard->setPropertyValue("PageStyleLayout", uno::makeAny(style::PageStyleLayout_MIRRORED));
+ sal_Int32 nGutterMm100 = 2000;
+ xStandard->setPropertyValue("GutterMargin", uno::makeAny(nGutterMm100));
+
+ tools::Long nNewLeft = pPage->getFramePrintArea().Left();
+ tools::Long nGutterTwips = convertMm100ToTwip(nGutterMm100);
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nNewLeft - nOldLeft);
+ tools::Long nNewRight = pPage2->getFramePrintArea().Right();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1134
+ // - Actual : 0
+ // i.e. the gutter was missing on the second, mirrored page.
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nOldRight - nNewRight);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testRtlGutterMargin)
+{
+ // Given a document with a right margin:
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ SwFrame* pPage = pLayout->GetLower();
+ tools::Long nOldRight = pPage->getFramePrintArea().Right();
+
+ // When setting enable RTL gutter mode and setting a gutter margin:
+ xStandard->setPropertyValue("RtlGutter", uno::makeAny(true));
+ sal_Int32 nGutterMm100 = 2000;
+ xStandard->setPropertyValue("GutterMargin", uno::makeAny(nGutterMm100));
+
+ // Then make sure the new right edge of the print area is decreased:
+ tools::Long nNewRight = pPage->getFramePrintArea().Right();
+ tools::Long nGutterTwips = convertMm100ToTwip(nGutterMm100);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1134
+ // - Actual : 0
+ // i.e. the gutter was missing on the right side.
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nOldRight - nNewRight);
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMarginPageBorder)
+{
+// FIXME this is 3369 on macOS -- calculate this number dynamically?
+// FIXME this is random on Windows at the moment (in two subsequent tests without any scaling,
+// the actual values were 6346, 10066) - something broke metafile generation on Windows?
+#if !defined(MACOSX) && !defined(_WIN32)
+ // Given a document with a non-0 gutter margin.
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ sal_Int32 nGutterMm100 = 2000;
+ xStandard->setPropertyValue("GutterMargin", uno::makeAny(nGutterMm100));
+
+ // When setting a left border.
+ table::BorderLine2 aBorder;
+ aBorder.LineWidth = 2;
+ aBorder.OuterLineWidth = 2;
+ xStandard->setPropertyValue("LeftBorder", uno::makeAny(aBorder));
+
+ // Then make sure border is at the left edge of the text area.
+ SwDocShell* pShell = pDoc->GetDocShell();
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 2565
+ // - Actual : 1425
+ // Where 2565 is close to the left edge of the text area (2553).
+ assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]", "x", "2565");
+#endif
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTdf45908_invoice)
+{
+ // without the fix, this was hanging (and slowly consuming memory) on fileopen.
+ load(DATA_DIRECTORY, "tdf45908_invoice.odt");
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testVerticallyMergedCellBorder)
+{
+ // Given a document with a table: 2 columns, 5 rows. B2 -> B5 is merged:
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "vmerge-cell-border.docx");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // When rendering the table:
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+
+ // Make sure that B4->B5 has no borders.
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ // Collect vertical positions of all border points.
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
+ std::vector<sal_Int32> aBorderPositions;
+ for (int i = 0; i < xmlXPathNodeSetGetLength(pXmlNodes); ++i)
+ {
+ xmlNodePtr pXmlNode = pXmlNodes->nodeTab[i];
+ xmlChar* pValue = xmlGetProp(pXmlNode, BAD_CAST("y"));
+ sal_Int32 nValue = OString(reinterpret_cast<char const*>(pValue)).toInt32();
+ aBorderPositions.push_back(nValue);
+ }
+ xmlXPathFreeObject(pXmlObj);
+ // Collect top and bottom of the B1->B3 rows.
+ xmlDocUniquePtr pLayout = parseLayoutDump();
+ pXmlObj = getXPathNode(pLayout, "//tab/row/infos/bounds");
+ pXmlNodes = pXmlObj->nodesetval;
+ std::vector<sal_Int32> aLayoutPositions;
+ for (int i = 0; i < 3; ++i)
+ {
+ xmlNodePtr pXmlNode = pXmlNodes->nodeTab[i];
+ if (i == 0)
+ {
+ xmlChar* pValue = xmlGetProp(pXmlNode, BAD_CAST("top"));
+ sal_Int32 nValue = OString(reinterpret_cast<char const*>(pValue)).toInt32();
+ aLayoutPositions.push_back(nValue);
+ }
+ xmlChar* pValue = xmlGetProp(pXmlNode, BAD_CAST("bottom"));
+ sal_Int32 nValue = OString(reinterpret_cast<char const*>(pValue)).toInt32();
+ aLayoutPositions.push_back(nValue);
+ }
+ xmlXPathFreeObject(pXmlObj);
+ // Check if any border is outside the B1->B3 range.
+ for (const auto nBorderPosition : aBorderPositions)
+ {
+ bool bFound = false;
+ for (const auto nLayoutPosition : aLayoutPositions)
+ {
+ if (std::abs(nBorderPosition - nLayoutPosition) <= 15)
+ {
+ bFound = true;
+ break;
+ }
+ }
+ std::stringstream ss;
+ ss << "Bad vertical position for border point: " << nBorderPosition;
+ ss << " Expected positions: ";
+ for (size_t i = 0; i < aLayoutPositions.size(); ++i)
+ {
+ if (i > 0)
+ {
+ ss << ", ";
+ }
+ ss << aLayoutPositions[i];
+ }
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Bad vertical position for border point: 5624 Expected positions: 3022, 3540, 4059, 4578
+ // i.e. the middle vertical border end was the bottom of B5, not bottom of B3.
+ CPPUNIT_ASSERT_MESSAGE(ss.str(), bFound);
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testCrashRemoveFromLayout)
+{
+ load(DATA_DIRECTORY, "tdf122894-4.doc");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index cb2616333486..66f2dd9b2794 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -113,9 +113,6 @@ void SwMacrosTest::testVba()
OUString aFileName;
createFileURL(testInfo[i].sFileBaseName, u"doc", aFileName);
uno::Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument");
- OUString sMsg = "Failed to load " + aFileName;
- CPPUNIT_ASSERT_MESSAGE( OUStringToOString( sMsg, RTL_TEXTENCODING_UTF8 ).getStr(), xComponent.is() );
-
OUString sUrl = testInfo[i].sMacroUrl;
Any aRet;
Sequence< sal_Int16 > aOutParamIndex;
@@ -209,7 +206,6 @@ void SwMacrosTest::testControlShapeGrouping()
createFileURL(u"testControlShapeGrouping.", u"odt", aFileName);
Reference< css::lang::XComponent > xComponent(
loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"));
- CPPUNIT_ASSERT(xComponent.is());
uno::Reference<frame::XModel> const xModel(xComponent, UNO_QUERY);
CPPUNIT_ASSERT(xModel.is());
@@ -349,9 +345,6 @@ void SwMacrosTest::testFdo68983()
createFileURL(u"fdo68983.", u"odt", aFileName);
Reference< css::lang::XComponent > xComponent =
loadFromDesktop(aFileName, "com.sun.star.text.TextDocument");
-
- CPPUNIT_ASSERT_MESSAGE("Failed to load fdo68983.odt", xComponent.is());
-
Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
utl::TempFile aTempFile;
diff --git a/sw/qa/core/objectpositioning/data/inside-outside-vert-align.docx b/sw/qa/core/objectpositioning/data/inside-outside-vert-align.docx
index 15d2dca0775e..1308e1f6a8a5 100644
--- a/sw/qa/core/objectpositioning/data/inside-outside-vert-align.docx
+++ b/sw/qa/core/objectpositioning/data/inside-outside-vert-align.docx
Binary files differ
diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx b/sw/qa/core/objectpositioning/objectpositioning.cxx
index 2a35a41f1ec2..7c91bc797512 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -65,12 +65,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertPosFromBottom)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32();
sal_Int32 nAnchoredBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "bottom").toInt32();
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "bottom").toInt32();
// Without the accompanying fix in place, this test would have failed with:
- // - Expected: 564
+ // - Expected: 565
// - Actual : 9035
// i.e. the vertical position was from-top, not from-bottom.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(564), nBodyBottom - nAnchoredBottom);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(565), nBodyBottom - nAnchoredBottom);
}
CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertAlignBottomMargin)
@@ -124,13 +124,15 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertAlignBottomMargin)
sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //14989
sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //16123
sal_Int32 nFirstShapeBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[1]/bounds", "bottom").toInt32(); //16124
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
+ .toInt32(); //16124
sal_Int32 nSecondShapeBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "bottom").toInt32(); //15699
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
+ .toInt32(); //15699
sal_Int32 nSecondShapeTop
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15414
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15414
sal_Int32 nThirdShapeTop
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14989
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14989
// Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=bottom)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstShapeBottom - nPageBottom);
@@ -194,13 +196,15 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertAlignBottomMarginWithF
sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //14853
sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //17121
sal_Int32 nFirstShapeBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[1]/bounds", "bottom").toInt32(); //17122
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
+ .toInt32(); //17122
sal_Int32 nSecondShapeTop
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15703
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15703
sal_Int32 nSecondShapeBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "bottom").toInt32(); //16272
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
+ .toInt32(); //16272
sal_Int32 nThirdShapeTop
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14853
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14853
// Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=bottom)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstShapeBottom - nPageBottom);
@@ -222,14 +226,15 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testInsideOutsideVertAlignBott
sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //15704
sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //17121
sal_Int32 nFirstShapeOutside
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[1]/bounds", "bottom").toInt32(); //17098
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
+ .toInt32(); //17098
sal_Int32 nSecondShapeInside
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15694
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15694
// Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=outside)
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nPageBottom - nFirstShapeOutside);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), nPageBottom - nFirstShapeOutside);
// Verify that the distance between the bottom of body and top of second shape is around 0cm. (align=inside)
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10), nBodyBottom - nSecondShapeInside);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nBodyBottom - nSecondShapeInside);
}
CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVMLVertAlignBottomMargin)
@@ -245,17 +250,20 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVMLVertAlignBottomMargin)
sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //16123
sal_Int32 nFirstVMLShapeInside
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[1]/bounds", "top").toInt32(); //11802
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "top").toInt32(); //11802
sal_Int32 nSecondVMLShapeBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "bottom").toInt32(); //16124
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
+ .toInt32(); //16124
sal_Int32 nThirdVMLShapeCenterBottom
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[3]/bounds", "bottom").toInt32(); //14185
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "bottom")
+ .toInt32(); //14185
sal_Int32 nThirdVMLShapeCenterTop
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //13741
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //13741
sal_Int32 nFourthVMLShapeTop
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[4]/bounds", "top").toInt32(); //11802
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[4]/bounds", "top").toInt32(); //11802
sal_Int32 nFifthVMLShapeOutside
- = getXPath(pXmlDoc, "//SwAnchoredDrawObject[5]/bounds", "bottom").toInt32(); //16124
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[5]/bounds", "bottom")
+ .toInt32(); //16124
// Verify that the distance between the bottom of body and top of first VMLshape is around 0cm. (align=inside)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nBodyBottom - nFirstVMLShapeInside);
diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx b/sw/qa/core/test_ToxLinkProcessor.cxx
index 9b690be4211a..a4bb1eac60f0 100644
--- a/sw/qa/core/test_ToxLinkProcessor.cxx
+++ b/sw/qa/core/test_ToxLinkProcessor.cxx
@@ -44,8 +44,8 @@ public:
static constexpr OUStringLiteral STYLE_NAME_2 = u"anyStyle2";
static const sal_uInt16 POOL_ID_1;
static const sal_uInt16 POOL_ID_2;
- static constexpr OUStringLiteral URL_1 = u"anyUrl1";
- static constexpr OUStringLiteral URL_2 = u"anyUrl2";
+ static constexpr OUStringLiteral URL_1 = u"#anyUrl1";
+ static constexpr OUStringLiteral URL_2 = u"#anyUrl2";
};
const sal_uInt16 ToxLinkProcessorTest::POOL_ID_1 = 42;
@@ -56,11 +56,11 @@ ToxLinkProcessorTest::NoExceptionIsThrownIfTooManyLinksAreClosed()
{
ToxLinkProcessor sut;
sut.StartNewLink(0, STYLE_NAME_1);
- sut.CloseLink(1, URL_1);
+ sut.CloseLink(1, URL_1, /*bRelative=*/true);
// fdo#85872 actually it turns out the UI does something like this
// so an exception must not be thrown!
// should not succeed either (for backward compatibility)
- sut.CloseLink(2, URL_1);
+ sut.CloseLink(2, URL_1, /*bRelative=*/true);
CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.size()));
CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.at(0)->mEndTextPos));
CPPUNIT_ASSERT_MESSAGE("no links are open", !sut.m_pStartedLink);
@@ -72,10 +72,10 @@ ToxLinkProcessorTest::AddingAndClosingTwoOverlappingLinksResultsInOneClosedLink(
ToxLinkProcessor sut;
sut.StartNewLink(0, STYLE_NAME_1);
sut.StartNewLink(0, STYLE_NAME_2);
- sut.CloseLink(1, URL_1);
+ sut.CloseLink(1, URL_1, /*bRelative=*/true);
// this should not cause an error, and should not succeed either
// (for backward compatibility)
- sut.CloseLink(1, URL_2);
+ sut.CloseLink(1, URL_2, /*bRelative=*/true);
CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.size()));
CPPUNIT_ASSERT_MESSAGE("no links are open", !sut.m_pStartedLink);
// backward compatibility: the last start is closed by the first end
@@ -108,7 +108,7 @@ ToxLinkProcessorTest::LinkIsCreatedCorrectly()
ToxLinkProcessorWithOverriddenObtainPoolId sut;
sut.StartNewLink(0, STYLE_NAME_1);
- sut.CloseLink(1, URL_1);
+ sut.CloseLink(1, URL_1, /*bRelative=*/true);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link", OUString(STYLE_NAME_1), sut.m_ClosedLinks.at(0)->mINetFormat.GetVisitedFormat());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link", OUString(URL_1), sut.m_ClosedLinks.at(0)->mINetFormat.GetValue());
@@ -122,9 +122,9 @@ ToxLinkProcessorTest::LinkSequenceIsPreserved()
ToxLinkProcessorWithOverriddenObtainPoolId sut;
sut.StartNewLink(0, STYLE_NAME_2);
- sut.CloseLink(1, URL_2);
+ sut.CloseLink(1, URL_2, /*bRelative=*/true);
sut.StartNewLink(1, STYLE_NAME_1);
- sut.CloseLink(2, URL_1);
+ sut.CloseLink(2, URL_1, /*bRelative=*/true);
// check first closed element
CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link",
diff --git a/sw/qa/core/text/data/tabovermargin-section.fodt b/sw/qa/core/text/data/tabovermargin-section.fodt
new file mode 100644
index 000000000000..6fd39c471228
--- /dev/null
+++ b/sw/qa/core/text/data/tabovermargin-section.fodt
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="TabOverMargin" config:type="boolean">true</config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:styles>
+ <style:default-style style:family="paragraph">
+ </style:default-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Index_20_1">
+ <style:paragraph-properties>
+ <style:tab-stops>
+ <style:tab-stop style:position="17.59cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Sect1" style:family="section">
+ <style:section-properties style:editable="false">
+ <style:columns fo:column-count="2" fo:column-gap="0cm">
+ <style:column style:rel-width="32767*" fo:start-indent="0cm" fo:end-indent="0cm"/>
+ <style:column style:rel-width="32768*" fo:start-indent="0cm" fo:end-indent="0cm"/>
+ </style:columns>
+ </style:section-properties>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.59cm" fo:page-height="27.94cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" fo:background-color="#ffffff" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="37" style:layout-grid-base-height="0.635cm" style:layout-grid-ruby-height="0cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:layout-grid-base-width="0.423cm" style:layout-grid-snap-to="true" draw:fill="solid" draw:fill-color="#ffffff" draw:opacity="0%" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:style style:name="dp1" style:family="drawing-page">
+ <style:drawing-page-properties draw:fill="solid" draw:background-size="full" draw:fill-color="#ffffff" draw:opacity="0%"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1" draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p>before</text:p>
+ <text:section text:style-name="Sect1" text:name="Section1">
+ <text:p text:style-name="P1">hello<text:tab/>1</text:p>
+ </text:section>
+ <text:p>after</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 8b4c6ae336bb..4db880e687f4 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -9,7 +9,14 @@
#include <swmodeltestbase.hxx>
+#include <memory>
+
+#include <com/sun/star/text/BibliographyDataType.hpp>
+
#include <vcl/gdimtf.hxx>
+#include <vcl/filter/PDFiumLibrary.hxx>
+#include <comphelper/propertyvalue.hxx>
+#include <unotools/mediadescriptor.hxx>
#include <docsh.hxx>
#include <unotxdoc.hxx>
@@ -69,6 +76,65 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testSemiTransparentText)
assertXPath(pXmlDoc, "//floattransparent");
}
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport)
+{
+ // Given a document with a bibliography entry field:
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
+ if (!pPDFium)
+ {
+ return;
+ }
+ createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString("http://www.example.com/test.pdf#page=1")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+
+ // When exporting to PDF:
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+ xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+ // Then make sure the field links the source.
+ SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+ SvMemoryStream aMemory;
+ aMemory.WriteStream(aFile);
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
+ = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize());
+ CPPUNIT_ASSERT(pPdfDocument);
+ std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/0);
+ // Without the accompanying fix in place, this test would have failed, the field was not
+ // clickable (while it was clickable on the UI).
+ CPPUNIT_ASSERT(pPdfPage->hasLinks());
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection)
+{
+ createSwDoc(DATA_DIRECTORY, "tabovermargin-section.fodt");
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ sal_Int32 nWidth
+ = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabRight']", "nWidth").toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected less than: 5000
+ // - Actual : 9372
+ // i.e. the tab portion width was not the expected 4386, but much larger, so the number after
+ // the tab portion was not visible.
+ CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(5000), nWidth);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/tox/tox.cxx b/sw/qa/core/tox/tox.cxx
new file mode 100644
index 000000000000..1ac8764a0574
--- /dev/null
+++ b/sw/qa/core/tox/tox.cxx
@@ -0,0 +1,256 @@
+/* -*- 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 <swmodeltestbase.hxx>
+
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/text/BibliographyDataType.hpp>
+#include <com/sun/star/text/ControlCharacter.hpp>
+#include <com/sun/star/text/XDocumentIndex.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+
+#include <comphelper/propertyvalue.hxx>
+
+#include <IDocumentFieldsAccess.hxx>
+#include <authfld.hxx>
+#include <fmtfld.hxx>
+
+namespace
+{
+/// Covers sw/source/core/tox/ fixes.
+class Test : public SwModelTestBase
+{
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testAuthorityLinkClick)
+{
+ // Create a document with a bibliography reference (of type WWW) in it.
+ createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("ARJ00")),
+ comphelper::makePropertyValue("Author", OUString("Ar, J")),
+ comphelper::makePropertyValue("Title", OUString("mytitle")),
+ comphelper::makePropertyValue("Year", OUString("2020")),
+ comphelper::makePropertyValue("URL", OUString("http://www.example.com/test.pdf")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+ // Create a bibliography table.
+ uno::Reference<text::XTextContent> xTable(
+ xFactory->createInstance("com.sun.star.text.Bibliography"), uno::UNO_QUERY);
+ xCursor->gotoEnd(/*bExpand=*/false);
+ xText->insertControlCharacter(xCursor, text::ControlCharacter::APPEND_PARAGRAPH,
+ /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xTable, /*bAbsorb=*/false);
+
+ // Update it.
+ uno::Reference<text::XDocumentIndex> xTableIndex(xTable, uno::UNO_QUERY);
+ xTableIndex->update();
+
+ // Paragraph index: Reference, table header, table row.
+ // Portion index: ID, etc; then the URL.
+ auto aActual = getProperty<OUString>(getRun(getParagraph(3), 2), "HyperLinkURL");
+ // Without the accompanying fix in place, this test would have failed with:
+ // An uncaught exception of type com.sun.star.container.NoSuchElementException
+ // i.e. the URL was not clickable and the table row was a single text portion.
+ CPPUNIT_ASSERT_EQUAL(OUString("http://www.example.com/test.pdf"), aActual);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testAuthorityTableEntryURL)
+{
+ // Given a document with a bibliography reference (of type WWW) in it:
+ createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString("http://www.example.com/test.pdf#page=1")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+ // Create a bibliography table.
+ uno::Reference<text::XTextContent> xTable(
+ xFactory->createInstance("com.sun.star.text.Bibliography"), uno::UNO_QUERY);
+ xCursor->gotoEnd(/*bExpand=*/false);
+ xText->insertControlCharacter(xCursor, text::ControlCharacter::APPEND_PARAGRAPH,
+ /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xTable, /*bAbsorb=*/false);
+
+ // When updating that table:
+ uno::Reference<text::XDocumentIndex> xTableIndex(xTable, uno::UNO_QUERY);
+ xTableIndex->update();
+
+ // Then the page number from the source's URL should be stripped:
+ // Paragraph index: Reference, table header, table row.
+ // Portion index: ID, etc; then the URL.
+ auto aActual = getProperty<OUString>(getRun(getParagraph(3), 2), "HyperLinkURL");
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: http://www.example.com/test.pdf
+ // - Actual : http://www.example.com/test.pdf#page=1
+ // i.e. the page number was still part of the bibliography table.
+ CPPUNIT_ASSERT_EQUAL(OUString("http://www.example.com/test.pdf"), aActual);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testAuthorityTableEntryClick)
+{
+ // Given an empty document:
+ SwDoc* pDoc = createSwDoc();
+
+ // When inserting a biblio entry field with an URL:
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString("http://www.example.com/test.pdf#page=1")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+
+ // Then make sure that the field is clickable, since the page part will not be part of the
+ // bibliography table:
+ const SwFieldTypes* pTypes = pDoc->getIDocumentFieldsAccess().GetFieldTypes();
+ auto it = std::find_if(pTypes->begin(), pTypes->end(),
+ [](const std::unique_ptr<SwFieldType>& pType) {
+ return pType->Which() == SwFieldIds::TableOfAuthorities;
+ });
+ CPPUNIT_ASSERT(it != pTypes->end());
+ const SwFieldType* pType = it->get();
+ std::vector<SwFormatField*> aFormatFields;
+ pType->GatherFields(aFormatFields);
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aFormatFields.size());
+ SwField* pField = aFormatFields[0]->GetField();
+ // Without the accompanying fix in place, this test would have failed, as the field was not
+ // clickable.
+ CPPUNIT_ASSERT(pField->IsClickable());
+ // This is needed, so the mouse has the correct RefHand pointer style.
+ CPPUNIT_ASSERT(pField->HasClickHdl());
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testAuthorityTableEntryRelClick)
+{
+ // Given an empty document with a file:// base URL:
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aArgs = {
+ comphelper::makePropertyValue("FilterName", OUString("writer8")),
+ };
+ xStorable->storeAsURL(maTempFile.GetURL(), aArgs);
+
+ // When inserting a biblio entry field with a relative URL:
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString("test.pdf#page=1")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+
+ // Then make sure that the field is clickable:
+ const SwFieldTypes* pTypes = pDoc->getIDocumentFieldsAccess().GetFieldTypes();
+ auto it = std::find_if(pTypes->begin(), pTypes->end(),
+ [](const std::unique_ptr<SwFieldType>& pType) {
+ return pType->Which() == SwFieldIds::TableOfAuthorities;
+ });
+ CPPUNIT_ASSERT(it != pTypes->end());
+ const SwFieldType* pType = it->get();
+ std::vector<SwFormatField*> aFormatFields;
+ pType->GatherFields(aFormatFields);
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aFormatFields.size());
+ auto pField = static_cast<SwAuthorityField*>(aFormatFields[0]->GetField());
+ CPPUNIT_ASSERT(pField->GetAbsoluteURL().startsWith("file://"));
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testAuthorityTableURLDeduplication)
+{
+ // Given a document with 3 bibliography references (of type WWW) in it:
+ static const std::initializer_list<std::u16string_view> aURLs = {
+ u"http://www.example.com/test.pdf#page=1",
+ u"http://www.example.com/test.pdf#page=2",
+ u"http://www.example.com/test2.pdf",
+ };
+ createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ for (const auto& rURL : aURLs)
+ {
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString(rURL)),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+ }
+ // Create a bibliography table.
+ uno::Reference<text::XTextContent> xTable(
+ xFactory->createInstance("com.sun.star.text.Bibliography"), uno::UNO_QUERY);
+ xCursor->gotoEnd(/*bExpand=*/false);
+ xText->insertControlCharacter(xCursor, text::ControlCharacter::APPEND_PARAGRAPH,
+ /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xTable, /*bAbsorb=*/false);
+
+ // When updating that table:
+ uno::Reference<text::XDocumentIndex> xTableIndex(xTable, uno::UNO_QUERY);
+ xTableIndex->update();
+
+ // Then the first two fields should be merged to a single source, but not the third.
+ CPPUNIT_ASSERT_EQUAL(OUString("AT: Author, Title, , http://www.example.com/test.pdf"),
+ getParagraph(3)->getString());
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: AT: Author, Title, , http://www.example.com/test2.pdf
+ // - Actual : AT: Author, Title, , http://www.example.com/test.pdf
+ // i.e. test.pdf was mentioned twice, without deduplication.
+ CPPUNIT_ASSERT_EQUAL(OUString("AT: Author, Title, , http://www.example.com/test2.pdf"),
+ getParagraph(4)->getString());
+}
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/undo/data/table-copy-redline.odt b/sw/qa/core/undo/data/table-copy-redline.odt
new file mode 100644
index 000000000000..f391687823aa
--- /dev/null
+++ b/sw/qa/core/undo/data/table-copy-redline.odt
Binary files differ
diff --git a/sw/qa/core/undo/undo.cxx b/sw/qa/core/undo/undo.cxx
index fd1069e64ae0..0e9ef5b0231e 100644
--- a/sw/qa/core/undo/undo.cxx
+++ b/sw/qa/core/undo/undo.cxx
@@ -84,6 +84,25 @@ CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTextboxCutUndo)
CPPUNIT_ASSERT_EQUAL(pIndex1->GetIndex(), pIndex2->GetIndex());
}
+CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTableCopyRedline)
+{
+ // Given a document with two table cells and redlining enabled:
+ load(DATA_DIRECTORY, "table-copy-redline.odt");
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ SwDocShell* pDocShell = pTextDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+
+ // When doing select-all, copy, paste and undo:
+ pWrtShell->SelAll();
+ rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
+ pTransfer->Copy();
+ TransferableDataHelper aHelper(pTransfer);
+ SwTransferable::Paste(*pWrtShell, aHelper);
+
+ // Without the accompanying fix in place, this test would have crashed.
+ pWrtShell->Undo();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index 62c3f439c4e5..cf701a25d423 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -82,6 +82,20 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, flyAtParaAnchor)
xText->insertTextContent(xAnchor, xFieldmark, false);
}
+CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testRtlGutter)
+{
+ mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Unknown property: RtlGutter
+ auto bRtlGutter = getProperty<bool>(xPageStyle, "RtlGutter");
+ CPPUNIT_ASSERT(!bRtlGutter);
+ xPageStyle->setPropertyValue("RtlGutter", uno::makeAny(true));
+ bRtlGutter = getProperty<bool>(xPageStyle, "RtlGutter");
+ CPPUNIT_ASSERT(bRtlGutter);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 02202d6fe8e2..ade0a9d8170b 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -287,15 +287,13 @@ void SwDocTest::testUserPerceivedCharCount()
//Grapheme example, two different unicode code-points perceived by the user as a single
//glyph
- const sal_Unicode ALEF_QAMATS [] = { 0x05D0, 0x05B8 };
- OUString sALEF_QAMATS(ALEF_QAMATS, SAL_N_ELEMENTS(ALEF_QAMATS));
+ static constexpr OUStringLiteral sALEF_QAMATS = u"\u05D0\u05B8";
sal_Int32 nGraphemeCount = pBreakIter->getGraphemeCount(sALEF_QAMATS);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Grapheme Count should be 1", static_cast<sal_Int32>(1), nGraphemeCount);
//Surrogate pair example, one single unicode code-point (U+1D11E)
//represented as two code units in UTF-16
- const sal_Unicode GCLEF[] = { 0xD834, 0xDD1E };
- OUString sGCLEF(GCLEF, SAL_N_ELEMENTS(GCLEF));
+ static constexpr OUStringLiteral sGCLEF = u"\U0001D11E";
sal_Int32 nCount = pBreakIter->getGraphemeCount(sGCLEF);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Surrogate Pair should be counted as single character", static_cast<sal_Int32>(1), nCount);
}
@@ -616,10 +614,9 @@ void SwDocTest::testSwScanner()
//See https://www.libreoffice.org/bugzilla/show_bug.cgi?id=45271
{
- const sal_Unicode IDEOGRAPHICFULLSTOP_D[] = { 0x3002, 'D' };
+ static constexpr OUStringLiteral IDEOGRAPHICFULLSTOP_D = u"\u3002D";
- m_pDoc->getIDocumentContentOperations().InsertString(aPaM, OUString(IDEOGRAPHICFULLSTOP_D,
- SAL_N_ELEMENTS(IDEOGRAPHICFULLSTOP_D)));
+ m_pDoc->getIDocumentContentOperations().InsertString(aPaM, IDEOGRAPHICFULLSTOP_D);
SvxLanguageItem aCJKLangItem( LANGUAGE_CHINESE_SIMPLIFIED, RES_CHRATR_CJK_LANGUAGE );
SvxLanguageItem aWestLangItem( LANGUAGE_ENGLISH_US, RES_CHRATR_LANGUAGE );
@@ -628,34 +625,31 @@ void SwDocTest::testSwScanner()
SwDocStat aDocStat;
pTextNode = aPaM.GetNode().GetTextNode();
- pTextNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(IDEOGRAPHICFULLSTOP_D));
+ pTextNode->CountWords(aDocStat, 0, IDEOGRAPHICFULLSTOP_D.getLength());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(2), aDocStat.nChar);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(2), aDocStat.nCharExcludingSpaces);
}
{
- const sal_Unicode test[] =
- {
- 0x3053, 0x306E, 0x65E5, 0x672C, 0x8A9E, 0x306F, 0x6B63, 0x3057,
- 0x304F, 0x6570, 0x3048, 0x3089, 0x308C, 0x308B, 0x3067, 0x3057,
- 0x3087, 0x3046, 0x304B, 0x3002, 0x0041, 0x006E, 0x0064, 0x0020,
- 0x006C, 0x0065, 0x0074, 0x0027, 0x0073, 0x0020, 0x0074, 0x0068,
- 0x0072, 0x006F, 0x0077, 0x0020, 0x0073, 0x006F, 0x006D, 0x0065,
- 0x0020, 0x0045, 0x006E, 0x0067, 0x006C, 0x0069, 0x0073, 0x0068,
- 0x0020, 0x0069, 0x006E, 0x0020, 0x0074, 0x006F, 0x0020, 0x006D,
- 0x0061, 0x006B, 0x0065, 0x0020, 0x0069, 0x0074, 0x0020, 0x0069,
- 0x006E, 0x0074, 0x0065, 0x0072, 0x0065, 0x0073, 0x0074, 0x0069,
- 0x006E, 0x0067, 0x002E, 0x0020, 0x0020, 0x305D, 0x3057, 0x3066,
- 0x3001, 0x307E, 0x305F, 0x65E5, 0x672C, 0x8A9E, 0x3000, 0x3000,
- 0x3067, 0x3082, 0x4ECA, 0x56DE, 0x306F, 0x7A7A, 0x767D, 0x3092,
- 0x3000, 0x3000, 0x5165, 0x308C, 0x307E, 0x3057, 0x305F, 0x3002,
- 0x0020, 0x0020, 0x0053, 0x006F, 0x0020, 0x0068, 0x006F, 0x0077,
- 0x0020, 0x0064, 0x006F, 0x0065, 0x0073, 0x0020, 0x0074, 0x0068,
- 0x0069, 0x0073, 0x0020, 0x0064, 0x006F, 0x003F, 0x0020, 0x0020
- };
+ static constexpr OUStringLiteral test =
+ u"\u3053\u306E\u65E5\u672C\u8A9E\u306F\u6B63\u3057"
+ "\u304F\u6570\u3048\u3089\u308C\u308B\u3067\u3057"
+ "\u3087\u3046\u304B\u3002And "
+ "let's th"
+ "row some"
+ " English"
+ " in to m"
+ "ake it i"
+ "nteresti"
+ "ng. \u305D\u3057\u3066"
+ "\u3001\u307E\u305F\u65E5\u672C\u8A9E\u3000\u3000"
+ "\u3067\u3082\u4ECA\u56DE\u306F\u7A7A\u767D\u3092"
+ "\u3000\u3000\u5165\u308C\u307E\u3057\u305F\u3002"
+ " So how"
+ " does th"
+ "is do? ";
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
- m_pDoc->getIDocumentContentOperations().InsertString(aPaM, OUString(test,
- SAL_N_ELEMENTS(test)));
+ m_pDoc->getIDocumentContentOperations().InsertString(aPaM, test);
SvxLanguageItem aCJKLangItem( LANGUAGE_JAPANESE, RES_CHRATR_CJK_LANGUAGE );
SvxLanguageItem aWestLangItem( LANGUAGE_ENGLISH_US, RES_CHRATR_LANGUAGE );
@@ -664,7 +658,7 @@ void SwDocTest::testSwScanner()
SwDocStat aDocStat;
pTextNode = aPaM.GetNode().GetTextNode();
- pTextNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(test));
+ pTextNode->CountWords(aDocStat, 0, test.getLength());
CPPUNIT_ASSERT_EQUAL_MESSAGE("words", static_cast<sal_uLong>(58), aDocStat.nWord);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Asian characters and Korean syllables", static_cast<sal_uLong>(43), aDocStat.nAsianWord);
CPPUNIT_ASSERT_EQUAL_MESSAGE("non-whitespace chars", static_cast<sal_uLong>(105), aDocStat.nCharExcludingSpaces);
@@ -676,34 +670,31 @@ void SwDocTest::testSwScanner()
{
SwDocStat aDocStat;
- const sal_Unicode aShouldBeThree[] = {
- 0x0053, 0x0068, 0x006F, 0x0075, 0x006C, 0x0064, 0x0020,
- 0x2018, 0x0062, 0x0065, 0x0020, 0x0074, 0x0068, 0x0072,
- 0x0065, 0x0065, 0x2019
- };
+ static constexpr OUStringLiteral aShouldBeThree =
+ u"Should "
+ "\u2018be thr"
+ "ee\u2019";
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
- m_pDoc->getIDocumentContentOperations().InsertString(aPaM, OUString(aShouldBeThree, SAL_N_ELEMENTS(aShouldBeThree)));
+ m_pDoc->getIDocumentContentOperations().InsertString(aPaM, aShouldBeThree);
pTextNode = aPaM.GetNode().GetTextNode();
- pTextNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(aShouldBeThree));
+ pTextNode->CountWords(aDocStat, 0, aShouldBeThree.getLength());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(3), aDocStat.nWord);
- const sal_Unicode aShouldBeFive[] = {
- // f r e n c h space
- 0x0046, 0x0072, 0x0065, 0x006E, 0x0063, 0x0068, 0x0020,
- // << nbsp s a v o i
- 0x00AB, 0x00A0, 0x0073, 0x0061, 0x0076, 0x006F, 0x0069,
- // r nnbsp c a l c u
- 0x0072, 0x202f, 0x0063, 0x0061, 0x006C, 0x0063, 0x0075,
- // l e r idspace >>
- 0x006C, 0x0065, 0x0072, 0x3000, 0x00BB
- };
+ static constexpr OUStringLiteral aShouldBeFive =
+ u"french "
+ // << nbsp
+ "\u00AB\u00A0savoi"
+ // nnbsp
+ "r\u202fcalcu"
+ // idspace >>
+ "ler\u3000\u00BB";
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
- m_pDoc->getIDocumentContentOperations().InsertString(aPaM, OUString(aShouldBeFive, SAL_N_ELEMENTS(aShouldBeFive)));
+ m_pDoc->getIDocumentContentOperations().InsertString(aPaM, aShouldBeFive);
pTextNode = aPaM.GetNode().GetTextNode();
aDocStat.Reset();
- pTextNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(aShouldBeFive));
+ pTextNode->CountWords(aDocStat, 0, aShouldBeFive.getLength());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(5), aDocStat.nWord);
}
@@ -846,72 +837,72 @@ void SwDocTest::testSwScanner()
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', ' '));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
- aDocStat.nCharExcludingSpaces == 12 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(4), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(12), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replaceAll("X", " = "));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 5 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 17);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(5), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(17), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replaceAll("X", " _ "));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 5 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 17);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(5), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(17), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replaceAll("X", " -- "));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 5 &&
- aDocStat.nCharExcludingSpaces == 14 &&
- aDocStat.nChar == 18);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(5), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(14), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(18), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', '_'));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(3), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', '-'));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(3), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', 0x2012));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(3), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', 0x2015));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(3), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
//But default configuration should, msword-alike treat emdash
@@ -920,29 +911,28 @@ void SwDocTest::testSwScanner()
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', 0x2013));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(4), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replace('X', 0x2014));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 15);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(4), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(15), aDocStat.nChar);
aDocStat.Reset();
- const sal_Unicode aChunk[] = {' ', 0x2013, ' '};
- OUString sChunk(aChunk, SAL_N_ELEMENTS(aChunk));
+ static constexpr OUStringLiteral sChunk = u" \u2013 ";
m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint());
m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sTemplate.replaceAll("X", sChunk));
pTextNode = aPaM.GetNode().GetTextNode();
pTextNode->CountWords(aDocStat, 0, pTextNode->Len());
- CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
- aDocStat.nCharExcludingSpaces == 13 &&
- aDocStat.nChar == 17);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(4), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(13), aDocStat.nCharExcludingSpaces);
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(17), aDocStat.nChar);
aDocStat.Reset();
}
}
@@ -1195,9 +1185,9 @@ void SwDocTest::randomTest()
xmlTextWriterPtr writer;
writer = xmlNewTextWriterFilename( aBuffer.makeStringAndClear().getStr(), 0 );
- xmlTextWriterStartDocument( writer, NULL, NULL, NULL );
+ (void)xmlTextWriterStartDocument( writer, NULL, NULL, NULL );
m_pDoc->dumpAsXml(writer);
- xmlTextWriterEndDocument( writer );
+ (void)xmlTextWriterEndDocument( writer );
xmlFreeTextWriter( writer );
#endif
}
@@ -1588,11 +1578,15 @@ void SwDocTest::testFormulas()
// tdf#61228: Evaluating non-defined function should return an error
SwCalc aCalc(*m_pDoc);
SwSbxValue val = aCalc.Calculate("foobar()");
- CPPUNIT_ASSERT(aCalc.IsCalcError() && val.IsVoidValue() && val.IsDouble());
+ CPPUNIT_ASSERT(aCalc.IsCalcError());
+ CPPUNIT_ASSERT(val.IsVoidValue());
+ CPPUNIT_ASSERT(val.IsDouble());
CPPUNIT_ASSERT_EQUAL(DBL_MAX, val.GetDouble());
// Evaluating non-defined variable should return 0 without an error
val = aCalc.Calculate("foobar");
- CPPUNIT_ASSERT(!aCalc.IsCalcError() && val.IsVoidValue() && val.IsLong());
+ CPPUNIT_ASSERT(!aCalc.IsCalcError());
+ CPPUNIT_ASSERT(val.IsVoidValue());
+ CPPUNIT_ASSERT(val.IsLong());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), val.GetLong());
}
@@ -2019,7 +2013,7 @@ void SwDocTest::test64kPageDescs()
CPPUNIT_ASSERT_EQUAL( OUString("Page65535"), rDesc.GetName() );
SwPageDesc aDesc( rDesc );
- const OUString aChanged("Changed01");
+ static const OUStringLiteral aChanged(u"Changed01");
aDesc.SetName( aChanged );
m_pDoc->ChgPageDesc( nPageDescCount, aDesc );
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx
index 8915ed808232..f84bc2ffc9bd 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -613,7 +613,7 @@ void Test::testCharStyleHighlight()
const sal_Int32 nBackColor(0xFFDBB6); //orange-y
// Always export character style's background colour as shading, never as highlighting.
- CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), false, hasProperty(xCharStyle,"CharHighlight"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), static_cast<sal_Int32>(COL_TRANSPARENT), getProperty<sal_Int32>(xCharStyle,"CharHighlight"));
CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), nBackColor, getProperty<sal_Int32>(xCharStyle,"CharBackColor"));
}
}
diff --git a/sw/qa/extras/htmlexport/data/ole1-pres-data-wmf.odt b/sw/qa/extras/htmlexport/data/ole1-pres-data-wmf.odt
new file mode 100644
index 000000000000..9bcca729bc52
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/ole1-pres-data-wmf.odt
Binary files differ
diff --git a/sw/qa/extras/htmlexport/data/reqif-aschar-objsize.odt b/sw/qa/extras/htmlexport/data/reqif-aschar-objsize.odt
new file mode 100644
index 000000000000..6028b54a4190
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/reqif-aschar-objsize.odt
Binary files differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index f749c363880e..a6795abc253f 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -58,10 +58,14 @@ public:
TestReqIfRtfReader(SvStream& rStream);
void NextToken(int nToken) override;
bool WriteObjectData(SvStream& rOLE);
+ tools::Long GetObjw() const { return m_nObjw; }
+ tools::Long GetObjh() const { return m_nObjh; }
private:
bool m_bInObjData = false;
OStringBuffer m_aHex;
+ tools::Long m_nObjw = 0;
+ tools::Long m_nObjh = 0;
};
TestReqIfRtfReader::TestReqIfRtfReader(SvStream& rStream)
@@ -83,6 +87,12 @@ void TestReqIfRtfReader::NextToken(int nToken)
case RTF_OBJDATA:
m_bInObjData = true;
break;
+ case RTF_OBJW:
+ m_nObjw = nTokenValue;
+ break;
+ case RTF_OBJH:
+ m_nObjh = nTokenValue;
+ break;
}
}
@@ -119,6 +129,43 @@ bool TestReqIfRtfReader::WriteObjectData(SvStream& rOLE)
rOLE.WriteStream(aStream);
return true;
}
+
+/// Parser for [MS-OLEDS] 2.2.5 EmbeddedObject, aka OLE1.
+struct OLE1Reader
+{
+ sal_uInt32 m_nNativeDataSize;
+ sal_uInt32 m_nPresentationDataSize;
+
+ OLE1Reader(SvStream& rStream);
+};
+
+OLE1Reader::OLE1Reader(SvStream& rStream)
+{
+ // Skip ObjectHeader, see [MS-OLEDS] 2.2.4.
+ rStream.Seek(0);
+ sal_uInt32 nData;
+ rStream.ReadUInt32(nData); // OLEVersion
+ rStream.ReadUInt32(nData); // FormatID
+ rStream.ReadUInt32(nData); // ClassName
+ rStream.SeekRel(nData);
+ rStream.ReadUInt32(nData); // TopicName
+ rStream.SeekRel(nData);
+ rStream.ReadUInt32(nData); // ItemName
+ rStream.SeekRel(nData);
+
+ rStream.ReadUInt32(m_nNativeDataSize);
+ rStream.SeekRel(m_nNativeDataSize);
+
+ rStream.ReadUInt32(nData); // OLEVersion for presentation data
+ CPPUNIT_ASSERT(rStream.good());
+ rStream.ReadUInt32(nData); // FormatID
+ rStream.ReadUInt32(nData); // ClassName
+ rStream.SeekRel(nData);
+ rStream.ReadUInt32(nData); // Width
+ rStream.ReadUInt32(nData); // Height
+ rStream.ReadUInt32(nData); // PresentationDataSize
+ m_nPresentationDataSize = nData;
+}
}
class HtmlExportTest : public SwModelTestBase, public HtmlTestTools
@@ -703,6 +750,39 @@ DECLARE_HTMLEXPORT_TEST(testReqIfTable2, "reqif-table2.odt")
CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:td>") != -1);
}
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIfTableHeight)
+{
+ // Given a document with a table in it, with an explicit row height:
+ loadURL("private:factory/swriter", nullptr);
+ uno::Sequence<beans::PropertyValue> aTableProperties = {
+ comphelper::makePropertyValue("Rows", static_cast<sal_Int32>(1)),
+ comphelper::makePropertyValue("Columns", static_cast<sal_Int32>(1)),
+ };
+ dispatchCommand(mxComponent, ".uno:InsertTable", aTableProperties);
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xRow(xTable->getRows()->getByIndex(0), uno::UNO_QUERY);
+ xRow->setPropertyValue("Height", uno::makeAny(static_cast<sal_Int32>(1000)));
+
+ // When exporting to reqif-xhtml:
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aStoreProperties = {
+ comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")),
+ comphelper::makePropertyValue("FilterOptions", OUString("xhtmlns=reqif-xhtml")),
+ };
+ xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+
+ // Then make sure that the explicit cell height is omitted from the output:
+ SvMemoryStream aStream;
+ HtmlExportTest::wrapFragment(maTempFile, aStream);
+ xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
+ // Without the accompanying fix in place, this test would have failed, explicit height was
+ // written, which is not valid reqif-xhtml.
+ assertXPathNoAttribute(pDoc, "//reqif-xhtml:td", "height");
+}
+
DECLARE_HTMLEXPORT_TEST(testXHTMLUseCSS, "xhtml-css.odt")
{
SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
@@ -1080,25 +1160,14 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF)
ParseOle1FromRtfUrl(aRtfUrl, aOle1);
// Check the content of the ole1 data.
- // Skip ObjectHeader, see [MS-OLEDS] 2.2.4.
- aOle1.Seek(0);
- sal_uInt32 nData;
- aOle1.ReadUInt32(nData); // OLEVersion
- aOle1.ReadUInt32(nData); // FormatID
- aOle1.ReadUInt32(nData); // ClassName
- aOle1.SeekRel(nData);
- aOle1.ReadUInt32(nData); // TopicName
- aOle1.SeekRel(nData);
- aOle1.ReadUInt32(nData); // ItemName
- aOle1.SeekRel(nData);
- aOle1.ReadUInt32(nData); // NativeDataSize
+ OLE1Reader aOle1Reader(aOle1);
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 39405
// - Actual : 43008
// i.e. we did not work with the Ole10Native stream, rather created an OLE1 wrapper around the
// OLE1-in-OLE2 data, resulting in additional size.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x99ed), nData);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x99ed), aOle1Reader.m_nNativeDataSize);
// Now import this back and check the ODT result.
mxComponent->dispose();
@@ -1285,26 +1354,61 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataNoOle2)
ParseOle1FromRtfUrl(aRtfUrl, aOle1);
// Check the content of the ole1 data.
- // Skip ObjectHeader, see [MS-OLEDS] 2.2.4.
- aOle1.Seek(0);
- sal_uInt32 nData;
- aOle1.ReadUInt32(nData); // OLEVersion
- aOle1.ReadUInt32(nData); // FormatID
- aOle1.ReadUInt32(nData); // ClassName
- aOle1.SeekRel(nData);
- aOle1.ReadUInt32(nData); // TopicName
- aOle1.SeekRel(nData);
- aOle1.ReadUInt32(nData); // ItemName
- aOle1.SeekRel(nData);
- aOle1.ReadUInt32(nData); // NativeDataSize
- aOle1.SeekRel(nData);
-
- aOle1.ReadUInt32(nData); // OLEVersion for presentation data
-
// Without the accompanying fix in place, this test would have failed as there was no
// presentation data after the native data in the OLE1 container. The result was not editable in
// Word.
- CPPUNIT_ASSERT(aOle1.good());
+ OLE1Reader aOle1Reader(aOle1);
+}
+
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataWmfOnly)
+{
+ // Save to reqif-xhtml.
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole1-pres-data-wmf.odt";
+ mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {});
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aStoreProperties = {
+ comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")),
+ comphelper::makePropertyValue("FilterOptions", OUString("xhtmlns=reqif-xhtml")),
+ };
+ xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+ OUString aRtfUrl = GetOlePath();
+ SvMemoryStream aOle1;
+ ParseOle1FromRtfUrl(aRtfUrl, aOle1);
+
+ OLE1Reader aOle1Reader(aOle1);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 135660
+ // - Actual : 272376
+ // i.e. we wrote some additional EMF data into the WMF output, which broke Word.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(135660), aOle1Reader.m_nPresentationDataSize);
+}
+
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifAscharObjsize)
+{
+ // Given a document with an as-char anchored embedded object:
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-aschar-objsize.odt";
+ mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {});
+
+ // When exporting to reqif-xhtml:
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aStoreProperties = {
+ comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")),
+ comphelper::makePropertyValue("FilterOptions", OUString("xhtmlns=reqif-xhtml")),
+ };
+ xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+
+ // Then make sure that the RTF snippet has the correct aspect ratio:
+ OUString aRtfUrl = GetOlePath();
+ SvMemoryStream aRtf;
+ HtmlExportTest::wrapRtfFragment(aRtfUrl, aRtf);
+ tools::SvRef<TestReqIfRtfReader> xReader(new TestReqIfRtfReader(aRtf));
+ CPPUNIT_ASSERT(xReader->CallParser() != SvParserState::Error);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 7344
+ // - Actual : 2836
+ // i.e. the aspect ratio was 1:1, while the PNG aspect ratio was correctly not 1:1.
+ CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(7344), xReader->GetObjw());
+ CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(4116), xReader->GetObjh());
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index 85adfa2b7b49..f60d8b912fad 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -49,7 +49,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf131812, "tdf131812.odt")
sal_uInt64 nLength = pStream->TellEnd();
OString aStream(read_uInt8s_ToOString(*pStream, nLength));
CPPUNIT_ASSERT(
- aStream.indexOf(".P1 { font-size:12pt; font-family:Liberation Serif; "
+ aStream.indexOf(".P1 { font-size:12pt; font-family:\'Liberation Serif\'; "
"writing-mode:horizontal-tb; direction:rtl; text-align:right ! important;}")
!= -1);
}
diff --git a/sw/qa/extras/layout/data/tdf116486.docx b/sw/qa/extras/layout/data/tdf116486.docx
index c6a4891b0cf4..825b0ef33a55 100644
--- a/sw/qa/extras/layout/data/tdf116486.docx
+++ b/sw/qa/extras/layout/data/tdf116486.docx
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf138465min.docx b/sw/qa/extras/layout/data/tdf138465min.docx
new file mode 100644
index 000000000000..d576a54f281f
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf138465min.docx
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf138951.odt b/sw/qa/extras/layout/data/tdf138951.odt
new file mode 100644
index 000000000000..5cb4940bd5fe
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf138951.odt
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf141079.odt b/sw/qa/extras/layout/data/tdf141079.odt
new file mode 100644
index 000000000000..65dfcb4a296f
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf141079.odt
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf40260.odt b/sw/qa/extras/layout/data/tdf40260.odt
new file mode 100644
index 000000000000..3a9c23f547cf
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf40260.odt
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf72727.odt b/sw/qa/extras/layout/data/tdf72727.odt
new file mode 100644
index 000000000000..606ad690703e
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf72727.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 253783a9e146..c8919f155c60 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -283,6 +283,37 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination)
"zzz. zzz zzzz zzzz7 zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz ");
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951)
+{
+ // Open the bugdoc
+ auto pDoc = createDoc("tdf138951.odt");
+
+ // Get the only shape
+ uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xShape);
+
+ // Gather its formats: the shape and textbox
+ const SwFrameFormat* pTxFrm = SwTextBoxHelper::getOtherTextBoxFormat(xShape);
+ CPPUNIT_ASSERT(pTxFrm);
+ const SwFrameFormat* pShFrm = SwTextBoxHelper::getOtherTextBoxFormat(pTxFrm, RES_FLYFRMFMT);
+ CPPUNIT_ASSERT(pShFrm);
+
+ pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
+
+ // Get the bound rectangle of the textframe
+ tools::Rectangle aTxtFrmRect(pTxFrm->FindRealSdrObject()->GetLogicRect());
+
+ // Get the bound rectangle of the shape
+ tools::Rectangle aShpRect(pShFrm->FindRealSdrObject()->GetLogicRect());
+
+ // Check the anchor the same and the textbox is inside the shape
+ const bool bIsAnchTheSame
+ = *pShFrm->GetAnchor().GetContentAnchor() == *pShFrm->GetAnchor().GetContentAnchor();
+ CPPUNIT_ASSERT_MESSAGE("The anchor is different for the textbox and shape!", bIsAnchTheSame);
+ CPPUNIT_ASSERT_MESSAGE("The textbox has fallen apart!", aShpRect.IsInside(aTxtFrmRect));
+ // Without the fix the anchor differs, and the frame outside of the shape
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInNumbering)
{
SwDoc* pDoc = createDoc("tdf42748.fodt");
@@ -486,6 +517,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425)
assertXPath(pXmlDoc, "//textarray", 14);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops)
+{
+ CPPUNIT_ASSERT(createDoc("tdf138465min.docx"));
+
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ CPPUNIT_ASSERT(pXmlDoc);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: >300
+ // - Actual : 142
+ // i.e. the formula squashed
+ CPPUNIT_ASSERT_GREATEREQUAL(
+ double(300),
+ getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/notxt/infos/bounds", "height")
+ .toDouble());
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf123268)
{
SwDoc* pDoc = createDoc("tdf123268.odt");
@@ -667,12 +714,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244)
= getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[5]",
"orientation")
.toInt32();
- CPPUNIT_ASSERT(nRotation >= 899 && nRotation <= 900);
+ CPPUNIT_ASSERT(nRotation >= 899);
+ CPPUNIT_ASSERT(nRotation <= 900);
// Test the third level of vertical category axis labels orientation. The third level orientation should be vertical.
nRotation = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[7]",
"orientation")
.toInt32();
- CPPUNIT_ASSERT(nRotation >= 899 && nRotation <= 900);
+ CPPUNIT_ASSERT(nRotation >= 899);
+ CPPUNIT_ASSERT(nRotation <= 900);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304)
@@ -690,7 +739,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304)
= getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[1]",
"orientation")
.toInt32();
- CPPUNIT_ASSERT(nRotation >= 899 && nRotation <= 900);
+ CPPUNIT_ASSERT(nRotation >= 899);
+ CPPUNIT_ASSERT(nRotation <= 900);
// Test the second level of horizontal category axis labels orientation. The second level orientation should be horizontal.
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[5]", "orientation",
"0");
@@ -775,6 +825,28 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124796)
"15");
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727)
+{
+ SwDoc* pDoc = createDoc("tdf72727.odt");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 1
+ // - Actual : Series1
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[1]/text",
+ "1");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[2]/text",
+ "2");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[3]/text",
+ "3");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969)
{
SwDoc* pDoc = createDoc("tdf130969.docx");
@@ -791,6 +863,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969)
pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[5]/text", "0.35781");
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260)
+{
+ SwDoc* pDoc = createDoc("tdf40260.odt");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: f(x) = 1.26510397865547E-06 x − 5.95245604996327E-12
+ // - Actual : f(x) = 0 x − 0
+ assertXPathContent(
+ pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[19]/text",
+ "f(x) = 1.26510397865547E-06 x " + OUStringChar(u'\x2212') + " 5.95245604996327E-12");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129054)
{
SwDoc* pDoc = createDoc("tdf129054.docx");
@@ -1690,9 +1780,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122607_regression)
// inline the loading because currently properties can't be passed...
mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument",
comphelper::containerToSequence(aFilterOptions));
-
- CPPUNIT_ASSERT(mxComponent.is());
-
uno::Sequence<beans::PropertyValue> props(comphelper::InitPropertySequence({
{ "FilterName", uno::Any(OUString("writer_pdf_Export")) },
}));
@@ -1895,7 +1982,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf123651)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Without the accompanying fix in place, this test would have failed with 'Expected: 7639;
// Actual: 12926'. The shape was below the second "Lorem ipsum" text, not above it.
- const sal_Int32 nTopValue = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "top").toInt32();
+ const sal_Int32 nTopValue
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(7639, nTopValue, 10);
}
@@ -1979,6 +2067,39 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testImageComment)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), aPosition.nContent.GetIndex());
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testScriptField)
+{
+ // Test clicking script field inside table ( tdf#141079 )
+ SwDoc* pDoc = createDoc("tdf141079.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ // Look up layout position which is the first cell in the table
+ SwRootFrame* pRoot = pWrtShell->GetLayout();
+ CPPUNIT_ASSERT(pRoot->GetLower()->IsPageFrame());
+ SwPageFrame* pPage = static_cast<SwPageFrame*>(pRoot->GetLower());
+ CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame());
+ SwBodyFrame* pBody = static_cast<SwBodyFrame*>(pPage->GetLower());
+ CPPUNIT_ASSERT(pBody->GetLower()->IsTextFrame());
+ SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pBody->GetLower());
+ CPPUNIT_ASSERT(pTextFrame->GetNext()->IsTabFrame());
+ SwFrame* pTable = pTextFrame->GetNext();
+ SwFrame* pRow1 = pTable->GetLower();
+ CPPUNIT_ASSERT(pRow1->GetLower()->IsCellFrame());
+ SwFrame* pCell1 = pRow1->GetLower();
+ CPPUNIT_ASSERT(pCell1->GetLower()->IsTextFrame());
+ SwTextFrame* pCellTextFrame = static_cast<SwTextFrame*>(pCell1->GetLower());
+ const SwRect& rCellRect = pCell1->getFrameArea();
+ Point aPoint = rCellRect.Center();
+ aPoint.setX(aPoint.getX() - rCellRect.Width() / 2);
+
+ // Ask for the doc model pos of this layout point.
+ SwPosition aPosition(*pCellTextFrame->GetTextNodeForFirstText());
+ pCellTextFrame->GetModelPositionForViewPoint(&aPosition, aPoint);
+
+ // Position was 1 without the fix from tdf#141079
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aPosition.nContent.GetIndex());
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testCommentCursorPosition)
{
// Load a document that has "aaa" in it, followed by three comments.
@@ -2282,9 +2403,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124601b)
createDoc("tdf124601b.doc");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFlyTop = getXPath(pXmlDoc, "//fly/infos/bounds", "top").toInt32();
- sal_Int32 nFlyLeft = getXPath(pXmlDoc, "//fly/infos/bounds", "left").toInt32();
- sal_Int32 nFlyRight = nFlyLeft + getXPath(pXmlDoc, "//fly/infos/bounds", "width").toInt32();
+ sal_Int32 nFlyTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32();
+ sal_Int32 nFlyLeft = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toInt32();
+ sal_Int32 nFlyRight
+ = nFlyLeft + getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "width").toInt32();
sal_Int32 nSecondRowTop = getXPath(pXmlDoc, "//tab/row[2]/infos/bounds", "top").toInt32();
sal_Int32 nLastCellLeft
= getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds", "left").toInt32();
@@ -2545,7 +2667,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testWriterImageNoCapture)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
sal_Int32 nPageLeft = getXPath(pXmlDoc, "//page/infos/bounds", "left").toInt32();
- sal_Int32 nImageLeft = getXPath(pXmlDoc, "//fly/infos/bounds", "left").toInt32();
+ sal_Int32 nImageLeft = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected less than: 284
// - Actual : 284
@@ -2621,16 +2743,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124423)
{
createDoc("tdf124423.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFly1Width = getXPath(pXmlDoc, "(//fly)[1]/infos/prtBounds", "width").toInt32();
- sal_Int32 nFly2Width = getXPath(pXmlDoc, "(//fly)[2]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nFly1Width
+ = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nFly2Width
+ = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
sal_Int32 nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds", "width").toInt32();
CPPUNIT_ASSERT_EQUAL(nPageWidth, nFly2Width);
CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly1Width);
createDoc("tdf124423.odt");
pXmlDoc = parseLayoutDump();
- nFly1Width = getXPath(pXmlDoc, "(//fly)[1]/infos/prtBounds", "width").toInt32();
- nFly2Width = getXPath(pXmlDoc, "(//fly)[2]/infos/prtBounds", "width").toInt32();
+ nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32();
+ nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds", "width").toInt32();
CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly2Width);
CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly1Width);
@@ -2649,7 +2773,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137185)
auto pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
CPPUNIT_ASSERT(pModel);
auto pPage = pModel->GetPage(0);
- CPPUNIT_ASSERT(pModel);
+ CPPUNIT_ASSERT(pPage);
auto pObj = pPage->GetObj(0);
CPPUNIT_ASSERT(pObj);
@@ -2681,9 +2805,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135035)
{
createDoc("tdf135035.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFly1Width = getXPath(pXmlDoc, "(//fly)[1]/infos/prtBounds", "width").toInt32();
- sal_Int32 nFly2Width = getXPath(pXmlDoc, "(//fly)[2]/infos/prtBounds", "width").toInt32();
- sal_Int32 nFly3Width = getXPath(pXmlDoc, "(//fly)[3]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nFly1Width
+ = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nFly2Width
+ = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nFly3Width
+ = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds", "width").toInt32();
sal_Int32 nParentWidth = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds", "width").toInt32();
CPPUNIT_ASSERT_EQUAL(nParentWidth, nFly2Width);
CPPUNIT_ASSERT_EQUAL(nParentWidth, nFly3Width);
@@ -2691,9 +2818,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135035)
createDoc("tdf135035.odt");
pXmlDoc = parseLayoutDump();
- nFly1Width = getXPath(pXmlDoc, "(//fly)[1]/infos/prtBounds", "width").toInt32();
- nFly2Width = getXPath(pXmlDoc, "(//fly)[2]/infos/prtBounds", "width").toInt32();
- nFly3Width = getXPath(pXmlDoc, "(//fly)[3]/infos/prtBounds", "width").toInt32();
+ nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32();
+ nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
+ nFly3Width = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds", "width").toInt32();
nParentWidth = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds", "width").toInt32();
CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly2Width);
CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly1Width);
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 824c4bbd60e5..67fb47fe6996 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -247,7 +247,6 @@ public:
std::cout << filename << ",";
mnStartTime = osl_getGlobalTimer();
mxComponent = loadFromDesktop(msMailMergeOutputURL + "/" + filename, "com.sun.star.text.TextDocument");
- CPPUNIT_ASSERT( mxComponent.is());
OString name2 = OUStringToOString( filename, RTL_TEXTENCODING_UTF8 );
discardDumpedLayout();
if (mustCalcLayoutOf(name2.getStr()))
@@ -397,7 +396,7 @@ DECLARE_FILE_MAILMERGE_TEST(testMissingDefaultLineColor, "missing-default-line-c
executeMailMerge();
// The document was created by LO version which didn't write out the default value for line color
// (see XMLGraphicsDefaultStyle::SetDefaults()).
- uno::Reference<beans::XPropertySet> xPropertySet(getShape(4), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(5), uno::UNO_QUERY);
// Lines do not have a line color.
CPPUNIT_ASSERT( !xPropertySet->getPropertySetInfo()->hasPropertyByName( "LineColor" ));
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
diff --git a/sw/qa/extras/odfexport/data/Formcontrol needs high z-index.odt b/sw/qa/extras/odfexport/data/Formcontrol needs high z-index.odt
new file mode 100644
index 000000000000..4b03bd7fd197
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/Formcontrol needs high z-index.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/MadeByLO7.odt b/sw/qa/extras/odfexport/data/MadeByLO7.odt
new file mode 100644
index 000000000000..9587fffe6470
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/MadeByLO7.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/gutter-left.odt b/sw/qa/extras/odfexport/data/gutter-left.odt
new file mode 100644
index 000000000000..a047ecaa3353
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/gutter-left.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/pagestyle_background_lo64.odt b/sw/qa/extras/odfexport/data/pagestyle_background_lo64.odt
new file mode 100644
index 000000000000..c8b3c3fdd056
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/pagestyle_background_lo64.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/pagestyle_background_lo70.odt b/sw/qa/extras/odfexport/data/pagestyle_background_lo70.odt
new file mode 100644
index 000000000000..eb8b4a0e72aa
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/pagestyle_background_lo70.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/pagestyle_background_ooo33.odt b/sw/qa/extras/odfexport/data/pagestyle_background_ooo33.odt
new file mode 100644
index 000000000000..92098d0bcfc3
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/pagestyle_background_ooo33.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/tdf115815.odt b/sw/qa/extras/odfexport/data/tdf115815.odt
new file mode 100644
index 000000000000..7c2aad0da638
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf115815.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/tdf140437.odt b/sw/qa/extras/odfexport/data/tdf140437.odt
new file mode 100644
index 000000000000..8ed9ee77ce8f
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf140437.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/tdf95806.docx b/sw/qa/extras/odfexport/data/tdf95806.docx
new file mode 100644
index 000000000000..65bfaae3e423
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf95806.docx
Binary files differ
diff --git a/sw/qa/extras/odfexport/data/testTdf52065_centerTabs.odt b/sw/qa/extras/odfexport/data/testTdf52065_centerTabs.odt
new file mode 100644
index 000000000000..8cdaf3eb9f31
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/testTdf52065_centerTabs.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 15704c8eeaad..6dc67ca58a1d 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -10,7 +10,6 @@
#include <algorithm>
#include <memory>
#include <swmodeltestbase.hxx>
-#include <config_features.h>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/Gradient.hpp>
@@ -50,6 +49,7 @@
#include <unotools/streamwrap.hxx>
#include <svl/PasswordHelper.hxx>
#include <comphelper/sequenceashashmap.hxx>
+#include <vcl/filter/PDFiumLibrary.hxx>
#include <docufld.hxx> // for SwHiddenTextField::ParseIfFieldDefinition() method call
#include <unoprnms.hxx>
@@ -232,6 +232,32 @@ DECLARE_ODFEXPORT_TEST(testTdf130314, "tdf130314.docx")
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf133487, "MadeByLO7.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ // shape in background has lowest index
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "background");
+ // shape in foreground, previously index 1
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[1]/draw:custom-shape", "z-index", "2");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[1]/draw:custom-shape[@draw:z-index = '2']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ // shape in foreground, previously index 0
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[3]/draw:custom-shape", "z-index", "1");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[3]/draw:custom-shape[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+}
+
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf141467, "Formcontrol needs high z-index.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ // shape in foreground has lowest index
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ // form control, previously index 0
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:control", "z-index", "1");
+ // no run-through on form's style
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:control[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties/attribute::run-through", 0);
+}
+
DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
@@ -249,6 +275,23 @@ DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt")
CPPUNIT_ASSERT_EQUAL(OUString("** Expression is faulty **"), xE2->getString());
}
+DECLARE_ODFEXPORT_TEST(testTdf125877, "tdf95806.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ uno::Reference<text::XTextTablesSupplier> xSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+
+ // This was 0 (lost table during ODT export in footnotes)
+ // Note: fix also tdf#95806: painting table layout is correct
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+
+ // floating table: there is a frame now
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+}
+
DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getShapes());
@@ -490,6 +533,19 @@ DECLARE_ODFEXPORT_TEST(testredlineTextFrame, "redlineTextFrame.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
}
+DECLARE_ODFEXPORT_TEST(testTdf140437, "tdf140437.odt")
+{
+ // Without the fix in place, the document would have failed to load
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+
+ // at least one field should be detected
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+}
+
DECLARE_ODFEXPORT_TEST(testTdf131621, "tdf131621.ott")
{
CPPUNIT_ASSERT_EQUAL(12, getShapes());
@@ -767,6 +823,45 @@ DECLARE_ODFEXPORT_TEST(testFdo60769, "fdo60769.odt")
}
}
+DECLARE_ODFEXPORT_TEST(testTdf115815, "tdf115815.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ // Test comment range feature on tracked deletion.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ bool bAnnotationStart = false;
+ bool bBeforeAnnotation = true;
+ OUString sTextBeforeAnnotation;
+ while (xRunEnum->hasMoreElements())
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ OUString aType = getProperty<OUString>(xPropertySet, "TextPortionType");
+ // there is no AnnotationEnd with preceding AnnotationStart,
+ // i.e. annotation with lost range
+ CPPUNIT_ASSERT(aType != "AnnotationEnd" || !bAnnotationStart);
+
+ bAnnotationStart = (aType == "Annotation");
+
+ // collect paragraph text before the first annotation
+ if (bBeforeAnnotation)
+ {
+ if (bAnnotationStart)
+ bBeforeAnnotation = false;
+ else if (aType == "Text")
+ {
+ uno::Reference<text::XTextRange> xRun(xPropertySet, uno::UNO_QUERY);
+ sTextBeforeAnnotation += xRun->getString();
+ }
+ }
+ }
+
+ // This was "Lorem ipsum" (collapsed annotation range)
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem "), sTextBeforeAnnotation);
+}
+
DECLARE_ODFEXPORT_TEST(testFdo58949, "fdo58949.docx")
{
/*
@@ -1821,6 +1916,276 @@ DECLARE_ODFEXPORT_TEST(testMasterPageWithDrawingPage, "sw_hatch.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle, "FillTransparence"));
}
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeOOo, "pagestyle_background_ooo33.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ // Standard
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "solid");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // Endnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Footnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "stretch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+}
+
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO64, "pagestyle_background_lo64.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ // Standard
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "solid");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // Endnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Footnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "stretch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Landscape
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "no-repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Index
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "gradient");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "gradient-step-count", "0");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // First Page
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "hatch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-hatch-solid", "false");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+}
+
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO70, "pagestyle_background_lo70.odt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ // Standard
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "solid");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // Endnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Footnote
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "stretch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Landscape
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "border");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "bitmap");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "repeat", "no-repeat");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ // Index
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "gradient");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "gradient-step-count", "0");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+ // First Page
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "background-size", "full");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill", "hatch");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "fill-hatch-solid", "false");
+ assertXPath(pXmlDoc,
+ "/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
+ "/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
+ "]/style:drawing-page-properties", "opacity", "100%");
+}
+
DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
@@ -1833,9 +2198,14 @@ DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
getUserDefineAttribute(uno::makeAny(xCellC1), "proName", "v3");
}
-#if HAVE_FEATURE_PDFIUM
DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
{
+ auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+ if (!pPdfium)
+ {
+ return;
+ }
+
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
uno::Reference<drawing::XShape> xShape = getShape(1);
@@ -1867,7 +2237,6 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
CPPUNIT_ASSERT(bHasBitmap);
}
}
-#endif
DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt")
{
@@ -2686,5 +3055,18 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(tdf135942, "nestedTableInFooter.odt")
assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 2);
}
+DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt")
+{
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
new file mode 100644
index 000000000000..21455b9d343d
--- /dev/null
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -0,0 +1,45 @@
+/* -*- 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 <swmodeltestbase.hxx>
+
+
+class Test : public SwModelTestBase
+{
+public:
+ Test() : SwModelTestBase("/sw/qa/extras/odfexport/data/", "writer8") {}
+
+ /**
+ * Denylist handling
+ */
+ bool mustTestImportOf(const char* filename) const override {
+ // Only test import of .odt document
+ return OString(filename).endsWith(".odt");
+ }
+
+ bool mustValidate(const char* /*filename*/) const override
+ {
+ return true;
+ }
+
+};
+
+DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
+{
+ sal_Int32 nTabStop = parseDump("//body/txt[4]/Text[3]", "nWidth").toInt32();
+ // Without the fix, the text was unseen, with a tabstop width of 64057. It should be 3057
+ CPPUNIT_ASSERT(nTabStop < 4000);
+ CPPUNIT_ASSERT(3000 < nTabStop);
+ CPPUNIT_ASSERT_EQUAL(OUString(u"Pečiatka zamestnávateľa"), parseDump("//body/txt[4]/Text[4]", "Portion"));
+}
+
+// This test started in LO 7.2. Use the odfexport.cxx if you intend to backport to 7.1.
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/odfimport/data/tdf128737.odt b/sw/qa/extras/odfimport/data/tdf128737.odt
new file mode 100644
index 000000000000..85f2c32c603e
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf128737.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/data/vmerge-cell-border.odt b/sw/qa/extras/odfimport/data/vmerge-cell-border.odt
new file mode 100644
index 000000000000..bf387bcb183e
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/vmerge-cell-border.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 6ab87d07a3de..33018abf1a4c 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <comphelper/propertysequence.hxx>
+#include <editeng/boxitem.hxx>
#include <IDocumentSettingAccess.hxx>
#include <wrtsh.hxx>
@@ -54,6 +55,7 @@
#include <hintids.hxx>
#include <docsh.hxx>
#include <unotxdoc.hxx>
+#include <frmatr.hxx>
typedef std::map<OUString, css::uno::Sequence< css::table::BorderLine> > AllBordersMap;
typedef std::pair<OUString, css::uno::Sequence< css::table::BorderLine> > StringSequencePair;
@@ -558,6 +560,13 @@ DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(422), xShape->getPosition().Y); // Was -2371
}
+DECLARE_ODFIMPORT_TEST(testTdf128737, "tdf128737.odt")
+{
+ // Without the fix in place, this test would have crashed
+ CPPUNIT_ASSERT_EQUAL(4, getPages());
+ CPPUNIT_ASSERT_EQUAL(8, getShapes());
+}
+
DECLARE_ODFIMPORT_TEST(testCalcFootnoteContent, "ooo32780-1.odt")
{
//this was a CalcFootnoteContent crash
@@ -1158,5 +1167,37 @@ CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat)
getProperty<sal_Int16>(xParagraph, "ParaAdjust"));
}
+CPPUNIT_TEST_FIXTURE(Test, testVerticallyMergedCellBorder)
+{
+ // Given a document with two cells, vertically merged, when loading the document:
+ SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "vmerge-cell-border.odt");
+
+ // Then make sure that the first cell has a right border while the second has no right border:
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->Down(/*bSelect=*/false, /*nCount=*/1);
+ SwShellCursor* pShellCursor = pWrtShell->getShellCursor(/*bBlock=*/false);
+ SwStartNode* pA1 = pShellCursor->Start()->nNode.GetNode().StartOfSectionNode();
+ const SwAttrSet& rA1Set = pA1->GetTableBox()->GetFrameFormat()->GetAttrSet();
+ CPPUNIT_ASSERT(rA1Set.GetBox().GetRight());
+ SwNodeIndex aA2(*pA1->EndOfSectionNode(), 1);
+ const SwAttrSet& rA2Set = aA2.GetNode().GetTableBox()->GetFrameFormat()->GetAttrSet();
+
+ // Without the accompanying fix in place, this test would have failed, as the A2 cell also had a
+ // right border, even if <table:covered-table-cell table:style-name="..."> explicitly disabled
+ // it.
+ CPPUNIT_ASSERT(!rA2Set.GetBox().GetRight());
+
+ // Given this document model, when exporting to ODT:
+ save("writer8", maTempFile);
+ mbExported = true;
+
+ // Then make sure the covered cell has a style.
+ xmlDocUniquePtr pXmlSettings = parseExport("content.xml");
+ // Without the accompanying fix in place, this test would have failed with:
+ // - In <...>, XPath '//table:covered-table-cell' no attribute 'style-name' exist
+ assertXPath(pXmlSettings, "//table:covered-table-cell", "style-name", "Table1.A2");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/data/controlshape.fodt b/sw/qa/extras/ooxmlexport/data/controlshape.fodt
new file mode 100644
index 000000000000..81a71092407c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/controlshape.fodt
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ <style:font-face style:name="Arial" svg:font-family="Arial"/>
+ <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
+ <style:font-face style:name="Lucida Sans Unicode" svg:font-family="&apos;Lucida Sans Unicode&apos;" style:font-pitch="variable"/>
+ <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/>
+ <style:font-face style:name="Arial1" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#000000" draw:fill-color="#99ccff" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text">
+ <style:text-properties fo:font-size="11pt"/>
+ </style:style>
+ <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" loext:contextual-spacing="false" style:line-height-at-least="0.46cm"/>
+ </style:style>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" fo:keep-with-next="always"/>
+ <style:text-properties style:font-name="Arial1" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="Lucida Sans Unicode" style:font-family-asian="&apos;Lucida Sans Unicode&apos;" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-family-complex="Tahoma" style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
+ </style:style>
+ <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
+ <style:text-properties style:font-name="Arial" fo:font-family="Arial" style:font-name-complex="Tahoma1" style:font-family-complex="Tahoma"/>
+ </style:style>
+ <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
+ <style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
+ <style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
+ <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Numbering_20_Symbols" style:display-name="Numbering Symbols" style:family="text"/>
+ <style:style style:name="Frame" style:family="graphic">
+ <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.06pt solid #000000"/>
+ </style:style>
+ <text:outline-style style:name="Outline">
+ <text:outline-level-style text:level="1" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="2" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="3" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="4" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="5" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="6" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="7" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="8" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="9" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="10" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ </text:outline-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Tabelle1" style:family="table" style:master-page-name="First_20_Page">
+ <style:table-properties style:width="19.396cm" fo:margin-left="-1.642cm" style:page-number="auto" table:align="left" style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="Tabelle1.A" style:family="table-column">
+ <style:table-column-properties style:column-width="19.396cm"/>
+ </style:style>
+ <style:style style:name="Tabelle1.1" style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:style>
+ <style:style style:name="Tabelle1.A1" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:padding="0cm" fo:border="none" style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
+ <style:graphic-properties fo:margin-left="0.002cm" fo:margin-right="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" style:flow-with-text="true"/>
+ </style:style>
+ <style:style style:name="gr1" style:family="graphic">
+ <style:graphic-properties style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+ </style:style>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" fo:background-color="transparent" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" draw:fill="none" draw:fill-color="#99ccff" style:footnote-max-height="0cm">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style>
+ <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+ </style:header-style>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style>
+ <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+ </style:header-style>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <office:forms form:automatic-focus="false" form:apply-design-mode="false">
+ <form:form form:name="WW-Standard" form:apply-filter="true" form:control-implementation="ooo:com.sun.star.form.component.Form" office:target-frame="">
+ <form:properties>
+ <form:property form:property-name="PropertyChangeNotificationEnabled" office:value-type="boolean" office:boolean-value="true"/>
+ <form:property form:property-name="TargetURL" office:value-type="string" office:string-value=""/>
+ </form:properties>
+ <form:checkbox form:name="Kontrollkästchen1" form:control-implementation="ooo:com.sun.star.form.component.CheckBox" xml:id="control1" form:id="control1" form:input-required="false" form:state="checked" form:current-state="checked" form:image-position="center">
+ <form:properties>
+ <form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
+ <form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.CheckBox"/>
+ <form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
+ <form:property form:property-name="SecondaryRefValue" office:value-type="string" office:string-value=""/>
+ </form:properties>
+ </form:checkbox>
+ </form:form>
+ </office:forms>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ </text:sequence-decls>
+ <table:table table:name="Tabelle1" table:style-name="Tabelle1">
+ <table:table-column table:style-name="Tabelle1.A"/>
+ <table:table-row table:style-name="Tabelle1.1">
+ <table:table-cell table:style-name="Tabelle1.A1" office:value-type="string">
+ <text:p>
+ <draw:frame draw:style-name="fr1" draw:name="Rahmen2" text:anchor-type="as-char" svg:width="7.959cm" draw:z-index="0">
+ <draw:text-box fo:min-height="0.041cm">
+ <text:p>
+ <draw:control text:anchor-type="as-char" draw:z-index="1" draw:name="Shape1" draw:style-name="gr1" svg:width="0.318cm" svg:height="0.318cm" draw:control="control1"/>
+ </text:p>
+ </draw:text-box>
+ </draw:frame>
+ </text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <text:p/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/ooxmlexport/data/effect-extent-line-width.docx b/sw/qa/extras/ooxmlexport/data/effect-extent-line-width.docx
new file mode 100644
index 000000000000..5cc4d4e374ee
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/effect-extent-line-width.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx b/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx
index 22db162a78b0..5dccf967fe7a 100644
--- a/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx
+++ b/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/fly_fieldmark.fodt b/sw/qa/extras/ooxmlexport/data/fly_fieldmark.fodt
new file mode 100644
index 000000000000..af1ae9a86243
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fly_fieldmark.fodt
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+
+ <office:font-face-decls>
+ <style:font-face style:name="Lohit Devanagari1" svg:font-family="&apos;Lohit Devanagari&apos;"/>
+ <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-face style:name="Lohit Devanagari" svg:font-family="&apos;Lohit Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Sans CN" svg:font-family="&apos;Source Han Sans CN&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Serif CN" svg:font-family="&apos;Source Han Serif CN&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph">
+ <style:paragraph-properties fo:text-align="center"/>
+ </style:style>
+ <style:style style:name="gr1" style:family="graphic">
+ <style:graphic-properties draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="1.609cm" fo:min-width="1.609cm" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page"/>
+ </style:style>
+ <style:style style:name="gr2" style:family="graphic">
+ <style:graphic-properties draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="2.064cm" fo:min-width="3.44cm" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <draw:custom-shape text:anchor-type="page" text:anchor-page-number="1" draw:z-index="1" draw:name="Shape2" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.276cm" svg:height="2.276cm" svg:x="4.752cm" svg:y="2.902cm">
+ <text:p/>
+ <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/>
+ </draw:custom-shape>
+ <text:p text:style-name="Standard"><draw:custom-shape text:anchor-type="char" draw:z-index="0" draw:name="Shape1" draw:style-name="gr2" svg:width="3.44cm" svg:height="2.065cm" svg:x="-1.337cm" svg:y="0.912cm">
+ <text:p/>
+ <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>
+ </draw:custom-shape><field:fieldmark-start text:name="__Fieldmark__0_1348794289" field:type="vnd.oasis.opendocument.field.FORMTEXT"/>foobar<field:fieldmark-end/></text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx b/sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx
new file mode 100644
index 000000000000..d6a9d7bd8df9
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/gutter-left.docx b/sw/qa/extras/ooxmlexport/data/gutter-left.docx
new file mode 100644
index 000000000000..4dc1cbf615f7
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/gutter-left.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/gutter-top.docx b/sw/qa/extras/ooxmlexport/data/gutter-top.docx
new file mode 100644
index 000000000000..d48cb2846287
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/gutter-top.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/rtl-gutter.docx b/sw/qa/extras/ooxmlexport/data/rtl-gutter.docx
new file mode 100644
index 000000000000..d6b28e5cbce2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/rtl-gutter.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt b/sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt
new file mode 100644
index 000000000000..42c9c7790509
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ <style:font-face style:name="Arial" svg:font-family="Arial"/>
+ <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
+ <style:font-face style:name="Lucida Sans Unicode" svg:font-family="&apos;Lucida Sans Unicode&apos;" style:font-pitch="variable"/>
+ <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/>
+ <style:font-face style:name="Arial1" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#000000" draw:fill-color="#99ccff" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text">
+ <style:text-properties fo:font-size="11pt"/>
+ </style:style>
+ <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" loext:contextual-spacing="false" style:line-height-at-least="0.46cm"/>
+ </style:style>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" fo:keep-with-next="always"/>
+ <style:text-properties style:font-name="Arial1" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="Lucida Sans Unicode" style:font-family-asian="&apos;Lucida Sans Unicode&apos;" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-family-complex="Tahoma" style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
+ </style:style>
+ <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
+ <style:text-properties style:font-name="Arial" fo:font-family="Arial" style:font-name-complex="Tahoma1" style:font-family-complex="Tahoma"/>
+ </style:style>
+ <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
+ <style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
+ <style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
+ <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Numbering_20_Symbols" style:display-name="Numbering Symbols" style:family="text"/>
+ <style:style style:name="Frame" style:family="graphic">
+ <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.06pt solid #000000"/>
+ </style:style>
+ <text:outline-style style:name="Outline">
+ <text:outline-level-style text:level="1" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="2" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="3" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="4" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="5" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="6" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="7" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="8" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="9" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="10" style:num-format="">
+ <style:list-level-properties text:min-label-distance="0.381cm"/>
+ </text:outline-level-style>
+ </text:outline-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Tabelle1" style:family="table" style:master-page-name="First_20_Page">
+ <style:table-properties style:width="19.396cm" fo:margin-left="-1.642cm" style:page-number="auto" table:align="left" style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="Tabelle1.A" style:family="table-column">
+ <style:table-column-properties style:column-width="19.396cm"/>
+ </style:style>
+ <style:style style:name="Tabelle1.1" style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:style>
+ <style:style style:name="Tabelle1.A1" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:padding="0cm" fo:border="none" style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="gr2" style:family="graphic">
+ <style:graphic-properties draw:stroke="none" draw:fill="none" draw:fill-color="#ffffff" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" draw:auto-grow-width="false" fo:padding-top="0.1in" fo:padding-bottom="0.1in" fo:padding-left="0.05in" fo:padding-right="0.05in" fo:wrap-option="wrap" draw:shadow="hidden" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+ <style:paragraph-properties style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ </style:style>
+ <style:style style:name="P54" style:family="paragraph">
+ <loext:graphic-properties draw:fill="none" draw:fill-color="#ffffff"/>
+ <style:paragraph-properties style:writing-mode="lr-tb"/>
+ <style:text-properties fo:color="#000000" style:font-name="Arial1" fo:font-size="7pt" fo:language="de" fo:country="DE" style:font-name-asian="Arial1" style:font-size-asian="7pt" style:font-name-complex="Arial1" style:font-size-complex="7pt" style:language-complex="ar" style:country-complex="SA"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" fo:background-color="transparent" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" draw:fill="none" draw:fill-color="#99ccff" style:footnote-max-height="0cm">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style>
+ <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+ </style:header-style>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style>
+ <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+ </style:header-style>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <office:forms form:automatic-focus="false" form:apply-design-mode="false">
+ <form:form form:name="WW-Standard" form:apply-filter="true" form:control-implementation="ooo:com.sun.star.form.component.Form" office:target-frame="">
+ <form:properties>
+ <form:property form:property-name="PropertyChangeNotificationEnabled" office:value-type="boolean" office:boolean-value="true"/>
+ <form:property form:property-name="TargetURL" office:value-type="string" office:string-value=""/>
+ </form:properties>
+ <form:checkbox form:name="Kontrollkästchen1" form:control-implementation="ooo:com.sun.star.form.component.CheckBox" xml:id="control1" form:id="control1" form:input-required="false" form:state="checked" form:current-state="checked" form:image-position="center">
+ <form:properties>
+ <form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
+ <form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.CheckBox"/>
+ <form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
+ <form:property form:property-name="SecondaryRefValue" office:value-type="string" office:string-value=""/>
+ </form:properties>
+ </form:checkbox>
+ </form:form>
+ </office:forms>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ </text:sequence-decls>
+ <draw:frame text:anchor-type="page" text:anchor-page-number="1" draw:z-index="0" draw:name="Shape1" draw:style-name="gr2" draw:text-style-name="P54" svg:width="2.3213in" svg:height="0.3776in" draw:transform="rotate (1.5707963267949) translate (0.364583333333333in 10.65in)">
+ <draw:text-box>
+ <text:p text:style-name="P53">
+ ABC DEF GHI
+ </text:p>
+ </draw:text-box>
+ </draw:frame>
+ <table:table table:name="Tabelle1" table:style-name="Tabelle1">
+ <table:table-column table:style-name="Tabelle1.A"/>
+ <table:table-row table:style-name="Tabelle1.1">
+ <table:table-cell table:style-name="Tabelle1.A1" office:value-type="string">
+ <text:p>
+ </text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <text:p/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf118535.odt b/sw/qa/extras/ooxmlexport/data/tdf118535.odt
new file mode 100644
index 000000000000..146c6f471a18
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf118535.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121666_lostPage.docx b/sw/qa/extras/ooxmlexport/data/tdf121666_lostPage.docx
new file mode 100644
index 000000000000..195f574d1c5d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf121666_lostPage.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt b/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt
new file mode 100644
index 000000000000..a694ff613633
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt b/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt
new file mode 100644
index 000000000000..cb14c8ea4df3
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf125936_numberingSuperscript.docx b/sw/qa/extras/ooxmlexport/data/tdf125936_numberingSuperscript.docx
new file mode 100644
index 000000000000..eb856fb3b02e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf125936_numberingSuperscript.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133045_TestShapeAlignmentRelativeFromTopMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf133045_TestShapeAlignmentRelativeFromTopMargin.docx
index 2cd299ff211a..aa976e7cc925 100644
--- a/sw/qa/extras/ooxmlexport/data/tdf133045_TestShapeAlignmentRelativeFromTopMargin.docx
+++ b/sw/qa/extras/ooxmlexport/data/tdf133045_TestShapeAlignmentRelativeFromTopMargin.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133473.docx b/sw/qa/extras/ooxmlexport/data/tdf133473.docx
new file mode 100644
index 000000000000..c351db950231
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf133473.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf134619_numberingProps.doc b/sw/qa/extras/ooxmlexport/data/tdf134619_numberingProps.doc
new file mode 100644
index 000000000000..742b45ce6563
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf134619_numberingProps.doc
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf134951_duplicates.odt b/sw/qa/extras/ooxmlexport/data/tdf134951_duplicates.odt
new file mode 100644
index 000000000000..53c7076b3eeb
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf134951_duplicates.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx b/sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx
new file mode 100644
index 000000000000..697db308e3d1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135774_numberingShading.docx b/sw/qa/extras/ooxmlexport/data/tdf135774_numberingShading.docx
new file mode 100644
index 000000000000..9f62ef2a5a21
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135774_numberingShading.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf136059.odt b/sw/qa/extras/ooxmlexport/data/tdf136059.odt
new file mode 100644
index 000000000000..50d808d12f2f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf136059.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf136841.docx b/sw/qa/extras/ooxmlexport/data/tdf136841.docx
new file mode 100644
index 000000000000..6f9020ee17f4
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf136841.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf137655.docx b/sw/qa/extras/ooxmlexport/data/tdf137655.docx
new file mode 100644
index 000000000000..d87d434b324d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf137655.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf138345_numberingHighlight.docx b/sw/qa/extras/ooxmlexport/data/tdf138345_numberingHighlight.docx
new file mode 100644
index 000000000000..0083b1b38dd0
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf138345_numberingHighlight.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf138771.docx b/sw/qa/extras/ooxmlexport/data/tdf138771.docx
new file mode 100644
index 000000000000..70b035508bb2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf138771.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf138780.odt b/sw/qa/extras/ooxmlexport/data/tdf138780.odt
new file mode 100644
index 000000000000..3e7a96a0297c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf138780.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140137.docx b/sw/qa/extras/ooxmlexport/data/tdf140137.docx
new file mode 100644
index 000000000000..d03925e75e2c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf140137.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140182_extraPagebreak.docx b/sw/qa/extras/ooxmlexport/data/tdf140182_extraPagebreak.docx
new file mode 100644
index 000000000000..be47d79c5b0a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf140182_extraPagebreak.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140336_paraNoneShading.odt b/sw/qa/extras/ooxmlexport/data/tdf140336_paraNoneShading.odt
new file mode 100644
index 000000000000..c4bd80f1a65c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf140336_paraNoneShading.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140572_docDefault_superscript.docx b/sw/qa/extras/ooxmlexport/data/tdf140572_docDefault_superscript.docx
new file mode 100644
index 000000000000..fd176dc8c896
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf140572_docDefault_superscript.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140597.docx b/sw/qa/extras/ooxmlexport/data/tdf140597.docx
new file mode 100644
index 000000000000..36db7d9bea2b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf140597.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140668.docx b/sw/qa/extras/ooxmlexport/data/tdf140668.docx
new file mode 100644
index 000000000000..d7072187bb57
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf140668.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141172.docx b/sw/qa/extras/ooxmlexport/data/tdf141172.docx
new file mode 100644
index 000000000000..0e1647ae27e1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf141172.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141173_missingFrames.rtf b/sw/qa/extras/ooxmlexport/data/tdf141173_missingFrames.rtf
new file mode 100644
index 000000000000..6ccc1de58e4b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf141173_missingFrames.rtf
@@ -0,0 +1,61 @@
+{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang3082\deflangfe3082{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
+{\f36\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Frutiger LT 65 Bold;}{\f37\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Frutiger LT 45 Light;}{\f38\fscript\fcharset0\fprq2{\*\panose 00000000000000000000}Comic Sans MS;}
+{\f39\froman\fcharset238\fprq2 Times New Roman CE;}{\f40\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\froman\fcharset162\fprq2 Times New Roman Tur;}
+{\f44\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\f49\fswiss\fcharset238\fprq2 Arial CE;}{\f50\fswiss\fcharset204\fprq2 Arial Cyr;}{\f52\fswiss\fcharset161\fprq2 Arial Greek;}{\f53\fswiss\fcharset162\fprq2 Arial Tur;}{\f54\fswiss\fcharset177\fprq2 Arial (Hebrew);}
+{\f55\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f56\fswiss\fcharset186\fprq2 Arial Baltic;}{\f57\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f419\fscript\fcharset238\fprq2 Comic Sans MS CE;}{\f420\fscript\fcharset204\fprq2 Comic Sans MS Cyr;}
+{\f422\fscript\fcharset161\fprq2 Comic Sans MS Greek;}{\f423\fscript\fcharset162\fprq2 Comic Sans MS Tur;}{\f426\fscript\fcharset186\fprq2 Comic Sans MS Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
+\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;
+\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 \snext0 Normal;}{\*\cs10 \additive \ssemihidden
+Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid10428813\rsid14756311}
+{\*\generator Microsoft Word 11.0.5604;}{\info{\author Crystal Reports}{\doccomm Powered By Crystal}{\operator GESTION}{\creatim\yr2014\mo7\dy4\hr10\min47}{\revtim\yr2014\mo7\dy4\hr11\min19}{\version3}{\edmins7}{\nofpages2}{\nofwords155}{\nofchars857}
+{\*\company Crystal Decisions}{\nofcharsws1010}{\vern24689}}\paperw11904\paperh16836\margl192\margr192\margt240\margb242 \widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120
+\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot14756311 \fet0\sectd \sbknone\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
+\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
+\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
+{\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\pvpg\phpg\posx762\posy1182\absh-228\absw1653\faauto\rin0\lin0\itap0 \fs24\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {
+\lang1024\langfe1024\noproof\insrsid10428813 {\shp{\shprslt{\*\do\dobxpage\dobypage\dodhgt1\dpline\dpptx0\dppty0\dpptx10945\dppty0\dpx306\dpy16065\dpxsize10945\dpysize0\dplinew20\dplinecor0\dplinecog0\dplinecob0}}}}{\f36\insrsid14756311
+
+\par }\pard \qc \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\pvpg\phpg\posx2944\posy3235\absh-1764\absw5927\faauto\rin0\lin0\itap0 {
+\lang1024\langfe1024\noproof\insrsid10428813 {\shp{\*\shpinst\shpleft192\shptop840\shpright670\shpbottom1852\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz3\shplid1028
+{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn pib}{\sv
+}}{\sp{\sn posrelh}{\sv 1}}{\sp{\sn posrelv}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}{\sp{\sn fBehindDocument}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}}{\shprslt\par\pard
+\ql \li0\ri0\widctlpar\pvpg\phpg\posx191\posy839\dxfrtext180\dfrmtxtx180\dfrmtxty0\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \par}}
+}{\f38\fs23\cf1\insrsid14756311\charrsid14756311 Se convoca CONSEJO ESCOLAR}{\f38\insrsid14756311\charrsid14756311
+\par }{\f38\fs23\cf1\insrsid14756311\charrsid14756311 de car\'e1cter ORDINARIO,}{\f38\insrsid14756311\charrsid14756311
+\par }{\f38\fs23\cf1\insrsid14756311\charrsid14756311 que tendr\'e1 lugar el pr\'f3ximo d\'eda 09/07/2014, }{\f38\fs23\cf1\insrsid14756311 a las 7 de la tarde }{\f38\fs23\cf1\insrsid14756311\charrsid14756311 en SALA DE PROFESORES ,}{
+\f38\insrsid14756311\charrsid14756311
+\par }{\f38\fs23\cf1\insrsid14756311\charrsid14756311 con el siguiente }{\b\f38\fs23\ul\cf1\insrsid14756311\charrsid14756311 ORDEN DEL D\'cdA:}{\f38\insrsid14756311\charrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\tx9360\tx9720\tx10080\pvpg\phpg
+\posx707\posy6035\absh-5856\absw10180\faauto\rin0\lin0\itap0 {\f38\fs28\cf1\insrsid14756311\charrsid14756311 1.- Lectura y aprobaci\'f3n del acta anterior, si procede.}{\f38\fs28\insrsid14756311\charrsid14756311
+\par }{\f38\fs28\cf1\insrsid14756311\charrsid14756311 2.- An\'e1lisis de los resultados de la evaluaci\'f3n Final.}{\f38\fs28\insrsid14756311\charrsid14756311
+\par }{\f38\fs28\cf1\insrsid14756311\charrsid14756311 3.- Resultados de la prueba de diagn\'f3stico de los alumnos de 4\'ba de Primaria.}{\f38\fs28\cf1\insrsid14756311
+\par }{\f38\fs28\cf1\insrsid10428813 4.- Normativa de biling\'fce para el curso pr\'f3ximo.}{\f38\fs28\insrsid10428813\charrsid14756311
+\par }{\f38\fs28\cf1\insrsid10428813 5}{\f38\fs28\cf1\insrsid14756311\charrsid14756311 .- Aprobaci\'f3n de la MEMORIA del curso 2013-2014.}{\f38\fs28\insrsid14756311\charrsid14756311
+\par }{\f38\fs28\cf1\insrsid10428813 6}{\f38\fs28\cf1\insrsid14756311\charrsid14756311 .- Proceso de elecci\'f3n de directores.}{\f38\fs28\cf1\insrsid14756311
+\par }{\f38\fs28\cf1\insrsid10428813 7.- Libros de texto para el curso que viene.}{\f38\fs28\insrsid10428813\charrsid14756311
+\par }{\f38\fs28\cf1\insrsid10428813 8}{\f38\fs28\cf1\insrsid14756311\charrsid14756311 .- Implantaci\'f3n de la LOMCE para el curso 2014-2015.}{\f38\fs28\insrsid14756311\charrsid14756311
+\par }{\f38\fs28\cf1\insrsid10428813 9}{\f38\fs28\cf1\insrsid14756311\charrsid14756311 .- Ruegos y preguntas.}{\f38\fs28\insrsid14756311\charrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\pvpg\phpg\posx621\posy12184\absh-480\absw1869\faauto\rin0\lin0\itap0\pararsid14756311 {\f38\fs19\cf1\insrsid14756311\charrsid14756311 V\'baB\'ba}{\f38\insrsid14756311\charrsid14756311
+
+\par }{\f38\fs19\cf1\insrsid14756311\charrsid14756311 El Director,}{\f38\insrsid14756311\charrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\pvpg\phpg\posx642\posy13627\absh-221\absw4950\faauto\rin0\lin0\itap0 {\f1\fs19\cf1\insrsid14756311 Fdo.: Jose Garcia Ros}{
+\f36\insrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\pvpg\phpg\posx3981\posy11104\absh-510\absw5120\faauto\rin0\lin0\itap0\pararsid14756311 {
+\f38\fs19\cf1\insrsid14756311\charrsid14756311 ROLDAN, a 4 de julio de 2014}{\f38\insrsid14756311\charrsid14756311
+\par }\pard \qc \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\tx9360\tx9720\tx10080\pvpg\phpg
+\posx732\posy2715\absh-349\absw10155\faauto\rin0\lin0\itap0 {\b\f1\fs27\ul\cf1\insrsid14756311 Convocatoria de CONSEJO ESCOLAR}{\f36\insrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\pvpg\phpg\posx6087\posy12551\absh-221\absw1995\faauto\rin0\lin0\itap0 {\f38\fs19\cf1\insrsid14756311\charrsid14756311 La Secretaria,}{\f38\insrsid14756311\charrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\pvpg\phpg\posx6097\posy13616\absh-221\absw5070\faauto\rin0\lin0\itap0 {\f1\fs19\cf1\insrsid14756311
+Fdo.: Luz Maria Ferreiro Fraga}{\f36\insrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\tx360\tx720\tx1080\pvpg\phpg\posx306\posy16179\absh-221\absw1083\faauto\rin0\lin0\itap0 {\f1\fs17\cf1\insrsid14756311 04/07/2014}{\f36\insrsid14756311
+\par }\pard \qc \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\pvpg\phpg\posx4695\posy16179\absh-221\absw1710\faauto\rin0\lin0\itap0 {\f1\fs17\cf1\insrsid14756311 2013/14}{\f36\insrsid14756311
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\lang1024\langfe1024\noproof\insrsid10428813
+{\shp{\*\shpinst\shpleft741\shptop2464\shpright10955\shpbottom5065\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz0\shplid1029{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}
+{\sp{\sn fFilled}{\sv 0}}{\sp{\sn lineWidth}{\sv 12700}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn posrelh}{\sv 1}}{\sp{\sn posrelv}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}
+{\sp{\sn fBehindDocument}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}{\shprslt{\*\do\dobxpage\dobypage\dodhgt0\dprect\dpx741\dpy2464\dpxsize10214\dpysize2601
+\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat0\dplinew20\dplinecor0\dplinecog0\dplinecob0}}}}{\f36\insrsid14756311 \page \sect }\sectd \sbknone\linex0\sectdefaultcl\sftnbj \pard\plain
+\qc \li0\ri0\nowidctlpar\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\pvpg\phpg\posx2093\posy1866\absh-228\absw7011\faauto\rin0\lin0\itap0\pararsid14756311
+\fs24\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {\insrsid14756311
+\par }}
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141231_arabicHebrewNumbering.docx b/sw/qa/extras/ooxmlexport/data/tdf141231_arabicHebrewNumbering.docx
new file mode 100644
index 000000000000..01bc2667a195
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf141231_arabicHebrewNumbering.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141660.docx b/sw/qa/extras/ooxmlexport/data/tdf141660.docx
new file mode 100644
index 000000000000..dbcceeebd2f5
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf141660.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf88126.docx b/sw/qa/extras/ooxmlexport/data/tdf88126.docx
deleted file mode 100644
index 9d4d2d5d0f8c..000000000000
--- a/sw/qa/extras/ooxmlexport/data/tdf88126.docx
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx b/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx
index e5ed0689d251..edbfe53b1627 100644
--- a/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx
+++ b/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 6275ee8948d4..e77c741031b3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -760,10 +760,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOOxmlOutlineNumberTypes, "outline-number
assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[2]/w:numFmt", "val", "decimal");
assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[3]/w:numFmt", "val", "decimal");
assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[4]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[5]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[6]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[7]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[8]/w:numFmt", "val", "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[5]/w:numFmt", "val", "russianUpper");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[6]/w:numFmt", "val", "russianLower");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[7]/w:numFmt", "val", "russianUpper");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[8]/w:numFmt", "val", "russianLower");
assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[1]/w:numFmt", "val", "decimal");
assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[2]/w:numFmt", "val", "decimal");
@@ -822,10 +822,10 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxRightEdge, "textbox-right-edge.docx")
// I'm fairly sure this is not specific to DOCX, but the doc model created
// by the ODF import doesn't trigger this bug, so let's test this here
// instead of uiwriter.
- int nShapeLeft = parseDump("//SwAnchoredDrawObject/bounds", "left").toInt32();
- int nShapeWidth = parseDump("//SwAnchoredDrawObject/bounds", "width").toInt32();
- int nTextboxLeft = parseDump("//fly/infos/bounds", "left").toInt32();
- int nTextboxWidth = parseDump("//fly/infos/bounds", "width").toInt32();
+ int nShapeLeft = parseDump("//anchored/SwAnchoredDrawObject/bounds", "left").toInt32();
+ int nShapeWidth = parseDump("//anchored/SwAnchoredDrawObject/bounds", "width").toInt32();
+ int nTextboxLeft = parseDump("//anchored/fly/infos/bounds", "left").toInt32();
+ int nTextboxWidth = parseDump("//anchored/fly/infos/bounds", "width").toInt32();
// This is a rectangle, make sure the right edge of the textbox is still
// inside the draw shape.
CPPUNIT_ASSERT(nShapeLeft + nShapeWidth >= nTextboxLeft + nTextboxWidth);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 626157e803dd..ba6a6a6a98e2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -453,10 +453,8 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.d
BitmapEx aBitmap(aVclGraphic.GetBitmapEx());
CPPUNIT_ASSERT_EQUAL(tools::Long(341), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(181), aBitmap.GetSizePixel().Height());
- Color aColor(aBitmap.GetPixelColor(120, 30));
- CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xb1, 0xc8, 0xdd ));
- aColor = aBitmap.GetPixelColor(260, 130);
- CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xb1, 0xc8, 0xdd ));
+ CPPUNIT_ASSERT_EQUAL(Color( 0xad, 0xc5, 0xdb ), aBitmap.GetPixelColor(120, 30));
+ CPPUNIT_ASSERT_EQUAL(Color( 0xad, 0xc5, 0xdb ), aBitmap.GetPixelColor(260, 130));
}
DECLARE_OOXMLEXPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx")
@@ -690,7 +688,9 @@ DECLARE_OOXMLEXPORT_TEST(testBnc875718, "bnc875718.docx")
// is not SwXBodyText but rather SwXHeadFootText
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
- for( int i = 0;
+ // The sample bugdoc has 3 footer.xml and has a textframe in each. The first one is hidden
+ // and it has no text in its anchored text range: it is anchored to body text. Ignoring...
+ for( int i = 1;
i < xIndexAccess->getCount();
++i )
{
@@ -702,6 +702,7 @@ DECLARE_OOXMLEXPORT_TEST(testBnc875718, "bnc875718.docx")
// Also check that the footer contents are not in the body text.
uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XText> text = textDocument->getText();
+ CPPUNIT_ASSERT(text); //Do not crash on empty content
CPPUNIT_ASSERT_EQUAL( OUString( "Text" ), text->getString());
}
@@ -881,10 +882,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf65955_2, "tdf65955_2.odt")
DECLARE_OOXMLEXPORT_TEST(testChtOutlineNumberingOoxml, "chtoutline.docx")
{
- const sal_Unicode aExpectedNumbering[] = { 0x7b2c, ' ', '1', ' ', 0x7ae0 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u7b2c 1 \u7ae0";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering,SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 936c7d03d348..280d29f3d596 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -546,6 +546,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113258_noBeforeAutospacing, "tdf113258_noBeforeA
getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin"));
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf137655, "tdf137655.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ // These were 280.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[1]/w:pPr/w:spacing", "before", "0");
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, "tdf120511_eatenSection.docx")
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
@@ -1298,6 +1306,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagr
assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf141660, "tdf141660.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:footnoteReference", "id", "2");
+ // w:del is imported correctly with its footnote
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:del[2]/w:r/w:footnoteReference", "id", "3");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/w:footnoteReference", "id", "4");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133643, "tdf133643.doc")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
@@ -1395,6 +1414,27 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf101122_noFillForCustomShape, "tdf1011
"a:graphicData/wps:wsp/wps:spPr/a:custGeom/a:pathLst/a:path",
"fill");
}
+// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same,
+// except:
+// - tdf124678_no_leading_paragraph.odt doesn't contain leading empty paragraph
+// before the first section
+//
+DECLARE_OOXMLEXPORT_TEST(testTdf124678_case1, "tdf124678_no_leading_paragraph.odt")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt"));
+}
+
+// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same,
+// except:
+// - tdf124678_no_leading_paragraph.odt doesn't contain leading empty paragraph
+// before the first section
+//
+DECLARE_OOXMLEXPORT_TEST(testTdf124678_case2, "tdf124678_with_leading_paragraph.odt")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt"));
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index b9cf6209afe6..3a8530733c76 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -860,6 +860,22 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx")
CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVMLShapetypeId, "controlshape.fodt")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ // must be _x0000_t<NR>
+ assertXPath(pXmlDoc,
+ "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent/"
+ "mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:txbx/"
+ "w:txbxContent/w:p/w:r/w:object/v:shapetype",
+ "id", "_x0000_t75");
+ assertXPath(pXmlDoc,
+ "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent/"
+ "mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:txbx/"
+ "w:txbxContent/w:p/w:r/w:object/v:shape",
+ "type", "#_x0000_t75");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf73547, "tdf73547-dash.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
@@ -911,6 +927,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117137, "tdf117137.docx")
CPPUNIT_ASSERT(xPara3->getPropertyValue("NumberingRules").hasValue());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf138780, "tdf138780.odt")
+{
+ // Paragraphs were not part of a numbering anymore after roundtrip.
+ uno::Reference<beans::XPropertySet> xPara1(getParagraph(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPara1.is());
+ CPPUNIT_ASSERT(xPara1->getPropertyValue("NumberingRules").hasValue());
+
+ uno::Reference<beans::XPropertySet> xPara2(getParagraph(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPara2.is());
+ CPPUNIT_ASSERT(xPara2->getPropertyValue("NumberingRules").hasValue());
+
+ uno::Reference<beans::XPropertySet> xPara3(getParagraph(3), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPara3.is());
+ CPPUNIT_ASSERT(xPara3->getPropertyValue("NumberingRules").hasValue());
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134618, "tdf134618.doc")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
@@ -942,6 +974,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138899, "tdf138899.docx")
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// This was 6, not removed empty temporary paragraph at the end of the section
assertXPath(pXmlDocument, "/w:document/w:body/w:p", 5);
+
+ //tdf#134385: Paragraph property to "add space between paragraphs of the same style" was lost
+ assertXPath(pXmlDocument, "//w:p[1]/w:pPr/w:contextualSpacing", "val", "false");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf122563, "tdf122563.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index c191713a7be9..c50a75c6daa1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -86,6 +86,27 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF2, "tdf121374_sectionHF2.doc")
CPPUNIT_ASSERT( xHeaderText->getString().startsWith("virkamatka-anomus") );
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121666_lostPage, "tdf121666_lostPage.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page");
+ // The second page break is exported too.
+ // Before this fix, if a node had both section break and page break, then only the section break was exported.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br", "type", "page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type", "val", "nextPage");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf140182_extraPagebreak, "tdf140182_extraPagebreak.docx")
+{
+ // Table, page break, section break should be only 2 pages
+ // 2 breaks would normally results in 3 pages, but page break + section break is a special case
+ // that is handled so to break only 1 page that result only 2 pages.
+ // Because of the table, a hack (m_bDummyParaAddedForTableInSection) is set for the entire section,
+ // that canceled the page break + section break special case handling, resulting 3 pages.
+ // The accompanying fix eliminates this cancellation.
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf95848, "tdf95848.docx")
{
OUString listId;
@@ -866,8 +887,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125657, "tdf125657.docx")
// Only decimal characters allowed, optionally prepended with '-'; no '.'
CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(),
sAttr[0] == '-' || (sAttr[0] >= '0' && sAttr[0] <= '9'));
- for (sal_Int32 i = 1; i < sAttr.getLength(); ++i)
- CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), sAttr[i] >= '0' && sAttr[i] <= '9');
+ for (sal_Int32 i = 1; i < sAttr.getLength(); ++i) {
+ CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), sAttr[i] >= '0');
+ CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), sAttr[i] <= '9');
+ }
};
// check that we export all coordinates of srcRect as integers
checkAttrIsInt("l");
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 01fc4eb37ac6..7709c46afb66 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -11,6 +11,7 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
@@ -34,6 +35,7 @@
#include <comphelper/sequenceashashmap.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <tools/lineend.hxx>
+#include <unotools/fltrcfg.hxx>
#include <unotools/mediadescriptor.hxx>
using namespace com::sun::star;
@@ -668,7 +670,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130167_spilloverHeaderShape, "testTdf130167_spil
uno::Reference<container::XIndexAccess> xNameAccess(
xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
// graphics from discarded headers were being added to the text body. Reduced from 5 to 2 shapes overall.
- CPPUNIT_ASSERT(xNameAccess->getCount() < 4);
+ // CPPUNIT_ASSERT(xNameAccess->getCount() <= 4); -> What about hidden headers?
+ CPPUNIT_ASSERT_LESS(sal_Int32(6), xNameAccess->getCount());
}
DECLARE_OOXMLEXPORT_TEST(testTdf124986, "tdf124986.docx")
@@ -857,6 +860,58 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testUserField)
assertXPath(pXmlDoc, "//w:docVars/w:docVar", "val", "bar");
}
+CPPUNIT_TEST_FIXTURE(SwModelTestBase, testHighlightEdit_numbering)
+{
+ // Create the doc model.
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf135774_numberingCRProps.docx";
+ loadURL(aURL, nullptr);
+
+ // This only affects when saving as w:highlight - which is not the default since 7.0.
+ SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ bool bWasExportToShade = rOpt.IsCharBackground2Shading();
+ rOpt.SetCharBackground2Highlighting();
+
+ //Simulate a user editing the char background color of the paragraph 2 marker (CR)
+ uno::Reference<beans::XPropertySet> properties(getParagraph(2), uno::UNO_QUERY);
+ uno::Sequence<beans::NamedValue> aListAutoFormat;
+ CPPUNIT_ASSERT(properties->getPropertyValue("ListAutoFormat") >>= aListAutoFormat);
+ comphelper::SequenceAsHashMap aMap(properties->getPropertyValue("ListAutoFormat"));
+ // change the background color to RES_CHRATR_BACKGROUND.
+ aMap["CharBackColor"] <<= static_cast<sal_Int32>(0xff00ff);
+ // Two attributes can affect character background. Highlight has priority, and is only there for MS compatibility,
+ // so clear any potential highlight set earlier, or override any coming via a style.
+ aMap["CharHighlight"] <<= static_cast<sal_Int32>(COL_TRANSPARENT);
+
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aMap["CharInteropGrabBag"] >>= aGrabBag;
+ for (beans::PropertyValue& rProp : aGrabBag)
+ {
+ // The shading is no longer defined from import, so clear that flag.
+ // BackColor 0xff00ff will now attempt to export as highlight, since we set that in SvtFilterOptions.
+ if (rProp.Name == "CharShadingMarker")
+ rProp.Value <<= false;
+ }
+ aMap["CharInteropGrabBag"] <<= aGrabBag;
+
+ aMap >> aListAutoFormat;
+ properties->setPropertyValue("ListAutoFormat", uno::makeAny(aListAutoFormat));
+
+ // Export to docx.
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text");
+ xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+ mbExported = true;
+
+ // Paragraph 2 should have only one w:highlight written per w:rPr. Without the fix, there were two.
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:rPr/w:highlight", "val", "none");
+ // Visually, the "none" highlight means the bullet point should not have a character background.
+
+ if (bWasExportToShade)
+ rOpt.SetCharBackground2Shading();
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132766, "tdf132766.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
@@ -1115,6 +1170,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123757, "tdf123757.docx")
assertXPath(pXml, "/w:document/w:body/w:tbl", 2);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf141172, "tdf141172.docx")
+{
+ xmlDocUniquePtr pXml = parseExport("word/endnotes.xml");
+ CPPUNIT_ASSERT(pXml);
+ // This was 1 (lost table during copying endnote content)
+ assertXPath(pXml, "/w:endnotes/w:endnote/w:tbl", 2);
+}
+
DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-footer.docx")
{
// Load a document with a continuous section break on page 2.
@@ -1255,7 +1318,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromTopMarginHasHead
// Note: page print area top = margin + header height.
// In this case the header exists.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "2551");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "2551");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
@@ -1270,7 +1333,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromTopMarginNoHeade
// Note: page print area top = margin + header height.
// In this case the header does not exist, so OpenDocument and OOXML margins are the same.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "2551");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "2551");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf64531,"tdf64531.docx")
@@ -1291,7 +1354,7 @@ DECLARE_OOXMLEXPORT_TEST(testVmlShapeTextWordWrap, "tdf97618_testVmlShapeTextWor
if (!pXmlDoc)
return;
// The bound rect of shape will be wider if wrap does not work (the wrong value is 3167).
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width", "2500");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width", "2500");
}
DECLARE_OOXMLEXPORT_TEST(testVmlLineShapeMirroredX, "tdf97517_testVmlLineShapeMirroredX.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 574b925a07aa..bacfd0d84fd8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -130,12 +130,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137850_compat15ZOrder, "tdf137850_compat15ZOrder
CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in the foreground", true, getProperty<bool>(xShape, "Opaque"));
}
-DECLARE_OOXMLEXPORT_TEST(testTdf88126, "tdf88126.docx")
-{
- // Without the fix in place, this test would have hung
- CPPUNIT_ASSERT_EQUAL(11, getPages());
-}
-
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118701, "tdf118701.docx")
{
// This was 6, related to moving inline images after the page breaks
@@ -795,6 +789,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138345_charStyleHighlight, "tdf138345_charStyleH
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_TRANSPARENT), getProperty<sal_Int32>(xRun,"CharBackColor"));
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138345_numberingHighlight, "tdf138345_numberingHighlight.docx")
+{
+ // Before the fix, the highlight was completely lost.
+ xmlDocUniquePtr pXmlStyles = parseExport("word/numbering.xml");
+ if (pXmlStyles)
+ assertXPath(pXmlStyles, "/w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:highlight", "val", "red");
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
{
CPPUNIT_ASSERT_EQUAL(2, getPages());
@@ -872,6 +874,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAtPageShapeRelOrientation, "rotated_shap
CPPUNIT_ASSERT(style.indexOf("v-text-anchor:middle") != -1);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVMLallowincell, "shape-atpage-in-table.fodt")
+{
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+
+ // VML o:allowincell, apparently the default is "t"
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape", "allowincell", "f");
+
+ // DML layoutInCell
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "layoutInCell", "0");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter,
"tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx")
{
@@ -880,7 +893,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromBottomMarginHasF
// Note: page print area bottom = margin + footer height.
// In this case the footer exists.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "1147");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "1147");
}
DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx")
@@ -904,7 +917,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromBottomMarginNoFo
// Note: page print area bottom = margin + footer height.
// In this case the footer does not exist, so OpenDocument and OOXML margins are the same.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "1147");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "1147");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133702, "tdf133702.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 77dda6a55c73..ee982194ff19 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -9,10 +9,22 @@
#include <swmodeltestbase.hxx>
+#include <svx/svddef.hxx>
+#include <svx/unoapi.hxx>
+#include <svx/sdmetitm.hxx>
+#include <svx/svdobj.hxx>
+
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/text/XEndnotesSupplier.hpp>
+#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
+#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
+#include <comphelper/configuration.hxx>
+#include <editeng/escapementitem.hxx>
+#include <unotools/fltrcfg.hxx>
constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/";
@@ -21,6 +33,24 @@ class Test : public SwModelTestBase
public:
Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {}
+virtual std::unique_ptr<Resetter> preTest(const char* filename) override
+ {
+ if (OString(filename) == "tdf135774_numberingShading.docx")
+ {
+ bool bIsExportAsShading = SvtFilterOptions::Get().IsCharBackground2Shading();
+ // This function is run at the end of the test - returning the filter options to normal.
+ std::unique_ptr<Resetter> pResetter(new Resetter(
+ [bIsExportAsShading] () {
+ if (bIsExportAsShading)
+ SvtFilterOptions::Get().SetCharBackground2Shading();
+ }));
+ // For these tests, ensure exporting CharBackground as w:highlight.
+ SvtFilterOptions::Get().SetCharBackground2Highlighting();
+ return pResetter;
+ }
+ return nullptr;
+ }
+
protected:
/**
* Denylist handling
@@ -31,6 +61,13 @@ protected:
}
};
+DECLARE_OOXMLEXPORT_TEST(testTdf136059, "tdf136059.odt")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Contour has not been exported!", true,
+ getProperty<bool>(getShape(1), "SurroundContour"));
+ // With the fix this shall pass, see tdf136059.
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx")
{
CPPUNIT_ASSERT_MESSAGE("Para1: Bullet point", !getProperty<OUString>(getParagraph(1), "NumberingStyleName").isEmpty());
@@ -38,6 +75,113 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx"
CPPUNIT_ASSERT_MESSAGE("Para3: <blank line>", getProperty<OUString>(getParagraph(3), "NumberingStyleName").isEmpty());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf141231_arabicHebrewNumbering, "tdf141231_arabicHebrewNumbering.docx")
+{
+ // The page's numbering type: instead of Hebrew, this was default style::NumberingType::ARABIC (4).
+ auto nActual = getProperty<sal_Int16>(getStyles("PageStyles")->getByName("Standard"), "NumberingType");
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_HEBREW, nActual);
+
+ // The footnote numbering type: instead of arabicAbjad, this was the default style::NumberingType::ARABIC.
+ uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFootnoteSettings = xFootnotesSupplier->getFootnoteSettings();
+ nActual = getProperty<sal_Int16>(xFootnotesSupplier->getFootnoteSettings(), "NumberingType");
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::CHARS_ARABIC_ABJAD, nActual);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx")
+{
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
+{
+ load(mpTestDocumentPath, "gutter-top.docx");
+ save("Office Open XML Text", maTempFile);
+ mbExported = true;
+ xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
+ CPPUNIT_ASSERT(pXmlSettings);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : 0
+ // i.e. <w:gutterAtTop> was lost.
+ assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx")
+{
+ // Don't crash when document is opened
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf138771, "tdf138771.docx")
+{
+ // Don't crash when document is imported
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf125936_numberingSuperscript, "tdf125936_numberingSuperscript.docx")
+{
+ // Without the fix, the first character run was superscripted.
+ CPPUNIT_ASSERT_EQUAL( sal_Int16(0), getProperty<sal_Int16>(getRun(getParagraph(1), 1, "A-570-108"), "CharEscapement") );
+}
+
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, "tdf134619_numberingProps.doc")
+{
+ // Get the third paragraph's numbering style's 1st level's bullet size
+ uno::Reference<text::XTextRange> xParagraph = getParagraph(3);
+ auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules");
+ uno::Sequence<beans::PropertyValue> aLevel;
+ xLevels->getByIndex(0) >>= aLevel; // 1st level
+ OUString aCharStyleName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get<OUString>();
+
+ // Make sure that the blue bullet's font size is 72 points, not 12 points.
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(72.f, getProperty<float>(xStyle, "CharHeight"));
+}
+
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134951_duplicates, "tdf134951_duplicates.odt")
+{
+ uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xEndnotesSupplier->getEndnotes()->getCount());
+
+ getParagraph(5, "Duplicate fields: 1");
+}
+
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf135773_numberingShading, "tdf135774_numberingShading.docx")
+{
+ // This test uses preTest to export CharBackground as Highlight instead of the 7.0 default of Shading.
+
+ // Before the fix, the imported shading was converted into a red highlight.
+ xmlDocUniquePtr pXmlStyles = parseExport("word/numbering.xml");
+ assertXPath(pXmlStyles, "/w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:shd", "fill", "ED4C05");
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf140336_paraNoneShading, "tdf140336_paraNoneShading.odt")
+{
+ // Before the fix, the background from a style was exported to dis-inheriting paragraphs/styles.
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(COL_AUTO), getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"));
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("CanclledBackground"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xStyle, "FillStyle"));
+
+ // sanity check: backgroundColor paragraph style has a golden color(FF7F50), which para2 inherits
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(16744272), getProperty<sal_uInt32>(getParagraph(2), "ParaBackColor"));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf141173_missingFrames, "tdf141173_missingFrames.rtf")
+{
+ // Without the fix in place, almost all of the text and textboxes were missing.
+ // Without the fix, there were only 2 shapes (mostly unseen).
+ CPPUNIT_ASSERT_EQUAL(13, getShapes());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf139580, "tdf139580.odt")
{
// Without the fix in place, this test would have crashed at export time
@@ -45,6 +189,82 @@ DECLARE_OOXMLEXPORT_TEST(testTdf139580, "tdf139580.odt")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFooterMarginLost, "footer-margin-lost.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 709
+ // - Actual : 0
+ // i.e. import + export lost the footer margin value.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "footer", "709");
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testEffectExtentLineWidth)
+{
+ auto verify = [this]() {
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(508),
+ getProperty<sal_Int32>(getShape(1), "TopMargin"));
+ };
+
+ // Given a document with a shape that has a non-zero line width and effect extent:
+ // When loading the document:
+ load(mpTestDocumentPath, "effect-extent-line-width.docx");
+ // Then make sure that the line width is not taken twice (once as part of the margin, and then
+ // also as the line width):
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 508
+ // - Actual : 561
+ // i.e. the upper spacing was too large, the last line of the text moved below the shape.
+ verify();
+ reload(mpFilter, "effect-extent-line-width.docx");
+ verify();
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testRtlGutter)
+{
+ // Given a document with RTL gutter:
+ load(mpTestDocumentPath, "rtl-gutter.docx");
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT(getProperty<bool>(xStandard, "RtlGutter"));
+
+ // When saving back to DOCX:
+ reload(mpFilter, "rtl-gutter.docx");
+
+ // Then make sure the section's gutter is still RTL:
+ xmlDocUniquePtr pXmlDoc = parseExport();
+ // Without the accompanying fix in place, this test would have failed as the XML element was
+ // missing.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:rtlGutter", 1);
+}
+
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf140572_docDefault_superscript, "tdf140572_docDefault_superscript.docx")
+{
+ // A round-trip was crashing.
+
+ // Without the fix, everything was DFLT_ESC_AUTO_SUPER (default superscript)
+ CPPUNIT_ASSERT_EQUAL( sal_Int16(0), getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharEscapement") );
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf136841, "tdf136841.docx")
+{
+ if (!IsDefaultDPI())
+ return;
+ uno::Reference<drawing::XShape> image = getShape(1);
+ uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
+ uno::Reference<graphic::XGraphic> graphic;
+ imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
+ Graphic vclGraphic(graphic);
+ BitmapEx bitmap(vclGraphic.GetBitmapEx());
+ CPPUNIT_ASSERT_EQUAL( tools::Long(76), bitmap.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL( tools::Long(76), bitmap.GetSizePixel().Height());
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: Color: R:228 G:71 B:69 A:0
+ // - Actual : Color: R:0 G:0 B:0 A:0
+ CPPUNIT_ASSERT_EQUAL( Color(228,71,69), bitmap.GetPixelColor(38,38));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getShapes());
@@ -59,6 +279,38 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(8664), frameRect.Width);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf118535, "tdf118535.odt")
+{
+ uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
+ CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.jpeg")));
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: false
+ // - Actual : true
+ // i.e. the embedded picture would have been saved twice.
+ CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/image2.jpeg")));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf133473_shadowSize, "tdf133473.docx")
+{
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+
+ SdrObject* pObj(GetSdrObjectFromXShape(xShape));
+ const SfxItemSet& rSet = pObj->GetMergedItemSet();
+ sal_Int32 nSize1 = rSet.Get(SDRATTR_SHADOWSIZEX).GetValue();
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 200000
+ // - Actual : 113386
+ // I.e. Shadow size will be smaller than actual.
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(200000), nSize1);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf140137, "tdf140137.docx")
+{
+ // Don't throw exception during load
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 5d973cc0551e..e7daad0b0240 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -486,7 +486,12 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx")
CPPUNIT_ASSERT(aDrawingDom); // Reference not empty
}
}
- CPPUNIT_ASSERT(bData && bLayout && bQStyle && bColor && bDrawing); // Grab Bag has all the expected elements
+ // Grab Bag has all the expected elements:
+ CPPUNIT_ASSERT(bData);
+ CPPUNIT_ASSERT(bLayout);
+ CPPUNIT_ASSERT(bQStyle);
+ CPPUNIT_ASSERT(bColor);
+ CPPUNIT_ASSERT(bDrawing);
uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(0), uno::UNO_QUERY);
OUString nValue;
@@ -773,13 +778,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt")
CPPUNIT_ASSERT_EQUAL(1, getPages());
// borderlessImage - image WITHOUT BORDERS : simulate padding with -crop
text::GraphicCrop crop = getProperty<text::GraphicCrop>(getShape(2), "GraphicCrop");
- CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
- CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right);
+ CPPUNIT_ASSERT( crop.Left != 0 );
+ CPPUNIT_ASSERT( crop.Right != 0 );
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Top);
+ CPPUNIT_ASSERT_EQUAL( crop.Right, crop.Bottom);
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Right);
// borderedImage - image WITH BORDERS : simulate padding with -crop
crop = getProperty<text::GraphicCrop>(getShape(3), "GraphicCrop");
- CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
- CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right);
+ CPPUNIT_ASSERT( crop.Left != 0 );
+ CPPUNIT_ASSERT( crop.Right != 0 );
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Top);
+ CPPUNIT_ASSERT_EQUAL( crop.Right, crop.Bottom);
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Right);
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteParagraphTag, "testFootnote.docx")
@@ -1129,7 +1140,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromLeftMargin, "tdf1
// tdf#132976 The size of the width of this shape should come from the size of the left margin.
// It was set to the size of the width of the entire page before.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width", "1133");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width", "1133");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromInsideOutsideMargin, "tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx")
@@ -1138,13 +1149,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromInsideOutsideMarg
// The open book: outside --text-- inside | inside --text-- outside
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Inside
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[1]/bounds", "width", "1440");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "width", "1440");
// Outside
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[2]/bounds", "width", "2552");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds", "width", "2552");
// Outside
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[3]/bounds", "width", "2552");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds", "width", "2552");
// Inside
- assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[4]/bounds", "width", "1440");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[4]/bounds", "width", "1440");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBodyPrUpright, "tdf123610_handle_upright.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index c39059e7904d..03eff3c65513 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -683,8 +683,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf38778, "tdf38778_properties_in_run_fo
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- const OUString psz("20");
- const OUString pszCs("20");
+ static const OUStringLiteral psz(u"20");
+ static const OUStringLiteral pszCs(u"20");
// w:fldCharType="begin"
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz", "val", psz);
@@ -1044,8 +1044,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx")
// More precisely, the table in the first page was clipped.
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFlyPrtHeight = getXPath(pXmlDoc, "(/root/page[1]//fly)[1]/infos/prtBounds", "height").toInt32();
- sal_Int32 nTableHeight = getXPath(pXmlDoc, "(/root/page[1]//fly)[1]/tab/infos/bounds", "height").toInt32();
+ sal_Int32 nFlyPrtHeight = getXPath(pXmlDoc, "(/root/page[1]//anchored/fly)[1]/infos/prtBounds", "height").toInt32();
+ sal_Int32 nTableHeight = getXPath(pXmlDoc, "(/root/page[1]//anchored/fly)[1]/tab/infos/bounds", "height").toInt32();
CPPUNIT_ASSERT_MESSAGE("The table is clipped in a fly frame.", nFlyPrtHeight >= nTableHeight);
}
@@ -1258,7 +1258,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromRightMargin, "tdf
{
// tdf#133670 The width was set relative from right margin, but this was handled relative from page width.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- auto nWidth = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width").toInt32();
+ auto nWidth = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width").toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(2408, nWidth, 1);
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 95f60995f933..98ba668c7231 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -131,6 +131,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79008, "fdo79008.docx")
*/
parseExport("word/document.xml");
+ // tdf#134951: there is only one comment
+ xmlDocUniquePtr pXmlSettings = parseExport("word/comments.xml");
+ assertXPath(pXmlSettings, "/w:comments/w:comment", 1);
+
// Read-only is set, but it is not enforced, so it should be off...
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
@@ -749,6 +753,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138612, "tdf138612.docx")
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[2]/w:tcPr/w:vMerge", 0);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf140597, "tdf140597.docx")
+{
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+
+ // There were missing tblPrEx table exception borders
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx")
{
// The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden.
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index a2391cbe31b3..ecc9198caa1c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -360,17 +360,17 @@ DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeChildPosition, "dml-groupshape-childpo
uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);
uno::Reference<drawing::XShape> xChildGroup(xGroup->getByIndex(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? -2120 : -2122), xChildGroup->getPosition().X);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11336 : 11333), xChildGroup->getPosition().Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-2123), xChildGroup->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11333 : 11331), xChildGroup->getPosition().Y);
xGroup.set(xChildGroup, uno::UNO_QUERY);
xChildGroup.set(xGroup->getByIndex(0), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? -1856 : -1858), xChildGroup->getPosition().X);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11336 : 11333), xChildGroup->getPosition().Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1859), xChildGroup->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11333 : 11331), xChildGroup->getPosition().Y);
xChildGroup.set(xGroup->getByIndex(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? -2120 : -2122), xChildGroup->getPosition().X);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 14026 : 14023), xChildGroup->getPosition().Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-2123), xChildGroup->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 14023 : 14021), xChildGroup->getPosition().Y);
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDMLGradientFillTheme, "dml-gradientfill-theme.docx")
@@ -1008,9 +1008,9 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAlignmentFromTopMargin,
return;
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject[1]/bounds", "top", "1487"); // center
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject[2]/bounds", "top", "2668"); // bottom
- assertXPath(pXmlDoc, "//SwAnchoredDrawObject[3]/bounds", "top", "298"); // top
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "top", "1502"); // center
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top", "2683"); // bottom
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top", "313"); // top
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 2e8c2c45aa42..c443120fecd5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -443,7 +443,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureEffectPreservation, "picture-effe
// second picture: shadow and reflection effects
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
"wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw",
- "dir", "8076614");
+ "dir", "8100000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
"wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr",
"val", "000000");
@@ -851,8 +851,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79591, "fdo79591.docx")
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr", "name", "");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", "");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr", "name", "_x0000_t0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", "_x0000_t0");
}
DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx")
@@ -1069,7 +1069,8 @@ DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx")
//that means 9 NEXT links and 9 PREV links.
//however, the current implementation adds leftover shapes, so can't go on exact numbers
// (unknown number of flys, unknown order of leftovers)
- CPPUNIT_ASSERT ( (followCount >= 6) && (precedeCount >= 6) );
+ CPPUNIT_ASSERT ( (followCount >= 6) );
+ CPPUNIT_ASSERT ( (precedeCount >= 6) );
}
#endif
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 9c5f05e51534..887ffc7560ad 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -484,6 +484,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testEditTime, "fdo81341.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:fldChar", "fldCharType", "end");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlyFieldmark, "fly_fieldmark.fodt")
+{
+ // the problem was that the flys were written after the field start
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ // run 1 contains 2 shapes, one was at-page, one was at-char
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent", 2);
+ // run 2 contains the field start
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:fldChar", "fldCharType", "begin");
+ // run 3 contains the field instruction text
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " FORMTEXT ");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo81945, "fdo81945.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/qa/extras/ooxmlimport/data/tdf118693.docx b/sw/qa/extras/ooxmlimport/data/tdf118693.docx
new file mode 100644
index 000000000000..4e832398bcd5
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf118693.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/data/tdf122717.docx b/sw/qa/extras/ooxmlimport/data/tdf122717.docx
new file mode 100644
index 000000000000..9a2098272c75
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf122717.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx b/sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx
new file mode 100644
index 000000000000..9b9eb1c43965
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3d185a72afb9..fe15ef8d94de 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -459,6 +459,21 @@ DECLARE_OOXMLIMPORT_TEST(testN758883, "n758883.docx")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType);
}
+DECLARE_OOXMLIMPORT_TEST(testTdf74367_MarginsZeroed, "tdf74367_MarginsZeroed.docx")
+{
+ // Do not import page borders with 'None' style, or else it will change the page margins.
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ xPropertySet->getPropertyValue("TopMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue);
+ xPropertySet->getPropertyValue("RightMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue);
+ xPropertySet->getPropertyValue("BottomMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue);
+ xPropertySet->getPropertyValue("LeftMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue);
+}
+
DECLARE_OOXMLIMPORT_TEST(testBnc773061, "bnc773061.docx")
{
uno::Reference< text::XTextRange > paragraph = getParagraph( 1 );
@@ -549,10 +564,10 @@ DECLARE_OOXMLIMPORT_TEST(testN779627, "n779627.docx")
sal_Int32(9), nLeftMargin);
/*
- * Another problem tested with this document is the unnecessary loading of the shapes
- * anchored to a discarded header or footer
+ * Another problem tested with this document is the loading of the shapes
+ * anchored to a hidden header or footer
*/
- CPPUNIT_ASSERT_EQUAL(0, getShapes());
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
}
DECLARE_OOXMLIMPORT_TEST(testN779627b, "n779627b.docx")
@@ -1067,8 +1082,7 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpsOnly, "textbox-wps-only.docx")
if ( nsScreen.frame.size.width * scaleFactor > 4000 )
return;
#endif
- // Vertically oriented to page due to tdf#135198
- CPPUNIT_ASSERT_EQUAL(sal_Int32(5304), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
}
DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx")
@@ -1332,16 +1346,8 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx")
// Make sure we're not testing the ellipse child.
CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.LineShape"), xShapeDescriptor->getShapeType());
- // tdf#106792 checked that during load of tdf85232.docx the method
- // SvxShapePolyPolygon::setPropertyValueImpl is used three times. In
- // that method, a call to ForceMetricToItemPoolMetric was missing so
- // that the import did not convert the input values from 100thmm
- // to twips what is needed due to the object residing in Writer. The
- // UNO API by definition is in 100thmm. Result is that in SwXShape::getPosition
- // the offset (aOffset) now is (0, 0) instead of an existing offset in
- // the load of the document before (what is plausible for a GroupObject).
- // Thus, I will adapt the result value here to the now (hopefully) correct one.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1630), xShape->getPosition().X); // was: 2267
+ // This was 2900: horizontal position of the line was incorrect, the 3 children were not connected visually.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2267), xShape->getPosition().X);
}
DECLARE_OOXMLIMPORT_TEST(testTdf95755, "tdf95755.docx")
@@ -1423,9 +1429,22 @@ DECLARE_OOXMLIMPORT_TEST(testTdf96674, "tdf96674.docx")
CPPUNIT_ASSERT(aActualSize.Height > 0);
}
+DECLARE_OOXMLIMPORT_TEST(testTdf122717, "tdf122717.docx")
+{
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ CPPUNIT_ASSERT(xShape.is());
+ awt::Size aActualSize(xShape->getSize());
+ // Without the fix in place, this test would have failed with
+ // - Expected: 2
+ // - Actual : 8160
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aActualSize.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8160), aActualSize.Height);
+
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf98882, "tdf98882.docx")
{
- sal_Int32 nFlyHeight = parseDump("//fly/infos/bounds", "height").toInt32();
+ sal_Int32 nFlyHeight = parseDump("//anchored/fly/infos/bounds", "height").toInt32();
sal_Int32 nContentHeight = parseDump("//notxt/infos/bounds", "height").toInt32();
// The content height was 600, not 360, so the frame and the content height did not match.
CPPUNIT_ASSERT_EQUAL(nFlyHeight, nContentHeight);
@@ -1610,7 +1629,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108806, "tdf108806.docx")
DECLARE_OOXMLIMPORT_TEST(testTdf87533_bidi, "tdf87533_bidi.docx")
{
// "w:bidi" (specified inside Default paragraph properties) should not be ignored
- const OUString writingMode = "WritingMode"; //getPropertyName(PROP_WRITING_MODE);
+ static const OUStringLiteral writingMode = u"WritingMode"; //getPropertyName(PROP_WRITING_MODE);
// check: "Default Style" master-style has RTL
{
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index b0589b913248..ed3b0cd153dc 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -28,6 +28,7 @@
#include <wrtsh.hxx>
#include <IDocumentMarkAccess.hxx>
+#include <IDocumentLayoutAccess.hxx>
#include <IMark.hxx>
#include <sortedobjs.hxx>
#include <anchoredobject.hxx>
@@ -36,6 +37,7 @@
#include <unotxdoc.hxx>
#include <docsh.hxx>
#include <rootfrm.hxx>
+#include <frame.hxx>
class Test : public SwModelTestBase
{
@@ -126,7 +128,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf114212, "tdf114212.docx")
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1427
// - Actual : 387
- OUString aTop = parseDump("//fly[1]/infos/bounds", "top");
+ OUString aTop = parseDump("//anchored/fly[1]/infos/bounds", "top");
CPPUNIT_ASSERT_EQUAL(OUString("1427"), aTop);
}
@@ -194,6 +196,43 @@ DECLARE_OOXMLIMPORT_TEST(testTdf120547, "tdf120547.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(8073), aSizeShape3.Height);
}
+DECLARE_OOXMLIMPORT_TEST(testTdf118693, "tdf118693.docx")
+{
+ uno::Reference<drawing::XShape> xGroupShape = getShape(1);
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xGroup->getCount());
+
+ awt::Point aPosGroup = xGroupShape->getPosition();
+ awt::Size aSizeGroup = xGroupShape->getSize();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10162), aPosGroup.X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(118), aPosGroup.Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(6369), aSizeGroup.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4983), aSizeGroup.Height);
+
+ // Without the fix in place, this test would have failed at many places
+ // as the first shape in the group would have had an incorrect position,
+ // an incorrect width or an incorrect height.
+
+ uno::Reference<drawing::XShape> xShape1(xGroup->getByIndex(0), uno::UNO_QUERY_THROW);
+ awt::Point aPosShape1 = xShape1->getPosition();
+ awt::Size aSizeShape1 = xShape1->getSize();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12863), aPosShape1.X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(146), aPosShape1.Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3669), aSizeShape1.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4914), aSizeShape1.Height);
+
+ uno::Reference<drawing::XShape> xShape2(xGroup->getByIndex(1), uno::UNO_QUERY_THROW);
+ awt::Point aPosShape2 = xShape2->getPosition();
+ awt::Size aSizeShape2 = xShape2->getSize();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10162), aPosShape2.X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(118), aPosShape2.Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4595), aSizeShape2.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4983), aSizeShape2.Height);
+}
+
DECLARE_OOXMLIMPORT_TEST(testGroupShapeFontName, "groupshape-fontname.docx")
{
// Font names inside a group shape were not imported
@@ -398,8 +437,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf112443, "tdf112443.docx")
{
// the position of the flying text frame should be off page
// 30624 below its anchor
- OUString aTop = parseDump("//fly[1]/infos/bounds", "top");
- CPPUNIT_ASSERT_EQUAL(OUString("30624"), aTop);
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ SwRootFrame* pRootFrame = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ const SwRect aPageRect = pRootFrame->getFrameArea();
+ const SwRect aShapeRect(getShape(1)->getPosition().X, getShape(1)->getPosition().Y,
+ getShape(1)->getSize().Width, getShape(1)->getSize().Height);
+ CPPUNIT_ASSERT_MESSAGE("The textframe must be off-page!", !aPageRect.IsInside(aShapeRect));
+
+ //OUString aTop = parseDump("//anchored/fly[1]/infos/bounds", "top");
+ //CPPUNIT_ASSERT_EQUAL(sal_Int32(30624), aTop.toInt32() );
}
// DOCX: Textbox wrap differs in MSO and LO
@@ -669,10 +717,9 @@ DECLARE_OOXMLIMPORT_TEST(testTdf129912, "tdf129912.docx")
// the expected footnote labels
// TODO: the 5th label is actually wrong (missing the "PR" after the symbol part), but the "b" is there?!
- const sal_Unicode pLabel5[] = { u'\xF0D1', u'\xF031', u'\xF032', u'\x0062' };
- const OUString sFootnoteLabels[] = {
- OUString(u'\xF0A7'), "1", "2", OUString(u'\xF020'), { pLabel5, SAL_N_ELEMENTS(pLabel5) }
- };
+ static constexpr OUStringLiteral pLabel5 = u"\uF0D1\uF031\uF032b";
+ const OUString sFootnoteLabels[]
+ = { OUString(u'\xF0A7'), "1", "2", OUString(u'\xF020'), pLabel5 };
CPPUNIT_ASSERT_EQUAL(sal_Int32(SAL_N_ELEMENTS(sFootnoteLabels)), nCount);
pWrtShell->GotoPrevFootnoteAnchor();
diff --git a/sw/qa/extras/rtfexport/data/gutter-left.rtf b/sw/qa/extras/rtfexport/data/gutter-left.rtf
new file mode 100644
index 000000000000..66016045c9d1
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/gutter-left.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter720
+\pard\plain Half in gutter on the left\par
+}
diff --git a/sw/qa/extras/rtfexport/data/gutter-top.rtf b/sw/qa/extras/rtfexport/data/gutter-top.rtf
new file mode 100644
index 000000000000..9c9a78ce2d03
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/gutter-top.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter720\gutterprl
+\pard\plain Half inch gutter on the top\par
+}
diff --git a/sw/qa/extras/rtfexport/data/rtl-gutter.rtf b/sw/qa/extras/rtfexport/data/rtl-gutter.rtf
new file mode 100644
index 000000000000..45c7c86b4500
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/rtl-gutter.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw8395\paperh5947\margl360\margr360\margt720\margb1440\gutter1080\rtlgutter
+\pard\plain hello\par
+}
diff --git a/sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf b/sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf
new file mode 100644
index 000000000000..95f28e34ddbb
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf100961_fixedDateTime.rtf
@@ -0,0 +1,38 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff1\deff0\stshfdbch42\stshfloch41\stshfhich41\stshfbi1\deflang2057\deflangfe2057{\fonttbl{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Liberation Sans{\*\falt Arial};}
+{\f41\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Liberation Serif{\*\falt Times New Roman};}{\f42\fmodern\fcharset134\fprq1{\*\panose 02010609030101010101}NSimSun;}{\f43\fswiss\fcharset134\fprq2{\*\panose 020b0503020204020204}Microsoft YaHei;}
+{\f72\fmodern\fcharset134\fprq1{\*\panose 00000000000000000000}@NSimSun;}{\f73\fswiss\fcharset134\fprq2{\*\panose 00000000000000000000}@Microsoft YaHei;}{\f84\fswiss\fcharset238\fprq2 Arial CE;}{\f85\fswiss\fcharset204\fprq2 Arial Cyr;}
+{\f87\fswiss\fcharset161\fprq2 Arial Greek;}{\f88\fswiss\fcharset162\fprq2 Arial Tur;}{\f89\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f90\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\f91\fswiss\fcharset186\fprq2 Arial Baltic;}
+{\f92\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f434\fswiss\fcharset238\fprq2 Liberation Sans CE{\*\falt Arial};}{\f435\fswiss\fcharset204\fprq2 Liberation Sans Cyr{\*\falt Arial};}
+{\f437\fswiss\fcharset161\fprq2 Liberation Sans Greek{\*\falt Arial};}{\f438\fswiss\fcharset162\fprq2 Liberation Sans Tur{\*\falt Arial};}{\f439\fbidi \fswiss\fcharset177\fprq2 Liberation Sans (Hebrew){\*\falt Arial};}
+{\f441\fswiss\fcharset186\fprq2 Liberation Sans Baltic{\*\falt Arial};}{\f442\fswiss\fcharset163\fprq2 Liberation Sans (Vietnamese){\*\falt Arial};}{\f484\froman\fcharset238\fprq2 Liberation Serif CE{\*\falt Times New Roman};}
+{\f485\froman\fcharset204\fprq2 Liberation Serif Cyr{\*\falt Times New Roman};}{\f487\froman\fcharset161\fprq2 Liberation Serif Greek{\*\falt Times New Roman};}{\f488\froman\fcharset162\fprq2 Liberation Serif Tur{\*\falt Times New Roman};}
+{\f489\fbidi \froman\fcharset177\fprq2 Liberation Serif (Hebrew){\*\falt Times New Roman};}{\f491\froman\fcharset186\fprq2 Liberation Serif Baltic{\*\falt Times New Roman};}
+{\f492\froman\fcharset163\fprq2 Liberation Serif (Vietnamese){\*\falt Times New Roman};}{\f74\froman\fcharset238\fprq2 Times New Roman CE;}{\f75\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f77\froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f78\froman\fcharset162\fprq2 Times New Roman Tur;}{\f79\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f80\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f81\froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f82\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;
+\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
+\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0 \fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \snext0 Normal;}{\*\cs10
+\additive \ssemihidden Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\lang1024\langfe1024\loch\f41\hich\af41\dbch\af42\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{
+\s15\ql \li0\ri0\sb240\sa120\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs28\alang1081 \ltrch\fcs0 \fs28\lang1049\langfe2052\kerning2\loch\f36\hich\af36\dbch\af43\cgrid\langnp1049\langfenp2052
+\sbasedon0 \snext16 Heading;}{\s16\ql \li0\ri0\sa140\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0
+\fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \sbasedon0 \snext16 Body Text;}{\s17\ql \li0\ri0\sa140\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af1\afs24\alang1081 \ltrch\fcs0 \fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \sbasedon16 \snext17 List;}{
+\s18\ql \li0\ri0\sb120\sa120\widctlpar\noline\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ai\af1\afs24\alang1081 \ltrch\fcs0 \i\fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052
+\sbasedon0 \snext18 caption;}{\s19\ql \li0\ri0\widctlpar\noline\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0
+\fs24\lang1049\langfe2052\kerning2\loch\f41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 \sbasedon0 \snext19 Index;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid336885\rsid2430917\rsid2647374\rsid4946236}{\*\generator Microsoft Word
+11.0.0000;}{\info{\title 05}{\author Mike Kaganski}{\operator JLAutoBuild}{\creatim\yr2021\mo4\dy13\hr10\min21}{\revtim\yr2021\mo4\dy13\hr10\min21}{\version2}{\edmins1}{\nofpages1}{\nofwords8}{\nofchars50}{\nofcharsws57}{\vern24611}{\*\password 00000000}}
+{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1134\margr1134\margt1134\margb1134\gutter0\ltrsect
+\deftab709\widowctrl\ftnbj\aenddoc\donotembedsysfont1\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin
+\dghspace180\dgvspace180\dghorigin1134\dgvorigin1134\dghshow1\dgvshow1
+\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
+\asianbrkrule\rsidroot2647374\newtblstyruls\nogrowautofit \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectunlocked1\sectexpand32768\sectlinegrid600\sectdefaultcl\sftnbj {\*\pnseclvl1
+\pnucrm\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxta )}}
+{\*\pnseclvl5\pndec\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
+\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\rtlch\fcs1 \af1\afs24\alang1081 \ltrch\fcs0 \fs24\lang1049\langfe2052\kerning2\loch\af41\hich\af41\dbch\af42\cgrid\langnp1049\langfenp2052 {\field\fldlock{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 DATE \\
+@"dd.MM.yy"}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 05.01.19}}}\sectd \ltrsect\linex0\endnhere\sectunlocked1\sectexpand32768\sectlinegrid600\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885
+\hich\af41\dbch\af42\loch\f41 }{\field\fldlock{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 TIME \\@"HH:mm:ss"}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid336885 \hich\af41\dbch\af42\loch\f41 04:06:08}}}
+\sectd \ltrsect\linex0\endnhere\sectunlocked1\sectexpand32768\sectlinegrid600\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid2647374
+\par }} \ No newline at end of file
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 737821f73286..049c78bd7f6b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -66,16 +66,6 @@ public:
return (OString(filename).endsWith(".rtf")
&& std::find(vDenylist.begin(), vDenylist.end(), filename) == vDenylist.end());
}
-
- virtual void postLoad(const char* pFilename) override
- {
- if (OString(pFilename) == "tdf90421.fodt")
- {
- // Change the hyperlink, so its URL is empty.
- uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY);
- xRun->setPropertyValue("HyperLinkURL", uno::makeAny(OUString()));
- }
- }
};
DECLARE_RTFEXPORT_TEST(testZoom, "zoom.rtf")
@@ -1019,17 +1009,19 @@ DECLARE_RTFEXPORT_TEST(testTdf80708, "tdf80708.rtf")
.getLength());
}
-DECLARE_RTFEXPORT_TEST(testTdf90421, "tdf90421.fodt")
+CPPUNIT_TEST_FIXTURE(Test, testHyperlinkWithoutURL)
{
- if (mbExported)
- {
- SvMemoryStream aMemoryStream;
- SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
- aStream.ReadStream(aMemoryStream);
- OString aData(static_cast<const char*>(aMemoryStream.GetData()), aMemoryStream.GetSize());
- // This was some positive number, i.e. we exported a hyperlink with an empty URL.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), aData.indexOf("HYPERLINK"));
- }
+ load(mpTestDocumentPath, "tdf90421.fodt");
+ // Change the hyperlink, so its URL is empty.
+ uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY);
+ xRun->setPropertyValue("HyperLinkURL", uno::makeAny(OUString()));
+ reload(mpFilter, "gutter-left.rtf");
+ SvMemoryStream aMemoryStream;
+ SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+ aStream.ReadStream(aMemoryStream);
+ OString aData(static_cast<const char*>(aMemoryStream.GetData()), aMemoryStream.GetSize());
+ // This was some positive number, i.e. we exported a hyperlink with an empty URL.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), aData.indexOf("HYPERLINK"));
}
DECLARE_RTFEXPORT_TEST(testTdf92521, "tdf92521.odt")
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 696e6add4c3b..4468a97650b5 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -14,8 +14,11 @@
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/text/XEndnotesSupplier.hpp>
+#include <com/sun/star/text/XTextField.hpp>
+#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/style/TabStop.hpp>
#include <comphelper/sequenceashashmap.hxx>
@@ -32,6 +35,16 @@ public:
}
};
+DECLARE_RTFEXPORT_TEST(testTdf100961_fixedDateTime, "tdf100961_fixedDateTime.rtf")
+{
+ // This should be a fixed date/time field, not the current time.
+ getParagraph(1, "05.01.19 04:06:08");
+
+ uno::Reference<text::XTextFieldsSupplier> xTFS(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xFields(xTFS->getTextFields()->createEnumeration());
+ CPPUNIT_ASSERT_MESSAGE("constant time", getProperty<bool>(xFields->nextElement(), "IsFixed"));
+}
+
DECLARE_RTFEXPORT_TEST(testTdf108949, "tdf108949_footnoteCharFormat.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
@@ -157,10 +170,12 @@ DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Row width", sal_Int32(9360), rowWidth);
sal_Int32 cell1Width
= parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
- CPPUNIT_ASSERT_MESSAGE("First cell width", cell1Width >= 9140 && cell1Width <= 9142);
+ CPPUNIT_ASSERT_MESSAGE("First cell width", cell1Width >= 9140);
+ CPPUNIT_ASSERT_MESSAGE("First cell width", cell1Width <= 9142);
sal_Int32 cell2Width
= parseDump("/root/page/body/tab/row/cell[2]/infos/bounds", "width").toInt32();
- CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width >= 218 && cell2Width <= 220);
+ CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width >= 218);
+ CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width <= 220);
}
DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.rtf")
@@ -253,6 +268,52 @@ DECLARE_RTFEXPORT_TEST(testTdf112520, "tdf112520.docx")
getProperty<text::TextContentAnchorType>(getShape(3), "AnchorType"));
}
+CPPUNIT_TEST_FIXTURE(Test, testNestedHyperlink)
+{
+ // Given a hyperlink contains a footnote which contains a hyperlink:
+ {
+ createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextContent> xFootnote(
+ xFactory->createInstance("com.sun.star.text.Footnote"), uno::UNO_QUERY);
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ xText->insertString(xCursor, "a", /*bAbsorb=*/false);
+ xText->insertTextContent(xCursor, xFootnote, /*bAbsorb=*/false);
+ xText->insertString(xCursor, "b", /*bAbsorb=*/false);
+ xCursor->gotoStart(/*bExpand=*/false);
+ xCursor->gotoEnd(/*bExpand=*/true);
+ uno::Reference<beans::XPropertySet> xCursorProps(xCursor, uno::UNO_QUERY);
+ xCursorProps->setPropertyValue("HyperLinkURL", uno::makeAny(OUString("http://body.com/")));
+ uno::Reference<text::XText> xFootnoteText(xFootnote, uno::UNO_QUERY);
+ xCursor = xFootnoteText->createTextCursor();
+ xFootnoteText->insertString(xCursor, "x", /*bAbsorb=*/false);
+ xCursor->gotoStart(/*bExpand=*/false);
+ xCursor->gotoEnd(/*bExpand=*/true);
+ xCursorProps.set(xCursor, uno::UNO_QUERY);
+ xCursorProps->setPropertyValue("HyperLinkURL",
+ uno::makeAny(OUString("http://footnote.com/")));
+ }
+
+ // When exporting to RTF:
+ // Without the accompanying fix in place, this test would have failed with:
+ // assertion failed
+ // - Expression: xComponent.is()
+ // i.e. the RTF output was not well-formed, loading failed.
+ reload(mpFilter, "nested-hyperlink.rtf");
+
+ // Then make sure both hyperlinks are have the correct URLs.
+ uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
+ uno::Reference<text::XTextRange> xPortion = getRun(xParagraph, 1);
+ CPPUNIT_ASSERT_EQUAL(OUString("http://body.com/"),
+ getProperty<OUString>(xPortion, "HyperLinkURL"));
+ auto xFootnote = getProperty<uno::Reference<text::XText>>(getRun(xParagraph, 2), "Footnote");
+ uno::Reference<text::XTextRange> xFootnotePortion = getRun(getParagraphOfText(1, xFootnote), 1);
+ CPPUNIT_ASSERT_EQUAL(OUString("http://footnote.com/"),
+ getProperty<OUString>(xFootnotePortion, "HyperLinkURL"));
+}
+
DECLARE_RTFEXPORT_TEST(testTdf121623, "tdf121623.rtf")
{
// This was 2, multicolumn section was ignored at the table.
@@ -355,6 +416,23 @@ DECLARE_RTFEXPORT_TEST(testTdf128428_dntblnsbdb, "tdf128428_dntblnsbdb.rtf")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+CPPUNIT_TEST_FIXTURE(Test, testRtlGutter)
+{
+ auto verify = [this]() {
+ uno::Reference<beans::XPropertySet> xStandard(
+ getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(getProperty<bool>(xStandard, "RtlGutter"));
+ };
+
+ // Given a document with RTL gutter, when loading it:
+ load(mpTestDocumentPath, "rtl-gutter.rtf");
+ // Then make sure the section's gutter is still RTL:
+ // Without the accompanying fix in place, this test would have failed as \rtlgutter was missing.
+ verify();
+ reload(mpFilter, "rtl-gutter.rtf");
+ verify();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index cf9a25e40d7c..7cb2f5cdb5ff 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -385,6 +385,35 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126309)
static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
}
+CPPUNIT_TEST_FIXTURE(Test, testGutterLeft)
+{
+ load(mpTestDocumentPath, "gutter-left.rtf");
+ reload(mpFilter, "gutter-left.rtf");
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
+{
+ load(mpTestDocumentPath, "gutter-top.rtf");
+ reload(mpFilter, "gutter-left.rtf");
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xSettings(
+ xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ bool bGutterAtTop{};
+ xSettings->getPropertyValue("GutterAtTop") >>= bGutterAtTop;
+ // Without the accompanying fix in place, this test would have failed, because the gutter was
+ // at the left.
+ CPPUNIT_ASSERT(bGutterAtTop);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4749fa3acf6f..ae99eab0d49a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1093,10 +1093,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext1)
load(mpTestDocumentPath, "cp950listleveltext1.rtf");
// suffix with Chinese only ( most common case generated by MSO2010 TC)
// This is a dot that is generally used as suffix of Chinese list number
- const sal_Unicode aExpectedNumbering[] = { 0x4e00, 0x3001 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u4e00\u3001";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
@@ -1105,10 +1105,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext2)
{
load(mpTestDocumentPath, "cp950listleveltext2.rtf");
// Prefix and suffix with Chinese only ( tweaked from default in MSO2010 TC)
- const sal_Unicode aExpectedNumbering[] = { 0x524d, 0x7f6e, 0x7532, 0x3001, 0x5f8c, 0x7f6e };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u524d\u7f6e\u7532\u3001\u5f8c\u7f6e";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
@@ -1117,11 +1117,11 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext3)
{
load(mpTestDocumentPath, "cp950listleveltext3.rtf");
// Numbering is a mix Chinese and English ( tweaked from default in MSO2010 TC)
- const sal_Unicode aExpectedNumbering[] = { 0x524d, 0x0061, 0x7f6e, 0x0062, 0x7532, 0x3001,
- 0x0063, 0x5f8c, 0x0064, 0x7f6e, 0x0065 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u524da\u7f6eb\u7532\u3001"
+ "c\u5f8cd\u7f6ee";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
@@ -1129,10 +1129,10 @@ CPPUNIT_TEST_FIXTURE(Test, testChtOutlineNumberingRtf)
{
load(mpTestDocumentPath, "chtoutline.rtf");
- const sal_Unicode aExpectedNumbering[] = { 0x7b2c, ' ', '1', ' ', 0x7ae0 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u7b2c 1 \u7ae0";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
diff --git a/sw/qa/extras/tiledrendering/data/cond-coll-copy.odt b/sw/qa/extras/tiledrendering/data/cond-coll-copy.odt
new file mode 100644
index 000000000000..8fa15f177eb7
--- /dev/null
+++ b/sw/qa/extras/tiledrendering/data/cond-coll-copy.odt
Binary files differ
diff --git a/sw/qa/extras/tiledrendering/data/tdf114799_highlight.docx b/sw/qa/extras/tiledrendering/data/tdf114799_highlight.docx
new file mode 100644
index 000000000000..3a64d71d7cfd
--- /dev/null
+++ b/sw/qa/extras/tiledrendering/data/tdf114799_highlight.docx
Binary files differ
diff --git a/sw/qa/extras/tiledrendering/data/tdf114799.docx b/sw/qa/extras/tiledrendering/data/tdf114799_shd.docx
index 730ef91dcef9..730ef91dcef9 100644
--- a/sw/qa/extras/tiledrendering/data/tdf114799.docx
+++ b/sw/qa/extras/tiledrendering/data/tdf114799_shd.docx
Binary files differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 28edd8c5fb55..b5d8000c967f 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -18,6 +18,7 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/datatransfer/XTransferable2.hpp>
#include <test/helper/transferable.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -45,6 +46,7 @@
#include <tools/json_writer.hxx>
#include <unotools/mediadescriptor.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <drawdoc.hxx>
#include <ndtxt.hxx>
@@ -60,6 +62,7 @@
#include <unotxdoc.hxx>
#include <docsh.hxx>
#include <txtfrm.hxx>
+#include <rootfrm.hxx>
constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/tiledrendering/data/";
@@ -134,6 +137,7 @@ public:
void testDeselectCustomShape();
void testSemiTransparent();
void testHighlightNumbering();
+ void testHighlightNumbering_shd();
void testPilcrowRedlining();
void testClipText();
void testAnchorTypes();
@@ -148,6 +152,10 @@ public:
void testTablePaintInvalidate();
void testSpellOnlineRenderParameter();
void testExtTextInputReadOnly();
+ void testBulletDeleteInvalidation();
+ void testBulletNoNumInvalidation();
+ void testBulletMultiDeleteInvalidation();
+ void testCondCollCopy();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -208,6 +216,7 @@ public:
CPPUNIT_TEST(testDeselectCustomShape);
CPPUNIT_TEST(testSemiTransparent);
CPPUNIT_TEST(testHighlightNumbering);
+ CPPUNIT_TEST(testHighlightNumbering_shd);
CPPUNIT_TEST(testPilcrowRedlining);
CPPUNIT_TEST(testClipText);
CPPUNIT_TEST(testAnchorTypes);
@@ -222,13 +231,20 @@ public:
CPPUNIT_TEST(testTablePaintInvalidate);
CPPUNIT_TEST(testSpellOnlineRenderParameter);
CPPUNIT_TEST(testExtTextInputReadOnly);
+ CPPUNIT_TEST(testBulletDeleteInvalidation);
+ CPPUNIT_TEST(testBulletNoNumInvalidation);
+ CPPUNIT_TEST(testBulletMultiDeleteInvalidation);
+ CPPUNIT_TEST(testCondCollCopy);
CPPUNIT_TEST_SUITE_END();
private:
SwXTextDocument* createDoc(const char* pName = nullptr);
static void callback(int nType, const char* pPayload, void* pData);
void callbackImpl(int nType, const char* pPayload);
+ // First invalidation.
tools::Rectangle m_aInvalidation;
+ /// Union of all invalidations.
+ tools::Rectangle m_aInvalidations;
Size m_aDocumentSize;
OString m_aTextSelection;
bool m_bFound;
@@ -309,17 +325,20 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
{
case LOK_CALLBACK_INVALIDATE_TILES:
{
+ tools::Rectangle aInvalidation;
+ uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
+ if (OString("EMPTY") == pPayload)
+ return;
+ CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
+ aInvalidation.setX(aSeq[0].toInt32());
+ aInvalidation.setY(aSeq[1].toInt32());
+ aInvalidation.setWidth(aSeq[2].toInt32());
+ aInvalidation.setHeight(aSeq[3].toInt32());
if (m_aInvalidation.IsEmpty())
{
- uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
- if (OString("EMPTY") == pPayload)
- return;
- CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
- m_aInvalidation.setX(aSeq[0].toInt32());
- m_aInvalidation.setY(aSeq[1].toInt32());
- m_aInvalidation.setWidth(aSeq[2].toInt32());
- m_aInvalidation.setHeight(aSeq[3].toInt32());
+ m_aInvalidation = aInvalidation;
}
+ m_aInvalidations.Union(aInvalidation);
++m_nInvalidations;
}
break;
@@ -1077,8 +1096,10 @@ void SwTiledRenderingTest::testShapeViewCursors()
// Make sure that aView1 gets a view-only cursor notification, while
// aView2 gets a real cursor notification.
CPPUNIT_ASSERT_EQUAL(aView1.m_aOwnCursor, aLastOwnCursor1);
- CPPUNIT_ASSERT(aView1.m_bViewCursorInvalidated && aLastViewCursor1 != aView1.m_aViewCursor);
- CPPUNIT_ASSERT(aView2.m_bOwnCursorInvalidated && aLastOwnCursor2 != aView2.m_aOwnCursor);
+ CPPUNIT_ASSERT(aView1.m_bViewCursorInvalidated);
+ CPPUNIT_ASSERT(aLastViewCursor1 != aView1.m_aViewCursor);
+ CPPUNIT_ASSERT(aView2.m_bOwnCursorInvalidated);
+ CPPUNIT_ASSERT(aLastOwnCursor2 != aView2.m_aOwnCursor);
CPPUNIT_ASSERT_EQUAL(aLastViewCursor2, aView2.m_aViewCursor);
}
@@ -1763,8 +1784,7 @@ void SwTiledRenderingTest::testUndoRepairResult()
SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
int nView1 = SfxLokHelper::getView();
SfxLokHelper::createView();
- TestResultListener* pResult2 = new TestResultListener();
- css::uno::Reference< css::frame::XDispatchResultListener > xListener(static_cast< css::frame::XDispatchResultListener* >(pResult2), css::uno::UNO_QUERY);
+ rtl::Reference<TestResultListener> pResult2 = new TestResultListener();
pXTextDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
int nView2 = SfxLokHelper::getView();
@@ -1782,7 +1802,7 @@ void SwTiledRenderingTest::testUndoRepairResult()
// Assert that by default the second view can't undo the action.
SfxLokHelper::setView(nView2);
- comphelper::dispatchCommand(".uno:Undo", {}, xListener);
+ comphelper::dispatchCommand(".uno:Undo", {}, pResult2);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pResult2->m_nDocRepair);
@@ -1798,8 +1818,7 @@ void SwTiledRenderingTest::testRedoRepairResult()
SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
int nView1 = SfxLokHelper::getView();
SfxLokHelper::createView();
- TestResultListener* pResult2 = new TestResultListener();
- css::uno::Reference< css::frame::XDispatchResultListener > xListener(static_cast< css::frame::XDispatchResultListener* >(pResult2), css::uno::UNO_QUERY);
+ rtl::Reference<TestResultListener> pResult2 = new TestResultListener();
pXTextDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
int nView2 = SfxLokHelper::getView();
@@ -1815,12 +1834,12 @@ void SwTiledRenderingTest::testRedoRepairResult()
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'a', 0);
Scheduler::ProcessEventsToIdle();
- comphelper::dispatchCommand(".uno:Undo", {}, xListener);
+ comphelper::dispatchCommand(".uno:Undo", {}, pResult2);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), pResult2->m_nDocRepair);
// Assert that by default the second view can't redo the action.
SfxLokHelper::setView(nView2);
- comphelper::dispatchCommand(".uno:Redo", {}, xListener);
+ comphelper::dispatchCommand(".uno:Redo", {}, pResult2);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pResult2->m_nDocRepair);
@@ -1927,7 +1946,8 @@ void SwTiledRenderingTest::testAllTrackedChanges()
int nView1 = SfxLokHelper::getView();
int nView2 = SfxLokHelper::createView();
SwView* pView2 = dynamic_cast<SwView*>(SfxViewShell::Current());
- CPPUNIT_ASSERT(pView2 && pView1 != pView2);
+ CPPUNIT_ASSERT(pView2);
+ CPPUNIT_ASSERT(pView1 != pView2);
SwWrtShell* pWrtShell2 = pView2->GetWrtShellPtr();
// Insert text and reject all
{
@@ -2427,7 +2447,7 @@ void SwTiledRenderingTest::testSemiTransparent()
void SwTiledRenderingTest::testHighlightNumbering()
{
// Load a document where the top left tile contains a semi-transparent rectangle shape.
- SwXTextDocument* pXTextDocument = createDoc("tdf114799.docx");
+ SwXTextDocument* pXTextDocument = createDoc("tdf114799_highlight.docx");
// Render a larger area, and then get the color of the bottom right corner of our tile.
size_t nCanvasWidth = 1024;
@@ -2449,6 +2469,31 @@ void SwTiledRenderingTest::testHighlightNumbering()
CPPUNIT_ASSERT_EQUAL(COL_YELLOW, aColor);
}
+void SwTiledRenderingTest::testHighlightNumbering_shd()
+{
+ // Load a document where the top left tile contains a semi-transparent rectangle shape.
+ SwXTextDocument* pXTextDocument = createDoc("tdf114799_shd.docx");
+
+ // Render a larger area, and then get the color of the bottom right corner of our tile.
+ size_t nCanvasWidth = 1024;
+ size_t nCanvasHeight = 512;
+ size_t nTileSize = 256;
+ std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0);
+ ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT);
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->SetOutputSizePixelScaleOffsetAndBuffer(Size(nCanvasWidth, nCanvasHeight),
+ Fraction(1.0), Point(), aPixmap.data());
+ pXTextDocument->paintTile(*pDevice, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0,
+ /*nTilePosY=*/0, /*nTileWidth=*/15360, /*nTileHeight=*/7680);
+ pDevice->EnableMapMode(false);
+ Bitmap aBitmap = pDevice->GetBitmap(Point(0, 0), Size(nTileSize, nTileSize));
+ Bitmap::ScopedReadAccess pAccess(aBitmap);
+
+ // No highlighting over numbering - w:shd does not apply to numbering.
+ Color aColor(pAccess->GetPixel(103, 148));
+ CPPUNIT_ASSERT_EQUAL(COL_WHITE, aColor);
+}
+
void SwTiledRenderingTest::testPilcrowRedlining()
{
// Load a document where the top left tile contains
@@ -2929,6 +2974,128 @@ void SwTiledRenderingTest::testExtTextInputReadOnly()
CPPUNIT_ASSERT_EQUAL(OUString("x"), getParagraph(2)->getString());
}
+void SwTiledRenderingTest::testBulletDeleteInvalidation()
+{
+ // Given a document with 3 paragraphs: first 2 is bulleted, the last is not.
+ SwXTextDocument* pXTextDocument = createDoc();
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->SplitNode();
+ pWrtShell->Up(/*bSelect=*/false);
+ pWrtShell->StartAllAction();
+ pWrtShell->BulletOn();
+ pWrtShell->EndAllAction();
+ pWrtShell->Insert2("a");
+ pWrtShell->SplitNode();
+ pWrtShell->Insert2("b");
+ pWrtShell->Down(/*bSelect=*/false);
+ pWrtShell->GetLayout()->PaintSwFrame(*pWrtShell->GetOut(),
+ pWrtShell->GetLayout()->getFrameArea());
+ Scheduler::ProcessEventsToIdle();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
+ m_aInvalidations = tools::Rectangle();
+
+ // When pressing backspace in the last paragraph.
+ pWrtShell->DelLeft();
+
+ // Then the first paragraph should not be invalidated.
+ SwRootFrame* pRoot = pWrtShell->GetLayout();
+ SwFrame* pPage = pRoot->GetLower();
+ SwFrame* pBody = pPage->GetLower();
+ SwFrame* pFirstText = pBody->GetLower();
+ tools::Rectangle aFirstTextRect = pFirstText->getFrameArea().SVRect();
+ CPPUNIT_ASSERT(!aFirstTextRect.IsOver(m_aInvalidations));
+}
+
+void SwTiledRenderingTest::testBulletNoNumInvalidation()
+{
+ // Given a document with 3 paragraphs: all are bulleted.
+ SwXTextDocument* pXTextDocument = createDoc();
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->StartAllAction();
+ pWrtShell->BulletOn();
+ pWrtShell->EndAllAction();
+ pWrtShell->Insert2("a");
+ pWrtShell->SplitNode();
+ pWrtShell->Insert2("b");
+ pWrtShell->SplitNode();
+ pWrtShell->GetLayout()->PaintSwFrame(*pWrtShell->GetOut(),
+ pWrtShell->GetLayout()->getFrameArea());
+ Scheduler::ProcessEventsToIdle();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
+ m_aInvalidations = tools::Rectangle();
+
+ // When pressing backspace in the last paragraph to turn bullets off.
+ pWrtShell->StartAllAction();
+ pWrtShell->NumOrNoNum(/*bDelete=*/false);
+ pWrtShell->EndAllAction();
+
+ // Then the first paragraph should not be invalidated.
+ SwRootFrame* pRoot = pWrtShell->GetLayout();
+ SwFrame* pPage = pRoot->GetLower();
+ SwFrame* pBody = pPage->GetLower();
+ SwFrame* pFirstText = pBody->GetLower();
+ tools::Rectangle aFirstTextRect = pFirstText->getFrameArea().SVRect();
+ CPPUNIT_ASSERT(!aFirstTextRect.IsOver(m_aInvalidations));
+}
+
+void SwTiledRenderingTest::testBulletMultiDeleteInvalidation()
+{
+ // Given a document with 5 paragraphs: all are bulleted.
+ SwXTextDocument* pXTextDocument = createDoc();
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->StartAllAction();
+ pWrtShell->BulletOn();
+ pWrtShell->EndAllAction();
+ // There is already an initial text node, so type 5 times, but split 4 times.
+ for (int i = 0; i < 4; ++i)
+ {
+ pWrtShell->Insert2("a");
+ pWrtShell->SplitNode();
+ }
+ pWrtShell->Insert2("a");
+ // Go to the end of the 4th para.
+ pWrtShell->Up(/*bSelect=*/false);
+ pWrtShell->GetLayout()->PaintSwFrame(*pWrtShell->GetOut(),
+ pWrtShell->GetLayout()->getFrameArea());
+ Scheduler::ProcessEventsToIdle();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
+ m_aInvalidations = tools::Rectangle();
+
+ // When selecting and deleting several bullets: select till the end of the 2nd para and delete.
+ pWrtShell->Up(/*bSelect=*/true, /*nCount=*/2);
+ pWrtShell->DelRight();
+
+ // Then the first paragraph should not be invalidated.
+ SwRootFrame* pRoot = pWrtShell->GetLayout();
+ SwFrame* pPage = pRoot->GetLower();
+ SwFrame* pBody = pPage->GetLower();
+ SwFrame* pFirstText = pBody->GetLower();
+ tools::Rectangle aFirstTextRect = pFirstText->getFrameArea().SVRect();
+ CPPUNIT_ASSERT(!aFirstTextRect.IsOver(m_aInvalidations));
+}
+
+void SwTiledRenderingTest::testCondCollCopy()
+{
+ // Given a document with a custom Text Body cond style:
+ SwXTextDocument* pXTextDocument = createDoc("cond-coll-copy.odt");
+ uno::Sequence<beans::PropertyValue> aPropertyValues
+ = { comphelper::makePropertyValue("Style", OUString("Text Body")),
+ comphelper::makePropertyValue("FamilyName", OUString("ParagraphStyles")) };
+ dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues);
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->SelAll();
+
+ // When getting the text selection, then make sure it doesn't crash:
+ uno::Reference<datatransfer::XTransferable2> xTransferable(pXTextDocument->getSelection(),
+ css::uno::UNO_QUERY);
+ datatransfer::DataFlavor aFlavor;
+ aFlavor.MimeType = "text/plain;charset=utf-16";
+ aFlavor.DataType = cppu::UnoType<OUString>::get();
+ CPPUNIT_ASSERT(xTransferable->isDataFlavorSupported(aFlavor));
+ // Without the accompanying fix in place, this test would have crashed.
+ xTransferable->getTransferData(aFlavor);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/uiwriter/data/AsCharTxBxTest.docx b/sw/qa/extras/uiwriter/data/AsCharTxBxTest.docx
new file mode 100644
index 000000000000..7603b80d2c2d
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/AsCharTxBxTest.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/AtPageTextBoxCrash.odt b/sw/qa/extras/uiwriter/data/AtPageTextBoxCrash.odt
index 20e58dfc0670..20e58dfc0670 100644
--- a/sw/qa/extras/uiwriter/data3/AtPageTextBoxCrash.odt
+++ b/sw/qa/extras/uiwriter/data/AtPageTextBoxCrash.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/floating-table-position.docx b/sw/qa/extras/uiwriter/data/floating-table-position.docx
index de7a467aac1b..de7a467aac1b 100644
--- a/sw/qa/extras/uiwriter/data2/floating-table-position.docx
+++ b/sw/qa/extras/uiwriter/data/floating-table-position.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/frame_size_export.docx b/sw/qa/extras/uiwriter/data/frame_size_export.docx
index 86147f311038..86147f311038 100644
--- a/sw/qa/extras/uiwriter/data2/frame_size_export.docx
+++ b/sw/qa/extras/uiwriter/data/frame_size_export.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/image-comment-at-char.odt b/sw/qa/extras/uiwriter/data/image-comment-at-char.odt
index ac6a06780a81..ac6a06780a81 100644
--- a/sw/qa/extras/uiwriter/data2/image-comment-at-char.odt
+++ b/sw/qa/extras/uiwriter/data/image-comment-at-char.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/image-comment.odt b/sw/qa/extras/uiwriter/data/image-comment.odt
index 4f0a520bcca3..4f0a520bcca3 100644
--- a/sw/qa/extras/uiwriter/data2/image-comment.odt
+++ b/sw/qa/extras/uiwriter/data/image-comment.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/lorem.fodt b/sw/qa/extras/uiwriter/data/lorem.fodt
index 1996ef8de580..1996ef8de580 100644
--- a/sw/qa/extras/uiwriter/data2/lorem.fodt
+++ b/sw/qa/extras/uiwriter/data/lorem.fodt
diff --git a/sw/qa/extras/uiwriter/data2/num-parent-style.docx b/sw/qa/extras/uiwriter/data/num-parent-style.docx
index 4b8c657afa3f..4b8c657afa3f 100644
--- a/sw/qa/extras/uiwriter/data2/num-parent-style.docx
+++ b/sw/qa/extras/uiwriter/data/num-parent-style.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/ofz18563.docx b/sw/qa/extras/uiwriter/data/ofz18563.docx
index 6733db44abb7..6733db44abb7 100644
--- a/sw/qa/extras/uiwriter/data2/ofz18563.docx
+++ b/sw/qa/extras/uiwriter/data/ofz18563.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/ole-save-while-edit.odt b/sw/qa/extras/uiwriter/data/ole-save-while-edit.odt
index 33a2284dd314..33a2284dd314 100644
--- a/sw/qa/extras/uiwriter/data2/ole-save-while-edit.odt
+++ b/sw/qa/extras/uiwriter/data/ole-save-while-edit.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/redline-para-join.docx b/sw/qa/extras/uiwriter/data/redline-para-join.docx
index c1ed90f801fb..c1ed90f801fb 100644
--- a/sw/qa/extras/uiwriter/data2/redline-para-join.docx
+++ b/sw/qa/extras/uiwriter/data/redline-para-join.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/shape-page-move.odt b/sw/qa/extras/uiwriter/data/shape-page-move.odt
index 80672b2448a2..80672b2448a2 100644
--- a/sw/qa/extras/uiwriter/data2/shape-page-move.odt
+++ b/sw/qa/extras/uiwriter/data/shape-page-move.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf100018-1.odt b/sw/qa/extras/uiwriter/data/tdf100018-1.odt
index 5cd36efcee77..5cd36efcee77 100644
--- a/sw/qa/extras/uiwriter/data3/tdf100018-1.odt
+++ b/sw/qa/extras/uiwriter/data/tdf100018-1.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf100691.fodt b/sw/qa/extras/uiwriter/data/tdf100691.fodt
index 6488f0b40663..6488f0b40663 100644
--- a/sw/qa/extras/uiwriter/data3/tdf100691.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf100691.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf101534.fodt b/sw/qa/extras/uiwriter/data/tdf101534.fodt
index e1db2f08ee08..e1db2f08ee08 100644
--- a/sw/qa/extras/uiwriter/data2/tdf101534.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf101534.fodt
diff --git a/sw/qa/extras/uiwriter/data3/tdf104649.docx b/sw/qa/extras/uiwriter/data/tdf104649.docx
index 7b1e4fd3cedc..7b1e4fd3cedc 100644
--- a/sw/qa/extras/uiwriter/data3/tdf104649.docx
+++ b/sw/qa/extras/uiwriter/data/tdf104649.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf105330.odt b/sw/qa/extras/uiwriter/data/tdf105330.odt
index bb1a088c38cc..bb1a088c38cc 100644
--- a/sw/qa/extras/uiwriter/data2/tdf105330.odt
+++ b/sw/qa/extras/uiwriter/data/tdf105330.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf105413.fodt b/sw/qa/extras/uiwriter/data/tdf105413.fodt
index f27ee904d82b..f27ee904d82b 100644
--- a/sw/qa/extras/uiwriter/data2/tdf105413.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf105413.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf106843.docx b/sw/qa/extras/uiwriter/data/tdf106843.docx
index 339ebd594168..339ebd594168 100644
--- a/sw/qa/extras/uiwriter/data2/tdf106843.docx
+++ b/sw/qa/extras/uiwriter/data/tdf106843.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf107893.odt b/sw/qa/extras/uiwriter/data/tdf107893.odt
index 9c24eccfa367..9c24eccfa367 100644
--- a/sw/qa/extras/uiwriter/data3/tdf107893.odt
+++ b/sw/qa/extras/uiwriter/data/tdf107893.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf107975.odt b/sw/qa/extras/uiwriter/data/tdf107975.odt
index afcab1814b58..afcab1814b58 100644
--- a/sw/qa/extras/uiwriter/data3/tdf107975.odt
+++ b/sw/qa/extras/uiwriter/data/tdf107975.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf108124.odt b/sw/qa/extras/uiwriter/data/tdf108124.odt
index af0260928b40..af0260928b40 100644
--- a/sw/qa/uitest/data/tdf108124.odt
+++ b/sw/qa/extras/uiwriter/data/tdf108124.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt b/sw/qa/extras/uiwriter/data/tdf108687_tabstop.odt
index caabc4987c30..caabc4987c30 100644
--- a/sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt
+++ b/sw/qa/extras/uiwriter/data/tdf108687_tabstop.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf112342.docx b/sw/qa/extras/uiwriter/data/tdf112342.docx
index ab4c7ee07d4d..ab4c7ee07d4d 100644
--- a/sw/qa/extras/uiwriter/data3/tdf112342.docx
+++ b/sw/qa/extras/uiwriter/data/tdf112342.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data/tdf115815.odt b/sw/qa/extras/uiwriter/data/tdf115815.odt
new file mode 100644
index 000000000000..7c2aad0da638
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf115815.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf117923.docx b/sw/qa/extras/uiwriter/data/tdf117923.docx
index c10ac24050b2..c10ac24050b2 100644
--- a/sw/qa/extras/uiwriter/data2/tdf117923.docx
+++ b/sw/qa/extras/uiwriter/data/tdf117923.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf118311.fodt b/sw/qa/extras/uiwriter/data/tdf118311.fodt
index cf1914e51d34..cf1914e51d34 100644
--- a/sw/qa/extras/uiwriter/data2/tdf118311.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf118311.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf118699.docx b/sw/qa/extras/uiwriter/data/tdf118699.docx
index 6aea0911aef1..6aea0911aef1 100644
--- a/sw/qa/extras/uiwriter/data2/tdf118699.docx
+++ b/sw/qa/extras/uiwriter/data/tdf118699.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf119019.docx b/sw/qa/extras/uiwriter/data/tdf119019.docx
index d38c9e4ae146..d38c9e4ae146 100644
--- a/sw/qa/extras/uiwriter/data2/tdf119019.docx
+++ b/sw/qa/extras/uiwriter/data/tdf119019.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf120336.docx b/sw/qa/extras/uiwriter/data/tdf120336.docx
index a9152bf31d07..a9152bf31d07 100644
--- a/sw/qa/extras/uiwriter/data2/tdf120336.docx
+++ b/sw/qa/extras/uiwriter/data/tdf120336.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf120338.docx b/sw/qa/extras/uiwriter/data/tdf120338.docx
index 94e0023cea7f..94e0023cea7f 100644
--- a/sw/qa/extras/uiwriter/data2/tdf120338.docx
+++ b/sw/qa/extras/uiwriter/data/tdf120338.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf122942.odt b/sw/qa/extras/uiwriter/data/tdf122942.odt
index c56583d305f2..c56583d305f2 100644
--- a/sw/qa/extras/uiwriter/data2/tdf122942.odt
+++ b/sw/qa/extras/uiwriter/data/tdf122942.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf123102.odt b/sw/qa/extras/uiwriter/data/tdf123102.odt
index 731a9b1521c1..731a9b1521c1 100644
--- a/sw/qa/extras/uiwriter/data2/tdf123102.odt
+++ b/sw/qa/extras/uiwriter/data/tdf123102.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf123285.odt b/sw/qa/extras/uiwriter/data/tdf123285.odt
index 1f92e1511a8b..1f92e1511a8b 100644
--- a/sw/qa/extras/uiwriter/data3/tdf123285.odt
+++ b/sw/qa/extras/uiwriter/data/tdf123285.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf124261.docx b/sw/qa/extras/uiwriter/data/tdf124261.docx
index 1d3efa5276f4..1d3efa5276f4 100644
--- a/sw/qa/extras/uiwriter/data2/tdf124261.docx
+++ b/sw/qa/extras/uiwriter/data/tdf124261.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf124397.docx b/sw/qa/extras/uiwriter/data/tdf124397.docx
index 65e2d25bcc62..65e2d25bcc62 100644
--- a/sw/qa/extras/uiwriter/data3/tdf124397.docx
+++ b/sw/qa/extras/uiwriter/data/tdf124397.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf124722.rtf b/sw/qa/extras/uiwriter/data/tdf124722.rtf
index 93f386d00a99..93f386d00a99 100644
--- a/sw/qa/extras/uiwriter/data3/tdf124722.rtf
+++ b/sw/qa/extras/uiwriter/data/tdf124722.rtf
diff --git a/sw/qa/extras/uiwriter/data3/tdf125261.odt b/sw/qa/extras/uiwriter/data/tdf125261.odt
index f89e1b21f518..f89e1b21f518 100644
--- a/sw/qa/extras/uiwriter/data3/tdf125261.odt
+++ b/sw/qa/extras/uiwriter/data/tdf125261.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf125310.fodt b/sw/qa/extras/uiwriter/data/tdf125310.fodt
index cf204e698223..cf204e698223 100644
--- a/sw/qa/extras/uiwriter/data2/tdf125310.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf125310.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf125310b.fodt b/sw/qa/extras/uiwriter/data/tdf125310b.fodt
index 1c131ce99b3a..1c131ce99b3a 100644
--- a/sw/qa/extras/uiwriter/data2/tdf125310b.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf125310b.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf125881.docx b/sw/qa/extras/uiwriter/data/tdf125881.docx
index 569d048eefe3..569d048eefe3 100644
--- a/sw/qa/extras/uiwriter/data2/tdf125881.docx
+++ b/sw/qa/extras/uiwriter/data/tdf125881.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf125916.docx b/sw/qa/extras/uiwriter/data/tdf125916.docx
index 6e1350da9c4a..6e1350da9c4a 100644
--- a/sw/qa/extras/uiwriter/data2/tdf125916.docx
+++ b/sw/qa/extras/uiwriter/data/tdf125916.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf126206.docx b/sw/qa/extras/uiwriter/data/tdf126206.docx
index 166125e7a738..166125e7a738 100644
--- a/sw/qa/extras/uiwriter/data2/tdf126206.docx
+++ b/sw/qa/extras/uiwriter/data/tdf126206.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf126340.odt b/sw/qa/extras/uiwriter/data/tdf126340.odt
index 79b481015093..79b481015093 100644
--- a/sw/qa/extras/uiwriter/data3/tdf126340.odt
+++ b/sw/qa/extras/uiwriter/data/tdf126340.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf126504.odt b/sw/qa/extras/uiwriter/data/tdf126504.odt
index 3f09230f21d5..3f09230f21d5 100644
--- a/sw/qa/extras/uiwriter/data3/tdf126504.odt
+++ b/sw/qa/extras/uiwriter/data/tdf126504.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf126626.docx b/sw/qa/extras/uiwriter/data/tdf126626.docx
index a2a289c2daca..a2a289c2daca 100644
--- a/sw/qa/extras/uiwriter/data3/tdf126626.docx
+++ b/sw/qa/extras/uiwriter/data/tdf126626.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf126784_distributeSelectedColumns.odt b/sw/qa/extras/uiwriter/data/tdf126784_distributeSelectedColumns.odt
index 90c23c56a32d..90c23c56a32d 100644
--- a/sw/qa/extras/uiwriter/data2/tdf126784_distributeSelectedColumns.odt
+++ b/sw/qa/extras/uiwriter/data/tdf126784_distributeSelectedColumns.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf127652.odt b/sw/qa/extras/uiwriter/data/tdf127652.odt
index 12b2b156bd23..12b2b156bd23 100644
--- a/sw/qa/extras/uiwriter/data3/tdf127652.odt
+++ b/sw/qa/extras/uiwriter/data/tdf127652.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf128335.odt b/sw/qa/extras/uiwriter/data/tdf128335.odt
index 6fb758af9168..6fb758af9168 100644
--- a/sw/qa/extras/uiwriter/data2/tdf128335.odt
+++ b/sw/qa/extras/uiwriter/data/tdf128335.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf128603.odt b/sw/qa/extras/uiwriter/data/tdf128603.odt
index 6fb758af9168..6fb758af9168 100644
--- a/sw/qa/extras/uiwriter/data2/tdf128603.odt
+++ b/sw/qa/extras/uiwriter/data/tdf128603.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf128739.docx b/sw/qa/extras/uiwriter/data/tdf128739.docx
index cf5d00f91f28..cf5d00f91f28 100644
--- a/sw/qa/extras/uiwriter/data3/tdf128739.docx
+++ b/sw/qa/extras/uiwriter/data/tdf128739.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf128782.odt b/sw/qa/extras/uiwriter/data/tdf128782.odt
index bb4a7d7f67c9..bb4a7d7f67c9 100644
--- a/sw/qa/extras/uiwriter/data3/tdf128782.odt
+++ b/sw/qa/extras/uiwriter/data/tdf128782.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf129382.docx b/sw/qa/extras/uiwriter/data/tdf129382.docx
index 19da7ef530b7..19da7ef530b7 100644
--- a/sw/qa/extras/uiwriter/data3/tdf129382.docx
+++ b/sw/qa/extras/uiwriter/data/tdf129382.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt b/sw/qa/extras/uiwriter/data/tdf129655-vtextbox.odt
index 8d668400c386..8d668400c386 100644
--- a/sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt
+++ b/sw/qa/extras/uiwriter/data/tdf129655-vtextbox.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf129805.docx b/sw/qa/extras/uiwriter/data/tdf129805.docx
index 53cb5550df6d..53cb5550df6d 100644
--- a/sw/qa/extras/uiwriter/data3/tdf129805.docx
+++ b/sw/qa/extras/uiwriter/data/tdf129805.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf130680.odt b/sw/qa/extras/uiwriter/data/tdf130680.odt
index 9065433dcdaa..9065433dcdaa 100644
--- a/sw/qa/extras/uiwriter/data3/tdf130680.odt
+++ b/sw/qa/extras/uiwriter/data/tdf130680.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf130685.odt b/sw/qa/extras/uiwriter/data/tdf130685.odt
index f83827ebb7e4..f83827ebb7e4 100644
--- a/sw/qa/extras/uiwriter/data3/tdf130685.odt
+++ b/sw/qa/extras/uiwriter/data/tdf130685.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf130746.odt b/sw/qa/extras/uiwriter/data/tdf130746.odt
index 7fcbec95b0a8..7fcbec95b0a8 100644
--- a/sw/qa/extras/uiwriter/data3/tdf130746.odt
+++ b/sw/qa/extras/uiwriter/data/tdf130746.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf130805.odt b/sw/qa/extras/uiwriter/data/tdf130805.odt
index 12e215123aa3..12e215123aa3 100644
--- a/sw/qa/extras/uiwriter/data3/tdf130805.odt
+++ b/sw/qa/extras/uiwriter/data/tdf130805.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf131684.docx b/sw/qa/extras/uiwriter/data/tdf131684.docx
index 7d3397dfba60..7d3397dfba60 100644
--- a/sw/qa/extras/uiwriter/data3/tdf131684.docx
+++ b/sw/qa/extras/uiwriter/data/tdf131684.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf131963.docx b/sw/qa/extras/uiwriter/data/tdf131963.docx
index 15db34ee9dca..15db34ee9dca 100644
--- a/sw/qa/extras/uiwriter/data3/tdf131963.docx
+++ b/sw/qa/extras/uiwriter/data/tdf131963.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf132160.odt b/sw/qa/extras/uiwriter/data/tdf132160.odt
index 8a8ae7b8b1cb..8a8ae7b8b1cb 100644
--- a/sw/qa/extras/uiwriter/data2/tdf132160.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132160.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132187.odt b/sw/qa/extras/uiwriter/data/tdf132187.odt
index 27bea84b6584..27bea84b6584 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132187.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132187.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf132236.odt b/sw/qa/extras/uiwriter/data/tdf132236.odt
index f37c9befc095..f37c9befc095 100644
--- a/sw/qa/extras/uiwriter/data2/tdf132236.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132236.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132321.odt b/sw/qa/extras/uiwriter/data/tdf132321.odt
index 1b725c072d43..1b725c072d43 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132321.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132321.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132420.odt b/sw/qa/extras/uiwriter/data/tdf132420.odt
index 8e556aa5a2d4..8e556aa5a2d4 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132420.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132420.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132596.docx b/sw/qa/extras/uiwriter/data/tdf132596.docx
index f19213ae1391..f19213ae1391 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132596.docx
+++ b/sw/qa/extras/uiwriter/data/tdf132596.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132597.odt b/sw/qa/extras/uiwriter/data/tdf132597.odt
index 68e9c9dffc77..68e9c9dffc77 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132597.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132597.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132637_protectTrackChanges.doc b/sw/qa/extras/uiwriter/data/tdf132637_protectTrackChanges.doc
index 2f75e60278e1..2f75e60278e1 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132637_protectTrackChanges.doc
+++ b/sw/qa/extras/uiwriter/data/tdf132637_protectTrackChanges.doc
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132725.odt b/sw/qa/extras/uiwriter/data/tdf132725.odt
index b14fc20486ea..b14fc20486ea 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132725.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132725.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132744.odt b/sw/qa/extras/uiwriter/data/tdf132744.odt
index 5681787d7f61..5681787d7f61 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132744.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132744.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132911.odt b/sw/qa/extras/uiwriter/data/tdf132911.odt
index 3c311f3ed36b..3c311f3ed36b 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132911.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132911.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf132944.odt b/sw/qa/extras/uiwriter/data/tdf132944.odt
index 08c3562aeaf1..08c3562aeaf1 100644
--- a/sw/qa/extras/uiwriter/data3/tdf132944.odt
+++ b/sw/qa/extras/uiwriter/data/tdf132944.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf133477.fodt b/sw/qa/extras/uiwriter/data/tdf133477.fodt
index e18a0e458a2d..e18a0e458a2d 100644
--- a/sw/qa/extras/uiwriter/data3/tdf133477.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf133477.fodt
diff --git a/sw/qa/extras/uiwriter/data3/tdf133490.odt b/sw/qa/extras/uiwriter/data/tdf133490.odt
index 98050b58fe46..98050b58fe46 100644
--- a/sw/qa/extras/uiwriter/data3/tdf133490.odt
+++ b/sw/qa/extras/uiwriter/data/tdf133490.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf133967.odt b/sw/qa/extras/uiwriter/data/tdf133967.odt
index 18ed5bfb7844..18ed5bfb7844 100644
--- a/sw/qa/extras/uiwriter/data3/tdf133967.odt
+++ b/sw/qa/extras/uiwriter/data/tdf133967.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf133982.docx b/sw/qa/extras/uiwriter/data/tdf133982.docx
index d2e8573d15ac..d2e8573d15ac 100644
--- a/sw/qa/extras/uiwriter/data3/tdf133982.docx
+++ b/sw/qa/extras/uiwriter/data/tdf133982.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf133990.odt b/sw/qa/extras/uiwriter/data/tdf133990.odt
index 8eaca8161701..8eaca8161701 100644
--- a/sw/qa/extras/uiwriter/data3/tdf133990.odt
+++ b/sw/qa/extras/uiwriter/data/tdf133990.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf134021.docx b/sw/qa/extras/uiwriter/data/tdf134021.docx
index cda11fbdf3ef..cda11fbdf3ef 100644
--- a/sw/qa/extras/uiwriter/data3/tdf134021.docx
+++ b/sw/qa/extras/uiwriter/data/tdf134021.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf134227.docx b/sw/qa/extras/uiwriter/data/tdf134227.docx
index e5228e6ca52f..e5228e6ca52f 100644
--- a/sw/qa/extras/uiwriter/data3/tdf134227.docx
+++ b/sw/qa/extras/uiwriter/data/tdf134227.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf134253.odt b/sw/qa/extras/uiwriter/data/tdf134253.odt
index 234b0bdca7ff..234b0bdca7ff 100644
--- a/sw/qa/extras/uiwriter/data3/tdf134253.odt
+++ b/sw/qa/extras/uiwriter/data/tdf134253.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf134404.odt b/sw/qa/extras/uiwriter/data/tdf134404.odt
index 53875f13822a..53875f13822a 100644
--- a/sw/qa/extras/uiwriter/data3/tdf134404.odt
+++ b/sw/qa/extras/uiwriter/data/tdf134404.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf134626.odt b/sw/qa/extras/uiwriter/data/tdf134626.odt
index 157bc258799e..157bc258799e 100644
--- a/sw/qa/extras/uiwriter/data3/tdf134626.odt
+++ b/sw/qa/extras/uiwriter/data/tdf134626.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf134931.odt b/sw/qa/extras/uiwriter/data/tdf134931.odt
index bfd1ccf2e561..bfd1ccf2e561 100644
--- a/sw/qa/extras/uiwriter/data3/tdf134931.odt
+++ b/sw/qa/extras/uiwriter/data/tdf134931.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf135056.odt b/sw/qa/extras/uiwriter/data/tdf135056.odt
index bd94317d07d4..bd94317d07d4 100644
--- a/sw/qa/extras/uiwriter/data3/tdf135056.odt
+++ b/sw/qa/extras/uiwriter/data/tdf135056.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf135412.docx b/sw/qa/extras/uiwriter/data/tdf135412.docx
index b420fa5ce2d1..b420fa5ce2d1 100644
--- a/sw/qa/extras/uiwriter/data3/tdf135412.docx
+++ b/sw/qa/extras/uiwriter/data/tdf135412.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf135623.docx b/sw/qa/extras/uiwriter/data/tdf135623.docx
index ed139eaeffdb..ed139eaeffdb 100644
--- a/sw/qa/extras/uiwriter/data3/tdf135623.docx
+++ b/sw/qa/extras/uiwriter/data/tdf135623.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf135661.odt b/sw/qa/extras/uiwriter/data/tdf135661.odt
index 7fe6a3ca4d56..7fe6a3ca4d56 100644
--- a/sw/qa/extras/uiwriter/data3/tdf135661.odt
+++ b/sw/qa/extras/uiwriter/data/tdf135661.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data/tdf135662.odt b/sw/qa/extras/uiwriter/data/tdf135662.odt
new file mode 100644
index 000000000000..d65725bda510
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf135662.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf135733.odt b/sw/qa/extras/uiwriter/data/tdf135733.odt
index 58293a07942d..58293a07942d 100644
--- a/sw/qa/extras/uiwriter/data3/tdf135733.odt
+++ b/sw/qa/extras/uiwriter/data/tdf135733.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf136385.odt b/sw/qa/extras/uiwriter/data/tdf136385.odt
index ee008e52372a..ee008e52372a 100644
--- a/sw/qa/extras/uiwriter/data3/tdf136385.odt
+++ b/sw/qa/extras/uiwriter/data/tdf136385.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data/tdf136778.docx b/sw/qa/extras/uiwriter/data/tdf136778.docx
new file mode 100644
index 000000000000..d1b6c877c4ed
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf136778.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf137964.odt b/sw/qa/extras/uiwriter/data/tdf137964.odt
index efbb27628ac7..efbb27628ac7 100644
--- a/sw/qa/extras/uiwriter/data3/tdf137964.odt
+++ b/sw/qa/extras/uiwriter/data/tdf137964.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf138130.docx b/sw/qa/extras/uiwriter/data/tdf138130.docx
index a570dec4b08a..a570dec4b08a 100644
--- a/sw/qa/extras/uiwriter/data3/tdf138130.docx
+++ b/sw/qa/extras/uiwriter/data/tdf138130.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data/tdf138482.docx b/sw/qa/extras/uiwriter/data/tdf138482.docx
new file mode 100644
index 000000000000..7bb4623e2c0c
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf138482.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf139127.fodt b/sw/qa/extras/uiwriter/data/tdf139127.fodt
index 1acd9dc24506..1acd9dc24506 100644
--- a/sw/qa/extras/uiwriter/data2/tdf139127.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf139127.fodt
diff --git a/sw/qa/extras/uiwriter/data/tdf140828.docx b/sw/qa/extras/uiwriter/data/tdf140828.docx
new file mode 100644
index 000000000000..bfdabc5d77ea
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf140828.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf39721.fodt b/sw/qa/extras/uiwriter/data/tdf39721.fodt
index 1acf06c5e2a5..1acf06c5e2a5 100644
--- a/sw/qa/extras/uiwriter/data2/tdf39721.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf39721.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf47471_paraStyleBackground.odt b/sw/qa/extras/uiwriter/data/tdf47471_paraStyleBackground.odt
index 1d6f1a5f22fe..1d6f1a5f22fe 100644
--- a/sw/qa/extras/uiwriter/data2/tdf47471_paraStyleBackground.odt
+++ b/sw/qa/extras/uiwriter/data/tdf47471_paraStyleBackground.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf52391.fodt b/sw/qa/extras/uiwriter/data/tdf52391.fodt
index b61d76f716d9..b61d76f716d9 100644
--- a/sw/qa/extras/uiwriter/data2/tdf52391.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf52391.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf54819.fodt b/sw/qa/extras/uiwriter/data/tdf54819.fodt
index f9a8e9d0b698..f9a8e9d0b698 100644
--- a/sw/qa/extras/uiwriter/data2/tdf54819.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf54819.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf54819b.odt b/sw/qa/extras/uiwriter/data/tdf54819b.odt
index 0fb7a6f95b2e..0fb7a6f95b2e 100644
--- a/sw/qa/extras/uiwriter/data2/tdf54819b.odt
+++ b/sw/qa/extras/uiwriter/data/tdf54819b.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf61154.fodt b/sw/qa/extras/uiwriter/data/tdf61154.fodt
index 18e0c0a64331..18e0c0a64331 100644
--- a/sw/qa/extras/uiwriter/data3/tdf61154.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf61154.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf64242_optimizeTable.odt b/sw/qa/extras/uiwriter/data/tdf64242_optimizeTable.odt
index 83d9be2cdf16..83d9be2cdf16 100644
--- a/sw/qa/extras/uiwriter/data2/tdf64242_optimizeTable.odt
+++ b/sw/qa/extras/uiwriter/data/tdf64242_optimizeTable.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data3/tdf76636.doc b/sw/qa/extras/uiwriter/data/tdf76636.doc
index 2d94868da586..2d94868da586 100644
--- a/sw/qa/extras/uiwriter/data3/tdf76636.doc
+++ b/sw/qa/extras/uiwriter/data/tdf76636.doc
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf76817.docx b/sw/qa/extras/uiwriter/data/tdf76817.docx
index 20478778a0d3..20478778a0d3 100644
--- a/sw/qa/extras/uiwriter/data2/tdf76817.docx
+++ b/sw/qa/extras/uiwriter/data/tdf76817.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/tdf76817.fodt b/sw/qa/extras/uiwriter/data/tdf76817.fodt
index 4b6decb1a82a..4b6decb1a82a 100644
--- a/sw/qa/extras/uiwriter/data2/tdf76817.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf76817.fodt
diff --git a/sw/qa/extras/uiwriter/data2/tdf90069.docx b/sw/qa/extras/uiwriter/data/tdf90069.docx
index 719502a67e78..719502a67e78 100644
--- a/sw/qa/extras/uiwriter/data2/tdf90069.docx
+++ b/sw/qa/extras/uiwriter/data/tdf90069.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data2/try2.fodt b/sw/qa/extras/uiwriter/data/try2.fodt
index 624a75a85ea9..624a75a85ea9 100644
--- a/sw/qa/extras/uiwriter/data2/try2.fodt
+++ b/sw/qa/extras/uiwriter/data/try2.fodt
diff --git a/sw/qa/extras/uiwriter/data3/txbx_crash.odt b/sw/qa/extras/uiwriter/data/txbx_crash.odt
index 0a029da88289..0a029da88289 100644
--- a/sw/qa/extras/uiwriter/data3/txbx_crash.odt
+++ b/sw/qa/extras/uiwriter/data/txbx_crash.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/data/udindex3.odt b/sw/qa/extras/uiwriter/data/udindex3.odt
new file mode 100644
index 000000000000..e6c7736b91e4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/udindex3.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 2147f581522f..f56cf50d328d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -55,6 +55,7 @@
#include <svl/itemiter.hxx>
#include <svx/svxids.hrc>
#include <unotools/localfilehelper.hxx>
+#include <vcl/filter/PDFiumLibrary.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/scripttypeitem.hxx>
@@ -216,6 +217,8 @@ public:
void testCreatePortions();
void testBookmarkUndo();
void testFdo85876();
+ void testCaretPositionMovingUp();
+ void testTdf93441();
void testTdf81226();
void testTdf79717();
void testTdf137532();
@@ -397,9 +400,8 @@ public:
void testSpellOnlineParameter();
void testRedlineAutoCorrect();
void testRedlineAutoCorrect2();
-#if HAVE_FEATURE_PDFIUM
+ void testEmojiAutoCorrect();
void testInsertPdf();
-#endif
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -449,6 +451,8 @@ public:
CPPUNIT_TEST(testCreatePortions);
CPPUNIT_TEST(testBookmarkUndo);
CPPUNIT_TEST(testFdo85876);
+ CPPUNIT_TEST(testCaretPositionMovingUp);
+ CPPUNIT_TEST(testTdf93441);
CPPUNIT_TEST(testTdf81226);
CPPUNIT_TEST(testTdf79717);
CPPUNIT_TEST(testTdf137532);
@@ -627,9 +631,8 @@ public:
CPPUNIT_TEST(testSpellOnlineParameter);
CPPUNIT_TEST(testRedlineAutoCorrect);
CPPUNIT_TEST(testRedlineAutoCorrect2);
-#if HAVE_FEATURE_PDFIUM
+ CPPUNIT_TEST(testEmojiAutoCorrect);
CPPUNIT_TEST(testInsertPdf);
-#endif
CPPUNIT_TEST_SUITE_END();
private:
@@ -1396,7 +1399,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134250)
xTransfer->Copy();
// .uno:Paste without touching shared clipboard
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
Scheduler::ProcessEventsToIdle();
@@ -2029,6 +2032,34 @@ void SwUiWriterTest::testFdo85876()
}
}
+void SwUiWriterTest::testCaretPositionMovingUp()
+{
+ SwDoc* const pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert("after");
+ pWrtShell->InsertLineBreak();
+ pWrtShell->Up(false);
+ pWrtShell->Insert("before");
+
+ CPPUNIT_ASSERT_EQUAL(OUString(u"beforeAfter" + OUStringChar(CH_TXTATR_NEWLINE)), getParagraph(1)->getString());
+}
+
+void SwUiWriterTest::testTdf93441()
+{
+ SwDoc* const pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert("Hello");
+ pWrtShell->InsertLineBreak();
+ pWrtShell->Insert("Hello World");
+ pWrtShell->Up(false);
+ pWrtShell->Insert(" World");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: Hello World\nHello World
+ // - Actual : WorldHello\nHello World
+ CPPUNIT_ASSERT_EQUAL(OUString(u"Hello World" + OUStringChar(CH_TXTATR_NEWLINE) + u"Hello World"), getParagraph(1)->getString());
+}
+
void SwUiWriterTest::testTdf81226()
{
SwDoc* const pDoc = createDoc();
@@ -2191,7 +2222,9 @@ void SwUiWriterTest::testTextCursorInvalidation()
// this does not actually delete the header: xPageStyle->setPropertyValue("HeaderIsOn", uno::makeAny(false));
pWrtShell->ChangeHeaderOrFooter(u"Default Page Style", true, false, false);
// must be disposed after deleting header
- CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
+ // cursor ends up in body
+ // UPDATE: this behaviour has been corrected as a side effect of the fix to tdf#46561:
+ //CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
}
void SwUiWriterTest::testTdf68183()
@@ -4441,7 +4474,6 @@ void SwUiWriterTest::testEmbeddedDataSource()
// Load: should have a component and a data source, too.
// Path with "#" must not cause issues
load(OUString(DATA_DIRECTORY + OUStringLiteral(u"hash%23path/")), "embedded-data-source.odt");
- CPPUNIT_ASSERT(mxComponent.is());
CPPUNIT_ASSERT(xDatabaseContext->hasByName("calc-data-source"));
// Data source has a table named Sheet1.
@@ -5023,7 +5055,9 @@ void SwUiWriterTest::testTdf92648()
SwDoc* pDoc = createDoc("tdf92648.docx");
SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
// Make sure we have ten draw shapes.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(10), SwTextBoxHelper::getCount(pPage));
+ // Yes, we have if the left/right pages have different header/footer,
+ // but if not we have only nine of them:
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(9), SwTextBoxHelper::getCount(pPage));
// and the text boxes haven't got zero height
sal_Int32 nCount = 0;
for (const SwFrameFormat* pFormat : *pDoc->GetSpzFrameFormats())
@@ -7740,6 +7774,39 @@ void SwUiWriterTest::testRedlineAutoCorrect2()
CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
}
+void SwUiWriterTest::testEmojiAutoCorrect()
+{
+ SwDoc* pDoc = createDoc("redline-autocorrect2.fodt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ // Emoji replacement (:snowman: -> ☃)
+
+ // without change tracking
+ CPPUNIT_ASSERT(!(pWrtShell->GetRedlineFlags() & RedlineFlags::On));
+ SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect());
+ pWrtShell->Insert(":snowman");
+ pWrtShell->AutoCorrect(corr, ':');
+ sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+ OUString sReplaced = u"☃Lorem,";
+ nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+ CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+
+ // with change tracking (showing redlines)
+ RedlineFlags const nMode(pWrtShell->GetRedlineFlags() | RedlineFlags::On);
+ CPPUNIT_ASSERT(nMode & (RedlineFlags::ShowDelete | RedlineFlags::ShowInsert));
+ pWrtShell->SetRedlineFlags(nMode);
+ CPPUNIT_ASSERT(nMode & RedlineFlags::On);
+ CPPUNIT_ASSERT(nMode & RedlineFlags::ShowDelete);
+
+ pWrtShell->Insert(":snowman");
+ pWrtShell->AutoCorrect(corr, ':');
+ sReplaced = u"☃☃Lorem,";
+ nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+
+ // tdf#140674 This was ":snowman:" instead of autocorrect
+ CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+}
+
void SwUiWriterTest::testTdf108423()
{
SwDoc* pDoc = createDoc();
@@ -7870,6 +7937,16 @@ void SwUiWriterTest::testTdf133524()
pWrtShell->AutoCorrect(corr, '"');
sReplaced += u".”";
CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+ // tdf#134940 avoid premature replacement of "--" in "-->"
+ pWrtShell->Insert(u" --");
+ pWrtShell->AutoCorrect(corr, '>');
+ OUString sReplaced2(sReplaced + u" -->");
+ // This was "–>" instead of "-->"
+ CPPUNIT_ASSERT_EQUAL(sReplaced2, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+ pWrtShell->AutoCorrect(corr, ' ');
+ sReplaced += u" → ";
+ // This was "–>" instead of "→"
+ CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
}
void SwUiWriterTest::testTdf133524_Romanian()
@@ -8001,9 +8078,14 @@ void SwUiWriterTest::testInsertLongDateFormat()
CPPUNIT_ASSERT(xField->getString().indexOf(" ") > -1);
}
-#if HAVE_FEATURE_PDFIUM
void SwUiWriterTest::testInsertPdf()
{
+ auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+ if (!pPdfium)
+ {
+ return;
+ }
+
createDoc();
SwXTextDocument *pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
@@ -8031,7 +8113,6 @@ void SwUiWriterTest::testInsertPdf()
// Assert that the graphic is a PDF
CPPUNIT_ASSERT_EQUAL(OUString("application/pdf"), getProperty<OUString>(xGraphic, "MimeType"));
}
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 7d24e652d694..e017bc2c7077 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -71,7 +71,7 @@
namespace
{
-constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data2/";
+constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/";
constexpr OUStringLiteral FLOATING_TABLE_DATA_DIRECTORY
= u"/sw/qa/extras/uiwriter/data/floating_table/";
} // namespace
@@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534)
// Make sure that direct formatting is preserved during paste.
pWrtShell->EndPara(/*bSelect=*/false);
- TransferableDataHelper aHelper(pTransfer.get());
+ TransferableDataHelper aHelper(pTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
aSet.ClearItem();
pWrtShell->GetCurAttr(aSet);
@@ -1929,7 +1929,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122942)
SdrObject* pObject2 = rFormats2[1]->FindSdrObject();
CPPUNIT_ASSERT(pObject2);
const tools::Rectangle& rOutRect2 = pObject2->GetLastBoundRect();
- CPPUNIT_ASSERT(rOutRect2.Top() > rOutRect1.Top() && rOutRect2.Top() < rOutRect1.Bottom());
+ CPPUNIT_ASSERT(rOutRect2.Top() > rOutRect1.Top());
+ CPPUNIT_ASSERT(rOutRect2.Top() < rOutRect1.Bottom());
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf132160)
@@ -2264,6 +2265,57 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testJoinParaChangesInMargin)
CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140757)
+{
+ load(DATA_DIRECTORY, "tdf54819.fodt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ // switch on "Show changes in margin" mode
+ dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+
+ SwWrtShell* const pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
+ CPPUNIT_ASSERT(pWrtShell->GetViewOptions()->IsShowChangesInMargin());
+
+ // turn on red-lining and show changes
+ SwDoc* pDoc = pWrtShell->GetDoc();
+ pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowInsert
+ | RedlineFlags::ShowDelete);
+ CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+ pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE(
+ "redlines should be visible",
+ IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+ // delete a character in the first paragraph, and another character in the second one
+ dispatchCommand(mxComponent, ".uno:Delete", {});
+ pWrtShell->Down(/*bSelect=*/false);
+ dispatchCommand(mxComponent, ".uno:Delete", {});
+
+ CPPUNIT_ASSERT_EQUAL(OUString("orem ipsum"), getParagraph(1)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("olor sit amet."), getParagraph(2)->getString());
+
+ // accept all changes
+ IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+ rIDRA.AcceptAllRedline(/*bAccept=*/true);
+
+ CPPUNIT_ASSERT_EQUAL(OUString("orem ipsum"), getParagraph(1)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("olor sit amet."), getParagraph(2)->getString());
+
+ // This crashed
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+
+ // Check result of Undo
+ rIDRA.AcceptAllRedline(/*bAccept=*/false);
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem ipsum"), getParagraph(1)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("dolor sit amet."), getParagraph(2)->getString());
+
+ // switch off "Show changes in margin" mode
+ dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+ CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139127)
{
load(DATA_DIRECTORY, "tdf139127.fodt");
@@ -2389,7 +2441,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf138666)
CPPUNIT_ASSERT_EQUAL(OUString("Loremm"), getParagraph(1)->getString());
CPPUNIT_ASSERT_EQUAL(OUString("dolsit"), getParagraph(2)->getString());
- // switch on "Show changes in margin" mode
+ // switch off "Show changes in margin" mode
dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
// show deletions inline again
@@ -2397,6 +2449,78 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf138666)
CPPUNIT_ASSERT_EQUAL(OUString("dolor sit"), getParagraph(2)->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140982)
+{
+ SwDoc* pDoc = createDoc("tdf115815.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ //turn on red-lining and show changes
+ pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete
+ | RedlineFlags::ShowInsert);
+ CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+ pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE(
+ "redlines should be visible",
+ IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+ // show deletions inline
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem ipsum dolor sit amet..."), getParagraph(1)->getString());
+
+ // switch on "Show changes in margin" mode
+ dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+
+ // show deletions in margin
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem amet..."), getParagraph(1)->getString());
+
+ // switch off "Show changes in margin" mode
+ dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+
+ // show deletions inline again
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem ipsum dolor sit amet..."), getParagraph(1)->getString());
+
+ // Save it and load it back.
+ reload("writer8", "tdf115815.odt");
+
+ // Test comment range feature on tracked deletion.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(),
+ uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(),
+ uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ bool bAnnotationStart = false;
+ bool bBeforeAnnotation = true;
+ OUString sTextBeforeAnnotation;
+ while (xRunEnum->hasMoreElements())
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ OUString aType = getProperty<OUString>(xPropertySet, "TextPortionType");
+ // there is no AnnotationEnd with preceding AnnotationStart,
+ // i.e. annotation with lost range
+ CPPUNIT_ASSERT(aType != "AnnotationEnd" || !bAnnotationStart);
+
+ bAnnotationStart = (aType == "Annotation");
+
+ // collect paragraph text before the first annotation
+ if (bBeforeAnnotation)
+ {
+ if (bAnnotationStart)
+ bBeforeAnnotation = false;
+ else if (aType == "Text")
+ {
+ uno::Reference<text::XTextRange> xRun(xPropertySet, uno::UNO_QUERY);
+ sTextBeforeAnnotation += xRun->getString();
+ }
+ }
+ }
+
+ // This was "Lorem ipsum" (collapsed annotation range)
+ CPPUNIT_ASSERT_EQUAL(OUString("Lorem "), sTextBeforeAnnotation);
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126206)
{
load(DATA_DIRECTORY, "tdf126206.docx");
@@ -2682,9 +2806,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDocxAttributeTableExport)
// test the new values
sal_Int32 nValue = getProperty<sal_Int32>(xShape, "VertOrientPosition");
- CPPUNIT_ASSERT(sal_Int32(7999) <= nValue && nValue <= sal_Int32(8001));
+ CPPUNIT_ASSERT(sal_Int32(7999) <= nValue);
+ CPPUNIT_ASSERT(nValue <= sal_Int32(8001));
nValue = getProperty<sal_Int32>(xShape, "HoriOrientPosition");
- CPPUNIT_ASSERT(sal_Int32(4999) <= nValue && nValue <= sal_Int32(5001));
+ CPPUNIT_ASSERT(sal_Int32(4999) <= nValue);
+ CPPUNIT_ASSERT(nValue <= sal_Int32(5001));
CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty<sal_Int16>(xShape, "VertOrientRelation"));
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xShape, "HoriOrientRelation"));
@@ -3515,7 +3641,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf128603)
// only care that it doesn't assert/crash
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testOfz18563)
{
- OUString sURL(m_directories.getURLFromSrc(u"/sw/qa/extras/uiwriter/data2/ofz18563.docx"));
+ OUString sURL(m_directories.getURLFromSrc(u"/sw/qa/extras/uiwriter/data/ofz18563.docx"));
SvFileStream aFileStream(sURL, StreamMode::READ);
TestImportDOCX(aFileStream);
}
@@ -3622,7 +3748,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf129655)
{
createDoc("tdf129655-vtextbox.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//fly/txt[@WritingMode='Vertical']", 1);
+ assertXPath(pXmlDoc, "//anchored/fly/txt[@WritingMode='Vertical']", 1);
}
static uno::Reference<text::XTextRange> getAssociatedTextRange(uno::Any object)
@@ -3757,6 +3883,57 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf123218)
CPPUNIT_ASSERT_EQUAL(chart2::AxisOrientation_REVERSE, aScaleData.Orientation);
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126735)
+{
+ SwDoc* pDoc = createDoc("tdf39721.fodt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ //turn on red-lining and show changes
+ pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete
+ | RedlineFlags::ShowInsert);
+ CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+ pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE(
+ "redlines should be visible",
+ IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+ // check next selected tracked change
+ dispatchCommand(mxComponent, ".uno:NextTrackedChange", {});
+ uno::Reference<view::XSelectionSupplier> xSelSupplier(pTextDoc->getCurrentController(),
+ uno::UNO_QUERY_THROW);
+ uno::Any aSelection = xSelSupplier->getSelection();
+ uno::Reference<text::XTextRange> xTextRange = getAssociatedTextRange(aSelection);
+ CPPUNIT_ASSERT(xTextRange);
+ CPPUNIT_ASSERT_EQUAL(OUString(" ipsu"), xTextRange->getString());
+
+ // check next selected tracked change
+ dispatchCommand(mxComponent, ".uno:NextTrackedChange", {});
+ aSelection = xSelSupplier->getSelection();
+ xTextRange = getAssociatedTextRange(aSelection);
+ CPPUNIT_ASSERT(xTextRange);
+ CPPUNIT_ASSERT_EQUAL(OUString("or "), xTextRange->getString());
+
+ // check next selected tracked change at the end of the document:
+ // select the first tracked change of the document
+ dispatchCommand(mxComponent, ".uno:NextTrackedChange", {});
+ aSelection = xSelSupplier->getSelection();
+ xTextRange = getAssociatedTextRange(aSelection);
+ CPPUNIT_ASSERT(xTextRange);
+ // This was empty (collapsing at the end of the last tracked change)
+ CPPUNIT_ASSERT_EQUAL(OUString(" ipsu"), xTextRange->getString());
+
+ // check the previous tracked change at the start of the document:
+ // select the last tracked change of the document
+ dispatchCommand(mxComponent, ".uno:PreviousTrackedChange", {});
+ aSelection = xSelSupplier->getSelection();
+ xTextRange = getAssociatedTextRange(aSelection);
+ CPPUNIT_ASSERT(xTextRange);
+ // This was empty (collapsing at the start of the last tracked change)
+ CPPUNIT_ASSERT_EQUAL(OUString("or "), xTextRange->getString());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 95503190218d..8454b3ed92e4 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <IDocumentDrawModelAccess.hxx>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/XTextFrame.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
@@ -28,6 +29,8 @@
#include <tools/json_writer.hxx>
#include <unotools/streamwrap.hxx>
+#include <fmtinfmt.hxx>
+#include <view.hxx>
#include <wrtsh.hxx>
#include <unotxdoc.hxx>
#include <docsh.hxx>
@@ -39,7 +42,7 @@
namespace
{
-constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data3/";
+constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/";
} // namespace
/// Third set of tests asserting the behavior of Writer user interface shells.
@@ -66,7 +69,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
CPPUNIT_ASSERT_EQUAL(3, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(8, getShapes());
@@ -80,6 +83,32 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
CPPUNIT_ASSERT_EQUAL(8, getShapes());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135662)
+{
+ load(DATA_DIRECTORY, "tdf135662.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+ SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
+ rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell);
+ xTransfer->Cut();
+
+ CPPUNIT_ASSERT_EQUAL(0, getShapes());
+
+ TransferableDataHelper aHelper(xTransfer);
+ SwTransferable::Paste(*pWrtShell, aHelper);
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 2
+ // - Actual : 1
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134227)
{
load(DATA_DIRECTORY, "tdf134227.docx");
@@ -99,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134227)
CPPUNIT_ASSERT_EQUAL(0, getShapes());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(4, getShapes());
@@ -130,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135412)
CPPUNIT_ASSERT_EQUAL(0, getShapes());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(4, getShapes());
@@ -148,6 +177,28 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135412)
CPPUNIT_ASSERT_EQUAL(OUString("X"), xShape->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf138482)
+{
+ load(DATA_DIRECTORY, "tdf138482.docx");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:Delete", {});
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(0, getShapes());
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911)
{
load(DATA_DIRECTORY, "tdf132911.odt");
@@ -171,7 +222,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
CPPUNIT_ASSERT_EQUAL(0, getShapes());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
Scheduler::ProcessEventsToIdle();
@@ -480,7 +531,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
CPPUNIT_ASSERT_EQUAL(2, getShapes());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(2, getShapes());
@@ -540,7 +591,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132187)
dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {});
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
for (sal_Int32 i = 0; i < 10; ++i)
{
SwTransferable::Paste(*pWrtShell, aHelper);
@@ -584,7 +635,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135733)
pWrtShell->SttPg(/*bSelect=*/false);
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
@@ -622,7 +673,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739)
CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(OUString("Fehler: Verweis nicht gefunden"), getParagraph(1)->getString());
@@ -648,7 +699,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124722)
CPPUNIT_ASSERT_EQUAL(22, getPages());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(43, getPages());
@@ -656,6 +707,129 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124722)
CPPUNIT_ASSERT_EQUAL(22, getPages());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
+{
+ load(DATA_DIRECTORY, "udindex3.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwWrtShell& rWrtShell(*pTextDoc->GetDocShell()->GetWrtShell());
+ SwView& rView(*pTextDoc->GetDocShell()->GetView());
+
+ // update indexes
+ for (auto i = rWrtShell.GetTOXCount(); 0 < i;)
+ {
+ --i;
+ rWrtShell.UpdateTableOf(*rWrtShell.GetTOX(i));
+ }
+
+ // click on the links...
+ {
+ OUString const tmp("Table of Contents");
+ rWrtShell.GotoNextTOXBase(&tmp);
+ }
+
+ { // ToC toxmark
+ rWrtShell.Down(false);
+ SfxItemSet aSet(rWrtShell.GetAttrPool(),
+ svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{});
+ rWrtShell.GetCurAttr(aSet);
+ CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
+ rWrtShell.Push();
+ OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
+ CPPUNIT_ASSERT_EQUAL(OUString("#1%19the%20tocmark%19C%7Ctoxmark"), url);
+ rView.JumpToSwMark(url.copy(1)); // SfxApplication::OpenDocExec_Impl eats the "#"
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "tocmark"),
+ rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
+ rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+
+ { // ToC heading
+ rWrtShell.Down(false);
+ SfxItemSet aSet(rWrtShell.GetAttrPool(),
+ svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{});
+ rWrtShell.GetCurAttr(aSet);
+ CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
+ rWrtShell.Push();
+ OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
+ CPPUNIT_ASSERT_EQUAL(OUString("#__RefHeading___Toc105_706348105"), url);
+ rView.JumpToSwMark(url.copy(1));
+ CPPUNIT_ASSERT_EQUAL(OUString("foo"),
+ rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
+ rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+
+ {
+ OUString const tmp("User-Defined1");
+ rWrtShell.GotoNextTOXBase(&tmp);
+ }
+
+ { // UD1 toxmark 1
+ rWrtShell.Down(false);
+ SfxItemSet aSet(rWrtShell.GetAttrPool(),
+ svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{});
+ rWrtShell.GetCurAttr(aSet);
+ CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
+ rWrtShell.Push();
+ OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
+ CPPUNIT_ASSERT_EQUAL(OUString("#1%19the%20udmark%19UUser-Defined%7Ctoxmark"), url);
+ rView.JumpToSwMark(url.copy(1));
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark the first"),
+ rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
+ rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+
+ { // UD1 toxmark 2 (with same text)
+ rWrtShell.Down(false);
+ SfxItemSet aSet(rWrtShell.GetAttrPool(),
+ svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{});
+ rWrtShell.GetCurAttr(aSet);
+ CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
+ rWrtShell.Push();
+ OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
+ CPPUNIT_ASSERT_EQUAL(OUString("#2%19the%20udmark%19UUser-Defined%7Ctoxmark"), url);
+ rView.JumpToSwMark(url.copy(1));
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark the 2nd"),
+ rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
+ rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+
+ { // UD heading
+ rWrtShell.Down(false);
+ SfxItemSet aSet(rWrtShell.GetAttrPool(),
+ svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{});
+ rWrtShell.GetCurAttr(aSet);
+ CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
+ rWrtShell.Push();
+ OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
+ CPPUNIT_ASSERT_EQUAL(OUString("#__RefHeading___Toc105_706348105"), url);
+ rView.JumpToSwMark(url.copy(1));
+ CPPUNIT_ASSERT_EQUAL(OUString("foo"),
+ rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
+ rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+
+ {
+ OUString const tmp("NewUD!|1");
+ rWrtShell.GotoNextTOXBase(&tmp);
+ }
+
+ { // UD2 toxmark, with same text as those in other UD
+ rWrtShell.Down(false);
+ SfxItemSet aSet(rWrtShell.GetAttrPool(),
+ svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{});
+ rWrtShell.GetCurAttr(aSet);
+ CPPUNIT_ASSERT(aSet.HasItem(RES_TXTATR_INETFMT));
+ rWrtShell.Push();
+ OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue());
+ CPPUNIT_ASSERT_EQUAL(OUString("#1%19the%20udmark%19UNewUD!%7C%7Ctoxmark"), url);
+ rView.JumpToSwMark(url.copy(1));
+ CPPUNIT_ASSERT_EQUAL(OUString("the udmark"),
+ rWrtShell.GetCursor()->GetNode().GetTextNode()->GetText());
+ rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261)
{
load(DATA_DIRECTORY, "tdf125261.odt");
@@ -726,7 +900,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126504)
dispatchCommand(mxComponent, ".uno:GoToEndOfPage", {});
Scheduler::ProcessEventsToIdle();
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
Scheduler::ProcessEventsToIdle();
@@ -776,7 +950,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133982)
xTransfer->Cut();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
}
@@ -802,7 +976,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134253)
SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell);
xTransfer->Copy();
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
//Without the fix in place, it would have crashed here
@@ -813,6 +987,58 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134253)
CPPUNIT_ASSERT_EQUAL(6, getPages());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, TestAsCharTextBox)
+{
+ // Related tickets:
+ // tdf#138598 Replace vertical alignment of As_char textboxes in footer
+ // tdf#140158 Remove horizontal positioning of As_char textboxes, because
+ // the anchor moving does the same for it.
+
+ load(DATA_DIRECTORY, "AsCharTxBxTest.docx");
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ // Add 3x tab to the doc
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB);
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB);
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB);
+ Scheduler::ProcessEventsToIdle();
+
+ auto pExportDump = parseLayoutDump();
+ CPPUNIT_ASSERT(pExportDump);
+
+ // Check if the texbox fallen apart due to the tabs
+ const double nLeftSideOfShape1
+ = getXPath(pExportDump, "/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "left")
+ .toDouble();
+ const double nLeftSideOfTxBx1
+ = getXPath(pExportDump, "/root/page/body/txt/anchored/fly/infos/bounds", "left").toDouble();
+
+ CPPUNIT_ASSERT(nLeftSideOfShape1 < nLeftSideOfTxBx1);
+
+ // Another test is for the tdf#138598: Check footer textbox
+ const double nLeftSideOfShape2
+ = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/SwAnchoredDrawObject/bounds",
+ "left")
+ .toDouble();
+ const double nLeftSideOfTxBx2
+ = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/fly/infos/bounds", "left")
+ .toDouble();
+
+ CPPUNIT_ASSERT(nLeftSideOfShape2 < nLeftSideOfTxBx2);
+
+ const double nTopSideOfShape2
+ = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/SwAnchoredDrawObject/bounds",
+ "top")
+ .toDouble();
+ const double nTopSideOfTxBx2
+ = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/fly/infos/bounds", "top")
+ .toDouble();
+
+ CPPUNIT_ASSERT(nTopSideOfShape2 < nTopSideOfTxBx2);
+ // Without the fix in place the two texboxes has been fallen apart, and asserts will broken.
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636)
{
load(DATA_DIRECTORY, "tdf76636.doc");
@@ -890,6 +1116,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636_2)
CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xTextTable->getColumns()->getCount());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf140828)
+{
+ load(DATA_DIRECTORY, "tdf140828.docx");
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ uno::Reference<drawing::XShape> xShp = getShape(1);
+ CPPUNIT_ASSERT(xShp);
+
+ uno::Reference<beans::XPropertySet> ShpProps(xShp, uno::UNO_QUERY_THROW);
+ dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:SetAnchorAtChar", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(ShpProps->getPropertyValue("AnchorType").get<text::TextContentAnchorType>()
+ != text::TextContentAnchorType::TextContentAnchorType_AS_CHARACTER);
+
+ uno::Reference<text::XTextFrame> xTxBx(SwTextBoxHelper::getUnoTextFrame(xShp));
+ CPPUNIT_ASSERT(xTxBx);
+
+ uno::Reference<beans::XPropertySet> TxBxProps(xTxBx, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("top left image"), xTxBx->getText()->getString());
+
+ CPPUNIT_ASSERT_MESSAGE("Bad Relative Orientation and Position!",
+ TxBxProps->getPropertyValue("HoriOrientRelation").get<sal_Int16>()
+ != text::RelOrientation::CHAR);
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132725)
{
load(DATA_DIRECTORY, "tdf132725.odt");
@@ -968,6 +1225,54 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124397)
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf108124)
+{
+ load(DATA_DIRECTORY, "tdf108124.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent,
+ uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(
+ xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+ SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
+ rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell);
+ xTransfer->Copy();
+
+ TransferableDataHelper aHelper(xTransfer);
+ SwTransferable::Paste(*pWrtShell, aHelper);
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+
+ uno::Reference<drawing::XShape> xOldShape1(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xOldShape2(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+
+ uno::Reference<drawing::XShape> xNewShape1(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xNewShape2(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
+
+ // there should be 2 different objects now but they have the same names,
+ // so rely on the object identity for testing...
+ CPPUNIT_ASSERT(xOldShape1.get() != xNewShape1.get());
+ CPPUNIT_ASSERT(xOldShape1.get() != xNewShape2.get());
+ CPPUNIT_ASSERT(xOldShape2.get() != xNewShape1.get());
+ CPPUNIT_ASSERT(xOldShape2.get() != xNewShape2.get());
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:Redo", {});
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf107975)
{
// This test also covers tdf#117185 tdf#110442
@@ -998,7 +1303,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf107975)
//Position the mouse cursor (caret) after "ABC" below the blue image
dispatchCommand(mxComponent, ".uno:GoRight", {});
{
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
}
@@ -1035,7 +1340,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf107975)
//Position the mouse cursor (caret) after "ABC" below the blue image
dispatchCommand(mxComponent, ".uno:GoRight", {});
{
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
}
@@ -1082,6 +1387,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134021)
CPPUNIT_ASSERT_EQUAL(12, getPages());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf136778)
+{
+ load(DATA_DIRECTORY, "tdf136778.docx");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ dispatchCommand(mxComponent, ".uno:JumpToNextTable", {});
+
+ dispatchCommand(mxComponent, ".uno:DeleteTable", {});
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ // Without the fix in place, it would have crashed here
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf123285)
{
load(DATA_DIRECTORY, "tdf123285.odt");
@@ -1181,7 +1514,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130685)
CPPUNIT_ASSERT_EQUAL(1, getPages());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
SwTransferable::Paste(*pWrtShell, aHelper);
@@ -1265,7 +1598,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134931)
dispatchCommand(mxComponent, ".uno:GoDown", {});
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
for (sal_Int32 i = 0; i < 10; ++i)
{
SwTransferable::Paste(*pWrtShell, aHelper);
@@ -1306,7 +1639,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130680)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
xClpDoc.clear();
@@ -1344,7 +1677,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf131684)
dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
@@ -1404,7 +1737,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132744)
CPPUNIT_ASSERT_EQUAL(0, getShapes());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
Scheduler::ProcessEventsToIdle();
@@ -1412,6 +1745,67 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132744)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135014)
+{
+ mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "KeyModifier", uno::makeAny(sal_Int32(0)) } }));
+
+ // Toggle Numbering List
+ dispatchCommand(mxComponent, ".uno:DefaultBullet", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ uno::Sequence<beans::PropertyValue> aArgs2(comphelper::InitPropertySequence(
+ { { "Param", uno::makeAny(OUString("NewNumberingStyle")) },
+ { "Family", uno::makeAny(static_cast<sal_Int16>(SfxStyleFamily::Pseudo)) } }));
+
+ // New Style from selection
+ dispatchCommand(mxComponent, ".uno:StyleNewByExample", aArgs2);
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, this test would have failed here
+ reload("Office Open XML Text", "tdf135014.docx");
+
+ xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NewNumberingStyle']/w:qFormat", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130629)
+{
+ mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "KeyModifier", uno::makeAny(KEY_MOD1) } }));
+
+ dispatchCommand(mxComponent, ".uno:BasicShapes.diamond", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+
+ // Undo twice
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+
+ CPPUNIT_ASSERT_EQUAL(0, getShapes());
+
+ // Shape toolbar is active, use ESC before inserting a new shape
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_ESCAPE);
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:BasicShapes.diamond", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133358)
{
mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
@@ -1616,7 +2010,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134626)
rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell);
xTransfer->Copy();
Scheduler::ProcessEventsToIdle();
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
mxComponent->dispose();
@@ -2035,7 +2429,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133490)
CPPUNIT_ASSERT_EQUAL(0, getShapes());
- TransferableDataHelper aHelper(xTransfer.get());
+ TransferableDataHelper aHelper(xTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
Scheduler::ProcessEventsToIdle();
@@ -2228,6 +2622,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135661)
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477)
{
+ if (getDefaultDeviceBitCount() < 24)
+ return;
load(DATA_DIRECTORY, "tdf133477.fodt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
@@ -2247,12 +2643,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477)
aStream.Seek(STREAM_SEEK_TO_BEGIN);
// Read it back and check the color of the first pixel.
+ // (Actually check at one-pixel offset, because imprecise shape positioning may
+ // result in blending with background for the first pixel).
Graphic aGraphic;
TypeSerializer aSerializer(aStream);
aSerializer.readGraphic(aGraphic);
BitmapEx aBitmap = aGraphic.GetBitmapEx();
- CPPUNIT_ASSERT_EQUAL(Color(0, 102, 204), aBitmap.GetPixelColor(0, 0));
+ CPPUNIT_ASSERT_EQUAL(Color(0, 102, 204), aBitmap.GetPixelColor(1, 1));
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf137964)
@@ -2299,6 +2697,52 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf138897)
Scheduler::ProcessEventsToIdle();
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf136740)
+{
+ mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+ css::uno::Reference<css::lang::XMultiServiceFactory> xFact(mxComponent,
+ css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<css::beans::XPropertySet> xTextDefaults(
+ xFact->createInstance("com.sun.star.text.Defaults"), css::uno::UNO_QUERY_THROW);
+ const css::uno::Any aOrig = xTextDefaults->getPropertyValue("TabStopDistance");
+ sal_Int32 nDefTab = aOrig.get<sal_Int32>();
+ CPPUNIT_ASSERT(nDefTab != 0);
+
+ css::uno::Reference<css::text::XTextRange> const xParagraph(getParagraphOrTable(1),
+ css::uno::UNO_QUERY_THROW);
+ xParagraph->setString("Foo");
+
+ CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+ CPPUNIT_ASSERT_EQUAL(OUString("Foo"), xParagraph->getString());
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {});
+
+ const css::uno::Any aNew(nDefTab * 2);
+ xTextDefaults->setPropertyValue("TabStopDistance", aNew);
+ // it may become slightly different because of conversions, so get the actual value
+ const css::uno::Any aNewCorrected = xTextDefaults->getPropertyValue("TabStopDistance");
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(nDefTab * 2, aNewCorrected.get<sal_Int32>(), 1);
+
+ // Paste special as RTF
+ const auto aPropertyValues = comphelper::InitPropertySequence(
+ { { "SelectedFormat",
+ css::uno::Any(static_cast<sal_uInt32>(SotClipboardFormatId::RTF)) } });
+ dispatchCommand(mxComponent, ".uno:ClipboardFormatItems", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+ CPPUNIT_ASSERT_EQUAL(OUString("FooFoo"), xParagraph->getString());
+
+ // Without the fix in place, this would fail with
+ // equality assertion failed
+ // - Expected: <Any: (long) 2501>
+ // - Actual : <Any: (long) 1251>
+ // i.e., pasting RTF would reset the modified default tab stop distance to hardcoded default
+ CPPUNIT_ASSERT_EQUAL(aNewCorrected, xTextDefaults->getPropertyValue("TabStopDistance"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt b/sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt
new file mode 100644
index 000000000000..f588fdba0515
--- /dev/null
+++ b/sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Lohit Devanagari" svg:font-family="&apos;Lohit Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Serif CN" svg:font-family="&apos;Source Han Serif CN&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
+ <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
+ <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Table1" style:family="table">
+ <style:table-properties style:width="17cm" table:align="margins"/>
+ </style:style>
+ <style:style style:name="Table1.A" style:family="table-column">
+ <style:table-column-properties style:column-width="17cm" style:rel-column-width="65535*"/>
+ </style:style>
+ <style:style style:name="Table1.A1" style:family="table-cell">
+ <style:table-cell-properties fo:padding="0.097cm" fo:border="0.05pt solid #000000"/>
+ </style:style>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:text-properties officeooo:rsid="00078615" officeooo:paragraph-rsid="00078615"/>
+ </style:style>
+ <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:text-properties officeooo:rsid="00095b34" officeooo:paragraph-rsid="00095b34"/>
+ </style:style>
+ <style:style style:name="Sect1" style:family="section">
+ <style:section-properties fo:background-color="#81d41a" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:background-image/>
+ </style:section-properties>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ </text:sequence-decls>
+ <text:section text:style-name="Sect1" text:name="Section1">
+ <table:table table:name="Table1" table:style-name="Table1">
+ <table:table-column table:style-name="Table1.A"/>
+ <table:table-row>
+ <table:table-cell table:style-name="Table1.A1" office:value-type="string" table:protected="true">
+ <text:p text:style-name="P3">baz</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ </text:section>
+ <text:p text:style-name="P1">foo</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index 0266723d9e4d..f0ed93e85941 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -318,11 +318,11 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testXAutoTextGroup)
uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1);
- const OUString sGroupName = "TestGroup*1";
- const OUString sTextName = "TEST";
- const OUString sTextNameNew = "TESTRENAMED";
- const OUString sTextTitle = "Test Auto Text";
- const OUString sTextTitleNew = "Test Auto Text Renamed";
+ static const OUStringLiteral sGroupName = u"TestGroup*1";
+ static const OUStringLiteral sTextName = u"TEST";
+ static const OUStringLiteral sTextNameNew = u"TESTRENAMED";
+ static const OUStringLiteral sTextTitle = u"Test Auto Text";
+ static const OUStringLiteral sTextTitleNew = u"Test Auto Text Renamed";
// Create new temporary group
uno::Reference<text::XAutoTextGroup> xAutoTextGroup
@@ -497,6 +497,65 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtEnd)
xCursor->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTable)
+{
+ // this contains a section that ends with a table (plus another section)
+ load(DATA_DIRECTORY, "tdf134252_onlytable_protected.fodt");
+
+ uno::Reference<text::XTextTablesSupplier> const xTextTablesSupplier(mxComponent,
+ uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> const xTables(xTextTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+
+ uno::Reference<text::XTextSectionsSupplier> const xTextSectionsSupplier(mxComponent,
+ uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> const xSections(
+ xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+
+ uno::Reference<text::XTextContent> const xSection(xSections->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> const xAnchor(xSection->getAnchor());
+ CPPUNIT_ASSERT_EQUAL(OUString("baz" SAL_NEWLINE_STRING), xAnchor->getString());
+
+ // copy the content of the section to a clipboard document
+ uno::Reference<datatransfer::XTransferableSupplier> const xTS(
+ uno::Reference<frame::XModel>(mxComponent, uno::UNO_QUERY_THROW)->getCurrentController(),
+ uno::UNO_QUERY);
+ uno::Reference<datatransfer::XTransferableTextSupplier> const xTTS(xTS, uno::UNO_QUERY);
+ uno::Reference<datatransfer::XTransferable> const xTransferable(
+ xTTS->getTransferableForTextRange(xAnchor));
+
+ // check this doesn't throw
+ CPPUNIT_ASSERT(xAnchor->getStart().is());
+ CPPUNIT_ASSERT(xAnchor->getEnd().is());
+
+ // replace section content
+ xAnchor->setString("quux");
+
+ // table in section was deleted, but not section itself
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("\""
+ "quux" /*SAL_NEWLINE_STRING*/ "\""),
+ OUString("\"" + xAnchor->getString() + "\""));
+
+ // now paste it
+ uno::Reference<text::XTextViewCursorSupplier> const xTVCS(xTS, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursor> const xCursor(xTVCS->getViewCursor());
+ xCursor->gotoEnd(false);
+ xTS->insertTransferable(xTransferable);
+
+ // table in section was pasted, but not section itself
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+ xCursor->gotoStart(true);
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("quux" SAL_NEWLINE_STRING "foo" SAL_NEWLINE_STRING "baz" SAL_NEWLINE_STRING),
+ xCursor->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTextRangeInTable)
{
load(DATA_DIRECTORY, "bookmarkintable.fodt");
@@ -806,7 +865,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testPasteListener)
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false);
rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
pTransfer->Cut();
- TransferableDataHelper aHelper(pTransfer.get());
+ TransferableDataHelper aHelper(pTransfer);
SwTransferable::Paste(*pWrtShell, aHelper);
// Without working listener registration in place, this test would have
// failed with 'Expected: DE; Actual:', i.e. the paste listener was not
@@ -1097,7 +1156,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf129841)
// Get SwXCellRange for the same cell
css::uno::Reference<css::beans::XPropertySet> xCellRange(
xTableCellRange->getCellRangeByName("A1:A1"), css::uno::UNO_QUERY_THROW);
- const OUString sBackColor = "BackColor";
+ static const OUStringLiteral sBackColor = u"BackColor";
// Apply background color to table cursor, and read background color from cell range
css::uno::Any aRefColor(sal_Int32(0x00FF0000));
xTableCursor->setPropertyValue(sBackColor, aRefColor);
diff --git a/sw/qa/extras/ww8export/data/gutter-left.doc b/sw/qa/extras/ww8export/data/gutter-left.doc
new file mode 100644
index 000000000000..0d76e8748699
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/gutter-left.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/gutter-top.doc b/sw/qa/extras/ww8export/data/gutter-top.doc
new file mode 100644
index 000000000000..07ffa3945ac5
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/gutter-top.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/rtl-gutter.doc b/sw/qa/extras/ww8export/data/rtl-gutter.doc
new file mode 100644
index 000000000000..37cbf8707ce6
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/rtl-gutter.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/tdf100961_fixedDateTime.doc b/sw/qa/extras/ww8export/data/tdf100961_fixedDateTime.doc
new file mode 100644
index 000000000000..86f0e478d469
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf100961_fixedDateTime.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/tdf120003.doc b/sw/qa/extras/ww8export/data/tdf120003.doc
new file mode 100644
index 000000000000..c544fa5a96e0
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf120003.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/tdf139495_tinyHeader.doc b/sw/qa/extras/ww8export/data/tdf139495_tinyHeader.doc
new file mode 100644
index 000000000000..c45a6c25fd99
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf139495_tinyHeader.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/tdf81705_outlineLevel.doc b/sw/qa/extras/ww8export/data/tdf81705_outlineLevel.doc
new file mode 100644
index 000000000000..55d188356a25
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf81705_outlineLevel.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 333b26b5230e..b7befec7c0cd 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -500,16 +500,12 @@ DECLARE_WW8EXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.doc")
uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
uno::Reference<graphic::XGraphic> graphic;
imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
- uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL( sal_Int32(58), bitmap->getSize().Width );
- CPPUNIT_ASSERT_EQUAL( sal_Int32(320), bitmap->getSize().Height );
- const uno::Sequence< sal_Int8 > data = bitmap->getDIB(); // as .bmp data
- CPPUNIT_ASSERT_EQUAL( sal_Int32(20278), data.getLength());
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b0])); // -50 = 206 pixel value
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b1]));
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b2]));
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b3]));
- CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b4]));
+ Graphic vclGraphic(graphic);
+ BitmapEx bitmap(vclGraphic.GetBitmapEx());
+ CPPUNIT_ASSERT_EQUAL( tools::Long(58), bitmap.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL( tools::Long(320), bitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL( Color(206,206,206), bitmap.GetPixelColor(16,27));
+ CPPUNIT_ASSERT_EQUAL( Color(206,206,206), bitmap.GetPixelColor(22,48));
}
DECLARE_WW8EXPORT_TEST(testTdf95321, "tdf95321.doc")
@@ -1027,13 +1023,19 @@ DECLARE_WW8EXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt")
CPPUNIT_ASSERT_EQUAL(1, getPages());
// borderlessImage - image WITHOUT BORDERS : simulate padding with -crop
text::GraphicCrop crop = getProperty<text::GraphicCrop>(getShape(2), "GraphicCrop");
- CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
- CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right );
+ CPPUNIT_ASSERT( crop.Left != 0 );
+ CPPUNIT_ASSERT( crop.Right != 0 );
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Top );
+ CPPUNIT_ASSERT_EQUAL( crop.Right, crop.Bottom );
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Right );
// borderedImage - image WITH BORDERS : simulate padding with -crop
crop = getProperty<text::GraphicCrop>(getShape(3), "GraphicCrop");
- CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
- CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right );
+ CPPUNIT_ASSERT( crop.Left != 0 );
+ CPPUNIT_ASSERT( crop.Right != 0 );
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Top );
+ CPPUNIT_ASSERT_EQUAL( crop.Right, crop.Bottom );
+ CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Right );
}
DECLARE_WW8EXPORT_TEST(testFdo77454, "fdo77454.doc")
@@ -1528,7 +1530,8 @@ DECLARE_WW8EXPORT_TEST(testTdf94386, "tdf94386.odt")
awt::Size lSize;
xNextPropertySet->getPropertyValue("Size") >>= lSize;
- CPPUNIT_ASSERT((fSize.Width != lSize.Width) && (fSize.Height != lSize.Height));
+ CPPUNIT_ASSERT((fSize.Width != lSize.Width));
+ CPPUNIT_ASSERT((fSize.Height != lSize.Height));
}
DECLARE_WW8EXPORT_TEST(testTdf99474, "tdf99474.odt")
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index b8e2117d4d6e..e525927579e3 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -69,6 +69,12 @@ DECLARE_WW8EXPORT_TEST(testTdf37778_readonlySection, "tdf37778_readonlySection.d
CPPUNIT_ASSERT_EQUAL_MESSAGE("Last printed date", sal_Int16(2009), xDPS->getDocumentProperties()->getPrintDate().Year);
}
+DECLARE_WW8EXPORT_TEST(testTdf100961_fixedDateTime, "tdf100961_fixedDateTime.doc")
+{
+ // This should be a fixed date/time field, not the current time.
+ getParagraph(1, "05.01.19 04:06:08");
+}
+
DECLARE_WW8EXPORT_TEST(testTdf138345_paraCharHighlight, "tdf138345_paraCharHighlight.doc")
{
uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(9), 1, "A side benefit is that "), uno::UNO_QUERY_THROW);
@@ -81,6 +87,10 @@ DECLARE_WW8EXPORT_TEST(testTdf138345_paraCharHighlight, "tdf138345_paraCharHighl
// Character style formatting must not contain a highlight setting at all.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_AUTO), getProperty<sal_Int32>(xRun, "CharHighlight"));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_AUTO), getProperty<sal_Int32>(xRun, "CharBackColor"));
+
+ //tdf#118711 - don't explicitly specify the default page style at the beginning of the document
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(), xPara->getPropertyValue("PageDescName"));
}
DECLARE_WW8EXPORT_TEST(testTdf104596_wrapInHeaderTable, "tdf104596_wrapInHeaderTable.doc")
@@ -93,6 +103,33 @@ DECLARE_WW8EXPORT_TEST(testTdf104596_wrapInHeaderTable, "tdf104596_wrapInHeaderT
CPPUNIT_ASSERT_MESSAGE("Text must wrap under green box", nRowHeight > 1000);
}
+DECLARE_WW8EXPORT_TEST(testGutterLeft, "gutter-left.doc")
+{
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
+{
+ load(mpTestDocumentPath, "gutter-top.doc");
+ reload(mpFilter, "gutter-top.doc");
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xSettings(
+ xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ bool bGutterAtTop{};
+ xSettings->getPropertyValue("GutterAtTop") >>= bGutterAtTop;
+ // Without the accompanying fix in place, this test would have failed, because the gutter was
+ // at the left.
+ CPPUNIT_ASSERT(bGutterAtTop);
+}
+
DECLARE_WW8EXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.doc")
{
auto xNumberingRules
@@ -183,6 +220,15 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testChicagoNumberingFootnote)
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
}
+DECLARE_WW8EXPORT_TEST(testHyperLinkURLSaving, "tdf120003.doc")
+{
+ OUString URL = getProperty<OUString>(getShape(1), "HyperLinkURL");
+ // Without the fix in place, this test would have failed with
+ // - Expected: https://www.libreoffice.org/
+ // - Actual : tps://www.libreoffice.org/
+ CPPUNIT_ASSERT_EQUAL(OUString("https://www.libreoffice.org/"), URL);
+}
+
DECLARE_WW8EXPORT_TEST(testdf79553_lineNumbers, "tdf79553_lineNumbers.doc")
{
bool bValue = false;
@@ -216,6 +262,12 @@ DECLARE_WW8EXPORT_TEST(testTdf122460_header, "tdf122460_header.odt")
CPPUNIT_ASSERT(headerIsOn);
}
+DECLARE_WW8EXPORT_TEST(testTdf139495_tinyHeader, "tdf139495_tinyHeader.doc")
+{
+ // In Word 2003, this is one page, but definitely not six pages.
+ CPPUNIT_ASSERT(getPages() < 3);
+}
+
DECLARE_WW8EXPORT_TEST(testFdo53985, "fdo53985.doc")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
@@ -539,6 +591,14 @@ DECLARE_WW8EXPORT_TEST(testTdf129522_removeShadowStyle, "tdf129522_removeShadowS
CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location);
}
+DECLARE_WW8EXPORT_TEST(testTdf81705_outlineLevel, "tdf81705_outlineLevel.doc")
+{
+ // direct formatting resets outline level to body text (0)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph C", sal_uInt16(0), getProperty<sal_uInt16>(getParagraph(3), "OutlineLevel"));
+ // myStyle sets outline level to 1.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph D", sal_uInt16(1), getProperty<sal_uInt16>(getParagraph(4), "OutlineLevel"));
+}
+
DECLARE_WW8EXPORT_TEST(testBtlrCell, "btlr-cell.doc")
{
// Without the accompanying fix in place, this test would have failed, as
@@ -668,6 +728,23 @@ DECLARE_WW8EXPORT_TEST(testPresetDash, "tdf127166_prstDash_Word97.doc")
}
}
+CPPUNIT_TEST_FIXTURE(Test, testRtlGutter)
+{
+ auto verify = [this]() {
+ uno::Reference<beans::XPropertySet> xStandard(
+ getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(getProperty<bool>(xStandard, "RtlGutter"));
+ };
+
+ // Given a document with RTL gutter, when loading it:
+ load(mpTestDocumentPath, "rtl-gutter.doc");
+ // Then make sure the section's gutter is still RTL:
+ // Without the accompanying fix in place, this test would have failed as the SPRM was missing.
+ verify();
+ reload(mpFilter, "rtl-gutter.doc");
+ verify();
+}
+
DECLARE_WW8EXPORT_TEST(testTdf120394, "tdf120394.doc")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/sw/qa/extras/ww8import/data/tdf120768_zOrder.doc b/sw/qa/extras/ww8import/data/tdf120768_zOrder.doc
new file mode 100644
index 000000000000..b70a7d840b6d
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/tdf120768_zOrder.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 7fca28bb49e5..ccae8638a2c3 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -245,6 +245,10 @@ DECLARE_WW8IMPORT_TEST(testTdf122425_1, "tdf122425_1.doc")
CPPUNIT_ASSERT(!pBox->GetLine(eLine));
}
}
+
+ //tdf#139495: without the fix, a negative number was converted into a uInt16, overflowing to 115501
+ auto nDist = getProperty<sal_uInt32>(getStyles("PageStyles")->getByName("Standard"), "HeaderBodyDistance");
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nDist);
}
DECLARE_WW8IMPORT_TEST(testTdf110987, "tdf110987")
@@ -258,6 +262,14 @@ DECLARE_WW8IMPORT_TEST(testTdf110987, "tdf110987")
CPPUNIT_ASSERT(sFilterName != "MS Word 97 Vorlage");
}
+DECLARE_WW8IMPORT_TEST(testTdf120768_zOrder, "tdf120768_zOrder.doc")
+{
+ //The blue shape was covering everything (highest zorder = 2) instead of the lowest(0)
+ uno::Reference<drawing::XShape> xShape(getShapeByName(u"Picture 2"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty<sal_uInt32>(xShape, "ZOrder"));
+}
+
+
// tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/python/check_cross_references.py b/sw/qa/python/check_cross_references.py
index 6aad1c47ca3a..de51d919c7c8 100644
--- a/sw/qa/python/check_cross_references.py
+++ b/sw/qa/python/check_cross_references.py
@@ -16,17 +16,6 @@
the License at http://www.apache.org/licenses/LICENSE-2.0 .
'''
import unittest
-import unohelper
-import os
-from com.sun.star.lang import XMultiServiceFactory
-from com.sun.star.text import XTextDocument
-from com.sun.star.text import XTextField
-from com.sun.star.container import XEnumeration
-from com.sun.star.util import XRefreshable
-from com.sun.star.container import XEnumerationAccess
-from com.sun.star.beans import XPropertySet
-from com.sun.star.text import XTextFieldsSupplier
-from com.sun.star.container import XNamed
from com.sun.star.text.ReferenceFieldPart import (NUMBER, NUMBER_NO_CONTEXT, NUMBER_FULL_CONTEXT, TEXT)
from com.sun.star.text.ReferenceFieldSource import BOOKMARK
from org.libreoffice.unotest import UnoInProcess
diff --git a/sw/qa/python/check_indexed_property_values.py b/sw/qa/python/check_indexed_property_values.py
index ceaf82a6cac6..4179872cea4b 100644
--- a/sw/qa/python/check_indexed_property_values.py
+++ b/sw/qa/python/check_indexed_property_values.py
@@ -17,12 +17,9 @@
'''
import unittest
-import unohelper
import uno
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.beans import PropertyValue
-from com.sun.star.container import XIndexContainer
-from org.libreoffice.unotest import OfficeConnection
from com.sun.star.lang import IllegalArgumentException
from com.sun.star.lang import IndexOutOfBoundsException
diff --git a/sw/qa/python/check_named_property_values.py b/sw/qa/python/check_named_property_values.py
index 1a81d13a6323..d11ee2e46651 100644
--- a/sw/qa/python/check_named_property_values.py
+++ b/sw/qa/python/check_named_property_values.py
@@ -17,13 +17,9 @@
'''
import unittest
-import unohelper
-import os
import uno
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.beans import PropertyValue
-from com.sun.star.container import XNameContainer
-from org.libreoffice.unotest import OfficeConnection
from com.sun.star.container import ElementExistException
from com.sun.star.lang import IllegalArgumentException
from com.sun.star.container import NoSuchElementException
diff --git a/sw/qa/python/check_range_properties.py b/sw/qa/python/check_range_properties.py
index 2be93686242a..26babf5220ce 100644
--- a/sw/qa/python/check_range_properties.py
+++ b/sw/qa/python/check_range_properties.py
@@ -7,13 +7,8 @@
# 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/.
#
-import math
import unittest
from org.libreoffice.unotest import UnoInProcess
-from com.sun.star.container import NoSuchElementException
-from com.sun.star.beans import UnknownPropertyException
-from com.sun.star.lang import IndexOutOfBoundsException
-from com.sun.star.lang import IllegalArgumentException
class CheckRangeProperties(unittest.TestCase):
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index c2ae21cf9899..d19f9850b445 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -7,7 +7,6 @@
# 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/.
#
-import math
import unittest
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.container import NoSuchElementException
@@ -159,7 +158,7 @@ class CheckStyle(unittest.TestCase):
def test_NumberingFamily(self):
xDoc = CheckStyle._uno.openEmptyWriterDoc()
xNumberingStyles = xDoc.StyleFamilies["NumberingStyles"]
- vEmptyDocStyles = ['List 1', 'List 2', 'List 3', 'List 4', 'List 5', 'Numbering 123', 'Numbering ABC', 'Numbering abc', 'Numbering IVX', 'Numbering ivx']
+ vEmptyDocStyles = ['No List','List 1', 'List 2', 'List 3', 'List 4', 'List 5', 'Numbering 123', 'Numbering ABC', 'Numbering abc', 'Numbering IVX', 'Numbering ivx']
self.__test_StyleFamily(xNumberingStyles, vEmptyDocStyles, "SwXStyle")
self.__test_StyleFamilyIndex(xNumberingStyles, vEmptyDocStyles, "SwXStyle")
self.__test_StyleFamilyInsert(xDoc, xNumberingStyles, vEmptyDocStyles, "com.sun.star.style.NumberingStyle", "com.sun.star.style.CharacterStyle")
diff --git a/sw/qa/python/check_xautotextcontainer.py b/sw/qa/python/check_xautotextcontainer.py
index c460c3d0eaa6..b01125dca3f4 100644
--- a/sw/qa/python/check_xautotextcontainer.py
+++ b/sw/qa/python/check_xautotextcontainer.py
@@ -11,7 +11,6 @@ import unittest
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.container import NoSuchElementException
from com.sun.star.lang import IllegalArgumentException
-from com.sun.star.uno import RuntimeException
class XAutoTextContainer(unittest.TestCase):
# 0 indicates the path of the Office Basis layer
diff --git a/sw/qa/python/check_xautotextgroup.py b/sw/qa/python/check_xautotextgroup.py
index a41987103e6b..504f12dcd422 100644
--- a/sw/qa/python/check_xautotextgroup.py
+++ b/sw/qa/python/check_xautotextgroup.py
@@ -11,7 +11,6 @@ import unittest
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.container import ElementExistException
from com.sun.star.container import NoSuchElementException
-from com.sun.star.uno import RuntimeException
class XAutoTextGroup(unittest.TestCase):
diff --git a/sw/qa/python/check_xmodel.py b/sw/qa/python/check_xmodel.py
index 27740958ddb1..6487b4781be2 100644
--- a/sw/qa/python/check_xmodel.py
+++ b/sw/qa/python/check_xmodel.py
@@ -8,11 +8,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
-import unohelper
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.lang import IllegalArgumentException
from com.sun.star.beans import PropertyValue
-import uno
class TestXModel(unittest.TestCase):
diff --git a/sw/qa/python/text_portion_enumeration_test.py b/sw/qa/python/text_portion_enumeration_test.py
index c379138db303..47f7c21e5307 100644
--- a/sw/qa/python/text_portion_enumeration_test.py
+++ b/sw/qa/python/text_portion_enumeration_test.py
@@ -20,11 +20,11 @@ This file incorporates work covered by the following license notice:
import uno
import unittest
import os.path
-from org.libreoffice.unotest import UnoInProcess, mkPropertyValue
+from org.libreoffice.unotest import UnoInProcess
from tempfile import TemporaryDirectory
from com.sun.star.uno import RuntimeException
from com.sun.star.lang import IllegalArgumentException, NoSupportException
-from com.sun.star.beans import PropertyValue, StringPair
+from com.sun.star.beans import StringPair
from com.sun.star.rdf.URIs import ODF_PREFIX, ODF_SUFFIX
from com.sun.star.i18n.NumberFormatIndex import NUMBER_INT
from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK, HARD_HYPHEN
@@ -3282,9 +3282,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
if xComp:
self.checkloadmeta(xComp)
with TemporaryDirectory() as tempdir:
- if os.altsep: # we need URL so replace "\" with "/"
- tempdir = tempdir.replace(os.sep, os.altsep)
- file = tempdir + "/" + filename
+ file = os.path.join(tempdir, filename)
self.dostore(xComp, file)
self.close(xComp)
xComp2 = None
@@ -3354,9 +3352,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
if xComp:
self.checkloadxmlid(xComp)
with TemporaryDirectory() as tempdir:
- if os.altsep: # we need URL so replace "\" with "/"
- tempdir = tempdir.replace(os.sep, os.altsep)
- file = tempdir + "/" + filename
+ file = os.path.join(tempdir, filename)
self.dostore(xComp, file)
self.close(xComp)
xComp2 = None
diff --git a/sw/qa/python/xcontrolshape.py b/sw/qa/python/xcontrolshape.py
index 336a6d3449c0..899c0c20b863 100644
--- a/sw/qa/python/xcontrolshape.py
+++ b/sw/qa/python/xcontrolshape.py
@@ -8,10 +8,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
-import unohelper
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.beans import UnknownPropertyException
-import uno
class TestXControlShape(unittest.TestCase):
diff --git a/sw/qa/python/xstyleloader.py b/sw/qa/python/xstyleloader.py
index ed2d7ffca4a4..92b901b9d527 100644
--- a/sw/qa/python/xstyleloader.py
+++ b/sw/qa/python/xstyleloader.py
@@ -8,11 +8,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-import os
import pathlib
import unittest
-import unohelper
-import uno
from org.libreoffice.unotest import UnoInProcess, makeCopyFromTDOC
from com.sun.star.beans import PropertyValue
diff --git a/sw/qa/python/xtext.py b/sw/qa/python/xtext.py
index 6d82647bf6b4..db1f83803148 100644
--- a/sw/qa/python/xtext.py
+++ b/sw/qa/python/xtext.py
@@ -11,7 +11,6 @@
import unittest
from org.libreoffice.unotest import UnoInProcess
-from com.sun.star.lang import IllegalArgumentException
class TestXText(unittest.TestCase):
diff --git a/sw/qa/python/xtextcursor.py b/sw/qa/python/xtextcursor.py
index 30d0518690a7..2c374bee5870 100644
--- a/sw/qa/python/xtextcursor.py
+++ b/sw/qa/python/xtextcursor.py
@@ -8,10 +8,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
-import unohelper
from org.libreoffice.unotest import UnoInProcess
-import uno
-import time
class TestXTextCursor(unittest.TestCase):
diff --git a/sw/qa/python/xtextfieldssupplier.py b/sw/qa/python/xtextfieldssupplier.py
index f99b0fc85ab7..76004a095f26 100755
--- a/sw/qa/python/xtextfieldssupplier.py
+++ b/sw/qa/python/xtextfieldssupplier.py
@@ -8,10 +8,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
-import unohelper
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.container import NoSuchElementException
-import uno
class TestXTextFieldsSupplier(unittest.TestCase):
diff --git a/sw/qa/python/xtextrange.py b/sw/qa/python/xtextrange.py
index 75e4aed79561..583cabc30aba 100644
--- a/sw/qa/python/xtextrange.py
+++ b/sw/qa/python/xtextrange.py
@@ -8,10 +8,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
-import unohelper
from org.libreoffice.unotest import UnoInProcess
-import uno
-import time
class TestXTextRange(unittest.TestCase):
diff --git a/sw/qa/uibase/dochdl/dochdl.cxx b/sw/qa/uibase/dochdl/dochdl.cxx
index 88ad5f7545d0..2006022fc587 100644
--- a/sw/qa/uibase/dochdl/dochdl.cxx
+++ b/sw/qa/uibase/dochdl/dochdl.cxx
@@ -10,10 +10,14 @@
#include <swmodeltestbase.hxx>
#include <vcl/transfer.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
#include <docsh.hxx>
#include <swdtflvr.hxx>
#include <wrtsh.hxx>
+#include <view.hxx>
/// Covers sw/source/uibase/dochdl/ fixes.
class SwUibaseDochdlTest : public SwModelTestBase
@@ -33,7 +37,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testSelectPasteFormat)
// Decide what format to use when doing a Writer->Writer paste and both RTF and ODF is an
// available format.
- TransferableDataHelper aHelper(pTransfer.get());
+ TransferableDataHelper aHelper(pTransfer);
sal_uInt8 nAction = EXCHG_OUT_ACTION_INSERT_STRING;
SotClipboardFormatId nFormat = SotClipboardFormatId::RICHTEXT;
SwTransferable::SelectPasteFormat(aHelper, nAction, nFormat);
@@ -46,6 +50,30 @@ CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testSelectPasteFormat)
CPPUNIT_ASSERT_EQUAL(SotClipboardFormatId::EMBED_SOURCE, nFormat);
}
+CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testComplexSelection)
+{
+ // Given a document where a text node has hints, but no as-char images.
+ SwDoc* pDoc = createSwDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->Insert2("abc");
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
+ SfxItemSet aSet(pWrtShell->GetView().GetPool(),
+ svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{});
+ // Bold, italic, underline.
+ aSet.Put(SvxWeightItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT));
+ aSet.Put(SvxPostureItem(ITALIC_NORMAL, RES_CHRATR_POSTURE));
+ aSet.Put(SvxUnderlineItem(LINESTYLE_SINGLE, RES_CHRATR_UNDERLINE));
+ pWrtShell->SetAttrSet(aSet);
+ uno::Reference<datatransfer::XTransferable2> xTransfer = new SwTransferable(*pWrtShell);
+
+ // When checking if the selection is complex, then there should be no crash.
+ // Without the accompanying fix in place, this test would have crashed, because we read past the
+ // end of the hints array.
+ CPPUNIT_ASSERT(!xTransfer->isComplex());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index d267bda51a96..6334be3a553b 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -11,6 +11,8 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
+#include <com/sun/star/text/BibliographyDataType.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
@@ -21,6 +23,7 @@
#include <editeng/outlobj.hxx>
#include <editeng/editobj.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <IDocumentContentOperations.hxx>
#include <cmdid.h>
@@ -130,6 +133,43 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOleSavePreviewUpdate)
CPPUNIT_ASSERT(xNameAccess->hasByName("ObjectReplacements/Object 2"));
}
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyUrlContextMenu)
+{
+ // Given a document with a bibliography field:
+ SwDoc* pDoc = createSwDoc();
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xField(
+ xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aFields = {
+ comphelper::makePropertyValue("BibiliographicType", text::BibliographyDataType::WWW),
+ comphelper::makePropertyValue("Identifier", OUString("AT")),
+ comphelper::makePropertyValue("Author", OUString("Author")),
+ comphelper::makePropertyValue("Title", OUString("Title")),
+ comphelper::makePropertyValue("URL", OUString("http://www.example.com/test.pdf#page=1")),
+ };
+ xField->setPropertyValue("Fields", uno::makeAny(aFields));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+ uno::Reference<text::XTextContent> xContent(xField, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false);
+
+ // When selecting the field and opening the context menu:
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
+ SfxDispatcher* pDispatcher = pDocShell->GetViewShell()->GetViewFrame()->GetDispatcher();
+ css::uno::Any aState;
+ SfxItemState eState = pDispatcher->QueryState(SID_OPEN_HYPERLINK, aState);
+
+ // Then the "open hyperlink" menu item should be visible:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 32 (SfxItemState::DEFAULT)
+ // - Actual : 1 (SfxItemState::DISABLED)
+ // i.e. the menu item was not visible for biblio entry fields with an URL.
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, eState);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index 01dadbc80fee..f4b337d8f9d2 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -9,10 +9,18 @@
#include <swmodeltestbase.hxx>
+#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/text/XTextViewTextRangeSupplier.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <vcl/scheduler.hxx>
+#include <docsh.hxx>
+#include <edtwin.hxx>
+#include <unotextrange.hxx>
+#include <view.hxx>
+#include <wrtsh.hxx>
+
constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/uibase/uno/data/";
/// Covers sw/source/uibase/uno/ fixes.
@@ -47,6 +55,41 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testCondFieldCachedValue)
getParagraph(2, "1");
}
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testCreateTextRangeByPixelPosition)
+{
+ // Given a document with 2 characters, and the pixel position of the point between them:
+ SwDoc* pDoc = createSwDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->Insert2("AZ");
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
+ Point aLogic = pWrtShell->GetCharRect().Center();
+ SwView* pView = pDocShell->GetView();
+ SwEditWin& rEditWin = pView->GetEditWin();
+ Point aPixel = rEditWin.LogicToPixel(aLogic);
+
+ // When converting that pixel position to a document model position (text range):
+ uno::Reference<frame::XModel2> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xControllers = xModel->getControllers();
+ uno::Reference<text::XTextViewTextRangeSupplier> xController(xControllers->nextElement(),
+ uno::UNO_QUERY);
+ awt::Point aPoint(aPixel.getX(), aPixel.getY());
+ uno::Reference<text::XTextRange> xTextRange
+ = xController->createTextRangeByPixelPosition(aPoint);
+
+ // Then make sure that text range points after the first character:
+ auto pTextRange = dynamic_cast<SwXTextRange*>(xTextRange.get());
+ SwPaM aPaM(pDoc->GetNodes());
+ pTextRange->GetPositions(aPaM);
+ sal_Int32 nActual = aPaM.GetPoint()->nContent.GetIndex();
+ // Without the needed PixelToLogic() call in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : 0
+ // i.e. the returned text range pointed before the first character, not between the first and
+ // the second character.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nActual);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uitest/chapterNumbering/chapterNumbering.py b/sw/qa/uitest/chapterNumbering/chapterNumbering.py
index 67e82a40014f..b72e6b458ef2 100644
--- a/sw/qa/uitest/chapterNumbering/chapterNumbering.py
+++ b/sw/qa/uitest/chapterNumbering/chapterNumbering.py
@@ -6,10 +6,10 @@
#
from uitest.framework import UITestCase
-from uitest.debug import sleep
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
from uitest.uihelper.common import change_measurement_unit
#Outline Numbering is now Chapter Numbering
@@ -38,27 +38,17 @@ class WriterChapterNumbering(UITestCase):
xatmf = xDialog.getChild("atmf")
xindentatmf = xDialog.getChild("indentatmf")
select_pos(xtab, "0") #first tab
- props = {"TEXT": "Heading"}
- actionProps = mkPropertyValues(props)
- xstyle.executeAction("SELECT", actionProps)
- props2 = {"TEXT": "1, 2, 3, ..."}
- actionProps2 = mkPropertyValues(props2)
- xnumbering.executeAction("SELECT", actionProps2)
- props3 = {"TEXT": "Bullets"}
- actionProps3 = mkPropertyValues(props3)
- xcharstyle.executeAction("SELECT", actionProps3)
+ select_by_text(xstyle, "Heading")
+ select_by_text(xnumbering, "1, 2, 3, ...")
+ select_by_text(xcharstyle, "Bullets")
xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
xstartat.executeAction("UP", tuple())
select_pos(xtab, "1") #second tab Position
xalignedatmf.executeAction("UP", tuple())
- props4 = {"TEXT": "Centered"}
- actionProps4 = mkPropertyValues(props4)
- xnum2alignlb.executeAction("SELECT", actionProps4)
- props5 = {"TEXT": "Tab stop"}
- actionProps5 = mkPropertyValues(props5)
- xnumfollowedbylb.executeAction("SELECT", actionProps5)
+ select_by_text(xnum2alignlb, "Centered")
+ select_by_text(xnumfollowedbylb, "Tab stop")
xatmf.executeAction("UP", tuple())
xindentatmf.executeAction("UP", tuple())
diff --git a/sw/qa/uitest/chapterNumbering/tdf123547.py b/sw/qa/uitest/chapterNumbering/tdf123547.py
index 5e0698f8bd1e..4b2cdf0a5f06 100644
--- a/sw/qa/uitest/chapterNumbering/tdf123547.py
+++ b/sw/qa/uitest/chapterNumbering/tdf123547.py
@@ -5,9 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
-from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_url_for_data_file
from uitest.uihelper.common import select_pos
#Bug 123547 - Systematic crash after opening Tools > Chapter Numbering
diff --git a/sw/qa/uitest/chapterNumbering/tdf140528.py b/sw/qa/uitest/chapterNumbering/tdf140528.py
new file mode 100644
index 000000000000..9b60ad9991a0
--- /dev/null
+++ b/sw/qa/uitest/chapterNumbering/tdf140528.py
@@ -0,0 +1,60 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+
+class Tdf140528(UITestCase):
+
+ def test_tdf140528(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+
+ self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xTab = xDialog.getChild("tabcontrol")
+ select_pos(xTab, "0")
+
+ xFormat = xDialog.getChild("format")
+
+ def handle_format_dlg(dialog):
+ xEntry = dialog.getChild("entry")
+ self.assertEqual("Untitled 1", get_state_as_dict(xEntry)['Text'])
+
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"TEXT" : "newFormat"}))
+
+ xOKBtn = dialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.execute_blocking_action(xFormat.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "10"})),
+ dialog_handler=handle_format_dlg)
+
+ self.assertEqual("saveas", get_state_as_dict(xFormat)['CurrentItem'])
+
+ # Go to Position tab
+ select_pos(xTab, "1")
+
+ # Go back to Numbering tab
+ select_pos(xTab, "0")
+
+ xFormat.executeAction('OPENFROMLIST', mkPropertyValues({"POS": "0"}))
+ self.assertEqual("form1", get_state_as_dict(xFormat)['CurrentItem'])
+
+ # Without the fix in place, this test would have crashed here
+ select_pos(xTab, "1")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/classification/classification.py b/sw/qa/uitest/classification/classification.py
index 181c00417397..72f7dd16bb8a 100644
--- a/sw/qa/uitest/classification/classification.py
+++ b/sw/qa/uitest/classification/classification.py
@@ -6,9 +6,7 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
+from uitest.uihelper.common import select_by_text
from libreoffice.uno.propertyvalue import mkPropertyValues
#TSCP: add advanced classification dialog https://cgit.freedesktop.org/libreoffice/core/commit/?id=71ee09947d5a71105d64fd225bb3672dfa7ce834
@@ -52,9 +50,7 @@ class classification(UITestCase):
intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
- props = {"TEXT": "Confidential"}
- actionProps = mkPropertyValues(props)
- classificationCB.executeAction("SELECT", actionProps)
+ select_by_text(classificationCB, "Confidential")
#verify International is set too
self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
#verify textBox Content
@@ -96,9 +92,7 @@ class classification(UITestCase):
intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
- props = {"TEXT": "Confidential"}
- actionProps = mkPropertyValues(props)
- classificationCB.executeAction("SELECT", actionProps)
+ select_by_text(classificationCB, "Confidential")
#verify International is set too
self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
#verify textBox Content TODO textbox not supported
@@ -128,9 +122,7 @@ class classification(UITestCase):
intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
- props = {"TEXT": "Confidential"}
- actionProps = mkPropertyValues(props)
- classificationCB.executeAction("SELECT", actionProps)
+ select_by_text(classificationCB, "Confidential")
#verify International is set too
self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
#verify textBox Content TODO - texbox not supported yet
@@ -163,9 +155,7 @@ class classification(UITestCase):
#type text AA
intellectualPropertyPartEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"AA"}))
intellectualPropertyPartAddButton.executeAction("CLICK", tuple())
- props = {"TEXT": "Internal Only"}
- actionProps = mkPropertyValues(props)
- classificationCB.executeAction("SELECT", actionProps)
+ select_by_text(classificationCB, "Internal Only")
#verify International is set too
self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Internal Only")
#verify textBox Content TODO - texbox not supported yet
diff --git a/sw/qa/uitest/data/TestHiddenHeadersFooters.docx b/sw/qa/uitest/data/TestHiddenHeadersFooters.docx
new file mode 100644
index 000000000000..f33482a93ba1
--- /dev/null
+++ b/sw/qa/uitest/data/TestHiddenHeadersFooters.docx
Binary files differ
diff --git a/sw/qa/uitest/data/metadata.odt b/sw/qa/uitest/data/metadata.odt
new file mode 100644
index 000000000000..1566f4ae1d73
--- /dev/null
+++ b/sw/qa/uitest/data/metadata.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf104795.odt b/sw/qa/uitest/data/tdf104795.odt
new file mode 100644
index 000000000000..4b359cdf554d
--- /dev/null
+++ b/sw/qa/uitest/data/tdf104795.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf122780.docx b/sw/qa/uitest/data/tdf122780.docx
new file mode 100644
index 000000000000..eca63620d357
--- /dev/null
+++ b/sw/qa/uitest/data/tdf122780.docx
Binary files differ
diff --git a/sw/qa/uitest/data/tdf127166_prstDash_Word97.docx b/sw/qa/uitest/data/tdf127166_prstDash_Word97.docx
new file mode 100644
index 000000000000..b89f52fdc5b5
--- /dev/null
+++ b/sw/qa/uitest/data/tdf127166_prstDash_Word97.docx
Binary files differ
diff --git a/sw/qa/uitest/data/tdf137803.odt b/sw/qa/uitest/data/tdf137803.odt
new file mode 100644
index 000000000000..8f2f7d5dc49b
--- /dev/null
+++ b/sw/qa/uitest/data/tdf137803.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf138271.odt b/sw/qa/uitest/data/tdf138271.odt
new file mode 100644
index 000000000000..ea09b5577b57
--- /dev/null
+++ b/sw/qa/uitest/data/tdf138271.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf140117.fodt b/sw/qa/uitest/data/tdf140117.fodt
new file mode 100644
index 000000000000..8487346d1d5c
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140117.fodt
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ooo="http://openoffice.org/2004/office" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" style:contextual-spacing="false" fo:keep-with-next="always"/>
+ <style:text-properties style:font-name="Liberation Sans" fo:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="Microsoft YaHei" style:font-family-asian="&apos;Microsoft YaHei&apos;" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="Lucida Sans" style:font-family-complex="&apos;Lucida Sans&apos;" style:font-family-generic-complex="system" style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
+ </style:style>
+ <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.247cm" style:contextual-spacing="false" fo:line-height="115%"/>
+ </style:style>
+ <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
+ <style:text-properties style:font-size-asian="12pt" style:font-name-complex="Lucida Sans1" style:font-family-complex="&apos;Lucida Sans&apos;" style:font-family-generic-complex="swiss"/>
+ </style:style>
+ <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" style:contextual-spacing="false" text:number-lines="false" text:line-number="0"/>
+ <style:text-properties fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-name-complex="Lucida Sans1" style:font-family-complex="&apos;Lucida Sans&apos;" style:font-family-generic-complex="swiss" style:font-size-complex="12pt" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+ <style:text-properties style:font-size-asian="12pt" style:font-name-complex="Lucida Sans1" style:font-family-complex="&apos;Lucida Sans&apos;" style:font-family-generic-complex="swiss"/>
+ </style:style>
+ <style:style style:name="Header_20_and_20_Footer" style:display-name="Header and Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0">
+ <style:tab-stops>
+ <style:tab-stop style:position="8.5cm" style:type="center"/>
+ <style:tab-stop style:position="17cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Header" style:family="paragraph" style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0">
+ <style:tab-stops>
+ <style:tab-stop style:position="8.5cm" style:type="center"/>
+ <style:tab-stop style:position="17cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Header">
+ <style:text-properties officeooo:rsid="0021d80c" officeooo:paragraph-rsid="0021d80c"/>
+ </style:style>
+ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:break-before="page"/>
+ <style:text-properties officeooo:rsid="001a8fea" officeooo:paragraph-rsid="001a8fea"/>
+ </style:style>
+ <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard">
+ <style:text-properties fo:font-size="18pt" officeooo:rsid="0021d80c" officeooo:paragraph-rsid="0021d80c" style:font-size-asian="15.75pt" style:font-size-complex="18pt"/>
+ </style:style>
+ <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Header">
+ <style:text-properties officeooo:rsid="0021d80c" officeooo:paragraph-rsid="0021d80c"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm" fo:background-color="transparent" style:dynamic-spacing="false" draw:fill="none" draw:fill-color="#729fcf"/>
+ </style:header-style>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ <style:header>
+ <text:p text:style-name="P1">right</text:p>
+ </style:header>
+ <style:header-left>
+ <text:p text:style-name="P1">left</text:p>
+ </style:header-left>
+ <style:header-first>
+ <text:p text:style-name="P1">first</text:p>
+ </style:header-first>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text text:use-soft-page-breaks="true">
+ <text:p text:style-name="P3">a</text:p>
+ <text:p text:style-name="P2"/>
+ <text:p text:style-name="P2"/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/uitest/data/tdf140198.odt b/sw/qa/uitest/data/tdf140198.odt
new file mode 100644
index 000000000000..087466b8155a
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140198.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf140239.odt b/sw/qa/uitest/data/tdf140239.odt
new file mode 100644
index 000000000000..53d2537e900c
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140239.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf140486.odt b/sw/qa/uitest/data/tdf140486.odt
new file mode 100644
index 000000000000..cc5bf277ee97
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140486.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf140661.odt b/sw/qa/uitest/data/tdf140661.odt
new file mode 100644
index 000000000000..4cc57724e2d3
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140661.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf40427_SectionPositions.odt b/sw/qa/uitest/data/tdf40427_SectionPositions.odt
new file mode 100644
index 000000000000..67d30d0ccfee
--- /dev/null
+++ b/sw/qa/uitest/data/tdf40427_SectionPositions.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf46561.odt b/sw/qa/uitest/data/tdf46561.odt
new file mode 100644
index 000000000000..c9f9942521d0
--- /dev/null
+++ b/sw/qa/uitest/data/tdf46561.odt
Binary files differ
diff --git a/sw/qa/uitest/data/tdf49683.rtf b/sw/qa/uitest/data/tdf49683.rtf
deleted file mode 100644
index 6dd4739e7460..000000000000
--- a/sw/qa/uitest/data/tdf49683.rtf
+++ /dev/null
@@ -1,81 +0,0 @@
-{\rtf1\ansi\deff4\adeflang1025
-{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset128 Times New Roman;}{\f4\fswiss\fprq0\fcharset0 Arial;}{\f5\fswiss\fprq2\fcharset128 Arial Narrow;}{\f6\froman\fprq2\fcharset0 Garamond;}{\f7\fnil\fprq2\fcharset128 WenQuanYi Zen Hei;}{\f8\fswiss\fprq2\fcharset0 Lucida Sans Unicode;}{\f9\fnil\fprq2\fcharset0 MS Mincho;}{\f10\fnil\fprq2\fcharset128 Lohit Hindi;}{\f11\fnil\fprq0\fcharset128 Lohit Hindi;}}
-{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
-{\stylesheet{\s0\snext0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043 Standaard;}
-{\s15\sbasedon0\snext16\aspalpha\sb240\sa120\keepn\hich\af7\langfe255\dbch\af10\afs28\loch\f5\fs28\lang1043 Kop;}
-{\s16\sbasedon0\snext16\aspalpha\sb0\sa120\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Tekstblok;}
-{\s17\sbasedon16\snext17\aspalpha\sb0\sa120\hich\af8\langfe255\dbch\af4\afs24\loch\f4\fs24\lang1043 Lijst;}
-{\s18\sbasedon0\snext18\aspalpha\sb120\sa120\noline\i\hich\af8\langfe255\dbch\af11\afs24\ai\loch\f6\fs24\lang1043 Bijschrift;}
-{\s19\sbasedon0\snext19\aspalpha\hich\af8\langfe255\dbch\af4\afs24\loch\f4\fs24\lang1043 Index;}
-{\s20\sbasedon0\snext16\aspalpha\sb240\sa120\keepn\hich\af9\langfe255\dbch\af2\afs28\loch\f2\fs28\lang1043 Heading;}
-{\s21\sbasedon0\snext21\aspalpha\sb120\sa120\i\hich\af8\langfe255\dbch\af4\afs24\ai\loch\f4\fs24\lang1043 caption;}
-{\s22\sbasedon0\snext16\aspalpha\sb240\sa120\keepn\hich\af9\langfe255\dbch\af2\afs28\loch\f2\fs28\lang1043 WW-Heading;}
-{\s23\sbasedon0\snext23\aspalpha\sb120\sa120\i\hich\af8\langfe255\dbch\af4\afs24\ai\loch\f4\fs24\lang1043 WW-caption;}
-{\s24\sbasedon0\snext24\tqc\tx4818\tqr\tx9637\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 header;}
-{\s25\sbasedon0\snext25\qr\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043 _GegegRiagg;}
-{\s26\sbasedon0\snext26\tqc\tx4320\tqr\tx8640\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 WW-header;}
-{\s27\sbasedon0\snext27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043 _GegegDoc;}
-{\s28\sbasedon0\snext28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Table Contents;}
-{\s29\sbasedon0\snext29\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 WW-Table Contents;}
-{\s30\sbasedon27\snext30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043 _GegegVast11;}
-{\s31\sbasedon30\snext31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043 _GegegVast11Vet;}
-{\s32\sbasedon29\snext32\qc\aspalpha\b\hich\af8\langfe255\dbch\af6\afs24\ab\loch\f6\fs24\lang1043 Table Heading;}
-{\s33\sbasedon0\snext33\tqc\tx4320\tqr\tx8640\aspalpha\noline\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Koptekst;}
-{\s34\sbasedon0\snext34\aspalpha\noline\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Inhoud tabel;}
-{\s35\sbasedon34\snext35\qc\aspalpha\noline\b\hich\af8\langfe255\dbch\af6\afs24\ab\loch\f6\fs24\lang1043 Tabelkop;}
-}{\info{\keywords bhavb}{\author Cor Nouws}{\creatim\yr2009\mo10\dy20\hr14\min33}{\revtim\yr2009\mo10\dy20\hr14\min47}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice 3.4.5}{\vern3400}}\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709
-
-{\*\pgdsctbl
-{\pgdsc0\pgdscuse195\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\headery709\margbsxn1134{\header\trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\i0\b0\rtlch \ltrch\loch
-Kenmerk:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\rtlch \ltrch\loch
-}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl{\rtlch \ltrch\loch
-*BriefReferentie*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043{\afs4\rtlch \ltrch\loch\fs4
-}
-\par }\pgdscnxt0 Standard;}
-{\pgdsc1\pgdscuse195\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\margbsxn1134\pgdscnxt0 First Page;}
-{\pgdsc2\pgdscuse195\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\margbsxn1134\pgdscnxt0 First Page;}
-{\pgdsc3\pgdscuse195\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\margbsxn1134\pgdscnxt0 Eerste pagina;}}
-\formshade{\*\pgdscno3}\paperh16838\paperw11906\margl1417\margr1417\margt1247\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\headery709\margbsxn1134{\header\trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\i0\b0\rtlch \ltrch\loch
-Kenmerk:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\rtlch \ltrch\loch
-}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl{\rtlch \ltrch\loch
-*BriefReferentie*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043{\afs4\rtlch \ltrch\loch\fs4
-}
-\par }\titlepg\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
-\trowd\trql\trleft0\ltrrow\trrh2098\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx4748\cellx9072\pgndec\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s25\qr\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\row\pard\trowd\trql\trleft0\ltrrow\trrh1191\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx4748\cellx9072\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-*HuisartsNaam*}
-\par \pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-*HuisartsAdres*}
-\par \pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-*HuisartsPostcode* *HuisartsPlaats*}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\row\pard\trowd\trql\trleft0\ltrrow\trrh624\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx4748\cellx9072\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-*ClientPostcode* *ClientPlaats*}\cell\pard\plain \s25\qr\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-*ClientAfdelingPlaatsLower*, *BriefDatum*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch
-}
-\par \trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-Betreft:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\b\ab\rtlch \ltrch\loch
-}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch
-}
-\par \trowd\trql\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx1245\cellx1365\cellx9072\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\row\pard\trowd\trql\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx1245\cellx1365\cellx9072\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\row\pard\trowd\trql\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx1245\cellx1365\cellx9072\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch
-}
-\par \trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-Kenmerk:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch
-*BriefReferentie*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch
-}
-\par \pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch
-}
-\par \pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch
-}
-\par } \ No newline at end of file
diff --git a/sw/qa/uitest/findBar/findbar.py b/sw/qa/uitest/findBar/findbar.py
index df973dc8e162..75bfbb33abd9 100644
--- a/sw/qa/uitest/findBar/findbar.py
+++ b/sw/qa/uitest/findBar/findbar.py
@@ -8,10 +8,8 @@
#
from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
#test Find Bar
class FindBar(UITestCase):
@@ -43,28 +41,28 @@ class FindBar(UITestCase):
self.assertEqual(get_state_as_dict(xfind_bar)["ItemCount"], "14")
# Press on FindAll in the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "5"})) # 5 is FindAll id
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "5")
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "5") # 5 is FindAll id for Pos 4
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find All")
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:FindAll")
self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "LibreLibreLibre")
# Press on Find Next in the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"})) # 4 is Find Next id
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"})) # 3 is Find Next pos
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "4")
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Next")
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:DownSearch")
self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre")
# Press on Find Previous in the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"})) # 3 is Find Previous id
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "2"})) # 2 is Find Previous pos
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "3")
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Previous")
self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:UpSearch")
self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre")
# Close the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "1"})) # 1 is for close
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 0 is pos for close
self.ui_test.close_doc()
diff --git a/sw/qa/uitest/findBar/tdf136941.py b/sw/qa/uitest/findBar/tdf136941.py
index a96964a2fb79..ab94449aefed 100644
--- a/sw/qa/uitest/findBar/tdf136941.py
+++ b/sw/qa/uitest/findBar/tdf136941.py
@@ -28,10 +28,10 @@ class tdf136941(UITestCase):
xfind_bar = xWriterDoc.getChild("FindBar")
# Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
# Close button
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "1"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"}))
# Check the toolbar is closed
self.assertTrue("find" not in xWriterDoc.getChildren())
@@ -49,10 +49,10 @@ class tdf136941(UITestCase):
xfind_bar = xWriterDoc.getChild("FindBar")
# Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
# Close button
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "1"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"}))
# Check the toolbar is closed
self.assertTrue("find" not in xWriterDoc.getChildren())
diff --git a/sw/qa/uitest/findBar/tdf138232.py b/sw/qa/uitest/findBar/tdf138232.py
index 037296c8d0d6..93f859bc7521 100644
--- a/sw/qa/uitest/findBar/tdf138232.py
+++ b/sw/qa/uitest/findBar/tdf138232.py
@@ -29,7 +29,7 @@ class tdf138232(UITestCase):
xfind_bar = xWriterDoc.getChild("FindBar")
# Click on Find All
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "5"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
self.assertEqual("HelloHello", get_state_as_dict(xWriterEdit)['SelectedText'])
@@ -39,7 +39,7 @@ class tdf138232(UITestCase):
# AssertionError: 'HelloWorld' != 'World'
self.assertEqual("HelloWorld", get_state_as_dict(xfind)['Text'])
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "5"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
self.assertEqual("", get_state_as_dict(xWriterEdit)['SelectedText'])
diff --git a/sw/qa/uitest/findBar/tdf88608.py b/sw/qa/uitest/findBar/tdf88608.py
index 463968dc4daa..b3576ec7587e 100644
--- a/sw/qa/uitest/findBar/tdf88608.py
+++ b/sw/qa/uitest/findBar/tdf88608.py
@@ -29,7 +29,7 @@ class tdf88608(UITestCase):
self.assertEqual('', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
# Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
self.assertEqual('Search key not found', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
@@ -44,7 +44,7 @@ class tdf88608(UITestCase):
self.assertEqual('', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
# Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
self.assertEqual('Reached the end of the document', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py
index 9ce377f38292..46e00135553e 100644
--- a/sw/qa/uitest/findReplace/findReplace.py
+++ b/sw/qa/uitest/findReplace/findReplace.py
@@ -6,8 +6,6 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
@@ -79,7 +77,6 @@ class findReplace(UITestCase):
select_pos(xTabs, "0")
xSizeFont = dialog.getChild("westsizelb-cjk")
xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFont.executeAction("BACKSPACE", tuple())
xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"16"})) #set font size 16
xOkBtn = dialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOkBtn)
diff --git a/sw/qa/uitest/findReplace/tdf106099.py b/sw/qa/uitest/findReplace/tdf106099.py
index 085bba6e694a..2e8011dab36a 100644
--- a/sw/qa/uitest/findReplace/tdf106099.py
+++ b/sw/qa/uitest/findReplace/tdf106099.py
@@ -5,13 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
+from uitest.uihelper.common import select_by_text
+from uitest.uihelper.common import get_state_as_dict
#Bug 106099 - Find and replace by format, font color added by force
@@ -30,9 +26,7 @@ class tdf106099(UITestCase):
xTabs = dialog.getChild("tabcontrol")
select_pos(xTabs, "1") #tab font effects
underlinelb = dialog.getChild("underlinelb")
- props = {"TEXT": "Single"}
- actionProps = mkPropertyValues(props)
- underlinelb.executeAction("SELECT", actionProps)
+ select_by_text(underlinelb, "Single")
xOkBtn = dialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOkBtn)
diff --git a/sw/qa/uitest/findReplace/tdf118208.py b/sw/qa/uitest/findReplace/tdf118208.py
index 3e2b4373221f..c602158b17a4 100644
--- a/sw/qa/uitest/findReplace/tdf118208.py
+++ b/sw/qa/uitest/findReplace/tdf118208.py
@@ -5,11 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
#Find and replace
#tdf118208/118212 - enabling either CJK or CTL, or both (Tools -> Options -> Language Settings -> Languages: Default Languages for Documents checkboxes)
diff --git a/sw/qa/uitest/findReplace/tdf119462.py b/sw/qa/uitest/findReplace/tdf119462.py
index e87cd8e7b856..8623873cbd02 100644
--- a/sw/qa/uitest/findReplace/tdf119462.py
+++ b/sw/qa/uitest/findReplace/tdf119462.py
@@ -5,13 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
+from uitest.uihelper.common import get_state_as_dict
#Bug 119462 - Find with formatting adds 0pt text size
diff --git a/sw/qa/uitest/findSimilarity/findSimilarity.py b/sw/qa/uitest/findSimilarity/findSimilarity.py
index cb62e5528c4f..ea8929983f80 100644
--- a/sw/qa/uitest/findSimilarity/findSimilarity.py
+++ b/sw/qa/uitest/findSimilarity/findSimilarity.py
@@ -5,11 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
#Find similarities
diff --git a/sw/qa/uitest/librelogo/compile.py b/sw/qa/uitest/librelogo/compile.py
index 89e538b8c926..1fb90e955f31 100644
--- a/sw/qa/uitest/librelogo/compile.py
+++ b/sw/qa/uitest/librelogo/compile.py
@@ -5,13 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import time, re
-from uitest.debug import sleep
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import select_pos
+import re
class LibreLogoCompileTest(UITestCase):
LIBRELOGO_PATH = "vnd.sun.star.script:LibreLogo|LibreLogo.py$%s?language=Python&location=share"
diff --git a/sw/qa/uitest/librelogo/run.py b/sw/qa/uitest/librelogo/run.py
index 7b243f00b952..26b8f5c7df44 100644
--- a/sw/qa/uitest/librelogo/run.py
+++ b/sw/qa/uitest/librelogo/run.py
@@ -5,13 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-
-import time
-from uitest.debug import sleep
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import type_text
class LibreLogoTest(UITestCase):
LIBRELOGO_PATH = "vnd.sun.star.script:LibreLogo|LibreLogo.py$%s?language=Python&location=share"
diff --git a/sw/qa/uitest/macro_tests/tdf124413.py b/sw/qa/uitest/macro_tests/tdf124413.py
index a8ab676b77d3..d0aaccd03929 100644
--- a/sw/qa/uitest/macro_tests/tdf124413.py
+++ b/sw/qa/uitest/macro_tests/tdf124413.py
@@ -40,4 +40,6 @@ class tdf124413(UITestCase):
self.assertEqual(get_state_as_dict(xEditWin)['Text'], resultText)
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/macro_tests/tdf64690.py b/sw/qa/uitest/macro_tests/tdf64690.py
new file mode 100644
index 000000000000..7039e48df83a
--- /dev/null
+++ b/sw/qa/uitest/macro_tests/tdf64690.py
@@ -0,0 +1,79 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf64690(UITestCase):
+
+ def test_tdf64690(self):
+
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xEditBtn = xDialog.getChild("edit")
+ xEditBtn.executeAction("CLICK", tuple())
+
+ xMacroWin = self.xUITest.getTopFocusWindow()
+ xEditWin = xMacroWin.getChild('EditorWindow')
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+ xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+
+ self.assertEqual("\n", get_state_as_dict(xEditWin)['Text'])
+
+ xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"'abc"}))
+ xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"'def"}))
+
+ self.assertEqual("'abc\n'def\n", get_state_as_dict(xEditWin)['Text'])
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"ABC"}))
+
+ regexp = xDialog.getChild("regexp")
+ if get_state_as_dict(regexp)['Selected'] == 'false':
+ regexp.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
+
+ selection = xDialog.getChild("selection")
+ if get_state_as_dict(selection)['Selected'] == 'false':
+ selection.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(selection)['Selected'])
+
+ def handle_confirmation_dlg(dialog):
+ xOKBtn = dialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ replaceall = xDialog.getChild("replaceall")
+
+ # Without the fix in place, this test would have hung here
+ self.ui_test.execute_blocking_action(replaceall.executeAction, args=('CLICK', ()),
+ dialog_handler=handle_confirmation_dlg)
+
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
+
+ self.assertEqual("ABCABCABCABC\nABCABCABCABC\n", get_state_as_dict(xEditWin)['Text'])
+
+ self.ui_test.close_doc()
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/navigator/tdf114724.py b/sw/qa/uitest/navigator/tdf114724.py
index a84bab60da60..fc220f530202 100644
--- a/sw/qa/uitest/navigator/tdf114724.py
+++ b/sw/qa/uitest/navigator/tdf114724.py
@@ -1,3 +1,6 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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
@@ -17,27 +20,32 @@ class tdf114724(UITestCase):
self.xUITest.executeCommand(".uno:Sidebar")
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
- xNavigatorPanel.executeAction("ROOT", tuple())
+ xNavigatorPanel = xWriterEdit.getChild("NavigatorPanel")
+ xToolBar = xNavigatorPanel.getChild("content5")
+ xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'root' button
xWriterEdit.executeAction("FOCUS", tuple())
- self.ui_test.wait_until_property_is_updated(xNavigatorPanel, "selectedtext", "HEADING 1")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectedtext"], "HEADING 1")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+
+ self.ui_test.wait_until_property_is_updated(xContentTree, "SelectEntryText", "HEADING 1")
+ self.assertEqual(get_state_as_dict(xContentTree)["SelectEntryText"], "HEADING 1")
+ self.assertEqual(get_state_as_dict(xContentTree)["SelectionCount"], "1")
for _ in range(0,3):
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- self.ui_test.wait_until_property_is_updated(xNavigatorPanel, "selectedtext", "HEADING 4")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectedtext"], "HEADING 4")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
+ self.ui_test.wait_until_property_is_updated(xContentTree, "SelectEntryText", "HEADING 4")
+ self.assertEqual(get_state_as_dict(xContentTree)["SelectEntryText"], "HEADING 4")
+ self.assertEqual(get_state_as_dict(xContentTree)["SelectionCount"], "1")
for _ in range(0,3):
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.wait_until_property_is_updated(xNavigatorPanel, "selectedtext", "HEADING 1")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectedtext"], "HEADING 1")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
+ self.ui_test.wait_until_property_is_updated(xContentTree, "SelectEntryText", "HEADING 1")
+ self.assertEqual(get_state_as_dict(xContentTree)["SelectEntryText"], "HEADING 1")
+ self.assertEqual(get_state_as_dict(xContentTree)["SelectionCount"], "1")
self.xUITest.executeCommand(".uno:Sidebar")
self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/navigator/tdf137274.py b/sw/qa/uitest/navigator/tdf137274.py
index f1e153992e2d..36f25f4c2d7a 100644
--- a/sw/qa/uitest/navigator/tdf137274.py
+++ b/sw/qa/uitest/navigator/tdf137274.py
@@ -24,16 +24,14 @@ class tdf137274(UITestCase):
self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
# wait until the comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment1')
+ self.ui_test.wait_until_child_is_available('Comment1')
self.xUITest.executeCommand(".uno:Sidebar")
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
# wait until the navigator panel is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'NavigatorPanelParent')
-
- xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
xContentTree = xNavigatorPanel.getChild("contenttree")
xComments = xContentTree.getChild('10')
@@ -50,7 +48,7 @@ class tdf137274(UITestCase):
self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
# wait until the second comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment2')
+ self.ui_test.wait_until_child_is_available('Comment2')
xComments.executeAction("EXPAND", tuple())
diff --git a/sw/qa/uitest/navigator/tdf140257.py b/sw/qa/uitest/navigator/tdf140257.py
new file mode 100644
index 000000000000..9c923bedee4d
--- /dev/null
+++ b/sw/qa/uitest/navigator/tdf140257.py
@@ -0,0 +1,115 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
+
+class Tdf140257(UITestCase):
+
+ def change_outline_level(self, sText):
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
+
+ select_by_text(xOutline, sText)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ def test_tdf140257(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
+
+ self.change_outline_level("Level 1")
+
+ for i in range(4):
+ type_text(xWriterEdit, 'P' + str(i + 1))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+
+ type_text(xWriterEdit, 'P5')
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xHeadings = xContentTree.getChild('0')
+ self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
+
+ xHeadings.executeAction("EXPAND", tuple())
+
+ self.assertEqual(5, len(xHeadings.getChildren()))
+
+ for i in range(5):
+ self.assertEqual('P' + str(i + 1), get_state_as_dict(xHeadings.getChild(str(i)))['Text'])
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ document = self.ui_test.get_component()
+ cursor = document.getCurrentController().getViewCursor()
+
+ # Use Adding Selection
+ selectionProperty = mkPropertyValues({"SelectionMode": 2})
+ self.xUITest.executeCommandWithParameters(".uno:SelectionMode", selectionProperty)
+
+ # Go to P2 and select it
+ cursor.goUp(3, False)
+ cursor.gotoStartOfLine(False)
+ cursor.gotoEndOfLine(True)
+
+ # Go to P4 and select it
+ cursor.goDown(2, False)
+ cursor.gotoStartOfLine(False)
+ cursor.gotoEndOfLine(True)
+
+ self.change_outline_level("Level 2")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xHeadings = xContentTree.getChild('0')
+ self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
+
+ xHeadings.executeAction("EXPAND", tuple())
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 3 != 4
+ self.assertEqual(3, len(xHeadings.getChildren()))
+ xChild1 = xHeadings.getChild('0')
+ self.assertEqual('P1', get_state_as_dict(xChild1)['Text'])
+ xChild1.executeAction("EXPAND", tuple())
+ self.assertEqual(1, len(xChild1.getChildren()))
+ self.assertEqual('P2', get_state_as_dict(xChild1.getChild('0'))['Text'])
+
+ xChild2 = xHeadings.getChild('1')
+ self.assertEqual('P3', get_state_as_dict(xChild2)['Text'])
+ xChild2.executeAction("EXPAND", tuple())
+ self.assertEqual(1, len(xChild2.getChildren()))
+ self.assertEqual('P4', get_state_as_dict(xChild2.getChild('0'))['Text'])
+
+ self.assertEqual('P5', get_state_as_dict(xHeadings.getChild('2'))['Text'])
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/navigator/tdf140661.py b/sw/qa/uitest/navigator/tdf140661.py
new file mode 100644
index 000000000000..3991105ee78b
--- /dev/null
+++ b/sw/qa/uitest/navigator/tdf140661.py
@@ -0,0 +1,61 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class tdf140661(UITestCase):
+
+ def launch_navigator(self, bIsBeforeUngroup):
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xDrawings = xContentTree.getChild('11')
+ self.assertEqual('Drawing objects', get_state_as_dict(xDrawings)['Text'])
+
+ xDrawings.executeAction("EXPAND", tuple())
+
+ if bIsBeforeUngroup:
+ self.assertEqual(1, len(xDrawings.getChildren()))
+ self.assertEqual('DrawObject1', get_state_as_dict(xDrawings.getChild('0'))['Text'])
+ else:
+ self.assertEqual(12, len(xDrawings.getChildren()))
+ for i in range(12):
+ self.assertEqual('Shape' + str(i + 1), get_state_as_dict(xDrawings.getChild(str(i)))['Text'])
+
+ xDrawings.executeAction("COLLAPSE", tuple())
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ def test_tdf140661(self):
+
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf140661.odt"))
+
+ self.launch_navigator(True)
+
+ # Select the shape and ungroup it
+ self.xUITest.executeCommand(".uno:JumpToNextFrame")
+
+ self.ui_test.wait_until_child_is_available('metricfield')
+
+ self.xUITest.executeCommand(".uno:FormatUngroup")
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 12 != 0
+ self.launch_navigator(False)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/navigator/tdf40427.py b/sw/qa/uitest/navigator/tdf40427.py
new file mode 100644
index 000000000000..9b125ff941ec
--- /dev/null
+++ b/sw/qa/uitest/navigator/tdf40427.py
@@ -0,0 +1,81 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class tdf40427(UITestCase):
+
+ def test_tdf40427(self):
+ self.ui_test.load_file(get_url_for_data_file("tdf40427_SectionPositions.odt"))
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
+
+ self.assertEqual(2, self.ui_test.get_component().CurrentController.PageCount)
+
+ # Make sure that the view is 2 pages side-by-side - look at dialog View-Zoom-Zoom
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ columnssb = xDialog.getChild("columnssb")
+ columns = xDialog.getChild("columns")
+ bookmode = xDialog.getChild("bookmode")
+ self.assertEqual("true", get_state_as_dict(columns)["Checked"])
+ self.assertEqual("2", get_state_as_dict(columnssb)["Text"])
+ self.assertEqual("false", get_state_as_dict(bookmode)["Selected"])
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # In this view, the sections "SectionB" and "SectionC" on second page are positioned on screen
+ # higher than "SectionY" and "SectionA" respectively; there are nested and anchored sections.
+ # Make sure that order in Navigator follows their relative position in document, not vertical
+ # position on screen, nor sorted alphabetically. Sections in flying frames are sorted by their
+ # anchor position in the document.
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xSections = xContentTree.getChild('6')
+ self.assertEqual('Sections', get_state_as_dict(xSections)['Text'])
+ xSections.executeAction("EXPAND", ())
+
+ refSectionNames = [
+ 'SectionZ',
+ 'SectionY', # SectionB should not get before this, despite its Y position on screen is higher
+ 'SectionT3', # Sections in tables go in rows, then across rows
+ 'SectionT1',
+ 'SectionT2',
+ 'SectionT0',
+ 'SectionF2', # Goes before SectionF1, because their fly anchors go in that order
+ 'SectionF3', # Same as SectionF1, but anchor section is in fly itself
+ 'SectionFinF3', # Check order of nested sections inside fly
+ 'SectionA',
+ 'SectionF1', # Section in fly anchored in a section goes immediately after its anchor section
+ 'SectionB', # High on screen, but late in list because it's on second page
+ 'SectionC',
+ ]
+ self.assertEqual(len(refSectionNames), len(xSections.getChildren()))
+
+ actSectionNames = []
+ for i in range(len(refSectionNames)):
+ actSectionNames.append(get_state_as_dict(xSections.getChild(str(i)))['Text'])
+ # Without the fix in place, this would fail with
+ # AssertionError: Lists differ: ['SectionZ', 'SectionY', 'SectionT3', 'SectionT1', 'SectionT2'[100 chars]onC'] != ['SectionZ', 'SectionB', 'SectionF3', 'SectionFinF3', 'Section[100 chars]onA']
+ self.assertEqual(refSectionNames, actSectionNames)
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/options/tdf78133.py b/sw/qa/uitest/options/tdf78133.py
index de1f2124200f..883c38231aa9 100644
--- a/sw/qa/uitest/options/tdf78133.py
+++ b/sw/qa/uitest/options/tdf78133.py
@@ -6,8 +6,6 @@
#
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
from uitest.uihelper.common import get_state_as_dict
#Bug 78133 - LibO crashes when in options dialog
diff --git a/sw/qa/uitest/sidebar/stylesSidebar.py b/sw/qa/uitest/sidebar/stylesSidebar.py
index db625be6f006..8364334ad77e 100644
--- a/sw/qa/uitest/sidebar/stylesSidebar.py
+++ b/sw/qa/uitest/sidebar/stylesSidebar.py
@@ -6,6 +6,7 @@
from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from uitest.uihelper.common import select_by_text
from libreoffice.uno.propertyvalue import mkPropertyValues
class StylesSidebar(UITestCase):
@@ -53,7 +54,7 @@ class StylesSidebar(UITestCase):
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"}))
xFilter = xWriterEdit.getChild('filter')
- xFilter.executeAction("SELECT", mkPropertyValues({"TEXT": "Custom Styles"}))
+ select_by_text(xFilter, "Custom Styles")
expectedResults = ["customParagraphStyle", "customCharacterStyle", "customFrameStyle",
"customPageStyle", "customNumberingStyle"]
@@ -62,7 +63,7 @@ class StylesSidebar(UITestCase):
xLeft = xWriterEdit.getChild('left')
#change to another style type
- xLeft.executeAction("CLICK", mkPropertyValues({"POS": str( i + 1 )}))
+ xLeft.executeAction("CLICK", mkPropertyValues({"POS": str( i )}))
xFlatView = xWriterEdit.getChild("flatview")
diff --git a/sw/qa/uitest/sidebar/tdf135590.py b/sw/qa/uitest/sidebar/tdf135590.py
new file mode 100644
index 000000000000..6a061b7a1f96
--- /dev/null
+++ b/sw/qa/uitest/sidebar/tdf135590.py
@@ -0,0 +1,81 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, select_pos
+from uitest.uihelper.common import change_measurement_unit
+from uitest.uihelper.common import select_by_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf135590(UITestCase):
+ def test_tdf135590(self):
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+
+ #change measurement to Centimeter
+ change_measurement_unit(self, 'Centimeter')
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
+
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild('width')
+ xHeight = xDialog.getChild('height')
+ xFormat = xDialog.getChild("format")
+
+ select_by_text(xFormat, "C6 Envelope")
+
+ self.assertEqual("16.2", get_state_as_dict(xWidth)['Value'])
+ self.assertEqual("11.4", get_state_as_dict(xHeight)['Value'])
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # A new document is created
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild('spinWidth')
+ xHeight = xDialog.getChild('spinHeight')
+ xFormatList = xDialog.getChild("comboPageFormat")
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '16.2' != '11.4'
+ self.assertEqual("16.2", get_state_as_dict(xWidth)['Value'])
+ self.assertEqual("11.4", get_state_as_dict(xHeight)['Value'])
+ self.assertEqual("User", get_state_as_dict(xFormatList)['SelectEntryText'])
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"}))
+
+ xPaperSize = xWriterEdit.getChild('papersize')
+ self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
+ self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
+
+ xPaperHeight = xWriterEdit.getChild('paperheight')
+ self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "11.40 cm")
+ self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "11.40 cm")
+
+ xPaperWidth = xWriterEdit.getChild('paperwidth')
+ self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "16.20 cm")
+ self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "16.20 cm")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sw/qa/uitest/sidebar/tdf99711.py b/sw/qa/uitest/sidebar/tdf99711.py
index 776894431b92..1cc899f42cc1 100644
--- a/sw/qa/uitest/sidebar/tdf99711.py
+++ b/sw/qa/uitest/sidebar/tdf99711.py
@@ -26,11 +26,11 @@ class tdf99711(UITestCase):
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"}))
#wait until the sidebar is available
- self.ui_test.wait_until_child_is_available(xWriterEdit, 'selectwidth')
- self.assertEqual(get_state_as_dict(xWriterEdit.getChild('selectwidth'))['Text'], '10.00 mm')
+ xChild = self.ui_test.wait_until_child_is_available('selectwidth')
+ self.assertEqual(get_state_as_dict(xChild)['Text'], '10.00 mm')
- self.ui_test.wait_until_child_is_available(xWriterEdit, 'selectheight')
- self.assertEqual(get_state_as_dict(xWriterEdit.getChild('selectheight'))['Text'], '10.00 mm')
+ xChild = self.ui_test.wait_until_child_is_available('selectheight')
+ self.assertEqual(get_state_as_dict(xChild)['Text'], '10.00 mm')
self.xUITest.executeCommand(".uno:Sidebar")
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py b/sw/qa/uitest/styleInspector/styleInspector.py
index 49337ee61761..d26c21f2a9ed 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -40,7 +40,7 @@ class styleNavigator(UITestCase):
xDirFormatting = xListBox.getChild('3')
self.assertEqual(5, len(xDirFormatting.getChildren()))
self.assertEqual("Char Back Color\t0xffff00", get_state_as_dict(xDirFormatting.getChild('0'))['Text'])
- self.assertEqual("Char Back Transparent\tfalse", get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
+ self.assertEqual("Char Back Transparent\tFalse", get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
self.assertEqual("Char Color\t0xc9211e", get_state_as_dict(xDirFormatting.getChild('2'))['Text'])
self.assertEqual("Char Shading Value\t0", get_state_as_dict(xDirFormatting.getChild('3'))['Text'])
self.assertEqual("Char Transparence\t0", get_state_as_dict(xDirFormatting.getChild('4'))['Text'])
@@ -57,9 +57,9 @@ class styleNavigator(UITestCase):
self.assertEqual(7, len(xParDirFormatting.getChildren()))
self.assertEqual("Fill Color\t0xff0000", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
self.assertEqual("Para Back Color\t0xff0000", get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
- self.assertEqual("Para Back Transparent\tfalse", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
+ self.assertEqual("Para Back Transparent\tFalse", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
self.assertEqual("Para First Line Indent\t0", get_state_as_dict(xParDirFormatting.getChild('3'))['Text'])
- self.assertEqual("Para is Auto First Line Indent\tfalse", get_state_as_dict(xParDirFormatting.getChild('4'))['Text'])
+ self.assertEqual("Para is Auto First Line Indent\tFalse", get_state_as_dict(xParDirFormatting.getChild('4'))['Text'])
self.assertEqual("Para Left Margin\t1482", get_state_as_dict(xParDirFormatting.getChild('5'))['Text'])
self.assertEqual("Para Right Margin\t0", get_state_as_dict(xParDirFormatting.getChild('6'))['Text'])
@@ -88,12 +88,12 @@ class styleNavigator(UITestCase):
self.assertEqual("Char Property Height\t100", get_state_as_dict(xTitleStyle.getChild('6'))['Text'])
self.assertEqual("Char Property Height Asian\t100", get_state_as_dict(xTitleStyle.getChild('7'))['Text'])
self.assertEqual("Char Property Height Complex\t100", get_state_as_dict(xTitleStyle.getChild('8'))['Text'])
- self.assertEqual("Char Weight\tbold", get_state_as_dict(xTitleStyle.getChild('9'))['Text'])
- self.assertEqual("Char Weight Asian\tbold", get_state_as_dict(xTitleStyle.getChild('10'))['Text'])
- self.assertEqual("Char Weight Complex\tbold", get_state_as_dict(xTitleStyle.getChild('11'))['Text'])
+ self.assertEqual("Char Weight\tBold", get_state_as_dict(xTitleStyle.getChild('9'))['Text'])
+ self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xTitleStyle.getChild('10'))['Text'])
+ self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xTitleStyle.getChild('11'))['Text'])
self.assertEqual("Follow Style\tText body", get_state_as_dict(xTitleStyle.getChild('12'))['Text'])
self.assertEqual("Para Adjust\t3", get_state_as_dict(xTitleStyle.getChild('13'))['Text'])
- self.assertEqual("Para Expand Single Word\tfalse", get_state_as_dict(xTitleStyle.getChild('14'))['Text'])
+ self.assertEqual("Para Expand Single Word\tFalse", get_state_as_dict(xTitleStyle.getChild('14'))['Text'])
self.assertEqual("Para Last Line Adjust\t0", get_state_as_dict(xTitleStyle.getChild('15'))['Text'])
self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
@@ -118,7 +118,7 @@ class styleNavigator(UITestCase):
self.assertEqual("Char Height\t20", get_state_as_dict(xCustomStyle.getChild('2'))['Text'])
self.assertEqual("Char Property Height\t100", get_state_as_dict(xCustomStyle.getChild('3'))['Text'])
self.assertEqual("Char Transparence\t0", get_state_as_dict(xCustomStyle.getChild('4'))['Text'])
- self.assertEqual("Char Weight\tbold", get_state_as_dict(xCustomStyle.getChild('5'))['Text'])
+ self.assertEqual("Char Weight\tBold", get_state_as_dict(xCustomStyle.getChild('5'))['Text'])
self.assertEqual("Follow Style\tCustom_Style", get_state_as_dict(xCustomStyle.getChild('6'))['Text'])
self.assertEqual(7, len(xListBox.getChild('0').getChild('2').getChildren()))
@@ -129,4 +129,62 @@ class styleNavigator(UITestCase):
self.xUITest.executeCommand(".uno:Sidebar")
self.ui_test.close_doc()
+ def test_metadata(self):
+ self.ui_test.load_file(get_url_for_data_file("metadata.odt"))
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
+
+ xListBox = xWriterEdit.getChild('listbox_fonts')
+
+ # The cursor is on text without metadata
+ self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
+ self.assertEqual("Default Paragraph Style", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
+ self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren()))
+ self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
+ self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
+ self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
+
+ self.xUITest.executeCommand(".uno:GoDown")
+
+ # The cursor is on text with paragraph metadata showed under direct paragraph formatting
+ self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
+ self.assertEqual("Default Paragraph Style", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
+ self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren()))
+
+ xParDirFormatting = xListBox.getChild('1')
+ self.assertEqual(1, len(xParDirFormatting.getChildren()))
+ self.assertEqual("Metadata Reference", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
+
+ xMetadata = xParDirFormatting.getChild('0')
+ self.assertEqual(3, len(xMetadata.getChildren()))
+ self.assertEqual("http://www.w3.org/1999/02/22-rdf-syntax-ns#type\tParagraph", get_state_as_dict(xMetadata.getChild('0'))['Text'])
+ self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tAbout this paragraph...", get_state_as_dict(xMetadata.getChild('1'))['Text'])
+ self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated paragraph", get_state_as_dict(xMetadata.getChild('2'))['Text'])
+
+ self.xUITest.executeCommand(".uno:GoDown")
+ # FIXME jump over the control character (not visible in getString(), but it affects
+ # cursor position and availability of NestedTextContent)
+ self.xUITest.executeCommand(".uno:GoRight")
+
+ # The cursor is on text with annotated text range
+ xDirFormatting = xListBox.getChild('3')
+ self.assertEqual(2, len(xDirFormatting.getChildren()))
+ self.assertEqual("Metadata Reference", get_state_as_dict(xDirFormatting.getChild('0'))['Text'])
+ self.assertEqual("Nested Text Content\tAnnotated text range", get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
+
+ xMetadata = xDirFormatting.getChild('0')
+ self.assertEqual(3, len(xMetadata.getChildren()))
+ self.assertEqual("http://www.w3.org/1999/02/22-rdf-syntax-ns#type\tText span", get_state_as_dict(xMetadata.getChild('0'))['Text'])
+ self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tComment...", get_state_as_dict(xMetadata.getChild('1'))['Text'])
+ self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated paragraph portion", get_state_as_dict(xMetadata.getChild('2'))['Text'])
+
+ self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
+ self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/styleInspector/tdf137513.py b/sw/qa/uitest/styleInspector/tdf137513.py
new file mode 100644
index 000000000000..b3884e078b17
--- /dev/null
+++ b/sw/qa/uitest/styleInspector/tdf137513.py
@@ -0,0 +1,58 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+# 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/.
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+
+class tdf137513(UITestCase):
+
+ def test_tdf137513(self):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2")
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ type_text(xWriterEdit, "test")
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ self.xUITest.executeCommand(".uno:Bold")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
+
+ xListBox = xWriterEdit.getChild('listbox_fonts')
+
+ # The cursor is on text inside the table with direct formatting
+ self.assertEqual(2, len(xListBox.getChild('0').getChildren()))
+ self.assertEqual("Default Paragraph Style", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
+ self.assertEqual("Table Contents", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text'])
+ self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren()))
+
+ xTableContent = xListBox.getChild('0').getChild('1')
+ self.assertEqual(5, len(xTableContent.getChildren()))
+ self.assertEqual("Follow Style\tTable Contents", get_state_as_dict(xTableContent.getChild('0'))['Text'])
+ self.assertEqual("Para Line Number Count\tFalse", get_state_as_dict(xTableContent.getChild('1'))['Text'])
+ self.assertEqual("Para Line Number Start Value\t0", get_state_as_dict(xTableContent.getChild('2'))['Text'])
+ self.assertEqual("Para Orphans\t0", get_state_as_dict(xTableContent.getChild('3'))['Text'])
+ self.assertEqual("Para Widows\t0", get_state_as_dict(xTableContent.getChild('4'))['Text'])
+
+ xParDirFormatting = xListBox.getChild('1')
+
+ # Without the fix in place, this test would have failed here with
+ # AssertionError: 3 != 0
+ self.assertEqual(3, len(xParDirFormatting.getChildren()))
+ self.assertEqual("Char Weight\tBold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
+ self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
+ self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
+ self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
+ self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/sheetToTable.py b/sw/qa/uitest/table/sheetToTable.py
index e47d26a52dc4..7beff37c6c8d 100644
--- a/sw/qa/uitest/table/sheetToTable.py
+++ b/sw/qa/uitest/table/sheetToTable.py
@@ -5,9 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_url_for_data_file
from uitest.uihelper.calc import enter_text_to_cell
#Calc sheet to Writer table
diff --git a/sw/qa/uitest/table/splitTable.py b/sw/qa/uitest/table/splitTable.py
index 8994273c4633..402aab45d543 100644
--- a/sw/qa/uitest/table/splitTable.py
+++ b/sw/qa/uitest/table/splitTable.py
@@ -5,11 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_url_for_data_file
#Writer Split Table
diff --git a/sw/qa/uitest/table/tableProperties.py b/sw/qa/uitest/table/tableProperties.py
index d74260892f01..da75f2218255 100644
--- a/sw/qa/uitest/table/tableProperties.py
+++ b/sw/qa/uitest/table/tableProperties.py
@@ -6,10 +6,9 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
+from uitest.uihelper.common import select_by_text
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
from uitest.uihelper.common import change_measurement_unit
#Writer Table Properties
@@ -56,9 +55,7 @@ class tableProperties(UITestCase):
belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
belowmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- props = {"TEXT": "Left-to-right (LTR)"}
- actionProps = mkPropertyValues(props)
- textdirection.executeAction("SELECT", actionProps)
+ select_by_text(textdirection, "Left-to-right (LTR)")
xOKBtn = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOKBtn)
#verify
@@ -103,13 +100,9 @@ class tableProperties(UITestCase):
headline = xDialog.getChild("headline")
headline.executeAction("CLICK", tuple())
textdirection = xDialog.getChild("textorientation")
- props = {"TEXT": "Vertical (bottom to top)"}
- actionProps = mkPropertyValues(props)
- textdirection.executeAction("SELECT", actionProps)
+ select_by_text(textdirection, "Vertical (bottom to top)")
vertorient = xDialog.getChild("vertorient")
- props2 = {"TEXT": "Bottom"}
- actionProps2 = mkPropertyValues(props2)
- vertorient.executeAction("SELECT", actionProps2)
+ select_by_text(vertorient, "Bottom")
xOKBtn = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOKBtn)
#verify
diff --git a/sw/qa/uitest/table/tableToText.py b/sw/qa/uitest/table/tableToText.py
index 003f46e20548..f131f914c93e 100644
--- a/sw/qa/uitest/table/tableToText.py
+++ b/sw/qa/uitest/table/tableToText.py
@@ -5,11 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_url_for_data_file
#Writer Table to text
diff --git a/sw/qa/uitest/table/tdf115026.py b/sw/qa/uitest/table/tdf115026.py
index 7e8edcf4260c..92314753a8c3 100644
--- a/sw/qa/uitest/table/tdf115026.py
+++ b/sw/qa/uitest/table/tdf115026.py
@@ -6,7 +6,6 @@
#
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
class tdf115026(UITestCase):
diff --git a/sw/qa/uitest/table/tdf116737.py b/sw/qa/uitest/table/tdf116737.py
index 7b27020e495e..139fcea3a812 100644
--- a/sw/qa/uitest/table/tdf116737.py
+++ b/sw/qa/uitest/table/tdf116737.py
@@ -6,9 +6,7 @@
#
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
-from uitest.debug import sleep
from uitest.uihelper.common import select_pos
#Bug 116737 - INSERT TABLE: Can't select table style (gen/gtk)
diff --git a/sw/qa/uitest/table/tdf128593.py b/sw/qa/uitest/table/tdf128593.py
index 26f9d903be27..3306a58d2b09 100755
--- a/sw/qa/uitest/table/tdf128593.py
+++ b/sw/qa/uitest/table/tdf128593.py
@@ -2,7 +2,6 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
-import importlib
from uitest.uihelper.common import get_state_as_dict
#https://bugs.documentfoundation.org/show_bug.cgi?id=128593
diff --git a/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py b/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py
index c1b4aea8b4eb..019c492374a1 100644
--- a/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py
+++ b/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py
@@ -6,7 +6,7 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.common import select_pos
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
from uitest.uihelper.common import change_measurement_unit
from libreoffice.uno.propertyvalue import mkPropertyValues
diff --git a/sw/qa/uitest/table/tdf81292.py b/sw/qa/uitest/table/tdf81292.py
index 68a79e6733d7..343b1a89bb13 100644
--- a/sw/qa/uitest/table/tdf81292.py
+++ b/sw/qa/uitest/table/tdf81292.py
@@ -5,8 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_url_for_data_file
#Bug 81292 - TABLE: Crashes on sorting table
diff --git a/sw/qa/uitest/table/tdf99334.py b/sw/qa/uitest/table/tdf99334.py
index 8c97aff57940..e87226a0c485 100644
--- a/sw/qa/uitest/table/tdf99334.py
+++ b/sw/qa/uitest/table/tdf99334.py
@@ -5,8 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_url_for_data_file
#Bug 99334 - Crashes when sorting table by columns with umlauts
diff --git a/sw/qa/uitest/table/textToTable.py b/sw/qa/uitest/table/textToTable.py
index d41c514d2716..d901ae6d2c04 100644
--- a/sw/qa/uitest/table/textToTable.py
+++ b/sw/qa/uitest/table/textToTable.py
@@ -5,11 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_url_for_data_file, type_text
#Writer Text to table
diff --git a/sw/qa/uitest/ui/fmtui/fmtui.py b/sw/qa/uitest/ui/fmtui/fmtui.py
index d147022635fb..36e00c95a479 100644
--- a/sw/qa/uitest/ui/fmtui/fmtui.py
+++ b/sw/qa/uitest/ui/fmtui/fmtui.py
@@ -8,8 +8,6 @@
"""Covers sw/source/ui/fmtui/ fixes."""
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
diff --git a/sw/qa/uitest/writer_dialogs/openDialogs.py b/sw/qa/uitest/writer_dialogs/openDialogs.py
index 6c8cb699a7a6..b4d9b356e153 100644
--- a/sw/qa/uitest/writer_dialogs/openDialogs.py
+++ b/sw/qa/uitest/writer_dialogs/openDialogs.py
@@ -37,7 +37,8 @@ dialogs = [
# {"command": ".uno:InsertBreak", "closeButton": "cancel"},
# tested in uitest/writer_tests/insertBreakDialog.py
{"command": ".uno:InsertObject", "closeButton": "cancel"},
- {"command": ".uno:InsertSection", "closeButton": "cancel"},
+ # {"command": ".uno:InsertSection", "closeButton": "cancel"},
+ # tested in sw/qa/uitest/writer_tests7/tdf140863.py
{"command": ".uno:InsertFrame", "closeButton": "cancel"},
{"command": ".uno:InsertObjectFloatingFrame", "closeButton": "cancel"},
{"command": ".uno:FontworkGalleryFloater", "closeButton": "cancel"},
diff --git a/sw/qa/uitest/writer_tests/comments.py b/sw/qa/uitest/writer_tests/comments.py
index c85ed256de37..66ecb06bb246 100644
--- a/sw/qa/uitest/writer_tests/comments.py
+++ b/sw/qa/uitest/writer_tests/comments.py
@@ -8,11 +8,8 @@
#
from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
-from uitest.config import DEFAULT_SLEEP
#test comments
class Comments(UITestCase):
@@ -30,10 +27,10 @@ class Comments(UITestCase):
self.xUITest.executeCommand(".uno:InsertAnnotation")
# wait until the comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment1')
+ xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
- xComment1 = xMainWindow.getChild("Comment1")
- xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": "This is the First Comment"}))
+ xEditView1 = xComment1.getChild("editview")
+ xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": "This is the First Comment"}))
self.assertEqual(get_state_as_dict(xComment1)["Text"], "This is the First Comment" )
self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
self.assertEqual(get_state_as_dict(xComment1)["Author"], "Unknown Author" )
@@ -77,27 +74,27 @@ class Comments(UITestCase):
xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 1"}))
self.xUITest.executeCommand(".uno:InsertAnnotation")
# wait until the comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment1')
- xComment1 = xMainWindow.getChild("Comment1")
- xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
+ xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
+ xEditView1 = xComment1.getChild("editview")
+ xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
xComment1.executeAction("LEAVE", mkPropertyValues({}))
xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 2"}))
self.xUITest.executeCommand(".uno:InsertAnnotation")
# wait until the comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment2')
- xComment2 = xMainWindow.getChild("Comment2")
- xComment2.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
+ xComment2 = self.ui_test.wait_until_child_is_available('Comment2')
+ xEditView2 = xComment2.getChild("editview")
+ xEditView2.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
xComment2.executeAction("LEAVE", mkPropertyValues({}))
xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 3"}))
self.xUITest.executeCommand(".uno:InsertAnnotation")
# wait until the comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment3')
- xComment3 = xMainWindow.getChild("Comment3")
- xComment3.executeAction("TYPE", mkPropertyValues({"TEXT": "Third Comment"}))
+ xComment3 = self.ui_test.wait_until_child_is_available('Comment3')
+ xEditView3 = xComment3.getChild("editview")
+ xEditView3.executeAction("TYPE", mkPropertyValues({"TEXT": "Third Comment"}))
xComment3.executeAction("LEAVE", mkPropertyValues({}))
xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
diff --git a/sw/qa/uitest/writer_tests/insertCaption.py b/sw/qa/uitest/writer_tests/insertCaption.py
index de73b3b767e5..57f6273875db 100644
--- a/sw/qa/uitest/writer_tests/insertCaption.py
+++ b/sw/qa/uitest/writer_tests/insertCaption.py
@@ -6,9 +6,6 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.debug import sleep
from uitest.uihelper.common import select_pos
class insertCaption(UITestCase):
diff --git a/sw/qa/uitest/writer_tests/tdf134734.py b/sw/qa/uitest/writer_tests/tdf134734.py
new file mode 100644
index 000000000000..5685f00a55a9
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf134734.py
@@ -0,0 +1,92 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, select_pos
+from com.sun.star.drawing.FillStyle import SOLID
+import importlib
+
+class TestClass(UITestCase):
+ def test_master_page_background(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+
+ # set margins and fill color
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ DrawPageDialog = self.xUITest.getTopFocusWindow()
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
+ self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "true")
+ spinMargLeft = DrawPageDialog.getChild("spinMargLeft")
+ for _ in range(20):
+ spinMargLeft.executeAction("UP",tuple())
+ spinMargRight = DrawPageDialog.getChild("spinMargRight")
+ for _ in range(15):
+ spinMargRight.executeAction("UP",tuple())
+ spinMargTop = DrawPageDialog.getChild("spinMargTop")
+ for _ in range(10):
+ spinMargTop.executeAction("UP",tuple())
+ spinMargBot = DrawPageDialog.getChild("spinMargBot")
+ for _ in range(5):
+ spinMargBot.executeAction("UP",tuple())
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ btncolor = DrawPageDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK",tuple())
+ ok = DrawPageDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(ok)
+
+ xStyle = document.StyleFamilies["PageStyles"]["Standard"]
+
+ self.assertEqual(xStyle.FillStyle, SOLID)
+ self.assertEqual(xStyle.LeftMargin, 2997)
+ self.assertEqual(xStyle.RightMargin, 2743)
+ self.assertEqual(xStyle.TopMargin, 2489)
+ self.assertEqual(xStyle.BottomMargin, 2235)
+ self.assertEqual(xStyle.BackgroundFullSize, True)
+
+ # uncheck it
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ DrawPageDialog = self.xUITest.getTopFocusWindow()
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
+ self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "true")
+ checkBackgroundFullSize.executeAction("CLICK",tuple())
+ ok = DrawPageDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(ok)
+
+ self.assertEqual(xStyle.FillStyle, SOLID)
+ self.assertEqual(xStyle.LeftMargin, 2997)
+ self.assertEqual(xStyle.RightMargin, 2743)
+ self.assertEqual(xStyle.TopMargin, 2489)
+ self.assertEqual(xStyle.BottomMargin, 2235)
+ self.assertEqual(xStyle.BackgroundFullSize, False)
+
+ # check it again
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ DrawPageDialog = self.xUITest.getTopFocusWindow()
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
+ self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "false")
+ checkBackgroundFullSize.executeAction("CLICK",tuple())
+ ok = DrawPageDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(ok)
+
+ self.assertEqual(xStyle.FillStyle, SOLID)
+ self.assertEqual(xStyle.LeftMargin, 2997)
+ self.assertEqual(xStyle.RightMargin, 2743)
+ self.assertEqual(xStyle.TopMargin, 2489)
+ self.assertEqual(xStyle.BottomMargin, 2235)
+ self.assertEqual(xStyle.BackgroundFullSize, True)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py b/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
index 1c8c1e54fef0..9adbd2047d37 100644
--- a/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
+++ b/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
@@ -8,8 +8,7 @@
#
from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf137459(UITestCase):
@@ -18,20 +17,17 @@ class tdf137459(UITestCase):
xMainDoc = self.ui_test.create_doc_in_start_center("writer")
- xMainWindow = self.xUITest.getTopFocusWindow()
-
- xwriter_edit = xMainWindow.getChild("writer_edit")
# adding new Comment
self.xUITest.executeCommand(".uno:InsertAnnotation")
# wait until the comment is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment1')
+ xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
- xComment1 = xMainWindow.getChild("Comment1")
+ xEditView1 = xComment1.getChild("editview")
sText = "Ctrl+Del should not delete BACKWARDS"
- xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": sText}))
+ xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": sText}))
self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
- xComment1.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+DELETE"}))
+ xEditView1.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+DELETE"}))
self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
self.ui_test.close_doc()
diff --git a/sw/qa/uitest/writer_tests/tdf53460.py b/sw/qa/uitest/writer_tests/tdf53460.py
index f8fc0ad47451..7f4b57416e6f 100644
--- a/sw/qa/uitest/writer_tests/tdf53460.py
+++ b/sw/qa/uitest/writer_tests/tdf53460.py
@@ -7,7 +7,6 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
class tdf53460(UITestCase):
diff --git a/sw/qa/uitest/writer_tests/tdf78068.py b/sw/qa/uitest/writer_tests/tdf78068.py
index 145b0bd99b51..1989722a3b1f 100644
--- a/sw/qa/uitest/writer_tests/tdf78068.py
+++ b/sw/qa/uitest/writer_tests/tdf78068.py
@@ -5,12 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import type_text
-import time
-from uitest.debug import sleep
-from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import select_pos
class tdf78068(UITestCase):
@@ -33,4 +29,4 @@ class tdf78068(UITestCase):
self.assertEqual(document.Text.String[0:4], "Test")
self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf81457.py b/sw/qa/uitest/writer_tests/tdf81457.py
index 655d0c2f671b..bf615f99c2b0 100644
--- a/sw/qa/uitest/writer_tests/tdf81457.py
+++ b/sw/qa/uitest/writer_tests/tdf81457.py
@@ -8,7 +8,6 @@
#
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
from uitest.uihelper.common import select_pos
@@ -21,9 +20,24 @@ class tdf81457(UITestCase):
xDialog = self.xUITest.getTopFocusWindow()
xTabs = xDialog.getChild("tabcontrol")
select_pos(xTabs, "2") #tab Custom properties
+
+ aExpectedNames = ['BookMarkCount', 'BookMarkInfo1', 'BookMarkInfo10', 'BookMarkInfo11',
+ 'BookMarkInfo12', 'BookMarkInfo13']
+ aExpectedValues = ['78', '00FF0000FF010', '00FF0000FF1E0', '00FF0000FF1E0',
+ '00FF0000FF210', '00FF0000FF230']
+
+ for i in range(6):
+ xNameBox = xDialog.getChild("namebox" + str(i + 1))
+ xTypeBox = xDialog.getChild("typebox" + str(i + 1))
+ xValueEdit = xDialog.getChild("valueedit" + str(i + 1))
+ self.assertEqual(aExpectedNames[i], get_state_as_dict(xNameBox)['Text'])
+ self.assertEqual('Text', get_state_as_dict(xTypeBox)['DisplayText'])
+ self.assertEqual(aExpectedValues[i], get_state_as_dict(xValueEdit)['Text'][:13])
+
+
xOkBtn = xDialog.getChild("ok")
xOkBtn.executeAction("CLICK", tuple())
self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/watermark.py b/sw/qa/uitest/writer_tests/watermark.py
index 0d918e92d061..3cf7c6fd84f6 100644
--- a/sw/qa/uitest/writer_tests/watermark.py
+++ b/sw/qa/uitest/writer_tests/watermark.py
@@ -7,9 +7,6 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.debug import sleep
-from uitest.uihelper.common import select_pos
class watermark(UITestCase):
diff --git a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
index 1af2bfe94933..39ba7eb3595a 100644
--- a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
+++ b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
@@ -6,10 +6,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.debug import sleep
-from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
class asianPhoneticGuide(UITestCase):
@@ -29,15 +26,9 @@ class asianPhoneticGuide(UITestCase):
xLeft1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
xRight1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"w"}))
- props = {"TEXT": "Right"}
- actionProps = mkPropertyValues(props)
- xadjustlb.executeAction("SELECT", actionProps)
- props2 = {"TEXT": "Right"}
- actionProps2 = mkPropertyValues(props2)
- xpositionlb.executeAction("SELECT", actionProps2)
- props3 = {"TEXT": "Quotation"}
- actionProps3 = mkPropertyValues(props3)
- xstylelb.executeAction("SELECT", actionProps3)
+ select_by_text(xadjustlb, "Right")
+ select_by_text(xpositionlb, "Right")
+ select_by_text(xstylelb, "Quotation")
xApplyBtn = xDialog.getChild("ok")
xApplyBtn.executeAction("CLICK", tuple())
diff --git a/sw/qa/uitest/writer_tests2/bookmark.py b/sw/qa/uitest/writer_tests2/bookmark.py
index 9cbf82c29b41..57ab151adbcb 100644
--- a/sw/qa/uitest/writer_tests2/bookmark.py
+++ b/sw/qa/uitest/writer_tests2/bookmark.py
@@ -8,10 +8,8 @@
#
from uitest.framework import UITestCase
-import time
from uitest.uihelper.common import get_state_as_dict, type_text
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
#test bookmark dialog
class bookmarkDialog(UITestCase):
diff --git a/sw/qa/uitest/writer_tests2/deleteAllComments.py b/sw/qa/uitest/writer_tests2/deleteAllComments.py
index ad9e0c823e6f..e6832af6cb62 100644
--- a/sw/qa/uitest/writer_tests2/deleteAllComments.py
+++ b/sw/qa/uitest/writer_tests2/deleteAllComments.py
@@ -5,8 +5,7 @@
#
from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import type_text
class DeleteAllComments(UITestCase):
@@ -16,7 +15,7 @@ class DeleteAllComments(UITestCase):
xWriterDoc = self.xUITest.getTopFocusWindow()
xWriterEdit = xWriterDoc.getChild("writer_edit")
-
+
type_text(xWriterEdit, "Test LibreOffice")
@@ -25,7 +24,6 @@ class DeleteAllComments(UITestCase):
selection = self.xUITest.executeCommand(".uno:SelectAll")
self.xUITest.executeCommand(".uno:InsertAnnotation")
cursor = document.getCurrentController().getViewCursor()
- xWriterDoc.executeAction("LEFT", tuple())
type_text(xWriterEdit, "EEEEE")
self.xUITest.executeCommand(".uno:InsertAnnotation")
self.xUITest.executeCommand(".uno:DeleteAllNotes")
diff --git a/sw/qa/uitest/writer_tests2/documentProperties.py b/sw/qa/uitest/writer_tests2/documentProperties.py
index 40366d2303b5..72e0c48dc636 100644
--- a/sw/qa/uitest/writer_tests2/documentProperties.py
+++ b/sw/qa/uitest/writer_tests2/documentProperties.py
@@ -10,13 +10,24 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.debug import sleep
from uitest.uihelper.common import select_pos
-
class documentProperties(UITestCase):
+ def assert_custom_properties(self, dialog, bIsFirstItemVisible):
+ for i in range(6):
+ aExpected = 'false'
+ if bIsFirstItemVisible and i == 0:
+ aExpected = 'true'
+ xNameBox = dialog.getChild("namebox" + str(i + 1))
+ xTypeBox = dialog.getChild("typebox" + str(i + 1))
+ xValueEdit = dialog.getChild("valueedit" + str(i + 1))
+ xRemoveBtn = dialog.getChild("remove" + str(i + 1))
+ self.assertEqual(aExpected, get_state_as_dict(xNameBox)['ReallyVisible'])
+ self.assertEqual(aExpected, get_state_as_dict(xTypeBox)['ReallyVisible'])
+ self.assertEqual(aExpected, get_state_as_dict(xValueEdit)['ReallyVisible'])
+ self.assertEqual(aExpected, get_state_as_dict(xRemoveBtn)['ReallyVisible'])
+
def test_open_documentProperties_writer(self):
self.ui_test.create_doc_in_start_center("writer")
self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
@@ -76,10 +87,19 @@ class documentProperties(UITestCase):
dialog_handler=handle_protect_dlg)
select_pos(xTabs, "2") #tab Custom properties
-#add custom properties ------>>>>>>>>>>> not supported
+
+ self.assert_custom_properties(xDialog, False)
+
xAddBtn = xDialog.getChild("add")
xAddBtn.executeAction("CLICK", tuple())
+ self.assert_custom_properties(xDialog, True)
+
+ xRemoveBtn = xDialog.getChild("remove1")
+ xRemoveBtn.executeAction("CLICK", tuple())
+
+ self.assert_custom_properties(xDialog, False)
+
select_pos(xTabs, "5") #tab Statistics
xUpdateBtn = xDialog.getChild("update")
xUpdateBtn.executeAction("CLICK", tuple())
diff --git a/sw/qa/uitest/writer_tests2/exchangeDatabase.py b/sw/qa/uitest/writer_tests2/exchangeDatabase.py
index d255bd15291b..3f3a49660bfc 100644
--- a/sw/qa/uitest/writer_tests2/exchangeDatabase.py
+++ b/sw/qa/uitest/writer_tests2/exchangeDatabase.py
@@ -6,10 +6,7 @@
#
from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
+from uitest.uihelper.common import get_state_as_dict
class exchangeDB(UITestCase):
diff --git a/sw/qa/uitest/writer_tests2/fontworks.py b/sw/qa/uitest/writer_tests2/fontworks.py
index 671f63087ba4..4d4044ab2bd0 100644
--- a/sw/qa/uitest/writer_tests2/fontworks.py
+++ b/sw/qa/uitest/writer_tests2/fontworks.py
@@ -8,9 +8,8 @@
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
#test FontWorks dialog
class fontWorksDialog(UITestCase):
@@ -42,4 +41,4 @@ class fontWorksDialog(UITestCase):
self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
index 9373101a3fd8..4633666f468d 100644
--- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
+++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
@@ -5,13 +5,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.debug import sleep
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
from uitest.uihelper.common import change_measurement_unit
class formatBulletsNumbering(UITestCase):
@@ -34,9 +32,7 @@ class formatBulletsNumbering(UITestCase):
xokbtn = xDialog.getChild("ok")
xalignedatmf.executeAction("UP", tuple())
- props = {"TEXT": "Centered"}
- actionProps = mkPropertyValues(props)
- xnum2alignlb.executeAction("SELECT", actionProps)
+ select_by_text(xnum2alignlb, "Centered")
xatmf.executeAction("UP", tuple())
xindentatmf.executeAction("UP", tuple())
@@ -71,9 +67,7 @@ class formatBulletsNumbering(UITestCase):
xTabs = xDialog.getChild("tabcontrol")
select_pos(xTabs, "