summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras')
-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.cxx230
-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.odtbin0 -> 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
224 files changed, 3238 insertions, 310 deletions
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..37f92c99dbd4 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
@@ -218,6 +265,8 @@ public:
OUString GetOlePath();
/// Parse the ole1 data out of an RTF fragment URL.
void ParseOle1FromRtfUrl(const OUString& rRtfUrl, SvMemoryStream& rOle1);
+ /// Export using the C++ HTML export filter, with xhtmlns=reqif-xhtml.
+ void ExportToReqif();
};
OUString SwHtmlDomExportTest::GetOlePath()
@@ -246,6 +295,16 @@ void SwHtmlDomExportTest::ParseOle1FromRtfUrl(const OUString& rRtfUrl, SvMemoryS
CPPUNIT_ASSERT(rOle1.Tell());
}
+void SwHtmlDomExportTest::ExportToReqif()
+{
+ 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);
+}
+
constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/htmlexport/data/";
DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo81276, "fdo81276.html")
@@ -703,6 +762,34 @@ 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:
+ ExportToReqif();
+
+ // 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);
@@ -953,19 +1040,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testChinese)
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-chinese.odt";
mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {});
- // Export it.
- 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")),
- };
-
// Prevent parseXmlStream guess incompatible encoding and complaint.
SvxHtmlOptions& rOptions = SvxHtmlOptions::Get();
rtl_TextEncoding eOldEncoding = rOptions.GetTextEncoding();
rOptions.SetTextEncoding(RTL_TEXTENCODING_UTF8);
- xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+ // Export it.
+ ExportToReqif();
SvMemoryStream aStream;
HtmlExportTest::wrapFragment(maTempFile, aStream);
xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
@@ -987,12 +1068,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifComment)
dispatchCommand(mxComponent, ".uno:InsertAnnotation", aPropertyValues);
// Export it.
- 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);
+ ExportToReqif();
SvMemoryStream aStream;
HtmlExportTest::wrapFragment(maTempFile, aStream);
xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
@@ -1016,12 +1092,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifFontNameSize)
xTextRange->setString("x");
// Export it.
- 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);
+ ExportToReqif();
SvMemoryStream aStream;
HtmlExportTest::wrapFragment(maTempFile, aStream);
xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
@@ -1044,12 +1115,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifParagraphAlignment)
"ParaAdjust", uno::makeAny(static_cast<sal_Int16>(style::ParagraphAdjust_RIGHT)));
// Export it.
- 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);
+ ExportToReqif();
SvMemoryStream aStream;
HtmlExportTest::wrapFragment(maTempFile, aStream);
xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
@@ -1069,36 +1135,20 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF)
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf-ole.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);
+ ExportToReqif();
OUString aRtfUrl = GetOlePath();
SvMemoryStream aOle1;
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();
@@ -1109,10 +1159,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF)
};
mxComponent
= loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument", aLoadProperties);
- xStorable.set(mxComponent, uno::UNO_QUERY);
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
- aStoreProperties = {
+ uno::Sequence<beans::PropertyValue> aStoreProperties = {
comphelper::makePropertyValue("FilterName", OUString("writer8")),
};
xStorable->storeToURL(aTempFile.GetURL(), aStoreProperties);
@@ -1167,11 +1217,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1Paint)
// case, which has its own clsid.
CPPUNIT_ASSERT_EQUAL(aExpected.GetHexName(), aActual.GetHexName());
- aStoreProperties = {
- comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")),
- comphelper::makePropertyValue("FilterOptions", OUString("xhtmlns=reqif-xhtml")),
- };
- xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+ ExportToReqif();
OUString aRtfUrl = GetOlePath();
SvMemoryStream aOle1;
ParseOle1FromRtfUrl(aRtfUrl, aOle1);
@@ -1221,12 +1267,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testMultiParaListItem)
pWrtShell->SplitNode();
pWrtShell->Insert("D");
- 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);
+ ExportToReqif();
SvMemoryStream aStream;
HtmlExportTest::wrapFragment(maTempFile, aStream);
@@ -1253,12 +1294,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testUnderlineNone)
uno::makeAny(sal_Int16(awt::FontUnderline::NONE)));
// Export 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);
+ ExportToReqif();
// Make sure that the paragraph has no explicit style, because "text-decoration: none" is
// filtered out.
@@ -1274,37 +1310,57 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataNoOle2)
// Save to reqif-xhtml.
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "no-ole2-pres-data.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);
+ ExportToReqif();
OUString aRtfUrl = GetOlePath();
SvMemoryStream aOle1;
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", {});
+ ExportToReqif();
+ 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:
+ ExportToReqif();
+
+ // 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/extras/uiwriter/data/tdf108124.odt b/sw/qa/extras/uiwriter/data/tdf108124.odt
new file mode 100644
index 000000000000..af0260928b40
--- /dev/null
+++ 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();