From 086550313260d9fa45b91dc705b21bb9b51ce0b8 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 7 Oct 2016 13:44:01 +0300 Subject: move round-tripables to ooxmlexport This serves two purposes. It helps to prevent regressions and it allows focus on features that still don't export properly. The standard .mk file had trouble on the Mac, so I ended up copying ooxmlimport.mk instead of trying to tweak the export template. The huge section of tests excluded from Win32 testing is still excluded here. The ole-anchor test works as export in the import code, but didn't work from the ooxmlexport directory, so left that one as import only. Change-Id: I9d72202c577940ba94855096c5a11d4dec4790a5 Reviewed-on: https://gerrit.libreoffice.org/29588 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/CppunitTest_sw_ooxmlexport8.mk | 104 + sw/CppunitTest_sw_ooxmlexport9.mk | 16 + sw/Module_sw.mk | 2 + sw/ooxmlexport_setup.mk | 1 + sw/qa/extras/ooxmlexport/data/all_gaps_word.docx | Bin 0 -> 10226 bytes .../ooxmlexport/data/annotation-formatting.docx | Bin 0 -> 14298 bytes .../extras/ooxmlexport/data/bnc780044_spacing.docx | Bin 0 -> 7437 bytes sw/qa/extras/ooxmlexport/data/bnc865381.docx | Bin 0 -> 19510 bytes sw/qa/extras/ooxmlexport/data/bnc875718.docx | Bin 0 -> 7369 bytes sw/qa/extras/ooxmlexport/data/bnc891663.docx | Bin 0 -> 7911 bytes sw/qa/extras/ooxmlexport/data/caption.docx | Bin 0 -> 13773 bytes sw/qa/extras/ooxmlexport/data/chart-prop.docx | Bin 0 -> 17749 bytes sw/qa/extras/ooxmlexport/data/chart-size.docx | Bin 0 -> 18128 bytes sw/qa/extras/ooxmlexport/data/chtoutline.docx | Bin 0 -> 15406 bytes .../data/conditionalstyles-tbllook.docx | Bin 0 -> 11531 bytes .../ooxmlexport/data/dml-charheight-default.docx | Bin 0 -> 15770 bytes .../data/dml-groupshape-capitalization.docx | Bin 0 -> 17676 bytes .../ooxmlexport/data/dml-groupshape-runfonts.docx | Bin 0 -> 16971 bytes .../ooxmlexport/data/dml-groupshape-sdt.docx | Bin 0 -> 19727 bytes sw/qa/extras/ooxmlexport/data/fdo38414.docx | Bin 0 -> 21800 bytes sw/qa/extras/ooxmlexport/data/fdo43093b.docx | Bin 0 -> 12959 bytes sw/qa/extras/ooxmlexport/data/fdo46361.docx | Bin 0 -> 13791 bytes sw/qa/extras/ooxmlexport/data/fdo49940.docx | Bin 0 -> 9909 bytes sw/qa/extras/ooxmlexport/data/fdo52208.docx | Bin 0 -> 13356 bytes sw/qa/extras/ooxmlexport/data/fdo53985.docx | Bin 0 -> 20115 bytes sw/qa/extras/ooxmlexport/data/fdo55187.docx | Bin 0 -> 12759 bytes sw/qa/extras/ooxmlexport/data/fdo59273.docx | Bin 0 -> 4358 bytes sw/qa/extras/ooxmlexport/data/fdo59638.docx | Bin 0 -> 12166 bytes sw/qa/extras/ooxmlexport/data/fdo60922.docx | Bin 0 -> 4503 bytes sw/qa/extras/ooxmlexport/data/fdo61343.docx | Bin 0 -> 114220 bytes sw/qa/extras/ooxmlexport/data/fdo63685.docx | Bin 0 -> 10964 bytes sw/qa/extras/ooxmlexport/data/fdo65090.docx | Bin 0 -> 10409 bytes sw/qa/extras/ooxmlexport/data/fdo65632.docx | Bin 0 -> 12862 bytes sw/qa/extras/ooxmlexport/data/fdo66474.docx | Bin 0 -> 96326 bytes sw/qa/extras/ooxmlexport/data/fdo68607.docx | Bin 0 -> 36117 bytes sw/qa/extras/ooxmlexport/data/fdo69548.docx | Bin 0 -> 3802 bytes sw/qa/extras/ooxmlexport/data/fdo70457.docx | Bin 0 -> 20296 bytes sw/qa/extras/ooxmlexport/data/fdo72560.docx | Bin 0 -> 15144 bytes sw/qa/extras/ooxmlexport/data/fdo73389.docx | Bin 0 -> 11067 bytes sw/qa/extras/ooxmlexport/data/fdo74357.docx | Bin 0 -> 11930 bytes sw/qa/extras/ooxmlexport/data/fdo74401.docx | Bin 0 -> 18425 bytes sw/qa/extras/ooxmlexport/data/fdo74745.docx | Bin 0 -> 32560 bytes sw/qa/extras/ooxmlexport/data/fdo78883.docx | Bin 0 -> 18303 bytes sw/qa/extras/ooxmlexport/data/fdo78904.docx | Bin 0 -> 14388 bytes sw/qa/extras/ooxmlexport/data/fdo78939.docx | Bin 0 -> 73680 bytes sw/qa/extras/ooxmlexport/data/fdo79535.docx | Bin 0 -> 22547 bytes sw/qa/extras/ooxmlexport/data/fdo79738.docx | Bin 0 -> 10159 bytes sw/qa/extras/ooxmlexport/data/fdo80555.docx | Bin 0 -> 15018 bytes sw/qa/extras/ooxmlexport/data/fdo81486.docx | Bin 0 -> 13354 bytes sw/qa/extras/ooxmlexport/data/fdo85542.docx | Bin 0 -> 10299 bytes sw/qa/extras/ooxmlexport/data/file_crash.docx | Bin 0 -> 17243 bytes .../ooxmlexport/data/floating-tables-anchor.docx | Bin 0 -> 16348 bytes sw/qa/extras/ooxmlexport/data/footnote.docx | Bin 0 -> 15779 bytes sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx | Bin 0 -> 10348 bytes sw/qa/extras/ooxmlexport/data/gridbefore.docx | Bin 0 -> 4987 bytes .../ooxmlexport/data/groupshape-rotation.docx | Bin 0 -> 10462 bytes .../ooxmlexport/data/groupshape-smarttag.docx | Bin 0 -> 10694 bytes .../data/groupshape-trackedchanges.docx | Bin 0 -> 17667 bytes sw/qa/extras/ooxmlexport/data/hello.docx | Bin 0 -> 12578 bytes sw/qa/extras/ooxmlexport/data/hidemark.docx | Bin 0 -> 12816 bytes sw/qa/extras/ooxmlexport/data/i124106.docx | Bin 0 -> 4810 bytes sw/qa/extras/ooxmlexport/data/imgshadow.docx | Bin 0 -> 29629 bytes sw/qa/extras/ooxmlexport/data/indentation.docx | Bin 0 -> 16945 bytes sw/qa/extras/ooxmlexport/data/indents.docx | Bin 0 -> 11553 bytes .../extras/ooxmlexport/data/inline-groupshape.docx | Bin 0 -> 16992 bytes sw/qa/extras/ooxmlexport/data/large-twips.docx | Bin 0 -> 5365 bytes sw/qa/extras/ooxmlexport/data/libreoffice.png | Bin 0 -> 767 bytes sw/qa/extras/ooxmlexport/data/mathtype.docx | Bin 0 -> 12533 bytes sw/qa/extras/ooxmlexport/data/mce-nested.docx | Bin 0 -> 32734 bytes sw/qa/extras/ooxmlexport/data/mce-wpg.docx | Bin 0 -> 17404 bytes sw/qa/extras/ooxmlexport/data/missing-path.docx | Bin 0 -> 15860 bytes .../ooxmlexport/data/msobrightnesscontrast.docx | Bin 0 -> 18972 bytes sw/qa/extras/ooxmlexport/data/n592908-frame.docx | Bin 0 -> 13589 bytes sw/qa/extras/ooxmlexport/data/n592908-picture.docx | Bin 0 -> 62593 bytes sw/qa/extras/ooxmlexport/data/n652364.docx | Bin 0 -> 8975 bytes sw/qa/extras/ooxmlexport/data/n693238.docx | Bin 0 -> 9933 bytes sw/qa/extras/ooxmlexport/data/n705956-1.docx | Bin 0 -> 7861 bytes sw/qa/extras/ooxmlexport/data/n705956-2.docx | Bin 0 -> 9363 bytes sw/qa/extras/ooxmlexport/data/n747461.docx | Bin 0 -> 6489 bytes sw/qa/extras/ooxmlexport/data/n750255.docx | Bin 0 -> 10102 bytes sw/qa/extras/ooxmlexport/data/n750935.docx | Bin 0 -> 57750 bytes sw/qa/extras/ooxmlexport/data/n751054.docx | Bin 0 -> 13100 bytes sw/qa/extras/ooxmlexport/data/n751117.docx | Bin 0 -> 10312 bytes sw/qa/extras/ooxmlexport/data/n764005.docx | Bin 0 -> 13088 bytes sw/qa/extras/ooxmlexport/data/n766481.docx | Bin 0 -> 10021 bytes sw/qa/extras/ooxmlexport/data/n766487.docx | Bin 0 -> 9273 bytes sw/qa/extras/ooxmlexport/data/n775906.docx | Bin 0 -> 11750 bytes sw/qa/extras/ooxmlexport/data/n777337.docx | Bin 0 -> 13409 bytes sw/qa/extras/ooxmlexport/data/n778828.docx | Bin 0 -> 10012 bytes sw/qa/extras/ooxmlexport/data/n778836.docx | Bin 0 -> 9649 bytes sw/qa/extras/ooxmlexport/data/n779630.docx | Bin 0 -> 12500 bytes sw/qa/extras/ooxmlexport/data/n779642.docx | Bin 0 -> 85485 bytes sw/qa/extras/ooxmlexport/data/n779834.docx | Bin 0 -> 22624 bytes sw/qa/extras/ooxmlexport/data/n779941.docx | Bin 0 -> 10316 bytes sw/qa/extras/ooxmlexport/data/n780563.docx | Bin 0 -> 24144 bytes sw/qa/extras/ooxmlexport/data/n780843.docx | Bin 0 -> 12614 bytes sw/qa/extras/ooxmlexport/data/n780843b.docx | Bin 0 -> 13623 bytes sw/qa/extras/ooxmlexport/data/n780853.docx | Bin 0 -> 9261 bytes sw/qa/extras/ooxmlexport/data/n782345.docx | Bin 0 -> 12607 bytes sw/qa/extras/ooxmlexport/data/n783638.docx | Bin 0 -> 19119 bytes sw/qa/extras/ooxmlexport/data/n785767.docx | Bin 0 -> 12848 bytes sw/qa/extras/ooxmlexport/data/n792778.docx | Bin 0 -> 15329 bytes sw/qa/extras/ooxmlexport/data/n793262.docx | Bin 0 -> 15449 bytes sw/qa/extras/ooxmlexport/data/n793998.docx | Bin 0 -> 13167 bytes sw/qa/extras/ooxmlexport/data/n816593.docx | Bin 0 -> 17030 bytes sw/qa/extras/ooxmlexport/data/n820509.docx | Bin 0 -> 10414 bytes sw/qa/extras/ooxmlexport/data/n830205.docx | Bin 0 -> 33186 bytes .../data/negative-cell-margin-twips.docx | Bin 0 -> 5902 bytes sw/qa/extras/ooxmlexport/data/numbering1.docx | Bin 0 -> 14346 bytes .../ooxmlexport/data/page-border-shadow.docx | Bin 0 -> 10012 bytes .../ooxmlexport/data/picture-with-schemecolor.docx | Bin 0 -> 35489 bytes sw/qa/extras/ooxmlexport/data/rhbz1180114.docx | Bin 0 -> 3435 bytes .../extras/ooxmlexport/data/rprchange_closed.docx | Bin 0 -> 24695 bytes .../ooxmlexport/data/section_break_numbering.docx | Bin 0 -> 5614 bytes sw/qa/extras/ooxmlexport/data/strict-smartart.docx | Bin 0 -> 18661 bytes sw/qa/extras/ooxmlexport/data/strict.docx | Bin 0 -> 25636 bytes .../data/table-auto-column-fixed-size.docx | Bin 0 -> 17672 bytes .../data/table-auto-column-fixed-size2.docx | Bin 0 -> 12907 bytes .../extras/ooxmlexport/data/table-auto-nested.docx | Bin 0 -> 10297 bytes .../extras/ooxmlexport/data/table-btlr-center.docx | Bin 0 -> 10686 bytes sw/qa/extras/ooxmlexport/data/table-pagebreak.docx | Bin 0 -> 10148 bytes .../ooxmlexport/data/table-style-parprop.docx | Bin 0 -> 10098 bytes .../ooxmlexport/data/tableborder-finedash.docx | Bin 0 -> 10266 bytes sw/qa/extras/ooxmlexport/data/tblr-height.docx | Bin 0 -> 10466 bytes sw/qa/extras/ooxmlexport/data/tcw-rounding.docx | Bin 0 -> 14876 bytes sw/qa/extras/ooxmlexport/data/tdf59699.docx | Bin 0 -> 13232 bytes sw/qa/extras/ooxmlexport/data/tdf78902.docx | Bin 0 -> 30230 bytes sw/qa/extras/ooxmlexport/data/tdf8255.docx | Bin 0 -> 27607 bytes sw/qa/extras/ooxmlexport/data/tdf83300.docx | Bin 0 -> 9948 bytes sw/qa/extras/ooxmlexport/data/tdf86374.docx | Bin 0 -> 13194 bytes sw/qa/extras/ooxmlexport/data/tdf87460.docx | Bin 0 -> 17343 bytes sw/qa/extras/ooxmlexport/data/tdf87924.docx | Bin 0 -> 15925 bytes sw/qa/extras/ooxmlexport/data/tdf89165.docx | Bin 0 -> 89495 bytes sw/qa/extras/ooxmlexport/data/tdf89702.docx | Bin 0 -> 13147 bytes sw/qa/extras/ooxmlexport/data/tdf90153.docx | Bin 0 -> 4856 bytes sw/qa/extras/ooxmlexport/data/tdf90611.docx | Bin 0 -> 14706 bytes sw/qa/extras/ooxmlexport/data/tdf90810short.docx | Bin 0 -> 22286 bytes sw/qa/extras/ooxmlexport/data/tdf91122.docx | Bin 0 -> 16946 bytes sw/qa/extras/ooxmlexport/data/tdf91260.docx | Bin 0 -> 16422 bytes sw/qa/extras/ooxmlexport/data/tdf91417.docx | Bin 0 -> 13007 bytes sw/qa/extras/ooxmlexport/data/tdf92045.docx | Bin 0 -> 12629 bytes sw/qa/extras/ooxmlexport/data/tdf92124.docx | Bin 0 -> 7042 bytes sw/qa/extras/ooxmlexport/data/tdf92157.docx | Bin 0 -> 25188 bytes sw/qa/extras/ooxmlexport/data/tdf92454.docx | Bin 0 -> 32409 bytes sw/qa/extras/ooxmlexport/data/tdf93919.docx | Bin 0 -> 15336 bytes sw/qa/extras/ooxmlexport/data/tdf94043.docx | Bin 0 -> 12326 bytes sw/qa/extras/ooxmlexport/data/tdf94374.docx | Bin 0 -> 12578 bytes sw/qa/extras/ooxmlexport/data/tdf95213.docx | Bin 0 -> 17747 bytes sw/qa/extras/ooxmlexport/data/tdf95376.docx | Bin 0 -> 25375 bytes sw/qa/extras/ooxmlexport/data/tdf95775.docx | Bin 0 -> 22523 bytes sw/qa/extras/ooxmlexport/data/tdf95777.docx | Bin 0 -> 19126 bytes sw/qa/extras/ooxmlexport/data/tdf97371.docx | Bin 0 -> 18800 bytes sw/qa/extras/ooxmlexport/data/tdf99140.docx | Bin 0 -> 13349 bytes .../extras/ooxmlexport/data/test_extra_image.docx | Bin 0 -> 120620 bytes .../extras/ooxmlexport/data/textbox-wpg-only.docx | Bin 0 -> 16526 bytes .../ooxmlexport/data/tools-line-numbering.docx | Bin 0 -> 15052 bytes .../ooxmlexport/data/vml-text-vertical-adjust.docx | Bin 0 -> 10578 bytes sw/qa/extras/ooxmlexport/data/wpg-nested.docx | Bin 0 -> 34068 bytes sw/qa/extras/ooxmlexport/data/wpg-only.docx | Bin 0 -> 13503 bytes sw/qa/extras/ooxmlexport/data/wps-only.docx | Bin 0 -> 13180 bytes sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 2082 +++++++++++++++++++ sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 45 + .../data/Table_cell_auto_width_fdo69656.docx | Bin 18939 -> 0 bytes sw/qa/extras/ooxmlimport/data/all_gaps_word.docx | Bin 10226 -> 0 bytes .../ooxmlimport/data/annotation-formatting.docx | Bin 14298 -> 0 bytes .../extras/ooxmlimport/data/bnc780044_spacing.docx | Bin 7437 -> 0 bytes sw/qa/extras/ooxmlimport/data/bnc865381.docx | Bin 19510 -> 0 bytes sw/qa/extras/ooxmlimport/data/bnc875718.docx | Bin 7369 -> 0 bytes sw/qa/extras/ooxmlimport/data/bnc891663.docx | Bin 7911 -> 0 bytes sw/qa/extras/ooxmlimport/data/caption.docx | Bin 13773 -> 0 bytes sw/qa/extras/ooxmlimport/data/chart-prop.docx | Bin 17749 -> 0 bytes sw/qa/extras/ooxmlimport/data/chart-size.docx | Bin 18128 -> 0 bytes sw/qa/extras/ooxmlimport/data/chtoutline.docx | Bin 15406 -> 0 bytes .../data/conditionalstyles-tbllook.docx | Bin 11531 -> 0 bytes .../ooxmlimport/data/dml-charheight-default.docx | Bin 15770 -> 0 bytes .../data/dml-groupshape-capitalization.docx | Bin 17676 -> 0 bytes .../ooxmlimport/data/dml-groupshape-runfonts.docx | Bin 16971 -> 0 bytes .../ooxmlimport/data/dml-groupshape-sdt.docx | Bin 19727 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo38414.docx | Bin 21800 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo43093.docx | Bin 12959 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo46361.docx | Bin 13791 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo49940.docx | Bin 9909 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo52208.docx | Bin 13356 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo53985.docx | Bin 20115 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo55187.docx | Bin 12759 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo59273.docx | Bin 4358 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo59638.docx | Bin 12166 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo60922.docx | Bin 4503 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo61343.docx | Bin 114220 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo63685.docx | Bin 10964 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo65090.docx | Bin 10409 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo65632.docx | Bin 12862 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo66474.docx | Bin 96326 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo68607.docx | Bin 36117 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo69548.docx | Bin 3802 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo69636.docx | Bin 23779 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo69649.docx | Bin 35048 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo70457.docx | Bin 20296 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo72560.docx | Bin 15144 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo73389.docx | Bin 11067 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo74357.docx | Bin 11930 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo74401.docx | Bin 18425 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo74745.docx | Bin 32560 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo78883.docx | Bin 18303 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo78904.docx | Bin 14388 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo78939.docx | Bin 73680 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo79535.docx | Bin 22547 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo79738.docx | Bin 10159 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo80555.docx | Bin 15018 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo81486.docx | Bin 13354 -> 0 bytes sw/qa/extras/ooxmlimport/data/fdo85542.docx | Bin 10299 -> 0 bytes sw/qa/extras/ooxmlimport/data/file_crash.docx | Bin 17243 -> 0 bytes .../ooxmlimport/data/floating-tables-anchor.docx | Bin 16348 -> 0 bytes sw/qa/extras/ooxmlimport/data/footnote.docx | Bin 15779 -> 0 bytes sw/qa/extras/ooxmlimport/data/frame-wrap-auto.docx | Bin 10348 -> 0 bytes sw/qa/extras/ooxmlimport/data/gridbefore.docx | Bin 4987 -> 0 bytes .../ooxmlimport/data/groupshape-rotation.docx | Bin 10462 -> 0 bytes .../ooxmlimport/data/groupshape-smarttag.docx | Bin 10694 -> 0 bytes .../data/groupshape-trackedchanges.docx | Bin 17667 -> 0 bytes sw/qa/extras/ooxmlimport/data/hello.docx | Bin 12578 -> 0 bytes sw/qa/extras/ooxmlimport/data/hidemark.docx | Bin 12816 -> 0 bytes sw/qa/extras/ooxmlimport/data/i124106.docx | Bin 4810 -> 0 bytes sw/qa/extras/ooxmlimport/data/imgshadow.docx | Bin 29629 -> 0 bytes sw/qa/extras/ooxmlimport/data/indentation.docx | Bin 16945 -> 0 bytes sw/qa/extras/ooxmlimport/data/indents.docx | Bin 11553 -> 0 bytes .../extras/ooxmlimport/data/inline-groupshape.docx | Bin 16992 -> 0 bytes sw/qa/extras/ooxmlimport/data/large-twips.docx | Bin 5365 -> 0 bytes sw/qa/extras/ooxmlimport/data/libreoffice.png | Bin 767 -> 0 bytes sw/qa/extras/ooxmlimport/data/mathtype.docx | Bin 12533 -> 0 bytes sw/qa/extras/ooxmlimport/data/mce-nested.docx | Bin 32734 -> 0 bytes sw/qa/extras/ooxmlimport/data/mce-wpg.docx | Bin 17404 -> 0 bytes sw/qa/extras/ooxmlimport/data/missing-path.docx | Bin 15860 -> 0 bytes .../ooxmlimport/data/msobrightnesscontrast.docx | Bin 18972 -> 0 bytes sw/qa/extras/ooxmlimport/data/n592908-frame.docx | Bin 13589 -> 0 bytes sw/qa/extras/ooxmlimport/data/n592908-picture.docx | Bin 62593 -> 0 bytes sw/qa/extras/ooxmlimport/data/n652364.docx | Bin 8975 -> 0 bytes sw/qa/extras/ooxmlimport/data/n693238.docx | Bin 9933 -> 0 bytes sw/qa/extras/ooxmlimport/data/n705956-1.docx | Bin 7861 -> 0 bytes sw/qa/extras/ooxmlimport/data/n705956-2.docx | Bin 9363 -> 0 bytes sw/qa/extras/ooxmlimport/data/n747461.docx | Bin 6489 -> 0 bytes sw/qa/extras/ooxmlimport/data/n750255.docx | Bin 10102 -> 0 bytes sw/qa/extras/ooxmlimport/data/n750935.docx | Bin 57750 -> 0 bytes sw/qa/extras/ooxmlimport/data/n751054.docx | Bin 13100 -> 0 bytes sw/qa/extras/ooxmlimport/data/n751117.docx | Bin 10312 -> 0 bytes sw/qa/extras/ooxmlimport/data/n764005.docx | Bin 13088 -> 0 bytes sw/qa/extras/ooxmlimport/data/n766481.docx | Bin 10021 -> 0 bytes sw/qa/extras/ooxmlimport/data/n766487.docx | Bin 9273 -> 0 bytes sw/qa/extras/ooxmlimport/data/n775906.docx | Bin 11750 -> 0 bytes sw/qa/extras/ooxmlimport/data/n777337.docx | Bin 13409 -> 0 bytes sw/qa/extras/ooxmlimport/data/n778828.docx | Bin 10012 -> 0 bytes sw/qa/extras/ooxmlimport/data/n778836.docx | Bin 9649 -> 0 bytes sw/qa/extras/ooxmlimport/data/n779630.docx | Bin 12500 -> 0 bytes sw/qa/extras/ooxmlimport/data/n779642.docx | Bin 85485 -> 0 bytes sw/qa/extras/ooxmlimport/data/n779834.docx | Bin 22624 -> 0 bytes sw/qa/extras/ooxmlimport/data/n779941.docx | Bin 10316 -> 0 bytes sw/qa/extras/ooxmlimport/data/n780563.docx | Bin 24144 -> 0 bytes sw/qa/extras/ooxmlimport/data/n780843.docx | Bin 12614 -> 0 bytes sw/qa/extras/ooxmlimport/data/n780843b.docx | Bin 13623 -> 0 bytes sw/qa/extras/ooxmlimport/data/n780853.docx | Bin 9261 -> 0 bytes sw/qa/extras/ooxmlimport/data/n782345.docx | Bin 12607 -> 0 bytes sw/qa/extras/ooxmlimport/data/n783638.docx | Bin 19119 -> 0 bytes sw/qa/extras/ooxmlimport/data/n785767.docx | Bin 12848 -> 0 bytes sw/qa/extras/ooxmlimport/data/n792778.docx | Bin 15329 -> 0 bytes sw/qa/extras/ooxmlimport/data/n793262.docx | Bin 15449 -> 0 bytes sw/qa/extras/ooxmlimport/data/n793998.docx | Bin 13167 -> 0 bytes sw/qa/extras/ooxmlimport/data/n816593.docx | Bin 17030 -> 0 bytes sw/qa/extras/ooxmlimport/data/n820509.docx | Bin 10414 -> 0 bytes sw/qa/extras/ooxmlimport/data/n830205.docx | Bin 33186 -> 0 bytes .../data/negative-cell-margin-twips.docx | Bin 5902 -> 0 bytes sw/qa/extras/ooxmlimport/data/numbering1.docx | Bin 14346 -> 0 bytes .../ooxmlimport/data/page-border-shadow.docx | Bin 10012 -> 0 bytes .../ooxmlimport/data/picture-with-schemecolor.docx | Bin 35489 -> 0 bytes sw/qa/extras/ooxmlimport/data/rhbz1180114.docx | Bin 3435 -> 0 bytes .../extras/ooxmlimport/data/rprchange_closed.docx | Bin 24695 -> 0 bytes .../ooxmlimport/data/section_break_numbering.docx | Bin 5614 -> 0 bytes sw/qa/extras/ooxmlimport/data/smartart.docx | Bin 20453 -> 0 bytes sw/qa/extras/ooxmlimport/data/strict-smartart.docx | Bin 18661 -> 0 bytes sw/qa/extras/ooxmlimport/data/strict.docx | Bin 25636 -> 0 bytes .../data/table-auto-column-fixed-size.docx | Bin 17672 -> 0 bytes .../data/table-auto-column-fixed-size2.docx | Bin 12907 -> 0 bytes .../extras/ooxmlimport/data/table-auto-nested.docx | Bin 10297 -> 0 bytes .../extras/ooxmlimport/data/table-btlr-center.docx | Bin 10686 -> 0 bytes sw/qa/extras/ooxmlimport/data/table-pagebreak.docx | Bin 10148 -> 0 bytes .../ooxmlimport/data/table-style-parprop.docx | Bin 10098 -> 0 bytes .../ooxmlimport/data/tableborder-finedash.docx | Bin 10266 -> 0 bytes sw/qa/extras/ooxmlimport/data/tblr-height.docx | Bin 10466 -> 0 bytes sw/qa/extras/ooxmlimport/data/tcw-rounding.docx | Bin 14876 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf59699.docx | Bin 13232 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf78902.docx | Bin 30230 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf8255.docx | Bin 27607 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf83300.docx | Bin 9948 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf86374.docx | Bin 13194 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf87460.docx | Bin 17343 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf87924.docx | Bin 15925 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf89165.docx | Bin 89495 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf89702.docx | Bin 13147 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf90153.docx | Bin 4856 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf90611.docx | Bin 14706 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf90810short.docx | Bin 22286 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf91122.docx | Bin 16946 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf91260.docx | Bin 16422 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf91417.docx | Bin 13007 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf92045.docx | Bin 12629 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf92124.docx | Bin 7042 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf92157.docx | Bin 25188 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf92454.docx | Bin 32409 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf93919.docx | Bin 15336 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf94043.docx | Bin 12326 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf94374.docx | Bin 12578 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf95213.docx | Bin 17747 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf95376.docx | Bin 25375 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf95775.docx | Bin 22523 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf95777.docx | Bin 19126 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf97371.docx | Bin 18800 -> 0 bytes sw/qa/extras/ooxmlimport/data/tdf99140.docx | Bin 13349 -> 0 bytes .../extras/ooxmlimport/data/test_extra_image.docx | Bin 120620 -> 0 bytes .../extras/ooxmlimport/data/textbox-wpg-only.docx | Bin 16526 -> 0 bytes .../ooxmlimport/data/tools-line-numbering.docx | Bin 15052 -> 0 bytes .../ooxmlimport/data/vml-text-vertical-adjust.docx | Bin 10578 -> 0 bytes sw/qa/extras/ooxmlimport/data/wpg-nested.docx | Bin 34068 -> 0 bytes sw/qa/extras/ooxmlimport/data/wpg-only.docx | Bin 13503 -> 0 bytes sw/qa/extras/ooxmlimport/data/wps-only.docx | Bin 13180 -> 0 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2130 +------------------- 323 files changed, 2303 insertions(+), 2077 deletions(-) create mode 100644 sw/CppunitTest_sw_ooxmlexport8.mk create mode 100644 sw/CppunitTest_sw_ooxmlexport9.mk create mode 100644 sw/qa/extras/ooxmlexport/data/all_gaps_word.docx create mode 100644 sw/qa/extras/ooxmlexport/data/annotation-formatting.docx create mode 100644 sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx create mode 100644 sw/qa/extras/ooxmlexport/data/bnc865381.docx create mode 100644 sw/qa/extras/ooxmlexport/data/bnc875718.docx create mode 100644 sw/qa/extras/ooxmlexport/data/bnc891663.docx create mode 100644 sw/qa/extras/ooxmlexport/data/caption.docx create mode 100644 sw/qa/extras/ooxmlexport/data/chart-prop.docx create mode 100644 sw/qa/extras/ooxmlexport/data/chart-size.docx create mode 100644 sw/qa/extras/ooxmlexport/data/chtoutline.docx create mode 100644 sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx create mode 100644 sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx create mode 100644 sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx create mode 100644 sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx create mode 100644 sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo38414.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo43093b.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo46361.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo49940.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo52208.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo53985.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo55187.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo59273.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo59638.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo60922.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo61343.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo63685.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo65090.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo65632.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo66474.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo68607.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo69548.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo70457.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo72560.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo73389.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo74357.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo74401.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo74745.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo78883.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo78904.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo78939.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo79535.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo79738.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo80555.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo81486.docx create mode 100644 sw/qa/extras/ooxmlexport/data/fdo85542.docx create mode 100644 sw/qa/extras/ooxmlexport/data/file_crash.docx create mode 100644 sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx create mode 100644 sw/qa/extras/ooxmlexport/data/footnote.docx create mode 100644 sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx create mode 100644 sw/qa/extras/ooxmlexport/data/gridbefore.docx create mode 100644 sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx create mode 100644 sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx create mode 100644 sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx create mode 100644 sw/qa/extras/ooxmlexport/data/hello.docx create mode 100644 sw/qa/extras/ooxmlexport/data/hidemark.docx create mode 100644 sw/qa/extras/ooxmlexport/data/i124106.docx create mode 100644 sw/qa/extras/ooxmlexport/data/imgshadow.docx create mode 100644 sw/qa/extras/ooxmlexport/data/indentation.docx create mode 100755 sw/qa/extras/ooxmlexport/data/indents.docx create mode 100644 sw/qa/extras/ooxmlexport/data/inline-groupshape.docx create mode 100644 sw/qa/extras/ooxmlexport/data/large-twips.docx create mode 100644 sw/qa/extras/ooxmlexport/data/libreoffice.png create mode 100644 sw/qa/extras/ooxmlexport/data/mathtype.docx create mode 100644 sw/qa/extras/ooxmlexport/data/mce-nested.docx create mode 100644 sw/qa/extras/ooxmlexport/data/mce-wpg.docx create mode 100644 sw/qa/extras/ooxmlexport/data/missing-path.docx create mode 100644 sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n592908-frame.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n592908-picture.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n652364.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n693238.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n705956-1.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n705956-2.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n747461.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n750255.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n750935.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n751054.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n751117.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n764005.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n766481.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n766487.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n775906.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n777337.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n778828.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n778836.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n779630.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n779642.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n779834.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n779941.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n780563.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n780843.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n780843b.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n780853.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n782345.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n783638.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n785767.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n792778.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n793262.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n793998.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n816593.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n820509.docx create mode 100644 sw/qa/extras/ooxmlexport/data/n830205.docx create mode 100644 sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx create mode 100644 sw/qa/extras/ooxmlexport/data/numbering1.docx create mode 100644 sw/qa/extras/ooxmlexport/data/page-border-shadow.docx create mode 100644 sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx create mode 100644 sw/qa/extras/ooxmlexport/data/rhbz1180114.docx create mode 100644 sw/qa/extras/ooxmlexport/data/rprchange_closed.docx create mode 100644 sw/qa/extras/ooxmlexport/data/section_break_numbering.docx create mode 100644 sw/qa/extras/ooxmlexport/data/strict-smartart.docx create mode 100644 sw/qa/extras/ooxmlexport/data/strict.docx create mode 100644 sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size.docx create mode 100644 sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size2.docx create mode 100644 sw/qa/extras/ooxmlexport/data/table-auto-nested.docx create mode 100644 sw/qa/extras/ooxmlexport/data/table-btlr-center.docx create mode 100644 sw/qa/extras/ooxmlexport/data/table-pagebreak.docx create mode 100644 sw/qa/extras/ooxmlexport/data/table-style-parprop.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tblr-height.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tcw-rounding.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf59699.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf78902.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf8255.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf83300.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf86374.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf87460.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf87924.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf89165.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf89702.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf90153.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf90611.docx create mode 100755 sw/qa/extras/ooxmlexport/data/tdf90810short.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf91122.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf91260.docx create mode 100755 sw/qa/extras/ooxmlexport/data/tdf91417.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf92045.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf92124.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf92157.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf92454.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf93919.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf94043.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf94374.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf95213.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf95376.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf95775.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf95777.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf97371.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tdf99140.docx create mode 100644 sw/qa/extras/ooxmlexport/data/test_extra_image.docx create mode 100644 sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx create mode 100644 sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx create mode 100644 sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx create mode 100644 sw/qa/extras/ooxmlexport/data/wpg-nested.docx create mode 100644 sw/qa/extras/ooxmlexport/data/wpg-only.docx create mode 100644 sw/qa/extras/ooxmlexport/data/wps-only.docx create mode 100644 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx create mode 100644 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx delete mode 100644 sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/all_gaps_word.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/annotation-formatting.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/bnc865381.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/bnc875718.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/bnc891663.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/caption.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/chart-prop.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/chart-size.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/chtoutline.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/conditionalstyles-tbllook.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/dml-groupshape-capitalization.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/dml-groupshape-runfonts.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo38414.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo43093.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo46361.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo49940.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo52208.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo53985.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo55187.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo59273.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo59638.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo60922.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo61343.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo63685.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo65090.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo65632.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo66474.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo68607.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo69548.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo69636.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo69649.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo70457.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo72560.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo73389.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo74357.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo74401.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo74745.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo78883.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo78904.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo78939.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo79535.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo79738.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo80555.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo81486.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/fdo85542.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/file_crash.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/floating-tables-anchor.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/footnote.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/frame-wrap-auto.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/gridbefore.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/groupshape-rotation.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/groupshape-smarttag.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/groupshape-trackedchanges.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/hello.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/hidemark.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/i124106.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/imgshadow.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/indentation.docx delete mode 100755 sw/qa/extras/ooxmlimport/data/indents.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/inline-groupshape.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/large-twips.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/libreoffice.png delete mode 100644 sw/qa/extras/ooxmlimport/data/mathtype.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/mce-nested.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/mce-wpg.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/missing-path.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/msobrightnesscontrast.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n592908-frame.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n592908-picture.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n652364.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n693238.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n705956-1.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n705956-2.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n747461.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n750255.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n750935.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n751054.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n751117.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n764005.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n766481.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n766487.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n775906.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n777337.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n778828.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n778836.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n779630.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n779642.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n779834.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n779941.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n780563.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n780843.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n780843b.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n780853.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n782345.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n783638.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n785767.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n792778.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n793262.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n793998.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n816593.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n820509.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/n830205.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/negative-cell-margin-twips.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/numbering1.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/page-border-shadow.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/picture-with-schemecolor.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/rhbz1180114.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/rprchange_closed.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/section_break_numbering.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/smartart.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/strict-smartart.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/strict.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/table-auto-nested.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/table-btlr-center.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/table-pagebreak.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/table-style-parprop.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tableborder-finedash.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tblr-height.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tcw-rounding.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf59699.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf78902.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf8255.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf83300.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf86374.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf87460.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf87924.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf89165.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf89702.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf90153.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf90611.docx delete mode 100755 sw/qa/extras/ooxmlimport/data/tdf90810short.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf91122.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf91260.docx delete mode 100755 sw/qa/extras/ooxmlimport/data/tdf91417.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf92045.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf92124.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf92157.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf92454.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf93919.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf94043.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf94374.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf95213.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf95376.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf95775.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf95777.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf97371.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tdf99140.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/test_extra_image.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/textbox-wpg-only.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/vml-text-vertical-adjust.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/wpg-nested.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/wpg-only.docx delete mode 100644 sw/qa/extras/ooxmlimport/data/wps-only.docx diff --git a/sw/CppunitTest_sw_ooxmlexport8.mk b/sw/CppunitTest_sw_ooxmlexport8.mk new file mode 100644 index 000000000000..8bf3f5dab8d7 --- /dev/null +++ b/sw/CppunitTest_sw_ooxmlexport8.mk @@ -0,0 +1,104 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# 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/. +# +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_ooxmlexport8)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_ooxmlexport8, \ + sw/qa/extras/ooxmlexport/ooxmlexport8 \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlexport8, \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + sal \ + test \ + unotest \ + utl \ + sw \ + tl \ + vcl \ + svxcore \ + $(gb_UWINAPI) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_ooxmlexport8,\ + boost_headers \ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_ooxmlexport8,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + -I$(SRCDIR)/sw/qa/extras/inc \ + $$(INCLUDE) \ +)) + +ifeq ($(OS),MACOSX) + +$(eval $(call gb_CppunitTest_add_cxxflags,sw_ooxmlexport8,\ + $(gb_OBJCXXFLAGS) \ +)) + +$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,sw_ooxmlexport8,\ + AppKit \ +)) + +endif + +$(eval $(call gb_CppunitTest_use_sdk_api,sw_ooxmlexport8)) + +$(eval $(call gb_CppunitTest_use_ure,sw_ooxmlexport8)) +$(eval $(call gb_CppunitTest_use_vcl,sw_ooxmlexport8)) + +$(eval $(call gb_CppunitTest_use_components,sw_ooxmlexport8,\ + basic/util/sb \ + chart2/source/controller/chartcontroller \ + chart2/source/chartcore \ + canvas/source/factory/canvasfactory \ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + drawinglayer/drawinglayer \ + embeddedobj/util/embobj \ + filter/source/config/cache/filterconfig1 \ + forms/util/frm \ + framework/util/fwk \ + i18npool/util/i18npool \ + linguistic/source/lng \ + oox/util/oox \ + package/source/xstor/xstor \ + package/util/package2 \ + sax/source/expatwrap/expwrap \ + sw/util/sw \ + sw/util/swd \ + sw/util/msword \ + sfx2/util/sfx \ + starmath/util/sm \ + svl/source/fsstor/fsstorage \ + svl/util/svl \ + svtools/util/svt \ + svx/util/svx \ + svx/util/svxcore \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unotools/util/utl \ + unoxml/source/service/unoxml \ + unoxml/source/rdf/unordf \ + uui/util/uui \ + writerfilter/util/writerfilter \ + xmloff/util/xo \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_ooxmlexport8)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_ooxmlexport9.mk b/sw/CppunitTest_sw_ooxmlexport9.mk new file mode 100644 index 000000000000..9b7c409271d0 --- /dev/null +++ b/sw/CppunitTest_sw_ooxmlexport9.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# 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 $(SRCDIR)/sw/ooxmlexport_setup.mk + +$(eval $(call sw_ooxmlexport_test,9)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 3341552ea8b1..d63c5a2dcdcc 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -59,6 +59,8 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_ooxmlexport5 \ CppunitTest_sw_ooxmlexport6 \ CppunitTest_sw_ooxmlexport7 \ + CppunitTest_sw_ooxmlexport8 \ + CppunitTest_sw_ooxmlexport9 \ CppunitTest_sw_ooxmlfieldexport \ CppunitTest_sw_ooxmlw14export \ CppunitTest_sw_ooxmlimport \ diff --git a/sw/ooxmlexport_setup.mk b/sw/ooxmlexport_setup.mk index da06f1a37bf0..91ffc4b431f0 100644 --- a/sw/ooxmlexport_setup.mk +++ b/sw/ooxmlexport_setup.mk @@ -20,6 +20,7 @@ define sw_ooxmlexport_libraries unotest \ utl \ vcl \ + svxcore \ $(gb_UWINAPI) endef diff --git a/sw/qa/extras/ooxmlexport/data/all_gaps_word.docx b/sw/qa/extras/ooxmlexport/data/all_gaps_word.docx new file mode 100644 index 000000000000..fc52281a2552 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/all_gaps_word.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/annotation-formatting.docx b/sw/qa/extras/ooxmlexport/data/annotation-formatting.docx new file mode 100644 index 000000000000..87af02b780e5 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/annotation-formatting.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx b/sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx new file mode 100644 index 000000000000..927d4d37671a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/bnc865381.docx b/sw/qa/extras/ooxmlexport/data/bnc865381.docx new file mode 100644 index 000000000000..bb125cc73095 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc865381.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/bnc875718.docx b/sw/qa/extras/ooxmlexport/data/bnc875718.docx new file mode 100644 index 000000000000..878a46fdf912 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc875718.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/bnc891663.docx b/sw/qa/extras/ooxmlexport/data/bnc891663.docx new file mode 100644 index 000000000000..d5f057e66fd6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc891663.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/caption.docx b/sw/qa/extras/ooxmlexport/data/caption.docx new file mode 100644 index 000000000000..301472cbc7ad Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/caption.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/chart-prop.docx b/sw/qa/extras/ooxmlexport/data/chart-prop.docx new file mode 100644 index 000000000000..f9cddd4949a6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/chart-prop.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/chart-size.docx b/sw/qa/extras/ooxmlexport/data/chart-size.docx new file mode 100644 index 000000000000..da5d144438a3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/chart-size.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/chtoutline.docx b/sw/qa/extras/ooxmlexport/data/chtoutline.docx new file mode 100644 index 000000000000..92fdaf71e745 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/chtoutline.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx b/sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx new file mode 100644 index 000000000000..4222d6376789 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx b/sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx new file mode 100644 index 000000000000..0f22a87f0e29 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx new file mode 100644 index 000000000000..67fd21f64d14 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx new file mode 100644 index 000000000000..e4c8c6cb575f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx new file mode 100644 index 000000000000..7314d876a45c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo38414.docx b/sw/qa/extras/ooxmlexport/data/fdo38414.docx new file mode 100644 index 000000000000..135cd32c981e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo38414.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo43093b.docx b/sw/qa/extras/ooxmlexport/data/fdo43093b.docx new file mode 100644 index 000000000000..3e5a910e2003 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo43093b.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo46361.docx b/sw/qa/extras/ooxmlexport/data/fdo46361.docx new file mode 100644 index 000000000000..2f894e4b3ccd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo46361.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo49940.docx b/sw/qa/extras/ooxmlexport/data/fdo49940.docx new file mode 100644 index 000000000000..242284463632 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo49940.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo52208.docx b/sw/qa/extras/ooxmlexport/data/fdo52208.docx new file mode 100644 index 000000000000..be842ad2acbc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo52208.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo53985.docx b/sw/qa/extras/ooxmlexport/data/fdo53985.docx new file mode 100644 index 000000000000..0c8b32fb671f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo53985.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo55187.docx b/sw/qa/extras/ooxmlexport/data/fdo55187.docx new file mode 100644 index 000000000000..59cd0a806250 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo55187.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo59273.docx b/sw/qa/extras/ooxmlexport/data/fdo59273.docx new file mode 100644 index 000000000000..fcdfd7734411 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo59273.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo59638.docx b/sw/qa/extras/ooxmlexport/data/fdo59638.docx new file mode 100644 index 000000000000..d33e7cc0a037 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo59638.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo60922.docx b/sw/qa/extras/ooxmlexport/data/fdo60922.docx new file mode 100644 index 000000000000..0d1ff2613ecd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo60922.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo61343.docx b/sw/qa/extras/ooxmlexport/data/fdo61343.docx new file mode 100644 index 000000000000..9ab99739b7c2 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo61343.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo63685.docx b/sw/qa/extras/ooxmlexport/data/fdo63685.docx new file mode 100644 index 000000000000..a1348fcff3b6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo63685.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo65090.docx b/sw/qa/extras/ooxmlexport/data/fdo65090.docx new file mode 100644 index 000000000000..4d45737ddc37 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo65090.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo65632.docx b/sw/qa/extras/ooxmlexport/data/fdo65632.docx new file mode 100644 index 000000000000..8c336c20fdfc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo65632.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo66474.docx b/sw/qa/extras/ooxmlexport/data/fdo66474.docx new file mode 100644 index 000000000000..0252746f5b6e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo66474.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo68607.docx b/sw/qa/extras/ooxmlexport/data/fdo68607.docx new file mode 100644 index 000000000000..11f57064ce92 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo68607.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo69548.docx b/sw/qa/extras/ooxmlexport/data/fdo69548.docx new file mode 100644 index 000000000000..6799f5ef26bf Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo69548.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo70457.docx b/sw/qa/extras/ooxmlexport/data/fdo70457.docx new file mode 100644 index 000000000000..b9cabb11902c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo70457.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560.docx b/sw/qa/extras/ooxmlexport/data/fdo72560.docx new file mode 100644 index 000000000000..b21535bfd453 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo72560.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo73389.docx b/sw/qa/extras/ooxmlexport/data/fdo73389.docx new file mode 100644 index 000000000000..02b55f74e2b8 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo73389.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo74357.docx b/sw/qa/extras/ooxmlexport/data/fdo74357.docx new file mode 100644 index 000000000000..970372906e29 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo74357.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo74401.docx b/sw/qa/extras/ooxmlexport/data/fdo74401.docx new file mode 100644 index 000000000000..fd3cbabdd9d2 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo74401.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo74745.docx b/sw/qa/extras/ooxmlexport/data/fdo74745.docx new file mode 100644 index 000000000000..773567756a79 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo74745.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo78883.docx b/sw/qa/extras/ooxmlexport/data/fdo78883.docx new file mode 100644 index 000000000000..a72ff9436e0c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78883.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo78904.docx b/sw/qa/extras/ooxmlexport/data/fdo78904.docx new file mode 100644 index 000000000000..c171ae2ca813 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78904.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo78939.docx b/sw/qa/extras/ooxmlexport/data/fdo78939.docx new file mode 100644 index 000000000000..2fc3198630cd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78939.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo79535.docx b/sw/qa/extras/ooxmlexport/data/fdo79535.docx new file mode 100644 index 000000000000..64aab18e0ad7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79535.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo79738.docx b/sw/qa/extras/ooxmlexport/data/fdo79738.docx new file mode 100644 index 000000000000..e6873e7a2362 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79738.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo80555.docx b/sw/qa/extras/ooxmlexport/data/fdo80555.docx new file mode 100644 index 000000000000..a15bdc1ecd31 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80555.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo81486.docx b/sw/qa/extras/ooxmlexport/data/fdo81486.docx new file mode 100644 index 000000000000..6e680c350a7c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo81486.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/fdo85542.docx b/sw/qa/extras/ooxmlexport/data/fdo85542.docx new file mode 100644 index 000000000000..db4940845140 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo85542.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/file_crash.docx b/sw/qa/extras/ooxmlexport/data/file_crash.docx new file mode 100644 index 000000000000..7a233aba5c47 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/file_crash.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx b/sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx new file mode 100644 index 000000000000..70dc7cf8bf10 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/footnote.docx b/sw/qa/extras/ooxmlexport/data/footnote.docx new file mode 100644 index 000000000000..f5c94bd27004 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/footnote.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx b/sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx new file mode 100644 index 000000000000..6ad7fe059449 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/gridbefore.docx b/sw/qa/extras/ooxmlexport/data/gridbefore.docx new file mode 100644 index 000000000000..571fb48eaa9a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/gridbefore.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx b/sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx new file mode 100644 index 000000000000..d63b5d0734e1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx b/sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx new file mode 100644 index 000000000000..6fc1cb2e6936 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx b/sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx new file mode 100644 index 000000000000..116721f39ecc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/hello.docx b/sw/qa/extras/ooxmlexport/data/hello.docx new file mode 100644 index 000000000000..d5d8d43ebdac Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/hello.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/hidemark.docx b/sw/qa/extras/ooxmlexport/data/hidemark.docx new file mode 100644 index 000000000000..4a273d6039bb Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/hidemark.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/i124106.docx b/sw/qa/extras/ooxmlexport/data/i124106.docx new file mode 100644 index 000000000000..de1d542936ce Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/i124106.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/imgshadow.docx b/sw/qa/extras/ooxmlexport/data/imgshadow.docx new file mode 100644 index 000000000000..efe0e9596008 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/imgshadow.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/indentation.docx b/sw/qa/extras/ooxmlexport/data/indentation.docx new file mode 100644 index 000000000000..cf57aaf5417e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/indentation.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/indents.docx b/sw/qa/extras/ooxmlexport/data/indents.docx new file mode 100755 index 000000000000..b16736791c2e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/indents.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/inline-groupshape.docx b/sw/qa/extras/ooxmlexport/data/inline-groupshape.docx new file mode 100644 index 000000000000..def5a05b40e4 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/inline-groupshape.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/large-twips.docx b/sw/qa/extras/ooxmlexport/data/large-twips.docx new file mode 100644 index 000000000000..6e9d82dfab42 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/large-twips.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/libreoffice.png b/sw/qa/extras/ooxmlexport/data/libreoffice.png new file mode 100644 index 000000000000..437f613c178c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/libreoffice.png differ diff --git a/sw/qa/extras/ooxmlexport/data/mathtype.docx b/sw/qa/extras/ooxmlexport/data/mathtype.docx new file mode 100644 index 000000000000..bf60f43b25b7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/mathtype.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/mce-nested.docx b/sw/qa/extras/ooxmlexport/data/mce-nested.docx new file mode 100644 index 000000000000..907ac080c1e3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/mce-nested.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/mce-wpg.docx b/sw/qa/extras/ooxmlexport/data/mce-wpg.docx new file mode 100644 index 000000000000..bd0d84681317 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/mce-wpg.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/missing-path.docx b/sw/qa/extras/ooxmlexport/data/missing-path.docx new file mode 100644 index 000000000000..8d75e9f630ed Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/missing-path.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx b/sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx new file mode 100644 index 000000000000..132f23575b57 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n592908-frame.docx b/sw/qa/extras/ooxmlexport/data/n592908-frame.docx new file mode 100644 index 000000000000..ff59cacbad79 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n592908-frame.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n592908-picture.docx b/sw/qa/extras/ooxmlexport/data/n592908-picture.docx new file mode 100644 index 000000000000..2766d3691cdd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n592908-picture.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n652364.docx b/sw/qa/extras/ooxmlexport/data/n652364.docx new file mode 100644 index 000000000000..0845509e84b7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n652364.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n693238.docx b/sw/qa/extras/ooxmlexport/data/n693238.docx new file mode 100644 index 000000000000..5bcda0fff6f7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n693238.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n705956-1.docx b/sw/qa/extras/ooxmlexport/data/n705956-1.docx new file mode 100644 index 000000000000..edff3bac412c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n705956-1.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n705956-2.docx b/sw/qa/extras/ooxmlexport/data/n705956-2.docx new file mode 100644 index 000000000000..138818523a92 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n705956-2.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n747461.docx b/sw/qa/extras/ooxmlexport/data/n747461.docx new file mode 100644 index 000000000000..1064e5db060b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n747461.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n750255.docx b/sw/qa/extras/ooxmlexport/data/n750255.docx new file mode 100644 index 000000000000..a0c7370022b0 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n750255.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n750935.docx b/sw/qa/extras/ooxmlexport/data/n750935.docx new file mode 100644 index 000000000000..0dd01592dd65 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n750935.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n751054.docx b/sw/qa/extras/ooxmlexport/data/n751054.docx new file mode 100644 index 000000000000..49d7d6af9cc6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n751054.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n751117.docx b/sw/qa/extras/ooxmlexport/data/n751117.docx new file mode 100644 index 000000000000..17cc9c53d1cb Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n751117.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n764005.docx b/sw/qa/extras/ooxmlexport/data/n764005.docx new file mode 100644 index 000000000000..1c0dd9d077e9 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n764005.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n766481.docx b/sw/qa/extras/ooxmlexport/data/n766481.docx new file mode 100644 index 000000000000..e1521ec82f9c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n766481.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n766487.docx b/sw/qa/extras/ooxmlexport/data/n766487.docx new file mode 100644 index 000000000000..85eda0e7e381 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n766487.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n775906.docx b/sw/qa/extras/ooxmlexport/data/n775906.docx new file mode 100644 index 000000000000..6b6dd1a6b45d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n775906.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n777337.docx b/sw/qa/extras/ooxmlexport/data/n777337.docx new file mode 100644 index 000000000000..8bb377dcf621 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n777337.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n778828.docx b/sw/qa/extras/ooxmlexport/data/n778828.docx new file mode 100644 index 000000000000..ad2e22d17fbf Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n778828.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n778836.docx b/sw/qa/extras/ooxmlexport/data/n778836.docx new file mode 100644 index 000000000000..ccd89e85b436 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n778836.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n779630.docx b/sw/qa/extras/ooxmlexport/data/n779630.docx new file mode 100644 index 000000000000..97812d66cff5 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n779630.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n779642.docx b/sw/qa/extras/ooxmlexport/data/n779642.docx new file mode 100644 index 000000000000..2fe9a176689b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n779642.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n779834.docx b/sw/qa/extras/ooxmlexport/data/n779834.docx new file mode 100644 index 000000000000..24b6db1a446e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n779834.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n779941.docx b/sw/qa/extras/ooxmlexport/data/n779941.docx new file mode 100644 index 000000000000..9889d81e2383 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n779941.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n780563.docx b/sw/qa/extras/ooxmlexport/data/n780563.docx new file mode 100644 index 000000000000..508dc7474bfa Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n780563.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n780843.docx b/sw/qa/extras/ooxmlexport/data/n780843.docx new file mode 100644 index 000000000000..9b92f79aaa17 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n780843.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n780843b.docx b/sw/qa/extras/ooxmlexport/data/n780843b.docx new file mode 100644 index 000000000000..2ba9ab2c6f0f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n780843b.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n780853.docx b/sw/qa/extras/ooxmlexport/data/n780853.docx new file mode 100644 index 000000000000..fed8276fbb2a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n780853.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n782345.docx b/sw/qa/extras/ooxmlexport/data/n782345.docx new file mode 100644 index 000000000000..f25709fedf4f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n782345.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n783638.docx b/sw/qa/extras/ooxmlexport/data/n783638.docx new file mode 100644 index 000000000000..93b587b92ef9 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n783638.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n785767.docx b/sw/qa/extras/ooxmlexport/data/n785767.docx new file mode 100644 index 000000000000..db356769bc8b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n785767.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n792778.docx b/sw/qa/extras/ooxmlexport/data/n792778.docx new file mode 100644 index 000000000000..d9541d4ccfce Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n792778.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n793262.docx b/sw/qa/extras/ooxmlexport/data/n793262.docx new file mode 100644 index 000000000000..7f2d2e0a8084 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n793262.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n793998.docx b/sw/qa/extras/ooxmlexport/data/n793998.docx new file mode 100644 index 000000000000..fc96e2e97f74 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n793998.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n816593.docx b/sw/qa/extras/ooxmlexport/data/n816593.docx new file mode 100644 index 000000000000..7d784e69d4e6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n816593.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n820509.docx b/sw/qa/extras/ooxmlexport/data/n820509.docx new file mode 100644 index 000000000000..a6da1e16842c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n820509.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/n830205.docx b/sw/qa/extras/ooxmlexport/data/n830205.docx new file mode 100644 index 000000000000..89cf1d8434a1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/n830205.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx b/sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx new file mode 100644 index 000000000000..3ae73db5c846 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/numbering1.docx b/sw/qa/extras/ooxmlexport/data/numbering1.docx new file mode 100644 index 000000000000..55b4af3e8584 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/numbering1.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/page-border-shadow.docx b/sw/qa/extras/ooxmlexport/data/page-border-shadow.docx new file mode 100644 index 000000000000..65a2273f6bc6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/page-border-shadow.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx b/sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx new file mode 100644 index 000000000000..bfee0e1415e8 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/rhbz1180114.docx b/sw/qa/extras/ooxmlexport/data/rhbz1180114.docx new file mode 100644 index 000000000000..23009ebbdc82 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/rhbz1180114.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/rprchange_closed.docx b/sw/qa/extras/ooxmlexport/data/rprchange_closed.docx new file mode 100644 index 000000000000..ff53871e91ae Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/rprchange_closed.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/section_break_numbering.docx b/sw/qa/extras/ooxmlexport/data/section_break_numbering.docx new file mode 100644 index 000000000000..8b5378a771e5 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/section_break_numbering.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/strict-smartart.docx b/sw/qa/extras/ooxmlexport/data/strict-smartart.docx new file mode 100644 index 000000000000..bab7c16bcea1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/strict-smartart.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/strict.docx b/sw/qa/extras/ooxmlexport/data/strict.docx new file mode 100644 index 000000000000..b46ce94b3402 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/strict.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size.docx b/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size.docx new file mode 100644 index 000000000000..557edcb3cb0b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size2.docx b/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size2.docx new file mode 100644 index 000000000000..2125f09da790 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size2.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/table-auto-nested.docx b/sw/qa/extras/ooxmlexport/data/table-auto-nested.docx new file mode 100644 index 000000000000..85f47dbba0b3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-auto-nested.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlexport/data/table-btlr-center.docx new file mode 100644 index 000000000000..79cb53eed06d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-btlr-center.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/table-pagebreak.docx b/sw/qa/extras/ooxmlexport/data/table-pagebreak.docx new file mode 100644 index 000000000000..06ecf9535af1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-pagebreak.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/table-style-parprop.docx b/sw/qa/extras/ooxmlexport/data/table-style-parprop.docx new file mode 100644 index 000000000000..1c68c704e7fb Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-style-parprop.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx b/sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx new file mode 100644 index 000000000000..003167ac3ade Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tblr-height.docx b/sw/qa/extras/ooxmlexport/data/tblr-height.docx new file mode 100644 index 000000000000..6a16c81dd5e0 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tblr-height.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tcw-rounding.docx b/sw/qa/extras/ooxmlexport/data/tcw-rounding.docx new file mode 100644 index 000000000000..d4055c953b6f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tcw-rounding.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf59699.docx b/sw/qa/extras/ooxmlexport/data/tdf59699.docx new file mode 100644 index 000000000000..158ac338f88a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf59699.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf78902.docx b/sw/qa/extras/ooxmlexport/data/tdf78902.docx new file mode 100644 index 000000000000..3cf3a443a975 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf78902.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf8255.docx b/sw/qa/extras/ooxmlexport/data/tdf8255.docx new file mode 100644 index 000000000000..366e498856ba Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf8255.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf83300.docx b/sw/qa/extras/ooxmlexport/data/tdf83300.docx new file mode 100644 index 000000000000..aa3ad22d10fc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf83300.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf86374.docx b/sw/qa/extras/ooxmlexport/data/tdf86374.docx new file mode 100644 index 000000000000..7fd772d79b3f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf86374.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf87460.docx b/sw/qa/extras/ooxmlexport/data/tdf87460.docx new file mode 100644 index 000000000000..c443dbe4563e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf87460.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf87924.docx b/sw/qa/extras/ooxmlexport/data/tdf87924.docx new file mode 100644 index 000000000000..5265d6638a88 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf87924.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf89165.docx b/sw/qa/extras/ooxmlexport/data/tdf89165.docx new file mode 100644 index 000000000000..a060ca444e27 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf89165.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf89702.docx b/sw/qa/extras/ooxmlexport/data/tdf89702.docx new file mode 100644 index 000000000000..5542d1cbe575 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf89702.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf90153.docx b/sw/qa/extras/ooxmlexport/data/tdf90153.docx new file mode 100644 index 000000000000..decbfa29d3b9 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf90153.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf90611.docx b/sw/qa/extras/ooxmlexport/data/tdf90611.docx new file mode 100644 index 000000000000..ac54feedd05f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf90611.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf90810short.docx b/sw/qa/extras/ooxmlexport/data/tdf90810short.docx new file mode 100755 index 000000000000..85b6369fbf29 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf90810short.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf91122.docx b/sw/qa/extras/ooxmlexport/data/tdf91122.docx new file mode 100644 index 000000000000..c7a45e4dd99a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf91122.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf91260.docx b/sw/qa/extras/ooxmlexport/data/tdf91260.docx new file mode 100644 index 000000000000..4888f498ddf9 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf91260.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf91417.docx b/sw/qa/extras/ooxmlexport/data/tdf91417.docx new file mode 100755 index 000000000000..1427f8cb3a5d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf91417.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf92045.docx b/sw/qa/extras/ooxmlexport/data/tdf92045.docx new file mode 100644 index 000000000000..d41f523c79b1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf92045.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf92124.docx b/sw/qa/extras/ooxmlexport/data/tdf92124.docx new file mode 100644 index 000000000000..2999311930eb Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf92124.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf92157.docx b/sw/qa/extras/ooxmlexport/data/tdf92157.docx new file mode 100644 index 000000000000..ba5bc2a8f5f5 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf92157.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf92454.docx b/sw/qa/extras/ooxmlexport/data/tdf92454.docx new file mode 100644 index 000000000000..70426685e207 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf92454.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf93919.docx b/sw/qa/extras/ooxmlexport/data/tdf93919.docx new file mode 100644 index 000000000000..c7454690c844 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf93919.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf94043.docx b/sw/qa/extras/ooxmlexport/data/tdf94043.docx new file mode 100644 index 000000000000..fa47be0760cd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf94043.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf94374.docx b/sw/qa/extras/ooxmlexport/data/tdf94374.docx new file mode 100644 index 000000000000..d5d8d43ebdac Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf94374.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf95213.docx b/sw/qa/extras/ooxmlexport/data/tdf95213.docx new file mode 100644 index 000000000000..831d543b903f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf95213.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf95376.docx b/sw/qa/extras/ooxmlexport/data/tdf95376.docx new file mode 100644 index 000000000000..9bd2d05b2e7a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf95376.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf95775.docx b/sw/qa/extras/ooxmlexport/data/tdf95775.docx new file mode 100644 index 000000000000..a4c1293a56ba Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf95775.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf95777.docx b/sw/qa/extras/ooxmlexport/data/tdf95777.docx new file mode 100644 index 000000000000..e71fdea609b6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf95777.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf97371.docx b/sw/qa/extras/ooxmlexport/data/tdf97371.docx new file mode 100644 index 000000000000..87e67ddf877b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf97371.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf99140.docx b/sw/qa/extras/ooxmlexport/data/tdf99140.docx new file mode 100644 index 000000000000..42fa73d2f8e0 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf99140.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/test_extra_image.docx b/sw/qa/extras/ooxmlexport/data/test_extra_image.docx new file mode 100644 index 000000000000..cdb05afa4456 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/test_extra_image.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx b/sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx new file mode 100644 index 000000000000..cd853f97d55f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx b/sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx new file mode 100644 index 000000000000..8fb2668b327e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx b/sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx new file mode 100644 index 000000000000..1b05dbd6edab Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/wpg-nested.docx b/sw/qa/extras/ooxmlexport/data/wpg-nested.docx new file mode 100644 index 000000000000..eba2aad0e76c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/wpg-nested.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/wpg-only.docx b/sw/qa/extras/ooxmlexport/data/wpg-only.docx new file mode 100644 index 000000000000..7c86361f9d34 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/wpg-only.docx differ diff --git a/sw/qa/extras/ooxmlexport/data/wps-only.docx b/sw/qa/extras/ooxmlexport/data/wps-only.docx new file mode 100644 index 000000000000..7f7b8c75bc26 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/wps-only.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx new file mode 100644 index 000000000000..a7cfd8d12679 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -0,0 +1,2082 @@ +/* -*- 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 "config_test.h" + +#ifdef MACOSX +#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#include +#include +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} + + virtual std::unique_ptr preTest(const char* filename) override + { + if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx" ) + { + std::unique_ptr pResetter(new Resetter( + [] () { + SvtFilterOptions::Get().SetSmartArt2Shape(false); + })); + SvtFilterOptions::Get().SetSmartArt2Shape(true); + return pResetter; + } + return nullptr; + } + +protected: + /** + * Blacklist handling + */ + bool mustTestImportOf(const char* filename) const override { + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx")); + } + +protected: + /// Copy&paste helper. + bool paste(const OUString& rFilename, const uno::Reference& xTextRange) + { + uno::Reference xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.WriterFilter"), uno::UNO_QUERY_THROW); + uno::Reference xImporter(xFilter, uno::UNO_QUERY_THROW); + xImporter->setTargetDocument(mxComponent); + SvStream* pStream = utl::UcbStreamHelper::CreateStream(m_directories.getURLFromSrc("/sw/qa/extras/ooxmlexport/data/") + rFilename, StreamMode::READ); + uno::Reference xStream(new utl::OStreamWrapper(*pStream)); + uno::Sequence aDescriptor(comphelper::InitPropertySequence( + { + {"InputStream", uno::makeAny(xStream)}, + {"InputMode", uno::makeAny(true)}, + {"TextInsertModeRange", uno::makeAny(xTextRange)}, + })); + return xFilter->filter(aDescriptor); + } +}; + +#if !defined(_WIN32) + +DECLARE_OOXMLEXPORT_TEST(testN751054, "n751054.docx") +{ + text::TextContentAnchorType eValue = getProperty(getShape(1), "AnchorType"); + CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); +} + +DECLARE_OOXMLEXPORT_TEST(testN750935, "n750935.docx") +{ + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + // Some page break types were ignores, resulting in less pages. + CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor->getPage()); + + /* + * The problem was that the header and footer was not shared. + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.FooterIsShared + */ + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + bool bValue = false; + xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue; + CPPUNIT_ASSERT_EQUAL(true, bValue); + xPropertySet->getPropertyValue("FooterIsShared") >>= bValue; + CPPUNIT_ASSERT_EQUAL(true, bValue); +} + +DECLARE_OOXMLEXPORT_TEST(testN751117, "n751117.docx") +{ + // First shape: the end should be an arrow, should be rotated and should be flipped. + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + OUString aValue; + xPropertySet->getPropertyValue("LineEndName") >>= aValue; + CPPUNIT_ASSERT(aValue.indexOf("Arrow") != -1); + + // Rotating & Flipping will cause the angle to change from 90 degrees to 270 degrees + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("RotateAngle") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(270 * 100), nValue); + + uno::Reference xShape(xPropertySet, uno::UNO_QUERY); + awt::Size aActualSize(xShape->getSize()); + CPPUNIT_ASSERT(aActualSize.Width > 0); + + // The second shape should be a line + uno::Reference xServiceInfo(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo49940, "fdo49940.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xPara->getPropertyValue("PageStyleName") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aValue); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo74745, "fdo74745.docx") +{ + uno::Reference paragraph = getParagraph(3); + uno::Reference text(paragraph, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text->getString(),OUString("09/02/14")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo81486, "fdo81486.docx") +{ + uno::Reference paragraph = getParagraph(1); + uno::Reference text(paragraph, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text->getString(),OUString("CustomTitle")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo79738, "fdo79738.docx") +{ + uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( mxComponent, uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies(); + uno::Reference xStyles; + xStyleFamilies->getByName("ParagraphStyles") >>= xStyles; + uno::Reference xPropertySetHeader( xStyles->getByName("Header"), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(false, xPropertySetHeader->getPropertyValue("ParaLineNumberCount").get()); + uno::Reference xPropertySetFooter( xStyles->getByName("Footer"), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(false, xPropertySetFooter->getPropertyValue("ParaLineNumberCount").get()); +} + +DECLARE_OOXMLEXPORT_TEST(testN705956_1, "n705956-1.docx") +{ +/* +Get the first image in the document and check it's the one image in the document. +It should be also anchored inline (as character) and be inside a groupshape. +image = ThisComponent.DrawPage.getByIndex(0) +graphic = image(0).Graphic +xray graphic.Size +xray image.AnchorType +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference drawPage = drawPageSupplier->getDrawPage(); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), drawPage->getCount()); + uno::Reference shapes(getShape(1), uno::UNO_QUERY); + uno::Reference image; + shapes->getByIndex(0) >>= image; + uno::Reference imageProperties(image, uno::UNO_QUERY); + uno::Reference graphic; + imageProperties->getPropertyValue( "Graphic" ) >>= graphic; + uno::Reference bitmap(graphic, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( static_cast(120), bitmap->getSize().Width ); + CPPUNIT_ASSERT_EQUAL( static_cast(106), bitmap->getSize().Height ); + text::TextContentAnchorType anchorType; + imageProperties->getPropertyValue( "AnchorType" ) >>= anchorType; + CPPUNIT_ASSERT_EQUAL( text::TextContentAnchorType_AS_CHARACTER, anchorType ); +} + +DECLARE_OOXMLEXPORT_TEST(testN705956_2, "n705956-2.docx") +{ +/* + must be global, reachable even from inside another +image = ThisComponent.DrawPage.getByIndex(0) +xray image.FillColor +*/ + uno::Reference image = getShape(1); + uno::Reference imageProperties(image, uno::UNO_QUERY); + sal_Int32 fillColor; + imageProperties->getPropertyValue( "FillColor" ) >>= fillColor; + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor ); +} + +DECLARE_OOXMLEXPORT_TEST(testN747461, "n747461.docx") +{ +/* +The document contains 3 images (Red, Black, Green, in this order), with explicit +w:relativeHeight (300, 0, 225763766). Check that they are in the right ZOrder +after they are loaded. +*/ + uno::Reference image1 = getShape(1), image2 = getShape(2), image3 = getShape(3); + sal_Int32 zOrder1, zOrder2, zOrder3; + OUString descr1, descr2, descr3; + uno::Reference imageProperties1(image1, uno::UNO_QUERY); + imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1; + imageProperties1->getPropertyValue( "Description" ) >>= descr1; + uno::Reference imageProperties2(image2, uno::UNO_QUERY); + imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2; + imageProperties2->getPropertyValue( "Description" ) >>= descr2; + uno::Reference imageProperties3(image3, uno::UNO_QUERY); + imageProperties3->getPropertyValue( "ZOrder" ) >>= zOrder3; + imageProperties3->getPropertyValue( "Description" ) >>= descr3; + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), zOrder1 ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), zOrder2 ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 2 ), zOrder3 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Black" ), descr1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 ); +} + +DECLARE_OOXMLEXPORT_TEST(testN750255, "n750255.docx") +{ + +/* +Column break without columns on the page is a page break, so check those paragraphs +are on page 2 and page 3 +*/ + CPPUNIT_ASSERT_EQUAL( OUString("one"), parseDump("/root/page[2]/body/txt/text()") ); + CPPUNIT_ASSERT_EQUAL( OUString("two"), parseDump("/root/page[3]/body/txt/text()") ); +} + +DECLARE_OOXMLEXPORT_TEST(testN652364, "n652364.docx") +{ +/* +Related to 750255 above, column break with columns on the page however should be a column break. +enum = ThisComponent.Text.createEnumeration +enum.nextElement +para1 = enum.nextElement +xray para1.String +xray para1.PageStyleName +enum.nextElement +para2 = enum.nextElement +xray para2.String +xray para2.PageStyleName +*/ + // get the 2nd and 4th paragraph + uno::Reference paragraph1(getParagraph( 2, "text1" )); + uno::Reference paragraph2(getParagraph( 4, "text2" )); + OUString pageStyle1 = getProperty< OUString >( paragraph1, "PageStyleName" ); + OUString pageStyle2 = getProperty< OUString >( paragraph2, "PageStyleName" ); + // "Standard" is the style for the first page (2nd is "Converted1"). + CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 ); +} + +DECLARE_OOXMLEXPORT_TEST(testN764005, "n764005.docx") +{ + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + + // The picture in the header wasn't absolutely positioned and wasn't in the background. + text::TextContentAnchorType eValue; + xPropertySet->getPropertyValue("AnchorType") >>= eValue; + CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); + bool bValue = true; + xPropertySet->getPropertyValue("Opaque") >>= bValue; + CPPUNIT_ASSERT_EQUAL(false, bool(bValue)); +} + +DECLARE_OOXMLEXPORT_TEST(testN766481, "n766481.docx") +{ + /* + * The problem was that we had an additional paragraph before the pagebreak. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oPara = oParas.nextElement + * xray oParas.hasMoreElements ' should be false + */ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + for (int i = 0; i < 2; ++i) + xParaEnum->nextElement(); + CPPUNIT_ASSERT_EQUAL(sal_False, xParaEnum->hasMoreElements()); +} + +DECLARE_OOXMLEXPORT_TEST(testN766487, "n766487.docx") +{ + /* + * The problem was that 1) the font size of the first para was too large 2) numbering had no first-line-indent. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * xray oRun.CharHeight ' 12, was larger + * oPara = oParas.nextElement + * xray oPara.ParaFirstLineIndent ' -635, was 0 + */ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); + uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + float fValue = 0; + xPropertySet->getPropertyValue("CharHeight") >>= fValue; + CPPUNIT_ASSERT_EQUAL(12.f, fValue); + + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-360)), nValue); +} + +DECLARE_OOXMLEXPORT_TEST(testN693238, "n693238.docx") +{ + /* + * The problem was that a continuous section break at the end of the doc caused the margins to be ignored. + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin ' was 2000, should be 635 + */ + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("LeftMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nValue); +} + +DECLARE_OOXMLEXPORT_TEST(testNumbering1, "numbering1.docx") +{ +/* in the paragraph itself was overridden by introduced by the paragraph's +enum = ThisComponent.Text.createEnumeration +para = enum.NextElement +xray para.NumberingStyleName +numberingstyle = ThisComponent.NumberingRules.getByIndex(6) +xray numberingstyle.name - should match name above +numbering = numberingstyle.getByIndex(0) +xray numbering(11) - should be 4, arabic +note that the indexes may get off as the implementation evolves, C++ code searches in loops +*/ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference< text::XTextRange > paragraph(getParagraph( 1, "Text1." )); + OUString numberingStyleName = getProperty< OUString >( paragraph, "NumberingStyleName" ); + uno::Reference xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference numberingRules(xNumberingRulesSupplier->getNumberingRules(), uno::UNO_QUERY); + uno::Reference numberingRule; + for( int i = 0; + i < numberingRules->getCount(); + ++i ) + { + OUString name = getProperty< OUString >( numberingRules->getByIndex( i ), "Name" ); + if( name == numberingStyleName ) + { + numberingRule.set( numberingRules->getByIndex( i ), uno::UNO_QUERY ); + break; + } + } + CPPUNIT_ASSERT( numberingRule.is()); + uno::Sequence< beans::PropertyValue > numbering; + numberingRule->getByIndex( 0 ) >>= numbering; + sal_Int16 numberingType = style::NumberingType::NUMBER_NONE; + for( int i = 0; + i < numbering.getLength(); + ++i ) + { + if( numbering[ i ].Name == "NumberingType" ) + { + numbering[ i ].Value >>= numberingType; + break; + } + } + CPPUNIT_ASSERT_EQUAL( style::NumberingType::ARABIC, numberingType ); +} + +DECLARE_OOXMLEXPORT_TEST(testAllGapsWord, "all_gaps_word.docx") +{ + BorderTest borderTest; + BorderTest::testTheBorders(mxComponent, false); +} + +DECLARE_OOXMLEXPORT_TEST(testN775906, "n775906.docx") +{ + /* + * The problem was that right margin (via direct formatting) erased the left/first margin (inherited from numbering style). + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * xray oPara.ParaFirstLineIndent ' was 0 + * xray oPara.ParaLeftMargin ' was 0 + */ + CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty(getParagraph(1), "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1905), getProperty(getParagraph(1), "ParaLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf59699, "tdf59699.docx") +{ + uno::Reference xImage(getShape(1), uno::UNO_QUERY); + auto xGraphic = getProperty >(xImage, "Graphic"); + // This was false: the referenced graphic data wasn't imported. + CPPUNIT_ASSERT(xGraphic.is()); +} + +DECLARE_OOXMLEXPORT_TEST(testN777337, "n777337.docx") +{ + /* + * The problem was that the top and bottom margin on the first page was only 0.1cm instead of 1.7cm. + * + * oFirst = ThisComponent.StyleFamilies.PageStyles.getByName("First Page") + * xray oFirst.TopMargin + * xray oFirst.BottomMargin + */ + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty(xPropertySet, "TopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty(xPropertySet, "BottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testN778836, "n778836.docx") +{ + /* + * The problem was that the paragraph inherited margins from the numbering + * and parent paragraph styles and the result was incorrect. + */ + CPPUNIT_ASSERT_EQUAL(sal_Int32(1270), getProperty(getParagraph(1), "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3810), getProperty(getParagraph(1), "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty(getParagraph(1), "ParaFirstLineIndent")); +} + +DECLARE_OOXMLEXPORT_TEST(testN778828, "n778828.docx") +{ + /* + * The problem was that a page break after a continuous section break caused + * double page break on title page. + */ + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage()); +} + +DECLARE_OOXMLEXPORT_TEST(testN779834, "n779834.docx") +{ + // This document simply crashed the importer. +} + +DECLARE_OOXMLEXPORT_TEST(testRHBZ1180114, "rhbz1180114.docx") +{ + // This document simply crashed the importer. +} + +DECLARE_OOXMLEXPORT_TEST(testTDF91122, "tdf91122.docx") +{ + /* + * OLE object shape: default vertical position is top in MSO, not bottom + */ + for (int i = 1; i <= 2; ++i) + { + uno::Reference xShapeProperties( getShape(i), uno::UNO_QUERY ); + uno::Reference xShapeDescriptor(xShapeProperties, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), xShapeDescriptor->getShapeType()); + sal_Int16 nValue; + xShapeProperties->getPropertyValue("VertOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", text::VertOrientation::TOP, nValue); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTDF91260, "tdf91260.docx") +{ + /* + * textbox can't extend beyond the page bottom + * solution: shrinking textbox (its text frame) height, if needed + */ + uno::Reference xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xFrame->getString().startsWith( "Lorem ipsum" ) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3454), getProperty(xFrame, "Height")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo74357, "fdo74357.docx") +{ + // Floating table wasn't converted to a textframe. + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + // This was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + + // Bottom margin of the first paragraph was too large, causing a layout problem. + // This was 494. + CPPUNIT_ASSERT_EQUAL(sal_Int32(86), getProperty(getParagraph(1), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo55187, "fdo55187.docx") +{ + // 0x010d was imported as a newline. + getParagraph(1, OUString("lup\xc4\x8dka", 7, RTL_TEXTENCODING_UTF8)); +} + +DECLARE_OOXMLEXPORT_TEST(testN780563, "n780563.docx") +{ + /* + * Make sure we have the table in the fly frame created + */ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount( )); +} + +DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx") +{ + /* + * The problem was that the table was not imported. + * + * xray ThisComponent.TextTables.Count 'was 0 + */ + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx") +{ + uno::Reference< text::XTextRange > xPara = getParagraph(1); + OUString aStyleName = getProperty(xPara, "PageStyleName"); + CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aStyleName); + + //tdf64372 this document should only have one page break (2 pages, not 3) + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage()); +} + +DECLARE_OOXMLEXPORT_TEST(testN780843b, "n780843b.docx") +{ + // Same document as testN780843 except there is more text before the continuous break. Now the opposite footer results should happen. + uno::Reference< text::XTextRange > xPara = getParagraph(3); + OUString aStyleName = getProperty(xPara, "PageStyleName"); + uno::Reference xPageStyle(getStyles("PageStyles")->getByName(aStyleName), uno::UNO_QUERY); + uno::Reference xFooterText = getProperty< uno::Reference >(xPageStyle, "FooterText"); + CPPUNIT_ASSERT_EQUAL( OUString("hidden footer"), xFooterText->getString() ); +} + +DECLARE_OOXMLEXPORT_TEST(testShadow, "imgshadow.docx") +{ + /* + * The problem was that drop shadows on inline images were not being + * imported and applied. + */ + uno::Reference xPropertySet(getShape(2), uno::UNO_QUERY); + + bool bShadow = getProperty(xPropertySet, "Shadow"); + CPPUNIT_ASSERT(bShadow); + + sal_Int32 nShadowXDistance = getProperty(xPropertySet, "ShadowXDistance"); + CPPUNIT_ASSERT(nShadowXDistance != 0); +} + +DECLARE_OOXMLEXPORT_TEST(testN782345, "n782345.docx") +{ + /* + * The problem was that the page break was inserted before the 3rd para, instead of before the 2nd para. + */ + CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty(getParagraph(2), "BreakType")); +} + +DECLARE_OOXMLEXPORT_TEST(testN779941, "n779941.docx") +{ + /* + * Make sure top/bottom margins of tables are set to 0 (problem was: bottom margin set to 0.35cm) + */ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); + { + uno::Any aValue = xTableProperties->getPropertyValue("TopMargin"); + sal_Int32 nTopMargin; + aValue >>= nTopMargin; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nTopMargin); + } + { + uno::Any aValue = xTableProperties->getPropertyValue("BottomMargin"); + sal_Int32 nBottomMargin; + aValue >>= nBottomMargin; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nBottomMargin); + } +} + +DECLARE_OOXMLEXPORT_TEST(testN783638, "n783638.docx") +{ + // The problem was that the margins of inline images were not zero. + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xPropertySet, "LeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo52208, "fdo52208.docx") +{ + // The problem was that the document had 2 pages instead of 1. + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); +} + +DECLARE_OOXMLEXPORT_TEST(testN785767, "n785767.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // Check the A1 and B1 cells, the width of both of them was the default value (10000 / 9, as there were 9 cells in the row). + CPPUNIT_ASSERT_MESSAGE("A1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position); + CPPUNIT_ASSERT_MESSAGE("B1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); +} + +DECLARE_OOXMLEXPORT_TEST(testFineTableDash, "tableborder-finedash.docx") +{ + // The problem was that finely dashed borders on tables were unsupported + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); + table::TableBorder2 aBorder; + xTableProperties->getPropertyValue("TableBorder2") >>= aBorder; + CPPUNIT_ASSERT_EQUAL(aBorder.RightLine.LineStyle, table::BorderLineStyle::FINE_DASHED); +} + +DECLARE_OOXMLEXPORT_TEST(testN792778, "n792778.docx") +{ + /* + * The problem was that the importer didn't handle complex groupshapes with groupshapes, textboxes and graphics inside. + * + * xray ThisComponent.DrawPage.Count ' 1 groupshape + * xray ThisComponent.DrawPage(0).Count ' 2 sub-groupshapes + * xray ThisComponent.DrawPage(0).getByIndex(0).Count ' first sub-groupshape: 1 pic + * xray ThisComponent.DrawPage(0).getByIndex(1).Count ' second sub-groupshape: 1 pic + * xray ThisComponent.DrawPage(0).getByIndex(0).getByIndex(0).Position.Y ' 11684, the vertical position of the shapes were also wrong + * xray ThisComponent.DrawPage(0).getByIndex(1).getByIndex(0).Position.Y ' 11684 + */ + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + + uno::Reference xGroupShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroupShape->getCount()); + + uno::Reference xInnerGroupShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xInnerGroupShape->getCount()); + + uno::Reference xInnerShape(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11684), xInnerShape->getPosition().Y); + + xInnerGroupShape.set(xGroupShape->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xInnerGroupShape->getCount()); + + xInnerShape.set(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11684), xInnerShape->getPosition().Y); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeSmarttag, "groupshape-smarttag.docx") +{ + uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); + // First run of shape text was missing due to the w:smartTag wrapper around it. + CPPUNIT_ASSERT_EQUAL(OUString("Box 2"), xShape->getString()); + + // Font size of the shape text was 10. + CPPUNIT_ASSERT_EQUAL(12.f, getProperty(xShape->getText(), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testN793262, "n793262.docx") +{ + uno::Reference xHeaderText = getProperty< uno::Reference >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + uno::Reference xHeaderParagraphs(xHeaderText->createEnumeration()); + xHeaderParagraphs->nextElement(); + // Font size of the last empty paragraph in the header was ignored, this was 11. + CPPUNIT_ASSERT_EQUAL(16.f, getProperty(xHeaderParagraphs->nextElement(), "CharHeight")); + + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Cell margins as direct formatting were ignored, this was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(76), getProperty(xTable->getCellByName("A1"), "TopBorderDistance")); +} + +DECLARE_OOXMLEXPORT_TEST(testN793998, "n793998.docx") +{ + sal_Int32 nTextPortion = parseDump("/root/page/body/txt/Text[1]", "nWidth").toInt32(); // Width of the first (text) portion + sal_Int32 nTabPortion = parseDump("/root/page/body/txt/Text[2]", "nWidth").toInt32(); // Width of the second (tab) portion + sal_Int32 nParagraph = parseDump("/root/page/body/txt/infos/bounds", "width").toInt32(); // Width of the paragraph + sal_Int32 nRightMargin = 3000; + // The problem was that the tab portion didn't ignore the right margin, so text + tab width wasn't larger than body (paragraph - right margin) width. + CPPUNIT_ASSERT(nTextPortion + nTabPortion > nParagraph - nRightMargin); +} + +DECLARE_OOXMLEXPORT_TEST(testN779642, "n779642.docx") +{ + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + + // First problem: check that we have 2 tables, nesting caused the + // creation of outer one to fail + uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong number of imported tables", sal_Int32(2), xTables->getCount()); + + // Second problem: check that the outer table is in a frame, at the bottom of the page + uno::Reference xTextTable(xTextTablesSupplier->getTextTables()->getByName("Table2"), uno::UNO_QUERY); + uno::Reference xAnchor(xTextTable->getAnchor(), uno::UNO_QUERY); + uno::Any aFrame = xAnchor->getPropertyValue("TextFrame"); + uno::Reference xFrame; + aFrame >>= xFrame; + sal_Int16 nValue; + xFrame->getPropertyValue("VertOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", nValue, text::VertOrientation::BOTTOM); + xFrame->getPropertyValue("VertOrientRelation") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation relation", nValue, text::RelOrientation::PAGE_PRINT_AREA); +} + +DECLARE_OOXMLEXPORT_TEST(testTbLrHeight, "tblr-height.docx") +{ + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTable->getRows(), uno::UNO_QUERY); + // btLr text direction was imported as MIN, it should be FIX to avoid incorrectly large height in case of too much content. + CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty(xTableRows->getByIndex(0), "SizeType")); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc865381, "bnc865381.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // Second row has a vertically merged cell, make sure size type is not FIX in that case (otherwise B2 is not readable). + CPPUNIT_ASSERT(text::SizeType::FIX != getProperty(xTableRows->getByIndex(1), "SizeType")); + // Explicit size of 41 mm100 was set, so the vertical text in A2 was not readable. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xTableRows->getByIndex(1), "Height")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo53985, "fdo53985.docx") +{ + // Unhandled exception prevented import of the rest of the document. + + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xTables->getCount()); // Only 4 tables were imported. +} + +DECLARE_OOXMLEXPORT_TEST(testFdo59638, "fdo59638.docx") +{ + // The problem was that w:lvlOverride inside w:num was ignores by dmapper. + + uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + + if (rProp.Name == "BulletChar") + { + // Was '*', should be 'o'. + CPPUNIT_ASSERT_EQUAL(OUString("\xEF\x82\xB7", 3, RTL_TEXTENCODING_UTF8), rProp.Value.get()); + return; + } + } + CPPUNIT_FAIL("no BulletChar property"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo61343, "fdo61343.docx") +{ + // The problem was that there were a groupshape in the doc, followed by an + // OLE object, and this lead to a crash. + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testToolsLineNumbering, "tools-line-numbering.docx") +{ + /* + * Test the line numbering feature import (Tools->Line Numbering ...) + * + * xray ThisComponent.getLineNumberingProperties().IsOn == True + * xray ThisComponent.getLineNumberingProperties().CountEmptyLines == True + * xray ThisComponent.getLineNumberingProperties().NumberPosition == 0 + * xray ThisComponent.getLineNumberingProperties().NumberingType == 4 + * xray ThisComponent.getLineNumberingProperties().SeparatorInterval == 3 + */ + + bool bValue = false; + sal_Int32 nValue = -1; + + uno::Reference< text::XTextDocument > xtextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference< text::XLineNumberingProperties > xLineProperties( xtextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPropertySet = xLineProperties->getLineNumberingProperties(); + + xPropertySet->getPropertyValue("IsOn") >>= bValue; + CPPUNIT_ASSERT_EQUAL(true, bValue); + + xPropertySet->getPropertyValue("CountEmptyLines") >>= bValue; + CPPUNIT_ASSERT_EQUAL(true, bValue); + + xPropertySet->getPropertyValue("NumberPosition") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue); + + xPropertySet->getPropertyValue("NumberingType") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), nValue); + + xPropertySet->getPropertyValue("SeparatorInterval") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue); +} + +DECLARE_OOXMLEXPORT_TEST(testfdo78904, "fdo78904.docx") +{ + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + if (xIndexAccess->getCount()) + { + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(0)), getProperty(xFrame, "HoriOrientPosition")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testFdo60922, "fdo60922.docx") +{ + // This was 0, not 100, due to wrong import of w:position w:val="0" + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty(getRun(getParagraph(1), 1), "CharEscapementHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo59273, "fdo59273.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Was 115596 (i.e. 10 times wider than necessary), as w:tblW was missing and the importer didn't set it. + CPPUNIT_ASSERT_EQUAL(sal_Int32(12961), getProperty(xTextTable, "Width")); + + uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // Was 9997, so the 4th column had ~zero width + CPPUNIT_ASSERT_EQUAL(sal_Int16(7498), getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators")[2].Position); +} + +DECLARE_OOXMLEXPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbllook.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Background was -1. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x7F7F7F), getProperty(xTable->getCellByName("A1"), "BackColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo63685, "fdo63685.docx") +{ + // An inline image's wrapping should be always zero, even if the doc model has a non-zero value. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(getShape(1), "TopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testN592908_Frame, "n592908-frame.docx") +{ + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + text::WrapTextMode eValue; + xPropertySet->getPropertyValue("Surround") >>= eValue; + CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_PARALLEL); +} + +DECLARE_OOXMLEXPORT_TEST(testN592908_Picture, "n592908-picture.docx") +{ + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + text::WrapTextMode eValue; + xPropertySet->getPropertyValue("Surround") >>= eValue; + CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_PARALLEL); +} + +DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx") +{ + // First shape: date picker + uno::Reference xControlShape(getShape(1), uno::UNO_QUERY); + uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.DateField"))); + CPPUNIT_ASSERT_EQUAL(OUString("date default text"), getProperty(xPropertySet, "HelpText")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, "DateFormat")); + CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xPropertySet, "Dropdown"))); + + // Second shape: combo box + xControlShape.set(getShape(2), uno::UNO_QUERY); + xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); + xServiceInfo.set(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox"))); + CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), getProperty(xPropertySet, "DefaultText")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence >(xPropertySet, "StringItemList").getLength()); + CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xPropertySet, "Dropdown"))); +} + +DECLARE_OOXMLEXPORT_TEST(testIndentation, "indentation.docx") +{ + uno::Reference xParaLTRTitle(getParagraph( 1, "Title aligned")); + uno::Reference xParaLTRNormal(getParagraph( 2, "")); + + // this will test the text direction for paragraphs + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty( xParaLTRTitle, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty( xParaLTRNormal, "WritingMode" )); +} + +DECLARE_OOXMLEXPORT_TEST(testPageBorderShadow, "page-border-shadow.docx") +{ + // The problem was that in w:pgBorders, child elements had a w:shadow attribute, but that was ignored. + table::ShadowFormat aShadow = getProperty(getStyles("PageStyles")->getByName("Standard"), "ShadowFormat"); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); + // w:sz="48" is in eights of a point, 1 pt is 20 twips. + CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(48/8*20)), aShadow.ShadowWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testN816593, "n816593.docx") +{ + // Two consecutive without any paragraph in between, but with different tblpPr. In this + // case we need to have 2 different tables instead of 1 + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testN820509, "n820509.docx") +{ + // Design mode was enabled. + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xFormLayerAccess(xModel->getCurrentController(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, bool(xFormLayerAccess->isFormDesignMode())); + + // M.d.yyyy date format was unhandled. + uno::Reference xControlShape(getShape(1), uno::UNO_QUERY); + uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, "DateFormat")); +} + +DECLARE_OOXMLEXPORT_TEST(testN830205, "n830205.docx") +{ + // Previously import just crashed (due to infinite recursion). + getParagraph(1, "XXX"); +} + +DECLARE_OOXMLEXPORT_TEST(testTableAutoColumnFixedSize, "table-auto-column-fixed-size.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + + // Width was not recognized during import when table size was 'auto' + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(3996)), getProperty(xTextTable, "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableAutoColumnFixedSize2, "table-auto-column-fixed-size2.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + // This was 17907, i.e. the sum of the width of the 3 cells (10152 twips each), which is too wide. + CPPUNIT_ASSERT_EQUAL(sal_Int32(16891), getProperty(xTextTable, "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo46361, "fdo46361.docx") +{ + uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); + // This was CENTER. + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty(xShape, "TextVerticalAdjust")); + uno::Reference xText = uno::Reference(xShape, uno::UNO_QUERY)->getText(); + uno::Reference xParagraph = getParagraphOfText(1, xText); + // This was LEFT. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast(getProperty(xParagraph, "ParaAdjust"))); + // This was black, not green. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x008000), getProperty(getRun(xParagraph, 1), "CharColor")); + // \n char was missing due to unhandled w:br. + CPPUNIT_ASSERT_EQUAL(OUString("text\ntext"), uno::Reference(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString()); + // \n chars were missing, due to unhandled multiple w:p tags. + CPPUNIT_ASSERT_EQUAL(OUString("text\ntext\n"), uno::Reference(xGroupShape->getByIndex(2), uno::UNO_QUERY)->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo65632, "fdo65632.docx") +{ + // The problem was that the footnote text had fake redline: only the body + // text has redline in fact. + uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + uno::Reference xText(xFootnotes->getByIndex(0), uno::UNO_QUERY); + //uno::Reference xParagraph = getParagraphOfText(1, xText); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(getRun(getParagraphOfText(1, xText), 1), "TextPortionType")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66474, "fdo66474.docx") +{ + // The table width was too small, so the text in the second cell was unreadable: this was 1397. + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(10492), getProperty(xTables->getByIndex(0), "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeRotation, "groupshape-rotation.docx") +{ + // Rotation on groupshapes wasn't handled at all by the VML importer. + CPPUNIT_ASSERT_EQUAL(sal_Int32(315 * 100), getProperty(getShape(1), "RotateAngle")); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc780044Spacing, "bnc780044_spacing.docx") +{ + // The document has global w:spacing in styles.xml , and local w:spacing in w:pPr, which however + // only applied to text runs, not to as-character pictures. So the picture made the line higher. + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); +} + +DECLARE_OOXMLEXPORT_TEST(testTableAutoNested, "table-auto-nested.docx") +{ + // This was 176, when compat option is not enabled, the auto paragraph bottom margin value was incorrect. + CPPUNIT_ASSERT_EQUAL(sal_Int32(494), getProperty(getParagraph(1), "ParaBottomMargin")); + + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // This was 115596, i.e. the width of the outer table was too large. + CPPUNIT_ASSERT_EQUAL(sal_Int32(23051), getProperty(xTables->getByIndex(1), "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableStyleParprop, "table-style-parprop.docx") +{ + // The problem was that w:spacing's w:after=0 (a paragraph property) wasn't imported from table style. + uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 353, the document default, i.e. paragraph property from table style had no effect. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTablePagebreak, "table-pagebreak.docx") +{ + // Page break inside table: should be ignored (was style::BreakType_PAGE_BEFORE before). + CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, getProperty(getParagraphOrTable(2), "BreakType")); + + // This one is outside the table: should not be ignored. + CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty(getParagraph(3), "BreakType")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo68607, "fdo68607.docx") +{ + // Bugdoc was 8 pages in Word, 1 in Writer due to pointlessly wrapping the + // table in a frame. Exact layout may depend on fonts available, etc. -- + // but at least make sure that our table spans over multiple pages now. + CPPUNIT_ASSERT(getPages() > 1); +} + +DECLARE_OOXMLEXPORT_TEST(testVmlTextVerticalAdjust, "vml-text-vertical-adjust.docx") +{ + uno::Reference xOuterGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference xInnerGroupShape(xOuterGroupShape->getByIndex(0), uno::UNO_QUERY); + uno::Reference xShape(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); + // Was CENTER. + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty(xShape, "TextVerticalAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo69636, "fdo69636.docx") +{ + // The problem was that the mso-layout-flow-alt:bottom-to-top VML shape property wasn't handled for sw text frames. + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-270), aCustomShapeGeometry["TextPreRotateAngle"].get()); +} + +DECLARE_OOXMLEXPORT_TEST(testChartProp, "chart-prop.docx") +{ + // The problem was that chart was not getting parsed in writer module. + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(15240), getProperty(xPropertySet, "Width")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8890), getProperty(xPropertySet, "Height")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo43093, "fdo43093b.docx") +{ + // The problem was that the direction and alignment are not correct for RTL paragraphs. + uno::Reference xParaRtlRight(getParagraph( 1, "Right and RTL in M$")); + sal_Int32 nRtlRight = getProperty< sal_Int32 >( xParaRtlRight, "ParaAdjust" ); + sal_Int16 nRRDir = getProperty< sal_Int32 >( xParaRtlRight, "WritingMode" ); + + uno::Reference xParaRtlLeft(getParagraph( 2, "Left and RTL in M$")); + sal_Int32 nRtlLeft = getProperty< sal_Int32 >( xParaRtlLeft, "ParaAdjust" ); + sal_Int16 nRLDir = getProperty< sal_Int32 >( xParaRtlLeft, "WritingMode" ); + + uno::Reference xParaLtrRight(getParagraph( 3, "Right and LTR in M$")); + sal_Int32 nLtrRight = getProperty< sal_Int32 >( xParaLtrRight, "ParaAdjust" ); + sal_Int16 nLRDir = getProperty< sal_Int32 >( xParaLtrRight, "WritingMode" ); + + uno::Reference xParaLtrLeft(getParagraph( 4, "Left and LTR in M$")); + sal_Int32 nLtrLeft = getProperty< sal_Int32 >( xParaLtrLeft, "ParaAdjust" ); + sal_Int16 nLLDir = getProperty< sal_Int32 >( xParaLtrLeft, "WritingMode" ); + + // this will test the both the text direction and alignment for each paragraph + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), nRtlRight); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, nRRDir); + + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), nRtlLeft); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, nRLDir); + + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), nLtrRight); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLRDir); + + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), nLtrLeft); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLLDir); +} + +DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY); + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc + + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xGroup->getCount()); // 3 rectangles and an arrow in the group + + uno::Reference xPropertySet(xGroup->getByIndex(1), uno::UNO_QUERY); + sal_Int32 nValue(0); + xPropertySet->getPropertyValue("FillColor") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK + + uno::Reference xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text + + uno::Reference xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaAdjust") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_CENTER), nValue); // Paragraph properties are imported +} + +DECLARE_OOXMLEXPORT_TEST(testFdo69548, "fdo69548.docx") +{ + // The problem was that the last space in target URL was removed + CPPUNIT_ASSERT_EQUAL(OUString("#this is a bookmark"), getProperty(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + +DECLARE_OOXMLEXPORT_TEST(testWpsOnly, "wps-only.docx") +{ + // Document has wp:anchor, not wp:inline, so handle it accordingly. + uno::Reference xShape = getShape(1); + text::TextContentAnchorType eValue = getProperty(xShape, "AnchorType"); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_PARAGRAPH, eValue); + + // Check position, it was 0. This is a shape, so use getPosition(), not a property. + CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(671830)), xShape->getPosition().X); + + // Left margin was 0, instead of 114300 EMU's. + CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty(xShape, "LeftMargin")); + // Wrap type was PARALLEL. + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty(xShape, "Surround")); + + // This should be in front of text. + CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xShape, "Opaque"))); + // And this should be behind the document. + CPPUNIT_ASSERT_EQUAL(false, bool(getProperty(getShape(2), "Opaque"))); +} + +DECLARE_OOXMLEXPORT_TEST(testWpgOnly, "wpg-only.docx") +{ + uno::Reference xShape = getShape(1); + // Check position, it was nearly 0. This is a shape, so use getPosition(), not a property. + CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(548005)), xShape->getPosition().X); +} + +DECLARE_OOXMLEXPORT_TEST(testWpgNested, "wpg-nested.docx") +{ + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY); + // This was a com.sun.star.drawing.CustomShape, due to lack of handling of groupshapes inside groupshapes. + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); + // This was text::RelOrientation::PAGE_FRAME, effectively placing the group shape on the left side of the page instead of the right one. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_RIGHT, getProperty(xGroup, "HoriOrientRelation")); +} + +DECLARE_OOXMLEXPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") +{ + uno::Reference xShape = getShape(1); + // The relativeFrom attribute was ignored for groupshapes, i.e. these were text::RelOrientation::FRAME. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xShape, "HoriOrientRelation")); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xShape, "VertOrientRelation")); + // Make sure the shape is not in the background, as we have behindDoc="0" in the doc. + CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xShape, "Opaque"))); + + // The 3 paragraphs on the rectangles inside the groupshape ended up in the + // body text, make sure we don't have multiple paragraphs there anymore. + CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); // was 4 + + // Character escapement was enabled by default, this was 58. + uno::Reference xGroup(xShape, uno::UNO_QUERY); + uno::Reference xText = uno::Reference(xGroup->getByIndex(0), uno::UNO_QUERY)->getText(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testMceWpg, "mce-wpg.docx") +{ + // Make sure that we read the primary branch, if wpg is requested as a feature. + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xText = uno::Reference(xGroup->getByIndex(0), uno::UNO_QUERY)->getText(); + // This was VML1. + getParagraphOfText(1, xText, "DML1"); +} + +DECLARE_OOXMLEXPORT_TEST(testMceNested, "mce-nested.docx") +{ + // Vertical position of the shape was incorrect due to incorrect nested mce handling. + uno::Reference xShape(getShape(1), uno::UNO_QUERY); + // positionV's posOffset from the bugdoc, was 0. + CPPUNIT_ASSERT(6985 <= getProperty(xShape, "VertOrientPosition")); + // This was -1 (default), make sure the background color is set. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty(xShape, "FillColor")); + + uno::Reference xShapeDescriptor(getShape(2), uno::UNO_QUERY); + // This was a com.sun.star.drawing.CustomShape, due to incorrect handling of wpg elements after a wps textbox. + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); + + // Now check the top right textbox. + uno::Reference xGroup(getShape(2), uno::UNO_QUERY); + uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); + uno::Reference xParagraph = getParagraphOfText(1, xText, "[Year]"); + CPPUNIT_ASSERT_EQUAL(48.f, getProperty(getRun(xParagraph, 1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty(getRun(xParagraph, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(getRun(xParagraph, 1), "CharWeight")); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty(xGroup->getByIndex(1), "TextVerticalAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testMissingPath, "missing-path.docx") +{ + comphelper::SequenceAsHashMap aCustomShapeGeometry(getProperty(getShape(1), "CustomShapeGeometry")); + comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"].get()); + uno::Sequence aCoordinates = aPath["Coordinates"].get< uno::Sequence >(); + // This was 0, the coordinate list was empty. + CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aCoordinates.getLength()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo70457, "fdo70457.docx") +{ + // The document contains a rotated bitmap + // It must be imported as a XShape object with the proper rotation value + + // Check: there is one shape in the doc + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); + + // Check: the angle of the shape is 45ยบ + CPPUNIT_ASSERT_EQUAL(sal_Int32(4500), getProperty(getShape(1), "RotateAngle")); +} + +DECLARE_OOXMLEXPORT_TEST(testLOCrash,"file_crash.docx") +{ + //The problem was libreoffice crash while opening the file. + getParagraph(1,"Contents"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo72560, "fdo72560.docx") +{ + // The problem was libreoffice confuse when there RTL default style for paragraph + uno::Reference xParaLeftRTL(getParagraph( 1, "RTL LEFT")); + uno::Reference xParaRightLTR(getParagraph( 2, "LTR RIGHT")); + + // this will test the text direction and alignment for paragraphs + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty( xParaLeftRTL, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), getProperty< sal_Int32 >( xParaLeftRTL, "ParaAdjust" )); + + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty( xParaRightLTR, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), getProperty< sal_Int32 >( xParaRightLTR, "ParaAdjust" )); +} + +DECLARE_OOXMLEXPORT_TEST(testRPrChangeClosed, "rprchange_closed.docx") +{ + // Redline defined by rPrChanged wasn't removed. + // First paragraph has an rPrChange element, make sure it doesn't appear in the second paragraph. + CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(2), 1), "RedlineType")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo65090, "fdo65090.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // The first row had two cells, instead of a single horizontally merged one. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") +{ + // The DOCX containing the Table of Contents was not imported with correct page nos + uno::Reference xIndexSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexes(xIndexSupplier->getDocumentIndexes( ), uno::UNO_QUERY); + uno::Reference xTOCIndex(xIndexes->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTextRange(xTOCIndex->getAnchor(), uno::UNO_QUERY); + uno::Reference xText(xTextRange->getText( ), uno::UNO_QUERY); + uno::Reference xTextCursor(xText->createTextCursor( ), uno::UNO_QUERY); + xTextCursor->gotoRange(xTextRange->getStart(),false); + xTextCursor->gotoRange(xTextRange->getEnd(),true); + OUString aTocString(xTextCursor->getString()); + aTocString = aTocString.copy(256); + CPPUNIT_ASSERT(aTocString.startsWithIgnoreAsciiCase( "Heading 15.1:\t15" ) ); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo73389,"fdo73389.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // This was 9340, i.e. the width of the inner table was too large. + CPPUNIT_ASSERT_EQUAL(sal_Int32(2842), getProperty(xTables->getByIndex(0), "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx") +{ + uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); + // The text in the groupshape was missing due to the w:sdt and w:sdtContent wrapper around it. + CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testDmlCharheightDefault, "dml-charheight-default.docx") +{ + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); + // This was 16: the first run of the second para incorrectly inherited the char height of the first para. + CPPUNIT_ASSERT_EQUAL(11.f, getProperty(getRun(getParagraphOfText(2, xShape->getText()), 1), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capitalization.docx") +{ + // Capitalization inside a group shape was not imported + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); + // 2nd line is written with uppercase letters + CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty(getRun(getParagraphOfText(2, xText), 1), "CharCaseMap")); + // 3rd line has no capitalization + CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty(getRun(getParagraphOfText(3, xText), 1), "CharCaseMap")); + // 4th line has written with small capitals + CPPUNIT_ASSERT_EQUAL(style::CaseMap::SMALLCAPS, getProperty(getRun(getParagraphOfText(4, xText), 1), "CharCaseMap")); + // 5th line has no capitalization + CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty(getRun(getParagraphOfText(5, xText), 1), "CharCaseMap")); +} + +DECLARE_OOXMLEXPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.docx") +{ + // At the start of the document, a picture which has a color specified with a color scheme, lost + // it's color during import. + uno::Reference xImage(getShape(1), uno::UNO_QUERY); + uno::Reference xGraphic = getProperty >(xImage, "Graphic"); + Graphic aVclGraphic(xGraphic); + Bitmap aBitmap(aVclGraphic.GetBitmap()); + BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess(); + CPPUNIT_ASSERT(pAccess); + CPPUNIT_ASSERT_EQUAL(341L, pAccess->Width()); + CPPUNIT_ASSERT_EQUAL(181L, pAccess->Height()); + Color aColor(pAccess->GetPixel(30, 120)); + CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd )); + aColor = pAccess->GetPixel(130, 260); + CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd )); + Bitmap::ReleaseAccess(pAccess); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8154), getProperty(xTables->getByIndex(0), "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testFloatingTablesAnchor, "floating-tables-anchor.docx") +{ + // Problem was one of the two text frames was anchored to the other text frame + // Both frames should be anchored to the paragraph with the text "Anchor point" + uno::Reference xTextContent(getShape(1), uno::UNO_QUERY); + uno::Reference xRange(xTextContent->getAnchor(), uno::UNO_QUERY); + uno::Reference xText(xRange->getText(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); + + xTextContent.set(getShape(2), uno::UNO_QUERY); + xRange.set(xTextContent->getAnchor(), uno::UNO_QUERY); + xText.set(xRange->getText(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testAnnotationFormatting, "annotation-formatting.docx") +{ + uno::Reference xTextField = getProperty< uno::Reference >(getRun(getParagraph(2), 2), "TextField"); + uno::Reference xText = getProperty< uno::Reference >(xTextField, "TextRange"); + // Make sure we test the right annotation. + uno::Reference xParagraph = getParagraphOfText(1, xText, "days"); + // Formatting was lost: the second text portion was NONE, not SINGLE. + CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty(getRun(xParagraph, 1), "CharUnderline")); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.docx") +{ + // Fonts defined by w:rFonts was not imported and so the font specified by a:fontRef was used. + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); + uno::Reference xRun = getRun(getParagraphOfText(1, xText),1); + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty(xRun, "CharFontNameComplex")); + CPPUNIT_ASSERT_EQUAL(OUString("MS Mincho"), getProperty(xRun, "CharFontNameAsian")); +} + +DECLARE_OOXMLEXPORT_TEST(testStrict, "strict.docx") +{ + uno::Reference xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + // This was only 127, pt suffix was ignored, so this got parsed as twips instead of points. + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(72 * 20)), getProperty(xPageStyle, "BottomMargin")); + // This was only 1397, same issue + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(792 * 20)), getProperty(xPageStyle, "Height")); + // Text was missing, due to not handling the strict namespaces. + getParagraph(1, "Hello world!"); + + // Header in the document caused a crash on import. + uno::Reference xHeaderText(xPageStyle->getPropertyValue("HeaderText"), uno::UNO_QUERY); + getParagraphOfText(1, xHeaderText, "This is a header."); + + // Picture was missing. + uno::Reference xServiceInfo(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextGraphicObject")); + + // SmartArt was missing. + xServiceInfo.set(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")); + + // Chart was missing. + xServiceInfo.set(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject")); + + // Math was missing. + xServiceInfo.set(getShape(4), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject")); +} + +DECLARE_OOXMLEXPORT_TEST(testSmartartStrict, "strict-smartart.docx") +{ + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + // This was 0, SmartArt was visually missing. + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xGroup->getCount()); // 3 ellipses + 3 arrows +} + +DECLARE_OOXMLEXPORT_TEST(testLibreOfficeHang, "frame-wrap-auto.docx") +{ + // fdo#72775 + // This was text::WrapTextMode_NONE. + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_DYNAMIC, getProperty(getShape(1), "Surround")); +} + +DECLARE_OOXMLEXPORT_TEST(testI124106, "i124106.docx") +{ + // This was 2. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testLargeTwips, "large-twips.docx" ) +{ + // cp#1000043: MSO seems to ignore large twips values, we didn't, which resulted in different + // layout of broken documents (text not visible in this specific document). + OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" ); + CPPUNIT_ASSERT( width.toInt32() > 0 ); +} + +DECLARE_OOXMLEXPORT_TEST(testNegativeCellMarginTwips, "negative-cell-margin-twips.docx" ) +{ + // Slightly related to cp#1000043, the twips value was negative, which wrapped around somewhere, + // while MSO seems to ignore that as well. + OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" ); + CPPUNIT_ASSERT( width.toInt32() > 0 ); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo38414, "fdo38414.docx" ) +{ + // The cells in the last (4th) column were merged properly and so the result didn't have the same height. + // (Since w:gridBefore is worked around by faking another cell in the row, so column count is thus 5 + // instead of 4, therefore compare height of cells 4 and 5 rather than 3 and 4.) + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableColumns(xTextTable->getColumns(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 5 ), xTableColumns->getCount()); + OUString height3 = parseDump("/root/page/body/tab/row[1]/cell[4]/infos/bounds", "height" ); + OUString height4 = parseDump("/root/page/body/tab/row[1]/cell[5]/infos/bounds", "height" ); + CPPUNIT_ASSERT_EQUAL( height3, height4 ); +} + +DECLARE_OOXMLEXPORT_TEST(test_extra_image, "test_extra_image.docx" ) +{ + // fdo#74652 Check there is no shape added to the doc during import + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xDraws->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo74401, "fdo74401.docx") +{ + uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference xShape(xGroupShape->getByIndex(1), uno::UNO_QUERY); + // The triangle (second child) was a TextShape before, so it was shown as a rectangle. + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), xShape->getShapeType()); +} + +DECLARE_OOXMLEXPORT_TEST(testGridBefore, "gridbefore.docx") +{ + // w:gridBefore is faked by inserting two cells without border (because Writer can't do non-rectangular tables). + // So check the first cell in the first row is in fact 3rd and that it's more to the right than the second + // cell on the second row. + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableColumns(xTextTable->getColumns(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 3 ), xTableColumns->getCount()); + OUString textA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/txt/text()" ); + OUString leftA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/infos/bounds", "left" ); + OUString leftB2 = parseDump("/root/page/body/tab/row[2]/cell[2]/infos/bounds", "left" ); + CPPUNIT_ASSERT_EQUAL( OUString( "A3" ), textA3 ); + CPPUNIT_ASSERT( leftA3.toInt32() > leftB2.toInt32()); +} + +DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx") +{ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference image(getShape(1), uno::UNO_QUERY); + uno::Reference imageProperties(image, uno::UNO_QUERY); + uno::Reference graphic; + imageProperties->getPropertyValue( "Graphic" ) >>= graphic; + uno::Reference bitmap(graphic, uno::UNO_QUERY); + Graphic aVclGraphic(graphic); + Bitmap aBitmap(aVclGraphic.GetBitmap()); + BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess(); + CPPUNIT_ASSERT(pAccess); + CPPUNIT_ASSERT_EQUAL(58L, pAccess->Width()); + CPPUNIT_ASSERT_EQUAL(320L, pAccess->Height()); + Color aColor(pAccess->GetPixel(30, 20)); + CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xce, 0xce, 0xce )); + Bitmap::ReleaseAccess(pAccess); +} + +DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx") +{ + // When chart was in a TextFrame, its size was too large. + uno::Reference xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); + // This was 10954. + CPPUNIT_ASSERT_EQUAL(sal_Int32(6008), getProperty(xEmbeddedObjects->getByIndex(0), "Width")); + + // Layout modified the document when it had this chart. + uno::Reference xModifiable(mxComponent, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, bool(xModifiable->isModified())); +} + +DECLARE_OOXMLEXPORT_TEST(testInlineGroupshape, "inline-groupshape.docx") +{ + // Inline groupshape was in the background, so it was hidden sometimes by other shapes. + CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), "Opaque")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo78883, "fdo78883.docx") +{ + // fdo#78883 : LO was getting hang while opening document + // Checking there is a single page after loading a doc in LO. + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + + // Check to make sure the document loaded. Note that the page number may + // be 1 or 2 depending on the environment. + CPPUNIT_ASSERT(xCursor->getPage() > sal_Int16(0)); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo79535, "fdo79535.docx") +{ + // fdo#79535 : LO was crashing while opening document + // Checking there is a single page after loading a doc successfully in LO. + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc875718, "bnc875718.docx") +{ + // The frame in the footer must not accidentally end up in the document body. + // The easiest way for this to test I've found is checking that + // xray ThisComponent.TextFrames.GetByIndex( index ).Anchor.Text.ImplementationName + // is not SwXBodyText but rather SwXHeadFootText + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + for( int i = 0; + i < xIndexAccess->getCount(); + ++i ) + { + uno::Reference frame(xIndexAccess->getByIndex( i ), uno::UNO_QUERY); + uno::Reference range(frame->getAnchor(), uno::UNO_QUERY); + uno::Reference text(range->getText(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "SwXHeadFootText" ), text->getImplementationName()); + } + // Also check that the footer contents are not in the body text. + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference text(textDocument->getText(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "Text" ), text->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testCaption, "caption.docx") +{ + uno::Reference xStyle(getStyles("ParagraphStyles")->getByName("Caption"), uno::UNO_QUERY); + // This was awt::FontSlant_ITALIC: Writer default was used instead of what is in the document. + CPPUNIT_ASSERT_EQUAL(awt::FontSlant_NONE, getProperty(xStyle, "CharPosture")); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeTrackedchanges, "groupshape-trackedchanges.docx") +{ + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); + // Shape text was completely missing, ensure inserted text is available. + CPPUNIT_ASSERT_EQUAL(OUString(" Inserted"), xShape->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo78939, "fdo78939.docx") +{ + // fdo#78939 : LO hanged while opening issue document + + // Whenever a para-style was applied to a Numbering format level, + // LO incorrectly also changed the para-style.. + + // check that file opens and does not hang while opening and also + // check that an incorrect numbering style is not applied ... + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty(getParagraph(1), "NumberingStyleName")); +} + +DECLARE_OOXMLEXPORT_TEST(testFootnote, "footnote.docx") +{ + uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + uno::Reference xFootnote(xFootnotes->getByIndex(0), uno::UNO_QUERY); + OUString aFootnote = xFootnote->getString(); + // Ensure there are no additional newlines after "bar". + CPPUNIT_ASSERT(aFootnote.endsWith("bar")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Cell vertical alignment was NONE, should be CENTER. + CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xTable->getCellByName("A2"), "VertOrient")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo80555, "fdo80555.docx") +{ + uno::Reference xShape = getShape(1); + // Shape was wrongly placed at X=0, Y=0 + CPPUNIT_ASSERT_EQUAL(sal_Int32(3318), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(247), xShape->getPosition().Y); +} + +DECLARE_OOXMLEXPORT_TEST(testHidemark, "hidemark.docx") +{ + // Problem was that cell property was ignored. + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // Height should be minimal + CPPUNIT_ASSERT_EQUAL(convertTwipToMm100(MINLAY), getProperty(xTableRows->getByIndex(1), "Height")); + // Size type was MIN, should be FIX to avoid considering the end of paragraph marker. + CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty(xTableRows->getByIndex(1), "SizeType")); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc891663, "bnc891663.docx") +{ + // The image should be inside a cell, so the text in the following cell should be below it. + int imageTop = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "top").toInt32(); + int imageHeight = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "height").toInt32(); + int textNextRowTop = parseDump("/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds", "top").toInt32(); + CPPUNIT_ASSERT( textNextRowTop >= imageTop + imageHeight ); +} + +DECLARE_OOXMLEXPORT_TEST(testTcwRounding, "tcw-rounding.docx") +{ + // Width of the A1 cell in twips was 3200, due to a rounding error. + CPPUNIT_ASSERT_EQUAL(static_cast(3201), parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo85542, "fdo85542.docx") +{ + uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(xBookmarksByIdx->getCount(), static_cast(3)); + uno::Reference xBookmarksByName(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("B1")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("B2")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("B3")); + // B1 + uno::Reference xContent1(xBookmarksByName->getByName("B1"), uno::UNO_QUERY); + uno::Reference xRange1(xContent1->getAnchor(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(xRange1->getString(), OUString("ABB")); + // B2 + uno::Reference xContent2(xBookmarksByName->getByName("B2"), uno::UNO_QUERY); + uno::Reference xRange2(xContent2->getAnchor(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(xRange2->getString(), OUString("BBC")); + // B3 -- testing a collapsed bookmark + uno::Reference xContent3(xBookmarksByName->getByName("B3"), uno::UNO_QUERY); + uno::Reference xRange3(xContent3->getAnchor(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(xRange3->getString(), OUString("")); + uno::Reference xText(xRange3->getText( ), uno::UNO_QUERY); + uno::Reference xNeighborhoodCursor(xText->createTextCursor( ), uno::UNO_QUERY); + xNeighborhoodCursor->gotoRange(xRange3, false); + xNeighborhoodCursor->goLeft(1, false); + xNeighborhoodCursor->goRight(2, true); + uno::Reference xTextNeighborhood(xNeighborhoodCursor, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(xTextNeighborhood->getString(), OUString("AB")); +} + +DECLARE_OOXMLEXPORT_TEST(testChtOutlineNumberingOoxml, "chtoutline.docx") +{ + const sal_Unicode aExpectedPrefix[2] = { 0x7b2c, 0x0020 }; + const sal_Unicode aExpectedSuffix[2] = { 0x0020, 0x7ae0 }; + uno::Reference< text::XChapterNumberingSupplier > xChapterNumberingSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference< container::XIndexAccess> xLevels(xChapterNumberingSupplier->getChapterNumberingRules()); + uno::Sequence aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + OUString aSuffix,aPrefix; + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + + if (rProp.Name == "Suffix") + aSuffix = rProp.Value.get(); + if (rProp.Name == "Prefix") + aPrefix = rProp.Value.get(); + } + CPPUNIT_ASSERT_EQUAL(OUString(aExpectedPrefix,SAL_N_ELEMENTS(aExpectedPrefix)), aPrefix); + CPPUNIT_ASSERT_EQUAL(OUString(aExpectedSuffix,SAL_N_ELEMENTS(aExpectedSuffix)), aSuffix); +} + +DECLARE_OOXMLEXPORT_TEST(mathtype, "mathtype.docx") +{ + uno::Reference xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); + // This failed as the Model property was empty. + auto xModel = getProperty< uno::Reference >(xEmbeddedObjects->getByIndex(0), "Model"); + CPPUNIT_ASSERT(xModel->supportsService("com.sun.star.formula.FormulaProperties")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf8255, "tdf8255.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPageSupplier(xTextDocument, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + // This was 1: a full-page-wide multi-page floating table was imported as a TextFrame. + CPPUNIT_ASSERT_EQUAL(static_cast(0), xDrawPage->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf87460, "tdf87460.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xEndnotesSupplier(xTextDocument, uno::UNO_QUERY); + uno::Reference xEndnotes = xEndnotesSupplier->getEndnotes(); + // This was 0: endnote was lost on import. + CPPUNIT_ASSERT_EQUAL(static_cast(1), xEndnotes->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90611, "tdf90611.docx") +{ + uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + uno::Reference xFootnoteText; + xFootnotes->getByIndex(0) >>= xFootnoteText; + // This was 11. + CPPUNIT_ASSERT_EQUAL(10.f, getProperty(getParagraphOfText(1, xFootnoteText), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf89702, "tdf89702.docx") +{ + // Get the first paragraph's numbering style's 2nd level's character style name. + uno::Reference xParagraph = getParagraph(1); + auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); + uno::Sequence aLevel; + xLevels->getByIndex(1) >>= aLevel; // 2nd level + OUString aCharStyleName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get(); + + // Make sure that the font name is Arial, this was Verdana. + uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xStyle, "CharFontName")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf86374, "tdf86374.docx") +{ + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTable->getRows(), uno::UNO_QUERY); + // btLr text direction was imported as FIX, it should be MIN to have enough space for the additionally entered paragraphs. + CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty(xTableRows->getByIndex(0), "SizeType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf87924, "tdf87924.docx") +{ + uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + // This was -270, the text rotation angle was set when it should not be rotated. + CPPUNIT_ASSERT_EQUAL(static_cast(0), aGeometry["TextPreRotateAngle"].get()); +} + +#endif + +DECLARE_OOXMLEXPORT_TEST(testIndents, "indents.docx") +{ + //expected left margin and first line indent values + static const sal_Int32 indents[] = + { + 0, 0, + -2000, 0, + -2000, 1000, + -1000, -1000, + 2000, -1000 + }; + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + size_t paraIndex = 0; + do + { + uno::Reference xServiceInfo; + if (xParaEnum->nextElement() >>= xServiceInfo) + { + uno::Reference const xPropertySet(xServiceInfo, uno::UNO_QUERY_THROW); + sal_Int32 nIndent = 0; + sal_Int32 nFirstLine = 0; + xPropertySet->getPropertyValue("ParaLeftMargin") >>= nIndent; + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nFirstLine; + CPPUNIT_ASSERT_EQUAL(indents[paraIndex * 2], nIndent); + CPPUNIT_ASSERT_EQUAL(indents[paraIndex * 2 + 1], nFirstLine); + ++paraIndex; + } + } while (xParaEnum->hasMoreElements()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92454, "tdf92454.docx") +{ + // The first paragraph had a large indentation / left margin as inheritance + // in Word and Writer works differently, and no direct value was set to be + // explicit. + uno::Reference xParagraph(getParagraph(1), uno::UNO_QUERY); + // This was beans::PropertyState_DEFAULT_VALUE. + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95376, "tdf95376.docx") +{ + uno::Reference xParagraph(getParagraph(2), uno::UNO_QUERY); + // This was beans::PropertyState_DIRECT_VALUE: indentation-from-numbering + // did not have priority over indentation-from-paragraph-style, due to a + // filter workaround that's not correct here. + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92124, "tdf92124.docx") +{ + // Get the second paragraph's numbering style's 1st level's suffix. + uno::Reference xParagraph = getParagraph(2); + auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); + uno::Sequence aLevel; + xLevels->getByIndex(0) >>= aLevel; // 1st level + OUString aSuffix = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "Suffix"; })->Value.get(); + // Make sure it's empty as the source document contains . + CPPUNIT_ASSERT(aSuffix.isEmpty()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90153, "tdf90153.docx") +{ + // This was at-para, so the line-level VertOrientRelation was lost, resulting in an incorrect vertical position. + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty(getShape(1), "AnchorType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf93919, "tdf93919.docx") +{ + // This was 0, left margin was not inherited from the list style. + CPPUNIT_ASSERT_EQUAL(static_cast(1270), getProperty(getParagraph(1), "ParaLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf91417, "tdf91417.docx") +{ + // The first paragraph should contain a link to "http://www.google.com/" + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xTextCursor(xTextDocument->getText()->createTextCursor( ), uno::UNO_QUERY); + uno::Reference xCursorProps(xTextCursor, uno::UNO_QUERY); + OUString aValue; + xCursorProps->getPropertyValue("HyperLinkURL") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/"), aValue); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90810, "tdf90810short.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xFootnoteSupp(xTextDocument, uno::UNO_QUERY); + uno::Reference xFootnoteIdxAcc(xFootnoteSupp->getFootnotes(), uno::UNO_QUERY); + uno::Reference xFootnote(xFootnoteIdxAcc->getByIndex(0), uno::UNO_QUERY); + uno::Reference xFootnoteText(xFootnote, uno::UNO_QUERY); + rtl::OUString sFootnoteText = xFootnoteText->getString(); + CPPUNIT_ASSERT_EQUAL(static_cast(90), static_cast(sFootnoteText.getLength())); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf89165, "tdf89165.docx") +{ + // This must not hang in layout +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95777, "tdf95777.docx") +{ + // This must not fail on open +} + +DECLARE_OOXMLEXPORT_TEST(testTdf94374, "hello.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xEnd = xText->getEnd(); + // This failed: it wasn't possible to insert a DOCX document into an existing Writer one. + CPPUNIT_ASSERT(paste("tdf94374.docx", xEnd)); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf83300, "tdf83300.docx") +{ + // This was 'Contents Heading', which (in the original document) implied 'keep with next' on unexpected paragraphs. + CPPUNIT_ASSERT_EQUAL(OUString("TOC Heading"), getProperty(getParagraph(1), "ParaStyleName")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf78902, "tdf78902.docx") +{ + // This hung in layout. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95775, "tdf95775.docx") +{ + // This must not fail in layout +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92157, "tdf92157.docx") +{ + // A graphic with dimensions 0,0 should not fail on load +} + +DECLARE_OOXMLEXPORT_TEST(testTdf97417, "section_break_numbering.docx") +{ + // paragraph with numbering and section break was removed by writerfilter + // but its numbering was copied to all following paragraphs + CPPUNIT_ASSERT_MESSAGE("first paragraph missing numbering", + getProperty>(getParagraph(1), "NumberingRules").is()); + uno::Reference const xProps(getParagraph(2), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("second paragraph erroneous numbering", + !xProps->getPropertyValue("NumberingRules").hasValue()); + +} + +DECLARE_OOXMLEXPORT_TEST(testTdf94043, "tdf94043.docx") +{ + auto xTextSection = getProperty< uno::Reference >(getParagraph(2), "TextSection"); + auto xTextColumns = getProperty< uno::Reference >(xTextSection, "TextColumns"); + // This was 0, the separator line was not visible due to 0 width. + CPPUNIT_ASSERT_EQUAL(static_cast(2), getProperty(xTextColumns, "SeparatorLineWidth")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95213, "tdf95213.docx") +{ + // Get the second paragraph's numbering style's 2nd level's character style name. + uno::Reference xParagraph = getParagraph(2); + auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); + uno::Sequence aLevel; + xLevels->getByIndex(1) >>= aLevel; // 2nd level + OUString aName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get(); + + uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aName), uno::UNO_QUERY); + // This was awt::FontWeight::BOLD. + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty(xStyle, "CharWeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf97371, "tdf97371.docx") +{ + SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + SdrObject* pShape = pPage->GetObj(0); + SdrObject* pTextBox = pPage->GetObj(1); + long nDiff = std::abs(pShape->GetSnapRect().Top() - pTextBox->GetSnapRect().Top()); + // The top of the two shapes were 410 and 3951, now it should be 3950 and 3951. + CPPUNIT_ASSERT(nDiff < 10); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf99140, "tdf99140.docx") +{ + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPageSupplier(xTextDocument, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + // This was 1: a multi-page floating table was imported as a TextFrame. + CPPUNIT_ASSERT_EQUAL(static_cast(0), xDrawPage->getCount()); + + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTableProperties(xTables->getByIndex(1), uno::UNO_QUERY); + // This was text::HoriOrientation::NONE, the second table was too wide due to this. + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT_AND_WIDTH, getProperty(xTableProperties, "HoriOrient")); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx new file mode 100644 index 000000000000..31c9b9f7c1ff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.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 + +#include +#include +#include +#include +#include +#include +#include +#include + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} + +protected: + /** + * Blacklist handling + */ + bool mustTestImportOf(const char* filename) const override { + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx")); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testTdf92045, "tdf92045.docx") +{ + // This was true, resulted in setting the blinking font effect. + CPPUNIT_ASSERT_EQUAL(false, getProperty(getRun(getParagraph(1), 1), "CharFlash")); +} + + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx b/sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx deleted file mode 100644 index 10b8f9de21d8..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/all_gaps_word.docx b/sw/qa/extras/ooxmlimport/data/all_gaps_word.docx deleted file mode 100644 index fc52281a2552..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/all_gaps_word.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/annotation-formatting.docx b/sw/qa/extras/ooxmlimport/data/annotation-formatting.docx deleted file mode 100644 index 87af02b780e5..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/annotation-formatting.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx b/sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx deleted file mode 100644 index 927d4d37671a..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/bnc780044_spacing.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/bnc865381.docx b/sw/qa/extras/ooxmlimport/data/bnc865381.docx deleted file mode 100644 index bb125cc73095..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/bnc865381.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/bnc875718.docx b/sw/qa/extras/ooxmlimport/data/bnc875718.docx deleted file mode 100644 index 878a46fdf912..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/bnc875718.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/bnc891663.docx b/sw/qa/extras/ooxmlimport/data/bnc891663.docx deleted file mode 100644 index d5f057e66fd6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/bnc891663.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/caption.docx b/sw/qa/extras/ooxmlimport/data/caption.docx deleted file mode 100644 index 301472cbc7ad..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/caption.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/chart-prop.docx b/sw/qa/extras/ooxmlimport/data/chart-prop.docx deleted file mode 100644 index f9cddd4949a6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/chart-prop.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/chart-size.docx b/sw/qa/extras/ooxmlimport/data/chart-size.docx deleted file mode 100644 index da5d144438a3..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/chart-size.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/chtoutline.docx b/sw/qa/extras/ooxmlimport/data/chtoutline.docx deleted file mode 100644 index 92fdaf71e745..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/chtoutline.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/conditionalstyles-tbllook.docx b/sw/qa/extras/ooxmlimport/data/conditionalstyles-tbllook.docx deleted file mode 100644 index 4222d6376789..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/conditionalstyles-tbllook.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx b/sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx deleted file mode 100644 index 0f22a87f0e29..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/dml-groupshape-capitalization.docx b/sw/qa/extras/ooxmlimport/data/dml-groupshape-capitalization.docx deleted file mode 100644 index 67fd21f64d14..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/dml-groupshape-capitalization.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/dml-groupshape-runfonts.docx b/sw/qa/extras/ooxmlimport/data/dml-groupshape-runfonts.docx deleted file mode 100644 index e4c8c6cb575f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/dml-groupshape-runfonts.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx b/sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx deleted file mode 100644 index 7314d876a45c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo38414.docx b/sw/qa/extras/ooxmlimport/data/fdo38414.docx deleted file mode 100644 index 135cd32c981e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo38414.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo43093.docx b/sw/qa/extras/ooxmlimport/data/fdo43093.docx deleted file mode 100644 index 3e5a910e2003..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo43093.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo46361.docx b/sw/qa/extras/ooxmlimport/data/fdo46361.docx deleted file mode 100644 index 2f894e4b3ccd..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo46361.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo49940.docx b/sw/qa/extras/ooxmlimport/data/fdo49940.docx deleted file mode 100644 index 242284463632..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo49940.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo52208.docx b/sw/qa/extras/ooxmlimport/data/fdo52208.docx deleted file mode 100644 index be842ad2acbc..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo52208.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo53985.docx b/sw/qa/extras/ooxmlimport/data/fdo53985.docx deleted file mode 100644 index 0c8b32fb671f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo53985.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo55187.docx b/sw/qa/extras/ooxmlimport/data/fdo55187.docx deleted file mode 100644 index 59cd0a806250..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo55187.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo59273.docx b/sw/qa/extras/ooxmlimport/data/fdo59273.docx deleted file mode 100644 index fcdfd7734411..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo59273.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo59638.docx b/sw/qa/extras/ooxmlimport/data/fdo59638.docx deleted file mode 100644 index d33e7cc0a037..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo59638.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo60922.docx b/sw/qa/extras/ooxmlimport/data/fdo60922.docx deleted file mode 100644 index 0d1ff2613ecd..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo60922.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo61343.docx b/sw/qa/extras/ooxmlimport/data/fdo61343.docx deleted file mode 100644 index 9ab99739b7c2..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo61343.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo63685.docx b/sw/qa/extras/ooxmlimport/data/fdo63685.docx deleted file mode 100644 index a1348fcff3b6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo63685.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo65090.docx b/sw/qa/extras/ooxmlimport/data/fdo65090.docx deleted file mode 100644 index 4d45737ddc37..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo65090.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo65632.docx b/sw/qa/extras/ooxmlimport/data/fdo65632.docx deleted file mode 100644 index 8c336c20fdfc..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo65632.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo66474.docx b/sw/qa/extras/ooxmlimport/data/fdo66474.docx deleted file mode 100644 index 0252746f5b6e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo66474.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo68607.docx b/sw/qa/extras/ooxmlimport/data/fdo68607.docx deleted file mode 100644 index 11f57064ce92..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo68607.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo69548.docx b/sw/qa/extras/ooxmlimport/data/fdo69548.docx deleted file mode 100644 index 6799f5ef26bf..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo69548.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo69636.docx b/sw/qa/extras/ooxmlimport/data/fdo69636.docx deleted file mode 100644 index b2f3069b5020..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo69636.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo69649.docx b/sw/qa/extras/ooxmlimport/data/fdo69649.docx deleted file mode 100644 index cb0f78999880..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo69649.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo70457.docx b/sw/qa/extras/ooxmlimport/data/fdo70457.docx deleted file mode 100644 index b9cabb11902c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo70457.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo72560.docx b/sw/qa/extras/ooxmlimport/data/fdo72560.docx deleted file mode 100644 index b21535bfd453..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo72560.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo73389.docx b/sw/qa/extras/ooxmlimport/data/fdo73389.docx deleted file mode 100644 index 02b55f74e2b8..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo73389.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo74357.docx b/sw/qa/extras/ooxmlimport/data/fdo74357.docx deleted file mode 100644 index 970372906e29..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo74357.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo74401.docx b/sw/qa/extras/ooxmlimport/data/fdo74401.docx deleted file mode 100644 index fd3cbabdd9d2..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo74401.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo74745.docx b/sw/qa/extras/ooxmlimport/data/fdo74745.docx deleted file mode 100644 index 773567756a79..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo74745.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo78883.docx b/sw/qa/extras/ooxmlimport/data/fdo78883.docx deleted file mode 100644 index a72ff9436e0c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo78883.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo78904.docx b/sw/qa/extras/ooxmlimport/data/fdo78904.docx deleted file mode 100644 index c171ae2ca813..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo78904.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo78939.docx b/sw/qa/extras/ooxmlimport/data/fdo78939.docx deleted file mode 100644 index 2fc3198630cd..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo78939.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo79535.docx b/sw/qa/extras/ooxmlimport/data/fdo79535.docx deleted file mode 100644 index 64aab18e0ad7..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo79535.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo79738.docx b/sw/qa/extras/ooxmlimport/data/fdo79738.docx deleted file mode 100644 index e6873e7a2362..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo79738.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo80555.docx b/sw/qa/extras/ooxmlimport/data/fdo80555.docx deleted file mode 100644 index a15bdc1ecd31..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo80555.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo81486.docx b/sw/qa/extras/ooxmlimport/data/fdo81486.docx deleted file mode 100644 index 6e680c350a7c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo81486.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo85542.docx b/sw/qa/extras/ooxmlimport/data/fdo85542.docx deleted file mode 100644 index db4940845140..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/fdo85542.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/file_crash.docx b/sw/qa/extras/ooxmlimport/data/file_crash.docx deleted file mode 100644 index 7a233aba5c47..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/file_crash.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/floating-tables-anchor.docx b/sw/qa/extras/ooxmlimport/data/floating-tables-anchor.docx deleted file mode 100644 index 70dc7cf8bf10..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/floating-tables-anchor.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/footnote.docx b/sw/qa/extras/ooxmlimport/data/footnote.docx deleted file mode 100644 index f5c94bd27004..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/footnote.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/frame-wrap-auto.docx b/sw/qa/extras/ooxmlimport/data/frame-wrap-auto.docx deleted file mode 100644 index 6ad7fe059449..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/frame-wrap-auto.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/gridbefore.docx b/sw/qa/extras/ooxmlimport/data/gridbefore.docx deleted file mode 100644 index 571fb48eaa9a..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/gridbefore.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-rotation.docx b/sw/qa/extras/ooxmlimport/data/groupshape-rotation.docx deleted file mode 100644 index d63b5d0734e1..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/groupshape-rotation.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-smarttag.docx b/sw/qa/extras/ooxmlimport/data/groupshape-smarttag.docx deleted file mode 100644 index 6fc1cb2e6936..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/groupshape-smarttag.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-trackedchanges.docx b/sw/qa/extras/ooxmlimport/data/groupshape-trackedchanges.docx deleted file mode 100644 index 116721f39ecc..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/groupshape-trackedchanges.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/hello.docx b/sw/qa/extras/ooxmlimport/data/hello.docx deleted file mode 100644 index d5d8d43ebdac..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/hello.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/hidemark.docx b/sw/qa/extras/ooxmlimport/data/hidemark.docx deleted file mode 100644 index 4a273d6039bb..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/hidemark.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/i124106.docx b/sw/qa/extras/ooxmlimport/data/i124106.docx deleted file mode 100644 index de1d542936ce..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/i124106.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/imgshadow.docx b/sw/qa/extras/ooxmlimport/data/imgshadow.docx deleted file mode 100644 index efe0e9596008..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/imgshadow.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/indentation.docx b/sw/qa/extras/ooxmlimport/data/indentation.docx deleted file mode 100644 index cf57aaf5417e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/indentation.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/indents.docx b/sw/qa/extras/ooxmlimport/data/indents.docx deleted file mode 100755 index b16736791c2e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/indents.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/inline-groupshape.docx b/sw/qa/extras/ooxmlimport/data/inline-groupshape.docx deleted file mode 100644 index def5a05b40e4..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/inline-groupshape.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/large-twips.docx b/sw/qa/extras/ooxmlimport/data/large-twips.docx deleted file mode 100644 index 6e9d82dfab42..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/large-twips.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/libreoffice.png b/sw/qa/extras/ooxmlimport/data/libreoffice.png deleted file mode 100644 index 437f613c178c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/libreoffice.png and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/mathtype.docx b/sw/qa/extras/ooxmlimport/data/mathtype.docx deleted file mode 100644 index bf60f43b25b7..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/mathtype.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/mce-nested.docx b/sw/qa/extras/ooxmlimport/data/mce-nested.docx deleted file mode 100644 index 907ac080c1e3..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/mce-nested.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/mce-wpg.docx b/sw/qa/extras/ooxmlimport/data/mce-wpg.docx deleted file mode 100644 index bd0d84681317..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/mce-wpg.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/missing-path.docx b/sw/qa/extras/ooxmlimport/data/missing-path.docx deleted file mode 100644 index 8d75e9f630ed..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/missing-path.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/msobrightnesscontrast.docx b/sw/qa/extras/ooxmlimport/data/msobrightnesscontrast.docx deleted file mode 100644 index 132f23575b57..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/msobrightnesscontrast.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n592908-frame.docx b/sw/qa/extras/ooxmlimport/data/n592908-frame.docx deleted file mode 100644 index ff59cacbad79..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n592908-frame.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n592908-picture.docx b/sw/qa/extras/ooxmlimport/data/n592908-picture.docx deleted file mode 100644 index 2766d3691cdd..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n592908-picture.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n652364.docx b/sw/qa/extras/ooxmlimport/data/n652364.docx deleted file mode 100644 index 0845509e84b7..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n652364.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n693238.docx b/sw/qa/extras/ooxmlimport/data/n693238.docx deleted file mode 100644 index 5bcda0fff6f7..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n693238.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n705956-1.docx b/sw/qa/extras/ooxmlimport/data/n705956-1.docx deleted file mode 100644 index edff3bac412c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n705956-1.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n705956-2.docx b/sw/qa/extras/ooxmlimport/data/n705956-2.docx deleted file mode 100644 index 138818523a92..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n705956-2.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n747461.docx b/sw/qa/extras/ooxmlimport/data/n747461.docx deleted file mode 100644 index 1064e5db060b..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n747461.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n750255.docx b/sw/qa/extras/ooxmlimport/data/n750255.docx deleted file mode 100644 index a0c7370022b0..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n750255.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n750935.docx b/sw/qa/extras/ooxmlimport/data/n750935.docx deleted file mode 100644 index 0dd01592dd65..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n750935.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n751054.docx b/sw/qa/extras/ooxmlimport/data/n751054.docx deleted file mode 100644 index 49d7d6af9cc6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n751054.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n751117.docx b/sw/qa/extras/ooxmlimport/data/n751117.docx deleted file mode 100644 index 17cc9c53d1cb..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n751117.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n764005.docx b/sw/qa/extras/ooxmlimport/data/n764005.docx deleted file mode 100644 index 1c0dd9d077e9..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n764005.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n766481.docx b/sw/qa/extras/ooxmlimport/data/n766481.docx deleted file mode 100644 index e1521ec82f9c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n766481.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n766487.docx b/sw/qa/extras/ooxmlimport/data/n766487.docx deleted file mode 100644 index 85eda0e7e381..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n766487.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n775906.docx b/sw/qa/extras/ooxmlimport/data/n775906.docx deleted file mode 100644 index 6b6dd1a6b45d..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n775906.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n777337.docx b/sw/qa/extras/ooxmlimport/data/n777337.docx deleted file mode 100644 index 8bb377dcf621..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n777337.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n778828.docx b/sw/qa/extras/ooxmlimport/data/n778828.docx deleted file mode 100644 index ad2e22d17fbf..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n778828.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n778836.docx b/sw/qa/extras/ooxmlimport/data/n778836.docx deleted file mode 100644 index ccd89e85b436..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n778836.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n779630.docx b/sw/qa/extras/ooxmlimport/data/n779630.docx deleted file mode 100644 index 97812d66cff5..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n779630.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n779642.docx b/sw/qa/extras/ooxmlimport/data/n779642.docx deleted file mode 100644 index 2fe9a176689b..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n779642.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n779834.docx b/sw/qa/extras/ooxmlimport/data/n779834.docx deleted file mode 100644 index 24b6db1a446e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n779834.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n779941.docx b/sw/qa/extras/ooxmlimport/data/n779941.docx deleted file mode 100644 index 9889d81e2383..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n779941.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n780563.docx b/sw/qa/extras/ooxmlimport/data/n780563.docx deleted file mode 100644 index 508dc7474bfa..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n780563.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n780843.docx b/sw/qa/extras/ooxmlimport/data/n780843.docx deleted file mode 100644 index 9b92f79aaa17..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n780843.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n780843b.docx b/sw/qa/extras/ooxmlimport/data/n780843b.docx deleted file mode 100644 index 2ba9ab2c6f0f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n780843b.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n780853.docx b/sw/qa/extras/ooxmlimport/data/n780853.docx deleted file mode 100644 index fed8276fbb2a..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n780853.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n782345.docx b/sw/qa/extras/ooxmlimport/data/n782345.docx deleted file mode 100644 index f25709fedf4f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n782345.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n783638.docx b/sw/qa/extras/ooxmlimport/data/n783638.docx deleted file mode 100644 index 93b587b92ef9..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n783638.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n785767.docx b/sw/qa/extras/ooxmlimport/data/n785767.docx deleted file mode 100644 index db356769bc8b..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n785767.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n792778.docx b/sw/qa/extras/ooxmlimport/data/n792778.docx deleted file mode 100644 index d9541d4ccfce..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n792778.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n793262.docx b/sw/qa/extras/ooxmlimport/data/n793262.docx deleted file mode 100644 index 7f2d2e0a8084..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n793262.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n793998.docx b/sw/qa/extras/ooxmlimport/data/n793998.docx deleted file mode 100644 index fc96e2e97f74..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n793998.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n816593.docx b/sw/qa/extras/ooxmlimport/data/n816593.docx deleted file mode 100644 index 7d784e69d4e6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n816593.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n820509.docx b/sw/qa/extras/ooxmlimport/data/n820509.docx deleted file mode 100644 index a6da1e16842c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n820509.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/n830205.docx b/sw/qa/extras/ooxmlimport/data/n830205.docx deleted file mode 100644 index 89cf1d8434a1..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/n830205.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/negative-cell-margin-twips.docx b/sw/qa/extras/ooxmlimport/data/negative-cell-margin-twips.docx deleted file mode 100644 index 3ae73db5c846..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/negative-cell-margin-twips.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/numbering1.docx b/sw/qa/extras/ooxmlimport/data/numbering1.docx deleted file mode 100644 index 55b4af3e8584..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/numbering1.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/page-border-shadow.docx b/sw/qa/extras/ooxmlimport/data/page-border-shadow.docx deleted file mode 100644 index 65a2273f6bc6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/page-border-shadow.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/picture-with-schemecolor.docx b/sw/qa/extras/ooxmlimport/data/picture-with-schemecolor.docx deleted file mode 100644 index bfee0e1415e8..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/picture-with-schemecolor.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/rhbz1180114.docx b/sw/qa/extras/ooxmlimport/data/rhbz1180114.docx deleted file mode 100644 index 23009ebbdc82..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/rhbz1180114.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx b/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx deleted file mode 100644 index ff53871e91ae..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/section_break_numbering.docx b/sw/qa/extras/ooxmlimport/data/section_break_numbering.docx deleted file mode 100644 index 8b5378a771e5..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/section_break_numbering.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/smartart.docx b/sw/qa/extras/ooxmlimport/data/smartart.docx deleted file mode 100644 index 7a553f425188..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/smartart.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/strict-smartart.docx b/sw/qa/extras/ooxmlimport/data/strict-smartart.docx deleted file mode 100644 index bab7c16bcea1..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/strict-smartart.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/strict.docx b/sw/qa/extras/ooxmlimport/data/strict.docx deleted file mode 100644 index b46ce94b3402..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/strict.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size.docx b/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size.docx deleted file mode 100644 index 557edcb3cb0b..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx b/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx deleted file mode 100644 index 2125f09da790..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/table-auto-nested.docx b/sw/qa/extras/ooxmlimport/data/table-auto-nested.docx deleted file mode 100644 index 85f47dbba0b3..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/table-auto-nested.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx deleted file mode 100644 index 79cb53eed06d..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/table-pagebreak.docx b/sw/qa/extras/ooxmlimport/data/table-pagebreak.docx deleted file mode 100644 index 06ecf9535af1..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/table-pagebreak.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/table-style-parprop.docx b/sw/qa/extras/ooxmlimport/data/table-style-parprop.docx deleted file mode 100644 index 1c68c704e7fb..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/table-style-parprop.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tableborder-finedash.docx b/sw/qa/extras/ooxmlimport/data/tableborder-finedash.docx deleted file mode 100644 index 003167ac3ade..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tableborder-finedash.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tblr-height.docx b/sw/qa/extras/ooxmlimport/data/tblr-height.docx deleted file mode 100644 index 6a16c81dd5e0..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tblr-height.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tcw-rounding.docx b/sw/qa/extras/ooxmlimport/data/tcw-rounding.docx deleted file mode 100644 index d4055c953b6f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tcw-rounding.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf59699.docx b/sw/qa/extras/ooxmlimport/data/tdf59699.docx deleted file mode 100644 index 158ac338f88a..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf59699.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf78902.docx b/sw/qa/extras/ooxmlimport/data/tdf78902.docx deleted file mode 100644 index 3cf3a443a975..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf78902.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf8255.docx b/sw/qa/extras/ooxmlimport/data/tdf8255.docx deleted file mode 100644 index 366e498856ba..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf8255.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf83300.docx b/sw/qa/extras/ooxmlimport/data/tdf83300.docx deleted file mode 100644 index aa3ad22d10fc..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf83300.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf86374.docx b/sw/qa/extras/ooxmlimport/data/tdf86374.docx deleted file mode 100644 index 7fd772d79b3f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf86374.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf87460.docx b/sw/qa/extras/ooxmlimport/data/tdf87460.docx deleted file mode 100644 index c443dbe4563e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf87460.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf87924.docx b/sw/qa/extras/ooxmlimport/data/tdf87924.docx deleted file mode 100644 index 5265d6638a88..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf87924.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf89165.docx b/sw/qa/extras/ooxmlimport/data/tdf89165.docx deleted file mode 100644 index a060ca444e27..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf89165.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf89702.docx b/sw/qa/extras/ooxmlimport/data/tdf89702.docx deleted file mode 100644 index 5542d1cbe575..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf89702.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf90153.docx b/sw/qa/extras/ooxmlimport/data/tdf90153.docx deleted file mode 100644 index decbfa29d3b9..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf90153.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf90611.docx b/sw/qa/extras/ooxmlimport/data/tdf90611.docx deleted file mode 100644 index ac54feedd05f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf90611.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf90810short.docx b/sw/qa/extras/ooxmlimport/data/tdf90810short.docx deleted file mode 100755 index 85b6369fbf29..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf90810short.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf91122.docx b/sw/qa/extras/ooxmlimport/data/tdf91122.docx deleted file mode 100644 index c7a45e4dd99a..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf91122.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf91260.docx b/sw/qa/extras/ooxmlimport/data/tdf91260.docx deleted file mode 100644 index 4888f498ddf9..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf91260.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf91417.docx b/sw/qa/extras/ooxmlimport/data/tdf91417.docx deleted file mode 100755 index 1427f8cb3a5d..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf91417.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf92045.docx b/sw/qa/extras/ooxmlimport/data/tdf92045.docx deleted file mode 100644 index d41f523c79b1..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf92045.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf92124.docx b/sw/qa/extras/ooxmlimport/data/tdf92124.docx deleted file mode 100644 index 2999311930eb..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf92124.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf92157.docx b/sw/qa/extras/ooxmlimport/data/tdf92157.docx deleted file mode 100644 index ba5bc2a8f5f5..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf92157.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf92454.docx b/sw/qa/extras/ooxmlimport/data/tdf92454.docx deleted file mode 100644 index 70426685e207..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf92454.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf93919.docx b/sw/qa/extras/ooxmlimport/data/tdf93919.docx deleted file mode 100644 index c7454690c844..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf93919.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf94043.docx b/sw/qa/extras/ooxmlimport/data/tdf94043.docx deleted file mode 100644 index fa47be0760cd..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf94043.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf94374.docx b/sw/qa/extras/ooxmlimport/data/tdf94374.docx deleted file mode 100644 index d5d8d43ebdac..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf94374.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf95213.docx b/sw/qa/extras/ooxmlimport/data/tdf95213.docx deleted file mode 100644 index 831d543b903f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf95213.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf95376.docx b/sw/qa/extras/ooxmlimport/data/tdf95376.docx deleted file mode 100644 index 9bd2d05b2e7a..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf95376.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf95775.docx b/sw/qa/extras/ooxmlimport/data/tdf95775.docx deleted file mode 100644 index a4c1293a56ba..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf95775.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf95777.docx b/sw/qa/extras/ooxmlimport/data/tdf95777.docx deleted file mode 100644 index e71fdea609b6..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf95777.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf97371.docx b/sw/qa/extras/ooxmlimport/data/tdf97371.docx deleted file mode 100644 index 87e67ddf877b..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf97371.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tdf99140.docx b/sw/qa/extras/ooxmlimport/data/tdf99140.docx deleted file mode 100644 index 42fa73d2f8e0..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf99140.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/test_extra_image.docx b/sw/qa/extras/ooxmlimport/data/test_extra_image.docx deleted file mode 100644 index cdb05afa4456..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/test_extra_image.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/textbox-wpg-only.docx b/sw/qa/extras/ooxmlimport/data/textbox-wpg-only.docx deleted file mode 100644 index cd853f97d55f..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/textbox-wpg-only.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx b/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx deleted file mode 100644 index 8fb2668b327e..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/vml-text-vertical-adjust.docx b/sw/qa/extras/ooxmlimport/data/vml-text-vertical-adjust.docx deleted file mode 100644 index 1b05dbd6edab..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/vml-text-vertical-adjust.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/wpg-nested.docx b/sw/qa/extras/ooxmlimport/data/wpg-nested.docx deleted file mode 100644 index eba2aad0e76c..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/wpg-nested.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/wpg-only.docx b/sw/qa/extras/ooxmlimport/data/wpg-only.docx deleted file mode 100644 index 7c86361f9d34..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/wpg-only.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/data/wps-only.docx b/sw/qa/extras/ooxmlimport/data/wps-only.docx deleted file mode 100644 index 7f7b8c75bc26..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/wps-only.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 912e01b55e70..7ec75f37dc81 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -20,14 +20,9 @@ #include #include -#include -#include #include #include -#include -#include #include -#include #include #include #include @@ -37,53 +32,31 @@ #include #include #include -#include -#include #include -#include #include #include #include #include #include #include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include #include #include #include #include -#include -#include #include #include #include -#include -#include #include #include #include #include -#include #include -#include - class Test : public SwModelTestBase { public: @@ -93,7 +66,7 @@ public: virtual std::unique_ptr preTest(const char* filename) override { - if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx" || OString(filename) == "fdo87488.docx") + if (OString(filename) == "fdo87488.docx") { std::unique_ptr pResetter(new Resetter( [] () { @@ -104,24 +77,6 @@ public: } return nullptr; } - -protected: - /// Copy&paste helper. - bool paste(const OUString& rFilename, const uno::Reference& xTextRange) - { - uno::Reference xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.WriterFilter"), uno::UNO_QUERY_THROW); - uno::Reference xImporter(xFilter, uno::UNO_QUERY_THROW); - xImporter->setTargetDocument(mxComponent); - SvStream* pStream = utl::UcbStreamHelper::CreateStream(m_directories.getURLFromSrc("/sw/qa/extras/ooxmlimport/data/") + rFilename, StreamMode::READ); - uno::Reference xStream(new utl::OStreamWrapper(*pStream)); - uno::Sequence aDescriptor(comphelper::InitPropertySequence( - { - {"InputStream", uno::makeAny(xStream)}, - {"InputMode", uno::makeAny(true)}, - {"TextInsertModeRange", uno::makeAny(xTextRange)}, - })); - return xFilter->filter(aDescriptor); - } }; class FailTest : public Test @@ -171,34 +126,6 @@ DECLARE_SW_IMPORT_TEST(testMathMalformedXml, "math-malformed_xml.docx", FailTest CPPUNIT_ASSERT(!mxComponent.is()); } -DECLARE_OOXMLIMPORT_TEST(testN751054, "n751054.docx") -{ - text::TextContentAnchorType eValue = getProperty(getShape(1), "AnchorType"); - CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); -} - -DECLARE_OOXMLIMPORT_TEST(testN751117, "n751117.docx") -{ - // First shape: the end should be an arrow, should be rotated and should be flipped. - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - OUString aValue; - xPropertySet->getPropertyValue("LineEndName") >>= aValue; - CPPUNIT_ASSERT(aValue.indexOf("Arrow") != -1); - - // Rotating & Flipping will cause the angle to change from 90 degrees to 270 degrees - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("RotateAngle") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(270 * 100), nValue); - - uno::Reference xShape(xPropertySet, uno::UNO_QUERY); - awt::Size aActualSize(xShape->getSize()); - CPPUNIT_ASSERT(aActualSize.Width > 0); - - // The second shape should be a line - uno::Reference xServiceInfo(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape")); -} - DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx") { uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -245,48 +172,6 @@ DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx") CPPUNIT_ASSERT(bFoundGet); } -DECLARE_OOXMLIMPORT_TEST(testN750935, "n750935.docx") -{ - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - // Some page break types were ignores, resulting in less pages. - CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor->getPage()); - - /* - * The problem was that the header and footer was not shared. - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.FooterIsShared - */ - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - bool bValue = false; - xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue; - CPPUNIT_ASSERT_EQUAL(true, bValue); - xPropertySet->getPropertyValue("FooterIsShared") >>= bValue; - CPPUNIT_ASSERT_EQUAL(true, bValue); -} - -DECLARE_OOXMLIMPORT_TEST(testN757890, "n757890.docx") -{ - // The w:pStyle token affected the text outside the textbox. - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - OUString aValue; - xPara->getPropertyValue("ParaStyleName") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), aValue); - - // This wan't centered - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - sal_Int16 nValue; - xFrame->getPropertyValue("HoriOrient") >>= nValue; - CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue); -} - DECLARE_OOXMLIMPORT_TEST(testRhbz988516, "rhbz988516.docx") { // The problem was that the list properties of the footer leaked into body @@ -299,43 +184,6 @@ DECLARE_OOXMLIMPORT_TEST(testRhbz988516, "rhbz988516.docx") getProperty(getParagraph(3), "NumberingStyleName")); } -DECLARE_OOXMLIMPORT_TEST(testFdo49940, "fdo49940.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - OUString aValue; - xPara->getPropertyValue("PageStyleName") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aValue); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo74745, "fdo74745.docx") -{ - uno::Reference paragraph = getParagraph(3); - uno::Reference text(paragraph, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(text->getString(),OUString("09/02/14")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo81486, "fdo81486.docx") -{ - uno::Reference paragraph = getParagraph(1); - uno::Reference text(paragraph, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(text->getString(),OUString("CustomTitle")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo79738, "fdo79738.docx") -{ - uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( mxComponent, uno::UNO_QUERY_THROW ); - uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies(); - uno::Reference xStyles; - xStyleFamilies->getByName("ParagraphStyles") >>= xStyles; - uno::Reference xPropertySetHeader( xStyles->getByName("Header"), uno::UNO_QUERY ); - CPPUNIT_ASSERT_EQUAL(false, xPropertySetHeader->getPropertyValue("ParaLineNumberCount").get()); - uno::Reference xPropertySetFooter( xStyles->getByName("Footer"), uno::UNO_QUERY ); - CPPUNIT_ASSERT_EQUAL(false, xPropertySetFooter->getPropertyValue("ParaLineNumberCount").get()); -} - DECLARE_OOXMLIMPORT_TEST(testN751077, "n751077.docx") { /* @@ -351,48 +199,6 @@ xray ThisComponent.DrawPage(1).getByIndex(0).Anchor.PageStyleName CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty(xTextContent->getAnchor(), "PageStyleName")); } -DECLARE_OOXMLIMPORT_TEST(testN705956_1, "n705956-1.docx") -{ -/* -Get the first image in the document and check it's the one image in the document. -It should be also anchored inline (as character) and be inside a groupshape. -image = ThisComponent.DrawPage.getByIndex(0) -graphic = image(0).Graphic -xray graphic.Size -xray image.AnchorType -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); - uno::Reference drawPage = drawPageSupplier->getDrawPage(); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), drawPage->getCount()); - uno::Reference shapes(getShape(1), uno::UNO_QUERY); - uno::Reference image; - shapes->getByIndex(0) >>= image; - uno::Reference imageProperties(image, uno::UNO_QUERY); - uno::Reference graphic; - imageProperties->getPropertyValue( "Graphic" ) >>= graphic; - uno::Reference bitmap(graphic, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( static_cast(120), bitmap->getSize().Width ); - CPPUNIT_ASSERT_EQUAL( static_cast(106), bitmap->getSize().Height ); - text::TextContentAnchorType anchorType; - imageProperties->getPropertyValue( "AnchorType" ) >>= anchorType; - CPPUNIT_ASSERT_EQUAL( text::TextContentAnchorType_AS_CHARACTER, anchorType ); -} - -DECLARE_OOXMLIMPORT_TEST(testN705956_2, "n705956-2.docx") -{ -/* - must be global, reachable even from inside another -image = ThisComponent.DrawPage.getByIndex(0) -xray image.FillColor -*/ - uno::Reference image = getShape(1); - uno::Reference imageProperties(image, uno::UNO_QUERY); - sal_Int32 fillColor; - imageProperties->getPropertyValue( "FillColor" ) >>= fillColor; - CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor ); -} - DECLARE_OOXMLIMPORT_TEST(testfdo90720, "testfdo90720.docx") { uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); @@ -405,68 +211,6 @@ DECLARE_OOXMLIMPORT_TEST(testfdo90720, "testfdo90720.docx") CPPUNIT_ASSERT_EQUAL( sal_Int32(100), fill_transperence ); } -DECLARE_OOXMLIMPORT_TEST(testN747461, "n747461.docx") -{ -/* -The document contains 3 images (Red, Black, Green, in this order), with explicit -w:relativeHeight (300, 0, 225763766). Check that they are in the right ZOrder -after they are loaded. -*/ - uno::Reference image1 = getShape(1), image2 = getShape(2), image3 = getShape(3); - sal_Int32 zOrder1, zOrder2, zOrder3; - OUString descr1, descr2, descr3; - uno::Reference imageProperties1(image1, uno::UNO_QUERY); - imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1; - imageProperties1->getPropertyValue( "Description" ) >>= descr1; - uno::Reference imageProperties2(image2, uno::UNO_QUERY); - imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2; - imageProperties2->getPropertyValue( "Description" ) >>= descr2; - uno::Reference imageProperties3(image3, uno::UNO_QUERY); - imageProperties3->getPropertyValue( "ZOrder" ) >>= zOrder3; - imageProperties3->getPropertyValue( "Description" ) >>= descr3; - CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), zOrder1 ); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), zOrder2 ); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 2 ), zOrder3 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Black" ), descr1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 ); -} - -DECLARE_OOXMLIMPORT_TEST(testN750255, "n750255.docx") -{ - -/* -Column break without columns on the page is a page break, so check those paragraphs -are on page 2 and page 3 -*/ - CPPUNIT_ASSERT_EQUAL( OUString("one"), parseDump("/root/page[2]/body/txt/text()") ); - CPPUNIT_ASSERT_EQUAL( OUString("two"), parseDump("/root/page[3]/body/txt/text()") ); -} - -DECLARE_OOXMLIMPORT_TEST(testN652364, "n652364.docx") -{ -/* -Related to 750255 above, column break with columns on the page however should be a column break. -enum = ThisComponent.Text.createEnumeration -enum.nextElement -para1 = enum.nextElement -xray para1.String -xray para1.PageStyleName -enum.nextElement -para2 = enum.nextElement -xray para2.String -xray para2.PageStyleName -*/ - // get the 2nd and 4th paragraph - uno::Reference paragraph1(getParagraph( 2, "text1" )); - uno::Reference paragraph2(getParagraph( 4, "text2" )); - OUString pageStyle1 = getProperty< OUString >( paragraph1, "PageStyleName" ); - OUString pageStyle2 = getProperty< OUString >( paragraph2, "PageStyleName" ); - // "Standard" is the style for the first page (2nd is "Converted1"). - CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 ); -} - DECLARE_OOXMLIMPORT_TEST(testN760764, "n760764.docx") { uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); @@ -484,19 +228,6 @@ DECLARE_OOXMLIMPORT_TEST(testN760764, "n760764.docx") CPPUNIT_ASSERT_EQUAL(8.f, fValue); } -DECLARE_OOXMLIMPORT_TEST(testN764005, "n764005.docx") -{ - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - - // The picture in the header wasn't absolutely positioned and wasn't in the background. - text::TextContentAnchorType eValue; - xPropertySet->getPropertyValue("AnchorType") >>= eValue; - CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); - bool bValue = true; - xPropertySet->getPropertyValue("Opaque") >>= bValue; - CPPUNIT_ASSERT_EQUAL(false, bool(bValue)); -} - DECLARE_OOXMLIMPORT_TEST(testN764745, "n764745-alignment.docx") { /* @@ -595,113 +326,6 @@ DECLARE_OOXMLIMPORT_TEST(testN758883, "n758883.docx") CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType); } -DECLARE_OOXMLIMPORT_TEST(testN766481, "n766481.docx") -{ - /* - * The problem was that we had an additional paragraph before the pagebreak. - * - * oParas = ThisComponent.Text.createEnumeration - * oPara = oParas.nextElement - * oPara = oParas.nextElement - * xray oParas.hasMoreElements ' should be false - */ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - for (int i = 0; i < 2; ++i) - xParaEnum->nextElement(); - CPPUNIT_ASSERT_EQUAL(sal_False, xParaEnum->hasMoreElements()); -} - -DECLARE_OOXMLIMPORT_TEST(testN766487, "n766487.docx") -{ - /* - * The problem was that 1) the font size of the first para was too large 2) numbering had no first-line-indent. - * - * oParas = ThisComponent.Text.createEnumeration - * oPara = oParas.nextElement - * oRuns = oPara.createEnumeration - * oRun = oRuns.nextElement - * xray oRun.CharHeight ' 12, was larger - * oPara = oParas.nextElement - * xray oPara.ParaFirstLineIndent ' -635, was 0 - */ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - - uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); - uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); - float fValue = 0; - xPropertySet->getPropertyValue("CharHeight") >>= fValue; - CPPUNIT_ASSERT_EQUAL(12.f, fValue); - - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-360)), nValue); -} - -DECLARE_OOXMLIMPORT_TEST(testN693238, "n693238.docx") -{ - /* - * The problem was that a continuous section break at the end of the doc caused the margins to be ignored. - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin ' was 2000, should be 635 - */ - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("LeftMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nValue); -} - -DECLARE_OOXMLIMPORT_TEST(testNumbering1, "numbering1.docx") -{ -/* in the paragraph itself was overridden by introduced by the paragraph's -enum = ThisComponent.Text.createEnumeration -para = enum.NextElement -xray para.NumberingStyleName -numberingstyle = ThisComponent.NumberingRules.getByIndex(6) -xray numberingstyle.name - should match name above -numbering = numberingstyle.getByIndex(0) -xray numbering(11) - should be 4, arabic -note that the indexes may get off as the implementation evolves, C++ code searches in loops -*/ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference< text::XTextRange > paragraph(getParagraph( 1, "Text1." )); - OUString numberingStyleName = getProperty< OUString >( paragraph, "NumberingStyleName" ); - uno::Reference xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference numberingRules(xNumberingRulesSupplier->getNumberingRules(), uno::UNO_QUERY); - uno::Reference numberingRule; - for( int i = 0; - i < numberingRules->getCount(); - ++i ) - { - OUString name = getProperty< OUString >( numberingRules->getByIndex( i ), "Name" ); - if( name == numberingStyleName ) - { - numberingRule.set( numberingRules->getByIndex( i ), uno::UNO_QUERY ); - break; - } - } - CPPUNIT_ASSERT( numberingRule.is()); - uno::Sequence< beans::PropertyValue > numbering; - numberingRule->getByIndex( 0 ) >>= numbering; - sal_Int16 numberingType = style::NumberingType::NUMBER_NONE; - for( int i = 0; - i < numbering.getLength(); - ++i ) - { - if( numbering[ i ].Name == "NumberingType" ) - { - numbering[ i ].Value >>= numberingType; - break; - } - } - CPPUNIT_ASSERT_EQUAL( style::NumberingType::ARABIC, numberingType ); -} - DECLARE_OOXMLIMPORT_TEST(testBnc773061, "bnc773061.docx") { uno::Reference< text::XTextRange > paragraph = getParagraph( 1 ); @@ -716,26 +340,6 @@ DECLARE_OOXMLIMPORT_TEST(testBnc773061, "bnc773061.docx") CPPUNIT_ASSERT_EQUAL( sal_Int32( 100 ), getProperty< sal_Int32 >( lowered, "CharEscapementHeight" )); } -DECLARE_OOXMLIMPORT_TEST(testAllGapsWord, "all_gaps_word.docx") -{ - BorderTest borderTest; - BorderTest::testTheBorders(mxComponent, false); -} - -DECLARE_OOXMLIMPORT_TEST(testN775906, "n775906.docx") -{ - /* - * The problem was that right margin (via direct formatting) erased the left/first margin (inherited from numbering style). - * - * oParas = ThisComponent.Text.createEnumeration - * oPara = oParas.nextElement - * xray oPara.ParaFirstLineIndent ' was 0 - * xray oPara.ParaLeftMargin ' was 0 - */ - CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty(getParagraph(1), "ParaFirstLineIndent")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1905), getProperty(getParagraph(1), "ParaLeftMargin")); -} - DECLARE_OOXMLIMPORT_TEST(testN775899, "n775899.docx") { /* @@ -773,39 +377,6 @@ DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx") #endif } -DECLARE_OOXMLIMPORT_TEST(testTdf59699, "tdf59699.docx") -{ - uno::Reference xImage(getShape(1), uno::UNO_QUERY); - auto xGraphic = getProperty >(xImage, "Graphic"); - // This was false: the referenced graphic data wasn't imported. - CPPUNIT_ASSERT(xGraphic.is()); -} - -DECLARE_OOXMLIMPORT_TEST(testN777337, "n777337.docx") -{ - /* - * The problem was that the top and bottom margin on the first page was only 0.1cm instead of 1.7cm. - * - * oFirst = ThisComponent.StyleFamilies.PageStyles.getByName("First Page") - * xray oFirst.TopMargin - * xray oFirst.BottomMargin - */ - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty(xPropertySet, "TopMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty(xPropertySet, "BottomMargin")); -} - -DECLARE_OOXMLIMPORT_TEST(testN778836, "n778836.docx") -{ - /* - * The problem was that the paragraph inherited margins from the numbering - * and parent paragraph styles and the result was incorrect. - */ - CPPUNIT_ASSERT_EQUAL(sal_Int32(1270), getProperty(getParagraph(1), "ParaRightMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3810), getProperty(getParagraph(1), "ParaLeftMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty(getParagraph(1), "ParaFirstLineIndent")); -} - DECLARE_OOXMLIMPORT_TEST(testN778140, "n778140.docx") { /* @@ -816,19 +387,6 @@ DECLARE_OOXMLIMPORT_TEST(testN778140, "n778140.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty(getParagraph(1), "ParaBottomMargin")); } -DECLARE_OOXMLIMPORT_TEST(testN778828, "n778828.docx") -{ - /* - * The problem was that a page break after a continuous section break caused - * double page break on title page. - */ - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage()); -} - DECLARE_OOXMLIMPORT_TEST(testInk, "ink.docx") { /* @@ -840,16 +398,6 @@ DECLARE_OOXMLIMPORT_TEST(testInk, "ink.docx") CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.OpenBezierShape")); } -DECLARE_OOXMLIMPORT_TEST(testN779834, "n779834.docx") -{ - // This document simply crashed the importer. -} - -DECLARE_OOXMLIMPORT_TEST(testRHBZ1180114, "rhbz1180114.docx") -{ - // This document simply crashed the importer. -} - DECLARE_OOXMLIMPORT_TEST(testN779627, "n779627.docx") { /* @@ -896,276 +444,68 @@ DECLARE_OOXMLIMPORT_TEST(testN779627b, "n779627b.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered vertically relatively to page", text::RelOrientation::PAGE_FRAME, nValue); } -DECLARE_OOXMLIMPORT_TEST(testTDF91122, "tdf91122.docx") -{ - /* - * OLE object shape: default vertical position is top in MSO, not bottom - */ - for (int i = 1; i <= 2; ++i) - { - uno::Reference xShapeProperties( getShape(i), uno::UNO_QUERY ); - uno::Reference xShapeDescriptor(xShapeProperties, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), xShapeDescriptor->getShapeType()); - sal_Int16 nValue; - xShapeProperties->getPropertyValue("VertOrient") >>= nValue; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", text::VertOrientation::TOP, nValue); - } -} - -DECLARE_OOXMLIMPORT_TEST(testTDF91260, "tdf91260.docx") +DECLARE_OOXMLIMPORT_TEST(testN782061, "n782061.docx") { /* - * textbox can't extend beyond the page bottom - * solution: shrinking textbox (its text frame) height, if needed + * The problem was that the character escapement in the second run was -58. */ - uno::Reference xFrame(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xFrame->getString().startsWith( "Lorem ipsum" ) ); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3454), getProperty(xFrame, "Height")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo74357, "fdo74357.docx") -{ - // Floating table wasn't converted to a textframe. - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - // This was 0. - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); - - // Bottom margin of the first paragraph was too large, causing a layout problem. - // This was 494. - CPPUNIT_ASSERT_EQUAL(sal_Int32(86), getProperty(getParagraph(1), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-9), getProperty(getRun(getParagraph(1), 2), "CharEscapement")); } -DECLARE_OOXMLIMPORT_TEST(testFdo55187, "fdo55187.docx") +DECLARE_OOXMLIMPORT_TEST(testN773061, "n773061.docx") { - // 0x010d was imported as a newline. - getParagraph(1, OUString("lup\xc4\x8dka", 7, RTL_TEXTENCODING_UTF8)); +// xray ThisComponent.TextFrames(0).LeftBorderDistance + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "LeftBorderDistance" ), sal_Int32( 0 )); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "TopBorderDistance" ), sal_Int32( 0 )); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "RightBorderDistance" ), sal_Int32( 0 )); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "BottomBorderDistance" ), sal_Int32( 0 )); } -DECLARE_OOXMLIMPORT_TEST(testN780563, "n780563.docx") +DECLARE_OOXMLIMPORT_TEST(testN780645, "n780645.docx") { - /* - * Make sure we have the table in the fly frame created - */ + // The problem was that when the number of cells didn't match the grid, we + // didn't take care of direct cell widths. uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount( )); -} - -DECLARE_OOXMLIMPORT_TEST(testN780853, "n780853.docx") -{ - /* - * The problem was that the table was not imported. - * - * xray ThisComponent.TextTables.Count 'was 0 - */ - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2135), getProperty< uno::Sequence >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); // was 1999 } -DECLARE_OOXMLIMPORT_TEST(testN780843, "n780843.docx") +DECLARE_OOXMLIMPORT_TEST(testWordArtResizing, "WordArt.docx") { - uno::Reference< text::XTextRange > xPara = getParagraph(1); - OUString aStyleName = getProperty(xPara, "PageStyleName"); - CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aStyleName); + /* The Word-Arts and watermarks were getting resized automatically, It was as if they were + getting glued to the fallback geometry(the sdrObj) and were getting bound to the font size. + The test-case ensures the original height and width of the word-art is not changed while importing*/ - //tdf64372 this document should only have one page break (2 pages, not 3) - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage()); -} + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); -DECLARE_OOXMLIMPORT_TEST(testN780843b, "n780843b.docx") -{ - // Same document as testN780843 except there is more text before the continuous break. Now the opposite footer results should happen. - uno::Reference< text::XTextRange > xPara = getParagraph(3); - OUString aStyleName = getProperty(xPara, "PageStyleName"); - uno::Reference xPageStyle(getStyles("PageStyles")->getByName(aStyleName), uno::UNO_QUERY); - uno::Reference xFooterText = getProperty< uno::Reference >(xPageStyle, "FooterText"); - CPPUNIT_ASSERT_EQUAL( OUString("hidden footer"), xFooterText->getString() ); + uno::Reference xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(10105), xShape->getSize().Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4755), xShape->getSize().Height); } -DECLARE_OOXMLIMPORT_TEST(testShadow, "imgshadow.docx") +DECLARE_OOXMLIMPORT_TEST(testGroupshapeLine, "groupshape-line.docx") { /* - * The problem was that drop shadows on inline images were not being - * imported and applied. + * Another fallout from n#792778, this time first the lines inside a + * groupshape wasn't imported, then the fix broke the size/position of + * non-groupshape lines. Test both here. + * + * xray ThisComponent.DrawPage.Count ' 2 shapes + * xray ThisComponent.DrawPage(0).Position 'x: 2656, y: 339 + * xray ThisComponent.DrawPage(0).Size ' width: 3270, height: 1392 + * xray ThisComponent.DrawPage(1).getByIndex(0).Position 'x: 1272, y: 2286 + * xray ThisComponent.DrawPage(1).getByIndex(0).Size 'width: 10160, height: 0 */ - uno::Reference xPropertySet(getShape(2), uno::UNO_QUERY); - - bool bShadow = getProperty(xPropertySet, "Shadow"); - CPPUNIT_ASSERT(bShadow); - - sal_Int32 nShadowXDistance = getProperty(xPropertySet, "ShadowXDistance"); - CPPUNIT_ASSERT(nShadowXDistance != 0); -} - -DECLARE_OOXMLIMPORT_TEST(testN782061, "n782061.docx") -{ - /* - * The problem was that the character escapement in the second run was -58. - */ - CPPUNIT_ASSERT_EQUAL(sal_Int32(-9), getProperty(getRun(getParagraph(1), 2), "CharEscapement")); -} - -DECLARE_OOXMLIMPORT_TEST(testN782345, "n782345.docx") -{ - /* - * The problem was that the page break was inserted before the 3rd para, instead of before the 2nd para. - */ - CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty(getParagraph(2), "BreakType")); -} - -DECLARE_OOXMLIMPORT_TEST(testN779941, "n779941.docx") -{ - /* - * Make sure top/bottom margins of tables are set to 0 (problem was: bottom margin set to 0.35cm) - */ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); - { - uno::Any aValue = xTableProperties->getPropertyValue("TopMargin"); - sal_Int32 nTopMargin; - aValue >>= nTopMargin; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nTopMargin); - } - { - uno::Any aValue = xTableProperties->getPropertyValue("BottomMargin"); - sal_Int32 nBottomMargin; - aValue >>= nBottomMargin; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nBottomMargin); - } -} - -DECLARE_OOXMLIMPORT_TEST(testN783638, "n783638.docx") -{ - // The problem was that the margins of inline images were not zero. - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xPropertySet, "LeftMargin")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo52208, "fdo52208.docx") -{ - // The problem was that the document had 2 pages instead of 1. - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); -} - -DECLARE_OOXMLIMPORT_TEST(testN785767, "n785767.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // Check the A1 and B1 cells, the width of both of them was the default value (10000 / 9, as there were 9 cells in the row). - CPPUNIT_ASSERT_MESSAGE("A1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position); - CPPUNIT_ASSERT_MESSAGE("B1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); -} - -DECLARE_OOXMLIMPORT_TEST(testN773061, "n773061.docx") -{ -// xray ThisComponent.TextFrames(0).LeftBorderDistance - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "LeftBorderDistance" ), sal_Int32( 0 )); - CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "TopBorderDistance" ), sal_Int32( 0 )); - CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "RightBorderDistance" ), sal_Int32( 0 )); - CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "BottomBorderDistance" ), sal_Int32( 0 )); -} - -DECLARE_OOXMLIMPORT_TEST(testN780645, "n780645.docx") -{ - // The problem was that when the number of cells didn't match the grid, we - // didn't take care of direct cell widths. - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2135), getProperty< uno::Sequence >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); // was 1999 -} - -DECLARE_OOXMLIMPORT_TEST(testFineTableDash, "tableborder-finedash.docx") -{ - // The problem was that finely dashed borders on tables were unsupported - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); - table::TableBorder2 aBorder; - xTableProperties->getPropertyValue("TableBorder2") >>= aBorder; - CPPUNIT_ASSERT_EQUAL(aBorder.RightLine.LineStyle, table::BorderLineStyle::FINE_DASHED); -} - -DECLARE_OOXMLIMPORT_TEST(testN792778, "n792778.docx") -{ - /* - * The problem was that the importer didn't handle complex groupshapes with groupshapes, textboxes and graphics inside. - * - * xray ThisComponent.DrawPage.Count ' 1 groupshape - * xray ThisComponent.DrawPage(0).Count ' 2 sub-groupshapes - * xray ThisComponent.DrawPage(0).getByIndex(0).Count ' first sub-groupshape: 1 pic - * xray ThisComponent.DrawPage(0).getByIndex(1).Count ' second sub-groupshape: 1 pic - * xray ThisComponent.DrawPage(0).getByIndex(0).getByIndex(0).Position.Y ' 11684, the vertical position of the shapes were also wrong - * xray ThisComponent.DrawPage(0).getByIndex(1).getByIndex(0).Position.Y ' 11684 - */ - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); - - uno::Reference xGroupShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroupShape->getCount()); - - uno::Reference xInnerGroupShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xInnerGroupShape->getCount()); - - uno::Reference xInnerShape(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(11684), xInnerShape->getPosition().Y); - - xInnerGroupShape.set(xGroupShape->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xInnerGroupShape->getCount()); - - xInnerShape.set(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(11684), xInnerShape->getPosition().Y); -} - -DECLARE_OOXMLIMPORT_TEST(testWordArtResizing, "WordArt.docx") -{ - /* The Word-Arts and watermarks were getting resized automatically, It was as if they were - getting glued to the fallback geometry(the sdrObj) and were getting bound to the font size. - The test-case ensures the original height and width of the word-art is not changed while importing*/ - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); - - uno::Reference xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(10105), xShape->getSize().Width); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4755), xShape->getSize().Height); -} - -DECLARE_OOXMLIMPORT_TEST(testGroupshapeLine, "groupshape-line.docx") -{ - /* - * Another fallout from n#792778, this time first the lines inside a - * groupshape wasn't imported, then the fix broke the size/position of - * non-groupshape lines. Test both here. - * - * xray ThisComponent.DrawPage.Count ' 2 shapes - * xray ThisComponent.DrawPage(0).Position 'x: 2656, y: 339 - * xray ThisComponent.DrawPage(0).Size ' width: 3270, height: 1392 - * xray ThisComponent.DrawPage(1).getByIndex(0).Position 'x: 1272, y: 2286 - * xray ThisComponent.DrawPage(1).getByIndex(0).Size 'width: 10160, height: 0 - */ - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDrawPage->getCount()); + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDrawPage->getCount()); uno::Reference xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2656), xShape->getPosition().X); @@ -1202,192 +542,6 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeChildRotation, "groupshape-child-rotation CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.TextShape"), xShapeDescriptor->getShapeType()); } -DECLARE_OOXMLIMPORT_TEST(testGroupshapeSmarttag, "groupshape-smarttag.docx") -{ - uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); - uno::Reference xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); - // First run of shape text was missing due to the w:smartTag wrapper around it. - CPPUNIT_ASSERT_EQUAL(OUString("Box 2"), xShape->getString()); - - // Font size of the shape text was 10. - CPPUNIT_ASSERT_EQUAL(12.f, getProperty(xShape->getText(), "CharHeight")); -} - -DECLARE_OOXMLIMPORT_TEST(testN793262, "n793262.docx") -{ - uno::Reference xHeaderText = getProperty< uno::Reference >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); - uno::Reference xHeaderParagraphs(xHeaderText->createEnumeration()); - xHeaderParagraphs->nextElement(); - // Font size of the last empty paragraph in the header was ignored, this was 11. - CPPUNIT_ASSERT_EQUAL(16.f, getProperty(xHeaderParagraphs->nextElement(), "CharHeight")); - - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - // Cell margins as direct formatting were ignored, this was 0. - CPPUNIT_ASSERT_EQUAL(sal_Int32(76), getProperty(xTable->getCellByName("A1"), "TopBorderDistance")); -} - -DECLARE_OOXMLIMPORT_TEST(testN793998, "n793998.docx") -{ - sal_Int32 nTextPortion = parseDump("/root/page/body/txt/Text[1]", "nWidth").toInt32(); // Width of the first (text) portion - sal_Int32 nTabPortion = parseDump("/root/page/body/txt/Text[2]", "nWidth").toInt32(); // Width of the second (tab) portion - sal_Int32 nParagraph = parseDump("/root/page/body/txt/infos/bounds", "width").toInt32(); // Width of the paragraph - sal_Int32 nRightMargin = 3000; - // The problem was that the tab portion didn't ignore the right margin, so text + tab width wasn't larger than body (paragraph - right margin) width. - CPPUNIT_ASSERT(nTextPortion + nTabPortion > nParagraph - nRightMargin); -} - -DECLARE_OOXMLIMPORT_TEST(testN779642, "n779642.docx") -{ - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - - // First problem: check that we have 2 tables, nesting caused the - // creation of outer one to fail - uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong number of imported tables", sal_Int32(2), xTables->getCount()); - - // Second problem: check that the outer table is in a frame, at the bottom of the page - uno::Reference xTextTable(xTextTablesSupplier->getTextTables()->getByName("Table2"), uno::UNO_QUERY); - uno::Reference xAnchor(xTextTable->getAnchor(), uno::UNO_QUERY); - uno::Any aFrame = xAnchor->getPropertyValue("TextFrame"); - uno::Reference xFrame; - aFrame >>= xFrame; - sal_Int16 nValue; - xFrame->getPropertyValue("VertOrient") >>= nValue; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", nValue, text::VertOrientation::BOTTOM); - xFrame->getPropertyValue("VertOrientRelation") >>= nValue; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation relation", nValue, text::RelOrientation::PAGE_PRINT_AREA); -} - -DECLARE_OOXMLIMPORT_TEST(testTbLrHeight, "tblr-height.docx") -{ - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTable->getRows(), uno::UNO_QUERY); - // btLr text direction was imported as MIN, it should be FIX to avoid incorrectly large height in case of too much content. - CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty(xTableRows->getByIndex(0), "SizeType")); -} - -DECLARE_OOXMLIMPORT_TEST(testBnc865381, "bnc865381.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // Second row has a vertically merged cell, make sure size type is not FIX in that case (otherwise B2 is not readable). - CPPUNIT_ASSERT(text::SizeType::FIX != getProperty(xTableRows->getByIndex(1), "SizeType")); - // Explicit size of 41 mm100 was set, so the vertical text in A2 was not readable. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xTableRows->getByIndex(1), "Height")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo53985, "fdo53985.docx") -{ - // Unhandled exception prevented import of the rest of the document. - - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xTables->getCount()); // Only 4 tables were imported. -} - -DECLARE_OOXMLIMPORT_TEST(testFdo59638, "fdo59638.docx") -{ - // The problem was that w:lvlOverride inside w:num was ignores by dmapper. - - uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); - uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); - uno::Sequence aProps; - xLevels->getByIndex(0) >>= aProps; // 1st level - - for (int i = 0; i < aProps.getLength(); ++i) - { - const beans::PropertyValue& rProp = aProps[i]; - - if (rProp.Name == "BulletChar") - { - // Was '*', should be 'o'. - CPPUNIT_ASSERT_EQUAL(OUString("\xEF\x82\xB7", 3, RTL_TEXTENCODING_UTF8), rProp.Value.get()); - return; - } - } - CPPUNIT_FAIL("no BulletChar property"); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo61343, "fdo61343.docx") -{ - // The problem was that there were a groupshape in the doc, followed by an - // OLE object, and this lead to a crash. - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); -} - -DECLARE_OOXMLIMPORT_TEST(testToolsLineNumbering, "tools-line-numbering.docx") -{ - /* - * Test the line numbering feature import (Tools->Line Numbering ...) - * - * xray ThisComponent.getLineNumberingProperties().IsOn == True - * xray ThisComponent.getLineNumberingProperties().CountEmptyLines == True - * xray ThisComponent.getLineNumberingProperties().NumberPosition == 0 - * xray ThisComponent.getLineNumberingProperties().NumberingType == 4 - * xray ThisComponent.getLineNumberingProperties().SeparatorInterval == 3 - */ - - bool bValue = false; - sal_Int32 nValue = -1; - - uno::Reference< text::XTextDocument > xtextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference< text::XLineNumberingProperties > xLineProperties( xtextDocument, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xPropertySet = xLineProperties->getLineNumberingProperties(); - - xPropertySet->getPropertyValue("IsOn") >>= bValue; - CPPUNIT_ASSERT_EQUAL(true, bValue); - - xPropertySet->getPropertyValue("CountEmptyLines") >>= bValue; - CPPUNIT_ASSERT_EQUAL(true, bValue); - - xPropertySet->getPropertyValue("NumberPosition") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue); - - xPropertySet->getPropertyValue("NumberingType") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), nValue); - - xPropertySet->getPropertyValue("SeparatorInterval") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue); -} - -DECLARE_OOXMLIMPORT_TEST(testfdo78904, "fdo78904.docx") -{ - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - if (xIndexAccess->getCount()) - { - uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(0)), getProperty(xFrame, "HoriOrientPosition")); - } -} - -DECLARE_OOXMLIMPORT_TEST(testFdo60922, "fdo60922.docx") -{ - // This was 0, not 100, due to wrong import of w:position w:val="0" - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty(getRun(getParagraph(1), 1), "CharEscapementHeight")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo59273, "fdo59273.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - // Was 115596 (i.e. 10 times wider than necessary), as w:tblW was missing and the importer didn't set it. - CPPUNIT_ASSERT_EQUAL(sal_Int32(12961), getProperty(xTextTable, "Width")); - - uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // Was 9997, so the 4th column had ~zero width - CPPUNIT_ASSERT_EQUAL(sal_Int16(7498), getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators")[2].Position); -} - DECLARE_OOXMLIMPORT_TEST(testTableWidth, "table_width.docx") { uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1400,101 +554,6 @@ DECLARE_OOXMLIMPORT_TEST(testTableWidth, "table_width.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty(xFrames->getByIndex(0), "FrameWidthPercent")); } -DECLARE_OOXMLIMPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbllook.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - // Background was -1. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x7F7F7F), getProperty(xTable->getCellByName("A1"), "BackColor")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo63685, "fdo63685.docx") -{ - // An inline image's wrapping should be always zero, even if the doc model has a non-zero value. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(getShape(1), "TopMargin")); -} - -DECLARE_OOXMLIMPORT_TEST(testN592908_Frame, "n592908-frame.docx") -{ - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - text::WrapTextMode eValue; - xPropertySet->getPropertyValue("Surround") >>= eValue; - CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_PARALLEL); -} - -DECLARE_OOXMLIMPORT_TEST(testN592908_Picture, "n592908-picture.docx") -{ - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - text::WrapTextMode eValue; - xPropertySet->getPropertyValue("Surround") >>= eValue; - CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_PARALLEL); -} - -DECLARE_OOXMLIMPORT_TEST(testN779630, "n779630.docx") -{ - // First shape: date picker - uno::Reference xControlShape(getShape(1), uno::UNO_QUERY); - uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); - uno::Reference xServiceInfo(xPropertySet, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.DateField"))); - CPPUNIT_ASSERT_EQUAL(OUString("date default text"), getProperty(xPropertySet, "HelpText")); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, "DateFormat")); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xPropertySet, "Dropdown"))); - - // Second shape: combo box - xControlShape.set(getShape(2), uno::UNO_QUERY); - xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); - xServiceInfo.set(xPropertySet, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox"))); - CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), getProperty(xPropertySet, "DefaultText")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence >(xPropertySet, "StringItemList").getLength()); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xPropertySet, "Dropdown"))); -} - -DECLARE_OOXMLIMPORT_TEST(testIndentation, "indentation.docx") -{ - uno::Reference xParaLTRTitle(getParagraph( 1, "Title aligned")); - uno::Reference xParaLTRNormal(getParagraph( 2, "")); - - // this will test the text direction for paragraphs - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty( xParaLTRTitle, "WritingMode" )); - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty( xParaLTRNormal, "WritingMode" )); -} - -DECLARE_OOXMLIMPORT_TEST(testPageBorderShadow, "page-border-shadow.docx") -{ - // The problem was that in w:pgBorders, child elements had a w:shadow attribute, but that was ignored. - table::ShadowFormat aShadow = getProperty(getStyles("PageStyles")->getByName("Standard"), "ShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); - CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); - // w:sz="48" is in eights of a point, 1 pt is 20 twips. - CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(48/8*20)), aShadow.ShadowWidth); -} - -DECLARE_OOXMLIMPORT_TEST(testN816593, "n816593.docx") -{ - // Two consecutive without any paragraph in between, but with different tblpPr. In this - // case we need to have 2 different tables instead of 1 - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); -} - -DECLARE_OOXMLIMPORT_TEST(testN820509, "n820509.docx") -{ - // Design mode was enabled. - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xFormLayerAccess(xModel->getCurrentController(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(false, bool(xFormLayerAccess->isFormDesignMode())); - - // M.d.yyyy date format was unhandled. - uno::Reference xControlShape(getShape(1), uno::UNO_QUERY); - uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); - uno::Reference xServiceInfo(xPropertySet, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, "DateFormat")); -} - DECLARE_OOXMLIMPORT_TEST(testN820788, "n820788.docx") { // The problem was that AutoSize was not enabled for the text frame. @@ -1519,12 +578,6 @@ DECLARE_OOXMLIMPORT_TEST(testN820504, "n820504.docx") CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty(getShape(1), "AnchorType")); } -DECLARE_OOXMLIMPORT_TEST(testN830205, "n830205.docx") -{ - // Previously import just crashed (due to infinite recursion). - getParagraph(1, "XXX"); -} - DECLARE_OOXMLIMPORT_TEST(testFdo43641, "fdo43641.docx") { uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); @@ -1533,125 +586,6 @@ DECLARE_OOXMLIMPORT_TEST(testFdo43641, "fdo43641.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(928440)), xLine->getSize().Width); } -DECLARE_OOXMLIMPORT_TEST(testTableAutoColumnFixedSize, "table-auto-column-fixed-size.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - - // Width was not recognized during import when table size was 'auto' - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(3996)), getProperty(xTextTable, "Width")); -} - -DECLARE_OOXMLIMPORT_TEST(testTableAutoColumnFixedSize2, "table-auto-column-fixed-size2.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - // This was 17907, i.e. the sum of the width of the 3 cells (10152 twips each), which is too wide. - CPPUNIT_ASSERT_EQUAL(sal_Int32(16891), getProperty(xTextTable, "Width")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo46361, "fdo46361.docx") -{ - uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); - uno::Reference xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); - // This was CENTER. - CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty(xShape, "TextVerticalAdjust")); - uno::Reference xText = uno::Reference(xShape, uno::UNO_QUERY)->getText(); - uno::Reference xParagraph = getParagraphOfText(1, xText); - // This was LEFT. - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast(getProperty(xParagraph, "ParaAdjust"))); - // This was black, not green. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x008000), getProperty(getRun(xParagraph, 1), "CharColor")); - // \n char was missing due to unhandled w:br. - CPPUNIT_ASSERT_EQUAL(OUString("text\ntext"), uno::Reference(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString()); - // \n chars were missing, due to unhandled multiple w:p tags. - CPPUNIT_ASSERT_EQUAL(OUString("text\ntext\n"), uno::Reference(xGroupShape->getByIndex(2), uno::UNO_QUERY)->getString()); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo65632, "fdo65632.docx") -{ - // The problem was that the footnote text had fake redline: only the body - // text has redline in fact. - uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); - uno::Reference xText(xFootnotes->getByIndex(0), uno::UNO_QUERY); - //uno::Reference xParagraph = getParagraphOfText(1, xText); - CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(getRun(getParagraphOfText(1, xText), 1), "TextPortionType")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo66474, "fdo66474.docx") -{ - // The table width was too small, so the text in the second cell was unreadable: this was 1397. - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(10492), getProperty(xTables->getByIndex(0), "Width")); -} - -DECLARE_OOXMLIMPORT_TEST(testGroupshapeRotation, "groupshape-rotation.docx") -{ - // Rotation on groupshapes wasn't handled at all by the VML importer. - CPPUNIT_ASSERT_EQUAL(sal_Int32(315 * 100), getProperty(getShape(1), "RotateAngle")); -} - -DECLARE_OOXMLIMPORT_TEST(testBnc780044Spacing, "bnc780044_spacing.docx") -{ - // The document has global w:spacing in styles.xml , and local w:spacing in w:pPr, which however - // only applied to text runs, not to as-character pictures. So the picture made the line higher. - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); -} - -DECLARE_OOXMLIMPORT_TEST(testTableAutoNested, "table-auto-nested.docx") -{ - // This was 176, when compat option is not enabled, the auto paragraph bottom margin value was incorrect. - CPPUNIT_ASSERT_EQUAL(sal_Int32(494), getProperty(getParagraph(1), "ParaBottomMargin")); - - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - // This was 115596, i.e. the width of the outer table was too large. - CPPUNIT_ASSERT_EQUAL(sal_Int32(23051), getProperty(xTables->getByIndex(1), "Width")); -} - -DECLARE_OOXMLIMPORT_TEST(testTableStyleParprop, "table-style-parprop.docx") -{ - // The problem was that w:spacing's w:after=0 (a paragraph property) wasn't imported from table style. - uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // This was 353, the document default, i.e. paragraph property from table style had no effect. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); -} - -DECLARE_OOXMLIMPORT_TEST(testTablePagebreak, "table-pagebreak.docx") -{ - // Page break inside table: should be ignored (was style::BreakType_PAGE_BEFORE before). - CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, getProperty(getParagraphOrTable(2), "BreakType")); - - // This one is outside the table: should not be ignored. - CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty(getParagraph(3), "BreakType")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo68607, "fdo68607.docx") -{ - // Bugdoc was 8 pages in Word, 1 in Writer due to pointlessly wrapping the - // table in a frame. Exact layout may depend on fonts available, etc. -- - // but at least make sure that our table spans over multiple pages now. - CPPUNIT_ASSERT(getPages() > 1); -} - -DECLARE_OOXMLIMPORT_TEST(testVmlTextVerticalAdjust, "vml-text-vertical-adjust.docx") -{ - uno::Reference xOuterGroupShape(getShape(1), uno::UNO_QUERY); - uno::Reference xInnerGroupShape(xOuterGroupShape->getByIndex(0), uno::UNO_QUERY); - uno::Reference xShape(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); - // Was CENTER. - CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty(xShape, "TextVerticalAdjust")); -} - DECLARE_OOXMLIMPORT_TEST(testGroupshapeSdt, "groupshape-sdt.docx") { // All problems here are due to the groupshape: we have a drawinglayer rectangle, not a writer textframe. @@ -1683,26 +617,6 @@ DECLARE_OOXMLIMPORT_TEST(testDefaultSectBreakCols, "default-sect-break-cols.docx CPPUNIT_ASSERT(!bValue) ; } -DECLARE_OOXMLIMPORT_TEST(testFdo69636, "fdo69636.docx") -{ - // The problem was that the mso-layout-flow-alt:bottom-to-top VML shape property wasn't handled for sw text frames. - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-270), aCustomShapeGeometry["TextPreRotateAngle"].get()); -} - -DECLARE_OOXMLIMPORT_TEST(testChartProp, "chart-prop.docx") -{ - // The problem was that chart was not getting parsed in writer module. - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); - - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(15240), getProperty(xPropertySet, "Width")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(8890), getProperty(xPropertySet, "Height")); -} - void lcl_countTextFrames(css::uno::Reference< lang::XComponent >& xComponent, sal_Int32 nExpected ) { @@ -1751,65 +665,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf75573, "tdf75573_page1frame.docx") CPPUNIT_ASSERT(!bProt); } -DECLARE_OOXMLIMPORT_TEST(testFdo43093, "fdo43093.docx") -{ - // The problem was that the direction and alignment are not correct for RTL paragraphs. - uno::Reference xParaRtlRight(getParagraph( 1, "Right and RTL in M$")); - sal_Int32 nRtlRight = getProperty< sal_Int32 >( xParaRtlRight, "ParaAdjust" ); - sal_Int16 nRRDir = getProperty< sal_Int32 >( xParaRtlRight, "WritingMode" ); - - uno::Reference xParaRtlLeft(getParagraph( 2, "Left and RTL in M$")); - sal_Int32 nRtlLeft = getProperty< sal_Int32 >( xParaRtlLeft, "ParaAdjust" ); - sal_Int16 nRLDir = getProperty< sal_Int32 >( xParaRtlLeft, "WritingMode" ); - - uno::Reference xParaLtrRight(getParagraph( 3, "Right and LTR in M$")); - sal_Int32 nLtrRight = getProperty< sal_Int32 >( xParaLtrRight, "ParaAdjust" ); - sal_Int16 nLRDir = getProperty< sal_Int32 >( xParaLtrRight, "WritingMode" ); - - uno::Reference xParaLtrLeft(getParagraph( 4, "Left and LTR in M$")); - sal_Int32 nLtrLeft = getProperty< sal_Int32 >( xParaLtrLeft, "ParaAdjust" ); - sal_Int16 nLLDir = getProperty< sal_Int32 >( xParaLtrLeft, "WritingMode" ); - - // this will test the both the text direction and alignment for each paragraph - CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), nRtlRight); - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, nRRDir); - - CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), nRtlLeft); - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, nRLDir); - - CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), nLtrRight); - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLRDir); - - CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), nLtrLeft); - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLLDir); -} - -DECLARE_OOXMLIMPORT_TEST(testSmartart, "smartart.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY); - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc - - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xGroup->getCount()); // 3 rectangles and an arrow in the group - - uno::Reference xPropertySet(xGroup->getByIndex(1), uno::UNO_QUERY); - sal_Int32 nValue(0); - xPropertySet->getPropertyValue("FillColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK - - uno::Reference xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text - - uno::Reference xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - xPropertySet->getPropertyValue("ParaAdjust") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_CENTER), nValue); // Paragraph properties are imported -} - DECLARE_OOXMLIMPORT_TEST(testMultiColumnSeparator, "multi-column-separator-with-line.docx") { uno::Reference xTextSection = getProperty< uno::Reference >(getParagraph(1, "First data."), "TextSection"); @@ -1821,33 +676,6 @@ DECLARE_OOXMLIMPORT_TEST(testMultiColumnSeparator, "multi-column-separator-with- CPPUNIT_ASSERT(bValue); } -DECLARE_OOXMLIMPORT_TEST(testFdo69548, "fdo69548.docx") -{ - // The problem was that the last space in target URL was removed - CPPUNIT_ASSERT_EQUAL(OUString("#this is a bookmark"), getProperty(getRun(getParagraph(1), 1), "HyperLinkURL")); -} - -DECLARE_OOXMLIMPORT_TEST(testWpsOnly, "wps-only.docx") -{ - // Document has wp:anchor, not wp:inline, so handle it accordingly. - uno::Reference xShape = getShape(1); - text::TextContentAnchorType eValue = getProperty(xShape, "AnchorType"); - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_PARAGRAPH, eValue); - - // Check position, it was 0. This is a shape, so use getPosition(), not a property. - CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(671830)), xShape->getPosition().X); - - // Left margin was 0, instead of 114300 EMU's. - CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty(xShape, "LeftMargin")); - // Wrap type was PARALLEL. - CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty(xShape, "Surround")); - - // This should be in front of text. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xShape, "Opaque"))); - // And this should be behind the document. - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty(getShape(2), "Opaque"))); -} - DECLARE_OOXMLIMPORT_TEST(lineWpsOnly, "line-wps-only.docx") { uno::Reference xShape = getShape(1); @@ -1875,181 +703,14 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpsOnly, "textbox-wps-only.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(2173), getProperty(xFrame, "HoriOrientPosition")); #ifdef MACOSX // FIXME: The assert below fails wildly on a Retina display - NSScreen* nsScreen = [ NSScreen mainScreen ]; - CGFloat scaleFactor = [ nsScreen backingScaleFactor ]; // for instance on the 5K Retina iMac, - // [NSScreen mainScreen].frame.size is 2560x1440, - // while real display size is 5120x2880 - if ( nsScreen.frame.size.width * scaleFactor > 4000 ) - return; -#endif - CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty(xFrame, "VertOrientPosition")); -} - -DECLARE_OOXMLIMPORT_TEST(testWpgOnly, "wpg-only.docx") -{ - uno::Reference xShape = getShape(1); - // Check position, it was nearly 0. This is a shape, so use getPosition(), not a property. - CPPUNIT_ASSERT_EQUAL(sal_Int32(oox::drawingml::convertEmuToHmm(548005)), xShape->getPosition().X); -} - -DECLARE_OOXMLIMPORT_TEST(testWpgNested, "wpg-nested.docx") -{ - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY); - // This was a com.sun.star.drawing.CustomShape, due to lack of handling of groupshapes inside groupshapes. - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); - // This was text::RelOrientation::PAGE_FRAME, effectively placing the group shape on the left side of the page instead of the right one. - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_RIGHT, getProperty(xGroup, "HoriOrientRelation")); -} - -DECLARE_OOXMLIMPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") -{ - uno::Reference xShape = getShape(1); - // The relativeFrom attribute was ignored for groupshapes, i.e. these were text::RelOrientation::FRAME. - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xShape, "HoriOrientRelation")); - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xShape, "VertOrientRelation")); - // Make sure the shape is not in the background, as we have behindDoc="0" in the doc. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(xShape, "Opaque"))); - - // The 3 paragraphs on the rectangles inside the groupshape ended up in the - // body text, make sure we don't have multiple paragraphs there anymore. - CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); // was 4 - - // Character escapement was enabled by default, this was 58. - uno::Reference xGroup(xShape, uno::UNO_QUERY); - uno::Reference xText = uno::Reference(xGroup->getByIndex(0), uno::UNO_QUERY)->getText(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight")); -} - -DECLARE_OOXMLIMPORT_TEST(testMceWpg, "mce-wpg.docx") -{ - // Make sure that we read the primary branch, if wpg is requested as a feature. - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference xText = uno::Reference(xGroup->getByIndex(0), uno::UNO_QUERY)->getText(); - // This was VML1. - getParagraphOfText(1, xText, "DML1"); -} - -DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx") -{ - // Vertical position of the shape was incorrect due to incorrect nested mce handling. - uno::Reference xShape(getShape(1), uno::UNO_QUERY); - // positionV's posOffset from the bugdoc, was 0. - CPPUNIT_ASSERT(6985 <= getProperty(xShape, "VertOrientPosition")); - // This was -1 (default), make sure the background color is set. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty(xShape, "FillColor")); - - uno::Reference xShapeDescriptor(getShape(2), uno::UNO_QUERY); - // This was a com.sun.star.drawing.CustomShape, due to incorrect handling of wpg elements after a wps textbox. - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); - - // Now check the top right textbox. - uno::Reference xGroup(getShape(2), uno::UNO_QUERY); - uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); - uno::Reference xParagraph = getParagraphOfText(1, xText, "[Year]"); - CPPUNIT_ASSERT_EQUAL(48.f, getProperty(getRun(xParagraph, 1), "CharHeight")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty(getRun(xParagraph, 1), "CharColor")); - CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(getRun(xParagraph, 1), "CharWeight")); - CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty(xGroup->getByIndex(1), "TextVerticalAdjust")); -} - -DECLARE_OOXMLIMPORT_TEST(testMissingPath, "missing-path.docx") -{ - comphelper::SequenceAsHashMap aCustomShapeGeometry(getProperty(getShape(1), "CustomShapeGeometry")); - comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"].get()); - uno::Sequence aCoordinates = aPath["Coordinates"].get< uno::Sequence >(); - // This was 0, the coordinate list was empty. - CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aCoordinates.getLength()); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") -{ - // The document contains a rotated bitmap - // It must be imported as a XShape object with the proper rotation value - - // Check: there is one shape in the doc - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); - - // Check: the angle of the shape is 45ยบ - CPPUNIT_ASSERT_EQUAL(sal_Int32(4500), getProperty(getShape(1), "RotateAngle")); -} - -DECLARE_OOXMLIMPORT_TEST(testLOCrash,"file_crash.docx") -{ - //The problem was libreoffice crash while opening the file. - getParagraph(1,"Contents"); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo72560, "fdo72560.docx") -{ - // The problem was libreoffice confuse when there RTL default style for paragraph - uno::Reference xParaLeftRTL(getParagraph( 1, "RTL LEFT")); - uno::Reference xParaRightLTR(getParagraph( 2, "LTR RIGHT")); - - // this will test the text direction and alignment for paragraphs - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty( xParaLeftRTL, "WritingMode" )); - CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), getProperty< sal_Int32 >( xParaLeftRTL, "ParaAdjust" )); - - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty( xParaRightLTR, "WritingMode" )); - CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), getProperty< sal_Int32 >( xParaRightLTR, "ParaAdjust" )); -} - -DECLARE_OOXMLIMPORT_TEST(testRPrChangeClosed, "rprchange_closed.docx") -{ - // Redline defined by rPrChanged wasn't removed. - // First paragraph has an rPrChange element, make sure it doesn't appear in the second paragraph. - CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(2), 1), "RedlineType")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo65090, "fdo65090.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // The first row had two cells, instead of a single horizontally merged one. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo69649, "fdo69649.docx") -{ - // The DOCX containing the Table of Contents was not imported with correct page nos - uno::Reference xIndexSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexes(xIndexSupplier->getDocumentIndexes( ), uno::UNO_QUERY); - uno::Reference xTOCIndex(xIndexes->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTextRange(xTOCIndex->getAnchor(), uno::UNO_QUERY); - uno::Reference xText(xTextRange->getText( ), uno::UNO_QUERY); - uno::Reference xTextCursor(xText->createTextCursor( ), uno::UNO_QUERY); - xTextCursor->gotoRange(xTextRange->getStart(),false); - xTextCursor->gotoRange(xTextRange->getEnd(),true); - OUString aTocString(xTextCursor->getString()); - aTocString = aTocString.copy(256); - CPPUNIT_ASSERT(aTocString.startsWithIgnoreAsciiCase( "Heading 15.1:\t15" ) ); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo73389,"fdo73389.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - // This was 9340, i.e. the width of the inner table was too large. - CPPUNIT_ASSERT_EQUAL(sal_Int32(2842), getProperty(xTables->getByIndex(0), "Width")); -} - -DECLARE_OOXMLIMPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx") -{ - uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); - // The text in the groupshape was missing due to the w:sdt and w:sdtContent wrapper around it. - CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString()); -} - -DECLARE_OOXMLIMPORT_TEST(testDmlCharheightDefault, "dml-charheight-default.docx") -{ - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); - // This was 16: the first run of the second para incorrectly inherited the char height of the first para. - CPPUNIT_ASSERT_EQUAL(11.f, getProperty(getRun(getParagraphOfText(2, xShape->getText()), 1), "CharHeight")); + NSScreen* nsScreen = [ NSScreen mainScreen ]; + CGFloat scaleFactor = [ nsScreen backingScaleFactor ]; // for instance on the 5K Retina iMac, + // [NSScreen mainScreen].frame.size is 2560x1440, + // while real display size is 5120x2880 + if ( nsScreen.frame.size.width * scaleFactor > 4000 ) + return; +#endif + CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty(xFrame, "VertOrientPosition")); } DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx") @@ -2066,21 +727,6 @@ DECLARE_OOXMLIMPORT_TEST(testOleAnchor, "ole-anchor.docx") CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty(getShape(1), "Surround")); } -DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capitalization.docx") -{ - // Capitalization inside a group shape was not imported - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); - // 2nd line is written with uppercase letters - CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty(getRun(getParagraphOfText(2, xText), 1), "CharCaseMap")); - // 3rd line has no capitalization - CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty(getRun(getParagraphOfText(3, xText), 1), "CharCaseMap")); - // 4th line has written with small capitals - CPPUNIT_ASSERT_EQUAL(style::CaseMap::SMALLCAPS, getProperty(getRun(getParagraphOfText(4, xText), 1), "CharCaseMap")); - // 5th line has no capitalization - CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty(getRun(getParagraphOfText(5, xText), 1), "CharCaseMap")); -} - DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeParaAdjust, "dml-groupshape-paraadjust.docx") { // Paragraph adjustment inside a group shape was not imported @@ -2100,63 +746,12 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeParaAdjust, "dml-groupshape-paraadjust CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty(getRun(getParagraphOfText(7, xText), 1), "ParaAdjust")); } -DECLARE_OOXMLIMPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.docx") -{ - // At the start of the document, a picture which has a color specified with a color scheme, lost - // it's color during import. - uno::Reference xImage(getShape(1), uno::UNO_QUERY); - uno::Reference xGraphic = getProperty >(xImage, "Graphic"); - Graphic aVclGraphic(xGraphic); - Bitmap aBitmap(aVclGraphic.GetBitmap()); - BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess(); - CPPUNIT_ASSERT(pAccess); - CPPUNIT_ASSERT_EQUAL(341L, pAccess->Width()); - CPPUNIT_ASSERT_EQUAL(181L, pAccess->Height()); - Color aColor(pAccess->GetPixel(30, 120)); - CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd )); - aColor = pAccess->GetPixel(130, 260); - CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd )); - Bitmap::ReleaseAccess(pAccess); -} - DECLARE_OOXMLIMPORT_TEST(testTdf99135, "tdf99135.docx") { // This was 0, crop was ignored on VML import. CPPUNIT_ASSERT_EQUAL(static_cast(1825), getProperty(getShape(1), "GraphicCrop").Bottom); } -DECLARE_OOXMLIMPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(8154), getProperty(xTables->getByIndex(0), "Width")); -} - -DECLARE_OOXMLIMPORT_TEST(testFloatingTablesAnchor, "floating-tables-anchor.docx") -{ - // Problem was one of the two text frames was anchored to the other text frame - // Both frames should be anchored to the paragraph with the text "Anchor point" - uno::Reference xTextContent(getShape(1), uno::UNO_QUERY); - uno::Reference xRange(xTextContent->getAnchor(), uno::UNO_QUERY); - uno::Reference xText(xRange->getText(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); - - xTextContent.set(getShape(2), uno::UNO_QUERY); - xRange.set(xTextContent->getAnchor(), uno::UNO_QUERY); - xText.set(xRange->getText(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); -} - -DECLARE_OOXMLIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.docx") -{ - uno::Reference xTextField = getProperty< uno::Reference >(getRun(getParagraph(2), 2), "TextField"); - uno::Reference xText = getProperty< uno::Reference >(xTextField, "TextRange"); - // Make sure we test the right annotation. - uno::Reference xParagraph = getParagraphOfText(1, xText, "days"); - // Formatting was lost: the second text portion was NONE, not SINGLE. - CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty(getRun(xParagraph, 1), "CharUnderline")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf85523, "tdf85523.docx") { auto xTextField = getProperty< uno::Reference >(getRun(getParagraph(1), 6), "TextField"); @@ -2165,121 +760,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85523, "tdf85523.docx") getParagraphOfText(1, xText, "comment"); } -DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.docx") -{ - // Fonts defined by w:rFonts was not imported and so the font specified by a:fontRef was used. - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); - uno::Reference xRun = getRun(getParagraphOfText(1, xText),1); - CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xRun, "CharFontName")); - CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty(xRun, "CharFontNameComplex")); - CPPUNIT_ASSERT_EQUAL(OUString("MS Mincho"), getProperty(xRun, "CharFontNameAsian")); -} - -DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx") -{ - uno::Reference xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - // This was only 127, pt suffix was ignored, so this got parsed as twips instead of points. - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(72 * 20)), getProperty(xPageStyle, "BottomMargin")); - // This was only 1397, same issue - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(792 * 20)), getProperty(xPageStyle, "Height")); - // Text was missing, due to not handling the strict namespaces. - getParagraph(1, "Hello world!"); - - // Header in the document caused a crash on import. - uno::Reference xHeaderText(xPageStyle->getPropertyValue("HeaderText"), uno::UNO_QUERY); - getParagraphOfText(1, xHeaderText, "This is a header."); - - // Picture was missing. - uno::Reference xServiceInfo(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextGraphicObject")); - - // SmartArt was missing. - xServiceInfo.set(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")); - - // Chart was missing. - xServiceInfo.set(getShape(3), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject")); - - // Math was missing. - xServiceInfo.set(getShape(4), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject")); -} - DECLARE_OOXMLIMPORT_TEST(testStrictLockedcanvas, "strict-lockedcanvas.docx") { // locked canvas shape was missing. getShape(1); } -DECLARE_OOXMLIMPORT_TEST(testSmartartStrict, "strict-smartart.docx") -{ - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - // This was 0, SmartArt was visually missing. - CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xGroup->getCount()); // 3 ellipses + 3 arrows -} - -DECLARE_OOXMLIMPORT_TEST(testLibreOfficeHang, "frame-wrap-auto.docx") -{ - // fdo#72775 - // This was text::WrapTextMode_NONE. - CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_DYNAMIC, getProperty(getShape(1), "Surround")); -} - -DECLARE_OOXMLIMPORT_TEST(testI124106, "i124106.docx") -{ - // This was 2. - CPPUNIT_ASSERT_EQUAL(1, getPages()); -} - -DECLARE_OOXMLIMPORT_TEST(testLargeTwips, "large-twips.docx" ) -{ - // cp#1000043: MSO seems to ignore large twips values, we didn't, which resulted in different - // layout of broken documents (text not visible in this specific document). - OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" ); - CPPUNIT_ASSERT( width.toInt32() > 0 ); -} - -DECLARE_OOXMLIMPORT_TEST(testNegativeCellMarginTwips, "negative-cell-margin-twips.docx" ) -{ - // Slightly related to cp#1000043, the twips value was negative, which wrapped around somewhere, - // while MSO seems to ignore that as well. - OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" ); - CPPUNIT_ASSERT( width.toInt32() > 0 ); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo38414, "fdo38414.docx" ) -{ - // The cells in the last (4th) column were merged properly and so the result didn't have the same height. - // (Since w:gridBefore is worked around by faking another cell in the row, so column count is thus 5 - // instead of 4, therefore compare height of cells 4 and 5 rather than 3 and 4.) - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableColumns(xTextTable->getColumns(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 5 ), xTableColumns->getCount()); - OUString height3 = parseDump("/root/page/body/tab/row[1]/cell[4]/infos/bounds", "height" ); - OUString height4 = parseDump("/root/page/body/tab/row[1]/cell[5]/infos/bounds", "height" ); - CPPUNIT_ASSERT_EQUAL( height3, height4 ); -} - -DECLARE_OOXMLIMPORT_TEST(test_extra_image, "test_extra_image.docx" ) -{ - // fdo#74652 Check there is no shape added to the doc during import - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xDraws->getCount()); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo74401, "fdo74401.docx") -{ - uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); - uno::Reference xShape(xGroupShape->getByIndex(1), uno::UNO_QUERY); - // The triangle (second child) was a TextShape before, so it was shown as a rectangle. - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), xShape->getShapeType()); -} - DECLARE_OOXMLIMPORT_TEST(testFdo75722vml, "fdo75722-vml.docx") { uno::Reference xShape = getShape(1); @@ -2318,163 +804,6 @@ DECLARE_OOXMLIMPORT_TEST(testFdo55381, "fdo55381.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(4), xCursor->getPage()); } -DECLARE_OOXMLIMPORT_TEST(testGridBefore, "gridbefore.docx") -{ - // w:gridBefore is faked by inserting two cells without border (because Writer can't do non-rectangular tables). - // So check the first cell in the first row is in fact 3rd and that it's more to the right than the second - // cell on the second row. - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableColumns(xTextTable->getColumns(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 3 ), xTableColumns->getCount()); - OUString textA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/txt/text()" ); - OUString leftA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/infos/bounds", "left" ); - OUString leftB2 = parseDump("/root/page/body/tab/row[2]/cell[2]/infos/bounds", "left" ); - CPPUNIT_ASSERT_EQUAL( OUString( "A3" ), textA3 ); - CPPUNIT_ASSERT( leftA3.toInt32() > leftB2.toInt32()); -} - -DECLARE_OOXMLIMPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx") -{ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference image(getShape(1), uno::UNO_QUERY); - uno::Reference imageProperties(image, uno::UNO_QUERY); - uno::Reference graphic; - imageProperties->getPropertyValue( "Graphic" ) >>= graphic; - uno::Reference bitmap(graphic, uno::UNO_QUERY); - Graphic aVclGraphic(graphic); - Bitmap aBitmap(aVclGraphic.GetBitmap()); - BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess(); - CPPUNIT_ASSERT(pAccess); - CPPUNIT_ASSERT_EQUAL(58L, pAccess->Width()); - CPPUNIT_ASSERT_EQUAL(320L, pAccess->Height()); - Color aColor(pAccess->GetPixel(30, 20)); - CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xce, 0xce, 0xce )); - Bitmap::ReleaseAccess(pAccess); -} - -DECLARE_OOXMLIMPORT_TEST(testChartSize, "chart-size.docx") -{ - // When chart was in a TextFrame, its size was too large. - uno::Reference xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); - // This was 10954. - CPPUNIT_ASSERT_EQUAL(sal_Int32(6008), getProperty(xEmbeddedObjects->getByIndex(0), "Width")); - - // Layout modified the document when it had this chart. - uno::Reference xModifiable(mxComponent, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(false, bool(xModifiable->isModified())); -} - -DECLARE_OOXMLIMPORT_TEST(testInlineGroupshape, "inline-groupshape.docx") -{ - // Inline groupshape was in the background, so it was hidden sometimes by other shapes. - CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), "Opaque")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo78883, "fdo78883.docx") -{ - // fdo#78883 : LO was getting hang while opening document - // Checking there is a single page after loading a doc in LO. - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - - // Check to make sure the document loaded. Note that the page number may - // be 1 or 2 depending on the environment. - CPPUNIT_ASSERT(xCursor->getPage() > sal_Int16(0)); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo79535, "fdo79535.docx") -{ - // fdo#79535 : LO was crashing while opening document - // Checking there is a single page after loading a doc successfully in LO. - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); -} - -DECLARE_OOXMLIMPORT_TEST(testBnc875718, "bnc875718.docx") -{ - // The frame in the footer must not accidentally end up in the document body. - // The easiest way for this to test I've found is checking that - // xray ThisComponent.TextFrames.GetByIndex( index ).Anchor.Text.ImplementationName - // is not SwXBodyText but rather SwXHeadFootText - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - for( int i = 0; - i < xIndexAccess->getCount(); - ++i ) - { - uno::Reference frame(xIndexAccess->getByIndex( i ), uno::UNO_QUERY); - uno::Reference range(frame->getAnchor(), uno::UNO_QUERY); - uno::Reference text(range->getText(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "SwXHeadFootText" ), text->getImplementationName()); - } - // Also check that the footer contents are not in the body text. - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference text(textDocument->getText(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "Text" ), text->getString()); -} - -DECLARE_OOXMLIMPORT_TEST(testCaption, "caption.docx") -{ - uno::Reference xStyle(getStyles("ParagraphStyles")->getByName("Caption"), uno::UNO_QUERY); - // This was awt::FontSlant_ITALIC: Writer default was used instead of what is in the document. - CPPUNIT_ASSERT_EQUAL(awt::FontSlant_NONE, getProperty(xStyle, "CharPosture")); -} - -DECLARE_OOXMLIMPORT_TEST(testGroupshapeTrackedchanges, "groupshape-trackedchanges.docx") -{ - uno::Reference xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); - // Shape text was completely missing, ensure inserted text is available. - CPPUNIT_ASSERT_EQUAL(OUString(" Inserted"), xShape->getString()); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo78939, "fdo78939.docx") -{ - // fdo#78939 : LO hanged while opening issue document - - // Whenever a para-style was applied to a Numbering format level, - // LO incorrectly also changed the para-style.. - - // check that file opens and does not hang while opening and also - // check that an incorrect numbering style is not applied ... - CPPUNIT_ASSERT_EQUAL(OUString(), getProperty(getParagraph(1), "NumberingStyleName")); -} - -DECLARE_OOXMLIMPORT_TEST(testFootnote, "footnote.docx") -{ - uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); - uno::Reference xFootnote(xFootnotes->getByIndex(0), uno::UNO_QUERY); - OUString aFootnote = xFootnote->getString(); - // Ensure there are no additional newlines after "bar". - CPPUNIT_ASSERT(aFootnote.endsWith("bar")); -} - -DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") -{ - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - // Cell vertical alignment was NONE, should be CENTER. - CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xTable->getCellByName("A2"), "VertOrient")); -} - -DECLARE_OOXMLIMPORT_TEST(testFdo80555, "fdo80555.docx") -{ - uno::Reference xShape = getShape(1); - // Shape was wrongly placed at X=0, Y=0 - CPPUNIT_ASSERT_EQUAL(sal_Int32(3318), xShape->getPosition().X); - CPPUNIT_ASSERT_EQUAL(sal_Int32(247), xShape->getPosition().Y); -} - DECLARE_OOXMLIMPORT_TEST(testFdo76803, "fdo76803.docx") { // The ContourPolyPolygon was wrong @@ -2527,19 +856,6 @@ DECLARE_OOXMLIMPORT_TEST(testFloatingTableSectionColumns, "floating-table-sectio CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 ); } -DECLARE_OOXMLIMPORT_TEST(testHidemark, "hidemark.docx") -{ - // Problem was that cell property was ignored. - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // Height should be minimal - CPPUNIT_ASSERT_EQUAL(convertTwipToMm100(MINLAY), getProperty(xTableRows->getByIndex(1), "Height")); - // Size type was MIN, should be FIX to avoid considering the end of paragraph marker. - CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty(xTableRows->getByIndex(1), "SizeType")); -} - DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, "bnc519228_odd-breaks.docx") { // Check that all the normal styles are not set as right-only, those should be only those used after odd page breaks. @@ -2572,26 +888,11 @@ DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, "bnc519228_odd-breaks.docx") getParagraphOfText( 1, getProperty< uno::Reference >(page5Style, "HeaderText"), "This is the header for odd pages"); } -DECLARE_OOXMLIMPORT_TEST(testBnc891663, "bnc891663.docx") -{ - // The image should be inside a cell, so the text in the following cell should be below it. - int imageTop = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "top").toInt32(); - int imageHeight = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "height").toInt32(); - int textNextRowTop = parseDump("/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds", "top").toInt32(); - CPPUNIT_ASSERT( textNextRowTop >= imageTop + imageHeight ); -} - static OString dateTimeToString( const util::DateTime& dt ) { return DateTimeToOString( DateTime( Date( dt.Day, dt.Month, dt.Year ), tools::Time( dt.Hours, dt.Minutes, dt.Seconds ))); } -DECLARE_OOXMLIMPORT_TEST(testTcwRounding, "tcw-rounding.docx") -{ - // Width of the A1 cell in twips was 3200, due to a rounding error. - CPPUNIT_ASSERT_EQUAL(static_cast(3201), parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32()); -} - DECLARE_OOXMLIMPORT_TEST(testBnc821804, "bnc821804.docx") { CPPUNIT_ASSERT_EQUAL( OUString( "TITLE" ), getRun( getParagraph( 1 ), 1 )->getString()); @@ -2696,59 +997,6 @@ DECLARE_OOXMLIMPORT_TEST(testBnc821804, "bnc821804.docx") CPPUNIT_ASSERT_EQUAL(false,getProperty(getRun(getParagraph(10), 3), "IsStart")); } -DECLARE_OOXMLIMPORT_TEST(testFdo85542, "fdo85542.docx") -{ - uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(xBookmarksByIdx->getCount(), static_cast(3)); - uno::Reference xBookmarksByName(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xBookmarksByName->hasByName("B1")); - CPPUNIT_ASSERT(xBookmarksByName->hasByName("B2")); - CPPUNIT_ASSERT(xBookmarksByName->hasByName("B3")); - // B1 - uno::Reference xContent1(xBookmarksByName->getByName("B1"), uno::UNO_QUERY); - uno::Reference xRange1(xContent1->getAnchor(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(xRange1->getString(), OUString("ABB")); - // B2 - uno::Reference xContent2(xBookmarksByName->getByName("B2"), uno::UNO_QUERY); - uno::Reference xRange2(xContent2->getAnchor(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(xRange2->getString(), OUString("BBC")); - // B3 -- testing a collapsed bookmark - uno::Reference xContent3(xBookmarksByName->getByName("B3"), uno::UNO_QUERY); - uno::Reference xRange3(xContent3->getAnchor(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(xRange3->getString(), OUString("")); - uno::Reference xText(xRange3->getText( ), uno::UNO_QUERY); - uno::Reference xNeighborhoodCursor(xText->createTextCursor( ), uno::UNO_QUERY); - xNeighborhoodCursor->gotoRange(xRange3, false); - xNeighborhoodCursor->goLeft(1, false); - xNeighborhoodCursor->goRight(2, true); - uno::Reference xTextNeighborhood(xNeighborhoodCursor, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(xTextNeighborhood->getString(), OUString("AB")); -} - -DECLARE_OOXMLIMPORT_TEST(testChtOutlineNumberingOoxml, "chtoutline.docx") -{ - const sal_Unicode aExpectedPrefix[2] = { 0x7b2c, 0x0020 }; - const sal_Unicode aExpectedSuffix[2] = { 0x0020, 0x7ae0 }; - uno::Reference< text::XChapterNumberingSupplier > xChapterNumberingSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference< container::XIndexAccess> xLevels(xChapterNumberingSupplier->getChapterNumberingRules()); - uno::Sequence aProps; - xLevels->getByIndex(0) >>= aProps; // 1st level - - OUString aSuffix,aPrefix; - for (int i = 0; i < aProps.getLength(); ++i) - { - const beans::PropertyValue& rProp = aProps[i]; - - if (rProp.Name == "Suffix") - aSuffix = rProp.Value.get(); - if (rProp.Name == "Prefix") - aPrefix = rProp.Value.get(); - } - CPPUNIT_ASSERT_EQUAL(OUString(aExpectedPrefix,SAL_N_ELEMENTS(aExpectedPrefix)), aPrefix); - CPPUNIT_ASSERT_EQUAL(OUString(aExpectedSuffix,SAL_N_ELEMENTS(aExpectedSuffix)), aSuffix); -} - DECLARE_OOXMLIMPORT_TEST(testFdo87488, "fdo87488.docx") { // The shape on the right (index 0, CustomShape within a @@ -2770,15 +1018,6 @@ DECLARE_OOXMLIMPORT_TEST(testFdo87488, "fdo87488.docx") } } -DECLARE_OOXMLIMPORT_TEST(mathtype, "mathtype.docx") -{ - uno::Reference xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); - // This failed as the Model property was empty. - auto xModel = getProperty< uno::Reference >(xEmbeddedObjects->getByIndex(0), "Model"); - CPPUNIT_ASSERT(xModel->supportsService("com.sun.star.formula.FormulaProperties")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf49073, "tdf49073.docx") { // test case for Asisan phontic guide ( ruby text.) @@ -2795,190 +1034,8 @@ DECLARE_OOXMLIMPORT_TEST(testTdf49073, "tdf49073.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_RIGHT) ,getProperty(getParagraph(6)->getStart(),"RubyAdjust")); } -DECLARE_OOXMLIMPORT_TEST(testTdf8255, "tdf8255.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPageSupplier(xTextDocument, uno::UNO_QUERY); - uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); - // This was 1: a full-page-wide multi-page floating table was imported as a TextFrame. - CPPUNIT_ASSERT_EQUAL(static_cast(0), xDrawPage->getCount()); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf87460, "tdf87460.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xEndnotesSupplier(xTextDocument, uno::UNO_QUERY); - uno::Reference xEndnotes = xEndnotesSupplier->getEndnotes(); - // This was 0: endnote was lost on import. - CPPUNIT_ASSERT_EQUAL(static_cast(1), xEndnotes->getCount()); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf90611, "tdf90611.docx") -{ - uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); - uno::Reference xFootnoteText; - xFootnotes->getByIndex(0) >>= xFootnoteText; - // This was 11. - CPPUNIT_ASSERT_EQUAL(10.f, getProperty(getParagraphOfText(1, xFootnoteText), "CharHeight")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf89702, "tdf89702.docx") -{ - // Get the first paragraph's numbering style's 2nd level's character style name. - uno::Reference xParagraph = getParagraph(1); - auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); - uno::Sequence aLevel; - xLevels->getByIndex(1) >>= aLevel; // 2nd level - OUString aCharStyleName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get(); - - // Make sure that the font name is Arial, this was Verdana. - uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(xStyle, "CharFontName")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf86374, "tdf86374.docx") -{ - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xTableRows(xTable->getRows(), uno::UNO_QUERY); - // btLr text direction was imported as FIX, it should be MIN to have enough space for the additionally entered paragraphs. - CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty(xTableRows->getByIndex(0), "SizeType")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf87924, "tdf87924.docx") -{ - uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); - comphelper::SequenceAsHashMap aGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); - // This was -270, the text rotation angle was set when it should not be rotated. - CPPUNIT_ASSERT_EQUAL(static_cast(0), aGeometry["TextPreRotateAngle"].get()); -} - #endif -DECLARE_OOXMLIMPORT_TEST(testIndents, "indents.docx") -{ - //expected left margin and first line indent values - static const sal_Int32 indents[] = - { - 0, 0, - -2000, 0, - -2000, 1000, - -1000, -1000, - 2000, -1000 - }; - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - size_t paraIndex = 0; - do - { - uno::Reference xServiceInfo; - if (xParaEnum->nextElement() >>= xServiceInfo) - { - uno::Reference const xPropertySet(xServiceInfo, uno::UNO_QUERY_THROW); - sal_Int32 nIndent = 0; - sal_Int32 nFirstLine = 0; - xPropertySet->getPropertyValue("ParaLeftMargin") >>= nIndent; - xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nFirstLine; - CPPUNIT_ASSERT_EQUAL(indents[paraIndex * 2], nIndent); - CPPUNIT_ASSERT_EQUAL(indents[paraIndex * 2 + 1], nFirstLine); - ++paraIndex; - } - } while (xParaEnum->hasMoreElements()); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf92454, "tdf92454.docx") -{ - // The first paragraph had a large indentation / left margin as inheritance - // in Word and Writer works differently, and no direct value was set to be - // explicit. - uno::Reference xParagraph(getParagraph(1), uno::UNO_QUERY); - // This was beans::PropertyState_DEFAULT_VALUE. - CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf95376, "tdf95376.docx") -{ - uno::Reference xParagraph(getParagraph(2), uno::UNO_QUERY); - // This was beans::PropertyState_DIRECT_VALUE: indentation-from-numbering - // did not have priority over indentation-from-paragraph-style, due to a - // filter workaround that's not correct here. - CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf92124, "tdf92124.docx") -{ - // Get the second paragraph's numbering style's 1st level's suffix. - uno::Reference xParagraph = getParagraph(2); - auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); - uno::Sequence aLevel; - xLevels->getByIndex(0) >>= aLevel; // 1st level - OUString aSuffix = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "Suffix"; })->Value.get(); - // Make sure it's empty as the source document contains . - CPPUNIT_ASSERT(aSuffix.isEmpty()); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf90153, "tdf90153.docx") -{ - // This was at-para, so the line-level VertOrientRelation was lost, resulting in an incorrect vertical position. - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty(getShape(1), "AnchorType")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf93919, "tdf93919.docx") -{ - // This was 0, left margin was not inherited from the list style. - CPPUNIT_ASSERT_EQUAL(static_cast(1270), getProperty(getParagraph(1), "ParaLeftMargin")); -} -DECLARE_OOXMLIMPORT_TEST(testTdf91417, "tdf91417.docx") -{ - // The first paragraph should contain a link to "http://www.google.com/" - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xTextCursor(xTextDocument->getText()->createTextCursor( ), uno::UNO_QUERY); - uno::Reference xCursorProps(xTextCursor, uno::UNO_QUERY); - OUString aValue; - xCursorProps->getPropertyValue("HyperLinkURL") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/"), aValue); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf90810, "tdf90810short.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xFootnoteSupp(xTextDocument, uno::UNO_QUERY); - uno::Reference xFootnoteIdxAcc(xFootnoteSupp->getFootnotes(), uno::UNO_QUERY); - uno::Reference xFootnote(xFootnoteIdxAcc->getByIndex(0), uno::UNO_QUERY); - uno::Reference xFootnoteText(xFootnote, uno::UNO_QUERY); - rtl::OUString sFootnoteText = xFootnoteText->getString(); - CPPUNIT_ASSERT_EQUAL(static_cast(90), static_cast(sFootnoteText.getLength())); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf89165, "tdf89165.docx") -{ - // This must not hang in layout -} - -DECLARE_OOXMLIMPORT_TEST(testTdf95777, "tdf95777.docx") -{ - // This must not fail on open -} - -DECLARE_OOXMLIMPORT_TEST(testTdf94374, "hello.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xEnd = xText->getEnd(); - // This failed: it wasn't possible to insert a DOCX document into an existing Writer one. - CPPUNIT_ASSERT(paste("tdf94374.docx", xEnd)); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf83300, "tdf83300.docx") -{ - // This was 'Contents Heading', which (in the original document) implied 'keep with next' on unexpected paragraphs. - CPPUNIT_ASSERT_EQUAL(OUString("TOC Heading"), getProperty(getParagraph(1), "ParaStyleName")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx") { uno::Reference xShapes(getShapeByName("Group 219"), uno::UNO_QUERY); @@ -2990,12 +1047,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx") CPPUNIT_ASSERT_EQUAL(static_cast(2267), xShape->getPosition().X); } -DECLARE_OOXMLIMPORT_TEST(testTdf78902, "tdf78902.docx") -{ - // This hung in layout. - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - DECLARE_OOXMLIMPORT_TEST(testTdf95755, "tdf95755.docx") { /* @@ -3011,16 +1062,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf95755, "tdf95755.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(10659), nWidth); } -DECLARE_OOXMLIMPORT_TEST(testTdf95775, "tdf95775.docx") -{ - // This must not fail in layout -} - -DECLARE_OOXMLIMPORT_TEST(testTdf92157, "tdf92157.docx") -{ - // A graphic with dimensions 0,0 should not fail on load -} - DECLARE_OOXMLIMPORT_TEST(testTdf60351, "tdf60351.docx") { // Get the first image in the document and check its contour polygon. @@ -3045,18 +1086,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf60351, "tdf60351.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[5].Y); } -DECLARE_OOXMLIMPORT_TEST(testTdf97417, "section_break_numbering.docx") -{ - // paragraph with numbering and section break was removed by writerfilter - // but its numbering was copied to all following paragraphs - CPPUNIT_ASSERT_MESSAGE("first paragraph missing numbering", - getProperty>(getParagraph(1), "NumberingRules").is()); - uno::Reference const xProps(getParagraph(2), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("second paragraph erroneous numbering", - !xProps->getPropertyValue("NumberingRules").hasValue()); - -} - DECLARE_OOXMLIMPORT_TEST(testTdf95970, "tdf95970.docx") { // First shape: the rotation should be -12.94 deg, it should be mirrored. @@ -3084,14 +1113,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf95970, "tdf95970.docx") CPPUNIT_ASSERT(basegfx::fTools::equal(aTransform.Line3.Column3, 1.0)); } -DECLARE_OOXMLIMPORT_TEST(testTdf94043, "tdf94043.docx") -{ - auto xTextSection = getProperty< uno::Reference >(getParagraph(2), "TextSection"); - auto xTextColumns = getProperty< uno::Reference >(xTextSection, "TextColumns"); - // This was 0, the separator line was not visible due to 0 width. - CPPUNIT_ASSERT_EQUAL(static_cast(2), getProperty(xTextColumns, "SeparatorLineWidth")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf96674, "tdf96674.docx") { uno::Reference xShape(getShape(1), uno::UNO_QUERY); @@ -3102,39 +1123,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf96674, "tdf96674.docx") CPPUNIT_ASSERT(aActualSize.Height > 0); } -DECLARE_OOXMLIMPORT_TEST(testTdf92045, "tdf92045.docx") -{ - // This was true, resulted in setting the blinking font effect. - CPPUNIT_ASSERT_EQUAL(false, getProperty(getRun(getParagraph(1), 1), "CharFlash")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf95213, "tdf95213.docx") -{ - // Get the second paragraph's numbering style's 2nd level's character style name. - uno::Reference xParagraph = getParagraph(2); - auto xLevels = getProperty< uno::Reference >(xParagraph, "NumberingRules"); - uno::Sequence aLevel; - xLevels->getByIndex(1) >>= aLevel; // 2nd level - OUString aName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get(); - - uno::Reference xStyle(getStyles("CharacterStyles")->getByName(aName), uno::UNO_QUERY); - // This was awt::FontWeight::BOLD. - CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty(xStyle, "CharWeight")); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf97371, "tdf97371.docx") -{ - SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); - CPPUNIT_ASSERT(pTextDoc); - SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); - SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); - SdrObject* pShape = pPage->GetObj(0); - SdrObject* pTextBox = pPage->GetObj(1); - long nDiff = std::abs(pShape->GetSnapRect().Top() - pTextBox->GetSnapRect().Top()); - // The top of the two shapes were 410 and 3951, now it should be 3950 and 3951. - CPPUNIT_ASSERT(nDiff < 10); -} - // base class to supply a helper method for testHFLinkToPrev class testHFBase : public Test { @@ -3251,27 +1239,15 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99074, "tdf99074.docx") CPPUNIT_ASSERT(getProperty(xSettings, "InBrowseMode")); } -DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx") -{ - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xDrawPageSupplier(xTextDocument, uno::UNO_QUERY); - uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); - // This was 1: a multi-page floating table was imported as a TextFrame. - CPPUNIT_ASSERT_EQUAL(static_cast(0), xDrawPage->getCount()); - - uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTableProperties(xTables->getByIndex(1), uno::UNO_QUERY); - // This was text::HoriOrientation::NONE, the second table was too wide due to this. - CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT_AND_WIDTH, getProperty(xTableProperties, "HoriOrient")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf100830, "tdf100830.docx") { // FillTransparence wasn't imported, this was 0. CPPUNIT_ASSERT_EQUAL(static_cast(30), getProperty(getShape(1), "FillTransparence")); } + +// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit