diff options
Diffstat (limited to '')
1125 files changed, 20317 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx b/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx Binary files differnew file mode 100644 index 000000000..bfed37919 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx diff --git a/sw/qa/extras/ooxmlexport/data/1-table-1-page.docx b/sw/qa/extras/ooxmlexport/data/1-table-1-page.docx Binary files differnew file mode 100644 index 000000000..d821c6698 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/1-table-1-page.docx diff --git a/sw/qa/extras/ooxmlexport/data/128197_compat14.docx b/sw/qa/extras/ooxmlexport/data/128197_compat14.docx Binary files differnew file mode 100644 index 000000000..507e28396 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/128197_compat14.docx diff --git a/sw/qa/extras/ooxmlexport/data/128197_compat15.docx b/sw/qa/extras/ooxmlexport/data/128197_compat15.docx Binary files differnew file mode 100644 index 000000000..d618b117c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/128197_compat15.docx diff --git a/sw/qa/extras/ooxmlexport/data/1_page.docx b/sw/qa/extras/ooxmlexport/data/1_page.docx Binary files differnew file mode 100644 index 000000000..9b8638dd3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/1_page.docx diff --git a/sw/qa/extras/ooxmlexport/data/2-id.docx b/sw/qa/extras/ooxmlexport/data/2-id.docx Binary files differnew file mode 100644 index 000000000..6d05e68a6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2-id.docx diff --git a/sw/qa/extras/ooxmlexport/data/2120112713.docx b/sw/qa/extras/ooxmlexport/data/2120112713.docx Binary files differnew file mode 100644 index 000000000..5de6378b7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2120112713.docx diff --git a/sw/qa/extras/ooxmlexport/data/2120112713_OpenBrace.docx b/sw/qa/extras/ooxmlexport/data/2120112713_OpenBrace.docx Binary files differnew file mode 100644 index 000000000..10dfd31ab --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2120112713_OpenBrace.docx diff --git a/sw/qa/extras/ooxmlexport/data/2129393649.docx b/sw/qa/extras/ooxmlexport/data/2129393649.docx Binary files differnew file mode 100644 index 000000000..e1fd7581f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2129393649.docx diff --git a/sw/qa/extras/ooxmlexport/data/2_table_doc.docx b/sw/qa/extras/ooxmlexport/data/2_table_doc.docx Binary files differnew file mode 100644 index 000000000..21513ec2c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2_table_doc.docx diff --git a/sw/qa/extras/ooxmlexport/data/2col-header.docx b/sw/qa/extras/ooxmlexport/data/2col-header.docx Binary files differnew file mode 100644 index 000000000..3e8f2c459 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2col-header.docx diff --git a/sw/qa/extras/ooxmlexport/data/99_Fields.docx b/sw/qa/extras/ooxmlexport/data/99_Fields.docx Binary files differnew file mode 100644 index 000000000..e0ee431e3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/99_Fields.docx diff --git a/sw/qa/extras/ooxmlexport/data/AnchorId.docx b/sw/qa/extras/ooxmlexport/data/AnchorId.docx Binary files differnew file mode 100644 index 000000000..b1b66684d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/AnchorId.docx diff --git a/sw/qa/extras/ooxmlexport/data/Chart_BorderLine_Style.docx b/sw/qa/extras/ooxmlexport/data/Chart_BorderLine_Style.docx Binary files differnew file mode 100644 index 000000000..0d3b74b77 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Chart_BorderLine_Style.docx diff --git a/sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx b/sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx Binary files differnew file mode 100644 index 000000000..d1f0f97f1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Chart_Plot_BorderLine_Style.docx diff --git a/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx b/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx Binary files differnew file mode 100644 index 000000000..567660b8e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/EmbeddedExcelChart.docx diff --git a/sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docx b/sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docx Binary files differnew file mode 100644 index 000000000..c35aaf12a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docx diff --git a/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2007_abc.docx b/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2007_abc.docx Binary files differnew file mode 100644 index 000000000..27566d4a7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2007_abc.docx diff --git a/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2010_abc.docx b/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2010_abc.docx Binary files differnew file mode 100644 index 000000000..4881e351d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2010_abc.docx diff --git a/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2013_abc.docx b/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2013_abc.docx Binary files differnew file mode 100644 index 000000000..28fa85c26 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Encrypted_MSO2013_abc.docx diff --git a/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx b/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx Binary files differnew file mode 100644 index 000000000..e6d6bdf44 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx b/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx Binary files differnew file mode 100644 index 000000000..7657d0507 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO73034.docx b/sw/qa/extras/ooxmlexport/data/FDO73034.docx Binary files differnew file mode 100644 index 000000000..c3f8c926e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO73034.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO73546.docx b/sw/qa/extras/ooxmlexport/data/FDO73546.docx Binary files differnew file mode 100644 index 000000000..468297196 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO73546.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO74105.docx b/sw/qa/extras/ooxmlexport/data/FDO74105.docx Binary files differnew file mode 100644 index 000000000..4299cf9c2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO74105.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO74106.docx b/sw/qa/extras/ooxmlexport/data/FDO74106.docx Binary files differnew file mode 100644 index 000000000..3b6257325 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO74106.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO74215.docx b/sw/qa/extras/ooxmlexport/data/FDO74215.docx Binary files differnew file mode 100644 index 000000000..fd2cc552e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO74215.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO74774.docx b/sw/qa/extras/ooxmlexport/data/FDO74774.docx Binary files differnew file mode 100644 index 000000000..11242475f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO74774.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO74775.docx b/sw/qa/extras/ooxmlexport/data/FDO74775.docx Binary files differnew file mode 100644 index 000000000..a8ee58895 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO74775.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO75133.docx b/sw/qa/extras/ooxmlexport/data/FDO75133.docx Binary files differnew file mode 100644 index 000000000..93170ddc6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO75133.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO76248.docx b/sw/qa/extras/ooxmlexport/data/FDO76248.docx Binary files differnew file mode 100644 index 000000000..c7b868e3f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO76248.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO76312.docx b/sw/qa/extras/ooxmlexport/data/FDO76312.docx Binary files differnew file mode 100644 index 000000000..b41ae7a72 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO76312.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO77715.docx b/sw/qa/extras/ooxmlexport/data/FDO77715.docx Binary files differnew file mode 100644 index 000000000..f93a46e0f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO77715.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO78292.docx b/sw/qa/extras/ooxmlexport/data/FDO78292.docx Binary files differnew file mode 100644 index 000000000..0388c0a5d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO78292.docx diff --git a/sw/qa/extras/ooxmlexport/data/FDO78590.docx b/sw/qa/extras/ooxmlexport/data/FDO78590.docx Binary files differnew file mode 100644 index 000000000..c32b0276b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FDO78590.docx diff --git a/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx b/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx Binary files differnew file mode 100644 index 000000000..50415bc1c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx diff --git a/sw/qa/extras/ooxmlexport/data/FileWithInvalidImageLink.docx b/sw/qa/extras/ooxmlexport/data/FileWithInvalidImageLink.docx Binary files differnew file mode 100644 index 000000000..6ad5cac38 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/FileWithInvalidImageLink.docx diff --git a/sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt b/sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt new file mode 100644 index 000000000..715fbcde8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Hau_min_list2.fodt @@ -0,0 +1,334 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/> + <style:font-face style:name="Arial" svg:font-family="Arial"/> + <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/> + <style:font-face style:name="Lucida Sans Unicode" svg:font-family="'Lucida Sans Unicode'" style:font-pitch="variable"/> + <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/> + <style:font-face style:name="Arial1" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#000000" draw:fill-color="#99ccff" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"> + <style:text-properties fo:font-size="11pt"/> + </style:style> + <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> + <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" loext:contextual-spacing="false" style:line-height-at-least="0.46cm"/> + </style:style> + <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text"> + <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" fo:keep-with-next="always"/> + <style:text-properties style:font-name="Arial1" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="Lucida Sans Unicode" style:font-family-asian="'Lucida Sans Unicode'" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-family-complex="Tahoma" style:font-pitch-complex="variable" style:font-size-complex="14pt"/> + </style:style> + <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list"> + <style:text-properties style:font-name="Arial" fo:font-family="Arial" style:font-name-complex="Tahoma1" style:font-family-complex="Tahoma"/> + </style:style> + <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties text:number-lines="false" text:line-number="0"/> + </style:style> + <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text"> + <style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text"> + <style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text"> + <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="Numbering_20_Symbols" style:display-name="Numbering Symbols" style:family="text"/> + <style:style style:name="Frame" style:family="graphic"> + <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.06pt solid #000000"/> + </style:style> + <text:outline-style style:name="Outline"> + <text:outline-level-style text:level="1" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="2" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="3" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="4" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="5" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="6" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="7" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="8" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="9" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="10" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + </text:outline-style> + <text:list-style style:name="Numbering_20_123" style:display-name="Numbering 123"> + <text:list-level-style-number text:level="1" text:style-name="Numbering_20_Symbols" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="2" text:style-name="Numbering_20_Symbols" style:num-format=""> + <style:list-level-properties text:min-label-width="1cm" text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="3" text:style-name="Numbering_20_Symbols" style:num-format=""> + <style:list-level-properties text:space-before="1cm" text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="4" text:style-name="Numbering_20_Symbols" style:num-format=""> + <style:list-level-properties text:space-before="1cm" text:min-label-width="1cm" text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="5" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1"> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="6" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1"> + <style:list-level-properties text:min-label-width="1cm" text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="7" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1"> + <style:list-level-properties text:space-before="1cm" text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="8" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1"> + <style:list-level-properties text:space-before="1cm" text:min-label-width="1cm" text:min-label-distance="0.381cm"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="9" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1"> + <style:list-level-properties text:min-label-distance="0.381cm" fo:text-align="end"/> + </text:list-level-style-number> + <text:list-level-style-number text:level="10" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1"> + <style:list-level-properties text:min-label-distance="0.381cm" fo:text-align="end"/> + </text:list-level-style-number> + </text:list-style> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Contents"> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="List" style:list-style-name="Numbering_20_123"> + <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="-0.704cm" style:auto-text-indent="false"> + <style:tab-stops/> + </style:paragraph-properties> + </style:style> + <style:style style:name="P6" style:family="paragraph" style:parent-style-name="List" style:list-style-name="Numbering_20_123"> + <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-align="end" style:justify-single-word="false" fo:text-indent="-0.704cm" style:auto-text-indent="false" style:writing-mode="rl-tb"> + <style:tab-stops/> + </style:paragraph-properties> + </style:style> + <style:style style:name="P8" style:family="paragraph" style:parent-style-name="List" style:list-style-name="Numbering_20_123"> + <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0.741cm" style:auto-text-indent="false"/> + </style:style> + <style:style style:name="P11" style:family="paragraph" style:parent-style-name="List" style:list-style-name="Numbering_20_123"> + <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-align="end" style:justify-single-word="false" fo:text-indent="0.741cm" style:auto-text-indent="false" style:writing-mode="rl-tb"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" fo:background-color="transparent" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" draw:fill="none" draw:fill-color="#99ccff" style:footnote-max-height="0cm"> + <style:columns fo:column-count="1" fo:column-gap="0cm"/> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style> + <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/> + </style:header-style> + <style:footer-style/> + </style:page-layout> + <style:page-layout style:name="pm2"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm"> + <style:columns fo:column-count="1" fo:column-gap="0cm"/> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style> + <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/> + </style:header-style> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"> + </style:master-page> + </office:master-styles> + <office:body> + <office:text> + <office:forms form:automatic-focus="false" form:apply-design-mode="false"/> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> + </text:sequence-decls> + <text:list xml:id="list2248535956" text:style-name="Numbering_20_123"> + <text:list-item> + <text:p text:style-name="P2">III.<text:tab/>Level 1</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">level 2 has width</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">level 3 has indent</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">level 4 has width + indent</text:p> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + <text:list-item> + <text:p text:style-name="P8">level 1 with positive on para</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P8">level 2</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P8">level 3</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P8">level 4</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">III.<text:tab/>Level 5</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">level 6 has width</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">level 7 has indent</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P2">level 8 has width + indent</text:p> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + <text:list-item> + <text:p text:style-name="P8">level 5 with positive on para</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P8">level 6</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P8">level 7</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P8">level 8</text:p> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + <text:p text:style-name="P1"/> + <text:list xml:id="list131919252068408" text:continue-numbering="true" text:style-name="Numbering_20_123"> + <text:list-item> + <text:p text:style-name="P6">III.<text:tab/>Level 1</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">level 2 has width</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">level 3 has indent</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">level 4 has width + indent</text:p> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + <text:list-item> + <text:p text:style-name="P11">level 1 with positive on para</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P11">level 2</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P11">level 3</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P11">level 4</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">III.<text:tab/>Level 5</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">level 6 has width</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">level 7 has indent</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P6">level 8 has width + indent</text:p> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + <text:list-item> + <text:p text:style-name="P11">level 5 with positive on para</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P11">level 6</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P11">level 7</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P11">level 8</text:p> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + </text:list-item> + </text:list> + <text:p text:style-name="P1"/> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/ImageCrop.docx b/sw/qa/extras/ooxmlexport/data/ImageCrop.docx Binary files differnew file mode 100644 index 000000000..120ce78eb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ImageCrop.docx diff --git a/sw/qa/extras/ooxmlexport/data/IndexFieldFlagF.docx b/sw/qa/extras/ooxmlexport/data/IndexFieldFlagF.docx Binary files differnew file mode 100644 index 000000000..2c7d36527 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/IndexFieldFlagF.docx diff --git a/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx Binary files differnew file mode 100644 index 000000000..b8eceb92d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx diff --git a/sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx Binary files differnew file mode 100644 index 000000000..8b9567231 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx diff --git a/sw/qa/extras/ooxmlexport/data/LinkedTextBoxes.docx b/sw/qa/extras/ooxmlexport/data/LinkedTextBoxes.docx Binary files differnew file mode 100644 index 000000000..48a5f64e3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/LinkedTextBoxes.docx diff --git a/sw/qa/extras/ooxmlexport/data/NoFillAttrInImagedata.docx b/sw/qa/extras/ooxmlexport/data/NoFillAttrInImagedata.docx Binary files differnew file mode 100644 index 000000000..3819e7931 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/NoFillAttrInImagedata.docx diff --git a/sw/qa/extras/ooxmlexport/data/NumberedList.docx b/sw/qa/extras/ooxmlexport/data/NumberedList.docx Binary files differnew file mode 100644 index 000000000..53f4490d4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/NumberedList.docx diff --git a/sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx b/sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx Binary files differnew file mode 100644 index 000000000..ac294fd0f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/PreserveWfieldTOC.docx diff --git a/sw/qa/extras/ooxmlexport/data/PreserveXfieldTOC.docx b/sw/qa/extras/ooxmlexport/data/PreserveXfieldTOC.docx Binary files differnew file mode 100644 index 000000000..adf7fd924 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/PreserveXfieldTOC.docx diff --git a/sw/qa/extras/ooxmlexport/data/SdtContent.docx b/sw/qa/extras/ooxmlexport/data/SdtContent.docx Binary files differnew file mode 100644 index 000000000..91e0ef0e4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/SdtContent.docx diff --git a/sw/qa/extras/ooxmlexport/data/Shape.docx b/sw/qa/extras/ooxmlexport/data/Shape.docx Binary files differnew file mode 100644 index 000000000..474e6ffc2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Shape.docx diff --git a/sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx b/sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx Binary files differnew file mode 100644 index 000000000..e1ec07489 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx diff --git a/sw/qa/extras/ooxmlexport/data/TCTagMisMatch.docx b/sw/qa/extras/ooxmlexport/data/TCTagMisMatch.docx Binary files differnew file mode 100644 index 000000000..6d890acdb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TCTagMisMatch.docx diff --git a/sw/qa/extras/ooxmlexport/data/TOC_field_b.docx b/sw/qa/extras/ooxmlexport/data/TOC_field_b.docx Binary files differnew file mode 100644 index 000000000..b8ff32b3b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TOC_field_b.docx diff --git a/sw/qa/extras/ooxmlexport/data/TOC_field_f.docx b/sw/qa/extras/ooxmlexport/data/TOC_field_f.docx Binary files differnew file mode 100644 index 000000000..ea0958a21 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TOC_field_f.docx diff --git a/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx b/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx Binary files differnew file mode 100644 index 000000000..f445ab6b1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx diff --git a/sw/qa/extras/ooxmlexport/data/Table_cell_auto_width_fdo69656.docx b/sw/qa/extras/ooxmlexport/data/Table_cell_auto_width_fdo69656.docx Binary files differnew file mode 100644 index 000000000..10b8f9de2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Table_cell_auto_width_fdo69656.docx diff --git a/sw/qa/extras/ooxmlexport/data/TestVMLData.docx b/sw/qa/extras/ooxmlexport/data/TestVMLData.docx Binary files differnew file mode 100644 index 000000000..a2f89b146 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TestVMLData.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_Glow_Shadow_Reflection.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_Glow_Shadow_Reflection.docx Binary files differnew file mode 100644 index 000000000..e7412077c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_Glow_Shadow_Reflection.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_Groupshapes.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_Groupshapes.docx Binary files differnew file mode 100644 index 000000000..85f7a55ae --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_Groupshapes.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_InStyle.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_InStyle.docx Binary files differnew file mode 100644 index 000000000..5be6d9c5f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_InStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_Props3d.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_Props3d.docx Binary files differnew file mode 100644 index 000000000..3d36b4d21 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_Props3d.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx Binary files differnew file mode 100644 index 000000000..e8636ec1e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_StylisticSets_CntxtAlts.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_StylisticSets_CntxtAlts.docx Binary files differnew file mode 100644 index 000000000..723310476 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_StylisticSets_CntxtAlts.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_TextFill.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_TextFill.docx Binary files differnew file mode 100644 index 000000000..383d0a021 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_TextFill.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextEffects_TextOutline.docx b/sw/qa/extras/ooxmlexport/data/TextEffects_TextOutline.docx Binary files differnew file mode 100644 index 000000000..4ceb40c0e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextEffects_TextOutline.docx diff --git a/sw/qa/extras/ooxmlexport/data/TextFrameRotation.docx b/sw/qa/extras/ooxmlexport/data/TextFrameRotation.docx Binary files differnew file mode 100644 index 000000000..ac7c2236b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/TextFrameRotation.docx diff --git a/sw/qa/extras/ooxmlexport/data/Unsupportedtextfields.docx b/sw/qa/extras/ooxmlexport/data/Unsupportedtextfields.docx Binary files differnew file mode 100644 index 000000000..698142eff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Unsupportedtextfields.docx diff --git a/sw/qa/extras/ooxmlexport/data/a4andborders.docx b/sw/qa/extras/ooxmlexport/data/a4andborders.docx Binary files differnew file mode 100644 index 000000000..afeb91cda --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/a4andborders.docx diff --git a/sw/qa/extras/ooxmlexport/data/abi11739.docx b/sw/qa/extras/ooxmlexport/data/abi11739.docx Binary files differnew file mode 100644 index 000000000..8eb6999da --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/abi11739.docx diff --git a/sw/qa/extras/ooxmlexport/data/absolute-link.docx b/sw/qa/extras/ooxmlexport/data/absolute-link.docx Binary files differnew file mode 100644 index 000000000..db36a6f32 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/absolute-link.docx diff --git a/sw/qa/extras/ooxmlexport/data/activex_checkbox.docx b/sw/qa/extras/ooxmlexport/data/activex_checkbox.docx Binary files differnew file mode 100644 index 000000000..d7415ef5a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/activex_checkbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/activex_control_align.odt b/sw/qa/extras/ooxmlexport/data/activex_control_align.odt Binary files differnew file mode 100644 index 000000000..b9944c7e5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/activex_control_align.odt diff --git a/sw/qa/extras/ooxmlexport/data/activex_control_at_run_end.odt b/sw/qa/extras/ooxmlexport/data/activex_control_at_run_end.odt Binary files differnew file mode 100644 index 000000000..9008cb90a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/activex_control_at_run_end.odt diff --git a/sw/qa/extras/ooxmlexport/data/activex_option_button_group.docx b/sw/qa/extras/ooxmlexport/data/activex_option_button_group.docx Binary files differnew file mode 100644 index 000000000..9da266a92 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/activex_option_button_group.docx diff --git a/sw/qa/extras/ooxmlexport/data/activex_textbox.docx b/sw/qa/extras/ooxmlexport/data/activex_textbox.docx Binary files differnew file mode 100644 index 000000000..6f137008c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/activex_textbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/afterlines.docx b/sw/qa/extras/ooxmlexport/data/afterlines.docx Binary files differnew file mode 100644 index 000000000..296f91e2e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/afterlines.docx diff --git a/sw/qa/extras/ooxmlexport/data/all_gaps_word.docx b/sw/qa/extras/ooxmlexport/data/all_gaps_word.docx Binary files differnew file mode 100644 index 000000000..fc52281a2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/all_gaps_word.docx diff --git a/sw/qa/extras/ooxmlexport/data/alphabeticalIndex_AutoColumn.docx b/sw/qa/extras/ooxmlexport/data/alphabeticalIndex_AutoColumn.docx Binary files differnew file mode 100644 index 000000000..e08e943ac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/alphabeticalIndex_AutoColumn.docx diff --git a/sw/qa/extras/ooxmlexport/data/alphabeticalIndex_MultipleColumns.docx b/sw/qa/extras/ooxmlexport/data/alphabeticalIndex_MultipleColumns.docx Binary files differnew file mode 100644 index 000000000..970166ad4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/alphabeticalIndex_MultipleColumns.docx diff --git a/sw/qa/extras/ooxmlexport/data/anchor-position.docx b/sw/qa/extras/ooxmlexport/data/anchor-position.docx Binary files differnew file mode 100644 index 000000000..b210ee930 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/anchor-position.docx diff --git a/sw/qa/extras/ooxmlexport/data/annotation-formatting.docx b/sw/qa/extras/ooxmlexport/data/annotation-formatting.docx Binary files differnew file mode 100644 index 000000000..87af02b78 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/annotation-formatting.docx diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx Binary files differnew file mode 100644 index 000000000..f87dce364 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero3-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero3-numbering.docx Binary files differnew file mode 100644 index 000000000..bd95186a6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/arabic-zero3-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx Binary files differnew file mode 100644 index 000000000..6779d8598 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx Binary files differnew file mode 100644 index 000000000..f7df2c526 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/author-property.docx b/sw/qa/extras/ooxmlexport/data/author-property.docx Binary files differnew file mode 100644 index 000000000..474bb7933 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/author-property.docx diff --git a/sw/qa/extras/ooxmlexport/data/autofit.docx b/sw/qa/extras/ooxmlexport/data/autofit.docx Binary files differnew file mode 100644 index 000000000..8932edfc7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/autofit.docx diff --git a/sw/qa/extras/ooxmlexport/data/bad.docm b/sw/qa/extras/ooxmlexport/data/bad.docm Binary files differnew file mode 100644 index 000000000..b1e83220a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bad.docm diff --git a/sw/qa/extras/ooxmlexport/data/behinddoc.docx b/sw/qa/extras/ooxmlexport/data/behinddoc.docx Binary files differnew file mode 100644 index 000000000..f859d2e90 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/behinddoc.docx diff --git a/sw/qa/extras/ooxmlexport/data/bezier.odt b/sw/qa/extras/ooxmlexport/data/bezier.odt Binary files differnew file mode 100644 index 000000000..c73ed3e98 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bezier.odt diff --git a/sw/qa/extras/ooxmlexport/data/bnc519228_odd-breaksB.docx b/sw/qa/extras/ooxmlexport/data/bnc519228_odd-breaksB.docx Binary files differnew file mode 100644 index 000000000..674d71401 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc519228_odd-breaksB.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc581614.doc b/sw/qa/extras/ooxmlexport/data/bnc581614.doc Binary files differnew file mode 100644 index 000000000..f56525e87 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc581614.doc diff --git a/sw/qa/extras/ooxmlexport/data/bnc637947.odt b/sw/qa/extras/ooxmlexport/data/bnc637947.odt Binary files differnew file mode 100644 index 000000000..db5c878c9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc637947.odt diff --git a/sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx b/sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx Binary files differnew file mode 100644 index 000000000..927d4d376 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc780044_spacing.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc834035.odt b/sw/qa/extras/ooxmlexport/data/bnc834035.odt Binary files differnew file mode 100644 index 000000000..393c960de --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc834035.odt diff --git a/sw/qa/extras/ooxmlexport/data/bnc837302.docx b/sw/qa/extras/ooxmlexport/data/bnc837302.docx Binary files differnew file mode 100644 index 000000000..9d0c0af68 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc837302.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc865381.docx b/sw/qa/extras/ooxmlexport/data/bnc865381.docx Binary files differnew file mode 100644 index 000000000..bb125cc73 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc865381.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc875718.docx b/sw/qa/extras/ooxmlexport/data/bnc875718.docx Binary files differnew file mode 100644 index 000000000..878a46fdf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc875718.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx b/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx Binary files differnew file mode 100644 index 000000000..2fb28ecfb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx b/sw/qa/extras/ooxmlexport/data/bnc884615.docx Binary files differnew file mode 100644 index 000000000..51ee5ca0c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc884615.docx diff --git a/sw/qa/extras/ooxmlexport/data/bnc891663.docx b/sw/qa/extras/ooxmlexport/data/bnc891663.docx Binary files differnew file mode 100644 index 000000000..d5f057e66 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc891663.docx diff --git a/sw/qa/extras/ooxmlexport/data/btlr-frame.odt b/sw/qa/extras/ooxmlexport/data/btlr-frame.odt Binary files differnew file mode 100644 index 000000000..31cb03849 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/btlr-frame.odt diff --git a/sw/qa/extras/ooxmlexport/data/btlr-textbox.docx b/sw/qa/extras/ooxmlexport/data/btlr-textbox.docx Binary files differnew file mode 100644 index 000000000..181d305ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/btlr-textbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/calendar1.docx b/sw/qa/extras/ooxmlexport/data/calendar1.docx Binary files differnew file mode 100644 index 000000000..81a504617 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/calendar1.docx diff --git a/sw/qa/extras/ooxmlexport/data/calendar2.docx b/sw/qa/extras/ooxmlexport/data/calendar2.docx Binary files differnew file mode 100644 index 000000000..4e7d4ed3c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/calendar2.docx diff --git a/sw/qa/extras/ooxmlexport/data/calendar3.docx b/sw/qa/extras/ooxmlexport/data/calendar3.docx Binary files differnew file mode 100644 index 000000000..6c720aff9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/calendar3.docx diff --git a/sw/qa/extras/ooxmlexport/data/calendar4.docx b/sw/qa/extras/ooxmlexport/data/calendar4.docx Binary files differnew file mode 100644 index 000000000..ecf71d8a3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/calendar4.docx diff --git a/sw/qa/extras/ooxmlexport/data/calendar5.docx b/sw/qa/extras/ooxmlexport/data/calendar5.docx Binary files differnew file mode 100644 index 000000000..a27634673 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/calendar5.docx diff --git a/sw/qa/extras/ooxmlexport/data/caption.docx b/sw/qa/extras/ooxmlexport/data/caption.docx Binary files differnew file mode 100644 index 000000000..301472cbc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/caption.docx diff --git a/sw/qa/extras/ooxmlexport/data/cell-btlr.docx b/sw/qa/extras/ooxmlexport/data/cell-btlr.docx Binary files differnew file mode 100644 index 000000000..f05f114da --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cell-btlr.docx diff --git a/sw/qa/extras/ooxmlexport/data/cell-grid-span.docx b/sw/qa/extras/ooxmlexport/data/cell-grid-span.docx Binary files differnew file mode 100644 index 000000000..de71d4818 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cell-grid-span.docx diff --git a/sw/qa/extras/ooxmlexport/data/charborder.odt b/sw/qa/extras/ooxmlexport/data/charborder.odt Binary files differnew file mode 100644 index 000000000..67dd89b09 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/charborder.odt diff --git a/sw/qa/extras/ooxmlexport/data/chart-dupe.docx b/sw/qa/extras/ooxmlexport/data/chart-dupe.docx Binary files differnew file mode 100644 index 000000000..545f9665f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/chart-dupe.docx diff --git a/sw/qa/extras/ooxmlexport/data/chart-in-footer.docx b/sw/qa/extras/ooxmlexport/data/chart-in-footer.docx Binary files differnew file mode 100644 index 000000000..293ee076b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/chart-in-footer.docx diff --git a/sw/qa/extras/ooxmlexport/data/chart-prop.docx b/sw/qa/extras/ooxmlexport/data/chart-prop.docx Binary files differnew file mode 100644 index 000000000..f9cddd494 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/chart-prop.docx diff --git a/sw/qa/extras/ooxmlexport/data/chart-size.docx b/sw/qa/extras/ooxmlexport/data/chart-size.docx Binary files differnew file mode 100644 index 000000000..da5d14443 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/chart-size.docx diff --git a/sw/qa/extras/ooxmlexport/data/checkbox-control.docx b/sw/qa/extras/ooxmlexport/data/checkbox-control.docx Binary files differnew file mode 100644 index 000000000..905d29a96 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/checkbox-control.docx diff --git a/sw/qa/extras/ooxmlexport/data/chtoutline.docx b/sw/qa/extras/ooxmlexport/data/chtoutline.docx Binary files differnew file mode 100644 index 000000000..92fdaf71e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/chtoutline.docx diff --git a/sw/qa/extras/ooxmlexport/data/cjklist30.docx b/sw/qa/extras/ooxmlexport/data/cjklist30.docx Binary files differnew file mode 100644 index 000000000..b2efbb995 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cjklist30.docx diff --git a/sw/qa/extras/ooxmlexport/data/cjklist31.docx b/sw/qa/extras/ooxmlexport/data/cjklist31.docx Binary files differnew file mode 100644 index 000000000..95d4c9aeb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cjklist31.docx diff --git a/sw/qa/extras/ooxmlexport/data/cjklist34.docx b/sw/qa/extras/ooxmlexport/data/cjklist34.docx Binary files differnew file mode 100644 index 000000000..c09615aa2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cjklist34.docx diff --git a/sw/qa/extras/ooxmlexport/data/cjklist35.docx b/sw/qa/extras/ooxmlexport/data/cjklist35.docx Binary files differnew file mode 100644 index 000000000..85aa24fc2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cjklist35.docx diff --git a/sw/qa/extras/ooxmlexport/data/cjklist44.docx b/sw/qa/extras/ooxmlexport/data/cjklist44.docx Binary files differnew file mode 100644 index 000000000..98538e931 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cjklist44.docx diff --git a/sw/qa/extras/ooxmlexport/data/columnbreak.docx b/sw/qa/extras/ooxmlexport/data/columnbreak.docx Binary files differnew file mode 100644 index 000000000..f55780e89 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/columnbreak.docx diff --git a/sw/qa/extras/ooxmlexport/data/combobox-control.docx b/sw/qa/extras/ooxmlexport/data/combobox-control.docx Binary files differnew file mode 100644 index 000000000..180aacab9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/combobox-control.docx diff --git a/sw/qa/extras/ooxmlexport/data/comment_initials.odt b/sw/qa/extras/ooxmlexport/data/comment_initials.odt Binary files differnew file mode 100644 index 000000000..9b84ed859 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/comment_initials.odt diff --git a/sw/qa/extras/ooxmlexport/data/comments-nested.odt b/sw/qa/extras/ooxmlexport/data/comments-nested.odt Binary files differnew file mode 100644 index 000000000..e7686058d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/comments-nested.odt diff --git a/sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx b/sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx Binary files differnew file mode 100644 index 000000000..4222d6376 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/conditionalstyles-tbllook.docx diff --git a/sw/qa/extras/ooxmlexport/data/cont-sect-break-header-footer.docx b/sw/qa/extras/ooxmlexport/data/cont-sect-break-header-footer.docx Binary files differnew file mode 100644 index 000000000..61c18298d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cont-sect-break-header-footer.docx diff --git a/sw/qa/extras/ooxmlexport/data/cp1000015.odt b/sw/qa/extras/ooxmlexport/data/cp1000015.odt Binary files differnew file mode 100644 index 000000000..7d8dc9f10 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/cp1000015.odt diff --git a/sw/qa/extras/ooxmlexport/data/crop-pixel.docx b/sw/qa/extras/ooxmlexport/data/crop-pixel.docx Binary files differnew file mode 100644 index 000000000..1ddb2efb9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/crop-pixel.docx diff --git a/sw/qa/extras/ooxmlexport/data/custom-properties.docx b/sw/qa/extras/ooxmlexport/data/custom-properties.docx Binary files differnew file mode 100644 index 000000000..01db34977 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/custom-properties.docx diff --git a/sw/qa/extras/ooxmlexport/data/customxml.docx b/sw/qa/extras/ooxmlexport/data/customxml.docx Binary files differnew file mode 100644 index 000000000..bfdf8ece6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/customxml.docx diff --git a/sw/qa/extras/ooxmlexport/data/dashed_line_custdash_1000th_of_percent.docx b/sw/qa/extras/ooxmlexport/data/dashed_line_custdash_1000th_of_percent.docx Binary files differnew file mode 100644 index 000000000..643ec08ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dashed_line_custdash_1000th_of_percent.docx diff --git a/sw/qa/extras/ooxmlexport/data/dashed_line_custdash_percentage.docx b/sw/qa/extras/ooxmlexport/data/dashed_line_custdash_percentage.docx Binary files differnew file mode 100644 index 000000000..643ec08ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dashed_line_custdash_percentage.docx diff --git a/sw/qa/extras/ooxmlexport/data/dashed_line_preset.docx b/sw/qa/extras/ooxmlexport/data/dashed_line_preset.docx Binary files differnew file mode 100644 index 000000000..923360b49 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dashed_line_preset.docx diff --git a/sw/qa/extras/ooxmlexport/data/date-control.docx b/sw/qa/extras/ooxmlexport/data/date-control.docx Binary files differnew file mode 100644 index 000000000..fdf229913 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/date-control.docx diff --git a/sw/qa/extras/ooxmlexport/data/date_field_at_end_of_paragraph.docx b/sw/qa/extras/ooxmlexport/data/date_field_at_end_of_paragraph.docx Binary files differnew file mode 100644 index 000000000..6514b2a53 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/date_field_at_end_of_paragraph.docx diff --git a/sw/qa/extras/ooxmlexport/data/date_field_in_shape.docx b/sw/qa/extras/ooxmlexport/data/date_field_in_shape.docx Binary files differnew file mode 100644 index 000000000..ff3c637c3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/date_field_in_shape.docx diff --git a/sw/qa/extras/ooxmlexport/data/decimal-numbering-no-leveltext.docx b/sw/qa/extras/ooxmlexport/data/decimal-numbering-no-leveltext.docx Binary files differnew file mode 100644 index 000000000..d7ec47997 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/decimal-numbering-no-leveltext.docx diff --git a/sw/qa/extras/ooxmlexport/data/default-sect-break-cols.docx b/sw/qa/extras/ooxmlexport/data/default-sect-break-cols.docx Binary files differnew file mode 100644 index 000000000..b66b844f1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/default-sect-break-cols.docx diff --git a/sw/qa/extras/ooxmlexport/data/defaultStyle.docx b/sw/qa/extras/ooxmlexport/data/defaultStyle.docx Binary files differnew file mode 100644 index 000000000..8e3faa70d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/defaultStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/dkvert.docx b/sw/qa/extras/ooxmlexport/data/dkvert.docx Binary files differnew file mode 100644 index 000000000..bc1ee7881 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dkvert.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx b/sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx Binary files differnew file mode 100644 index 000000000..0f22a87f0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-charheight-default.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-customgeometry-cubicbezier.docx b/sw/qa/extras/ooxmlexport/data/dml-customgeometry-cubicbezier.docx Binary files differnew file mode 100644 index 000000000..9cc84a927 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-customgeometry-cubicbezier.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-gradientfill-theme.docx b/sw/qa/extras/ooxmlexport/data/dml-gradientfill-theme.docx Binary files differnew file mode 100644 index 000000000..3311ce8a0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-gradientfill-theme.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx Binary files differnew file mode 100644 index 000000000..67fd21f64 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-capitalization.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docx Binary files differnew file mode 100644 index 000000000..a5c6bf99a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-childposition.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-paraspacing.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-paraspacing.docx Binary files differnew file mode 100644 index 000000000..a8fc82bd5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-paraspacing.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx Binary files differnew file mode 100644 index 000000000..6be137b28 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx Binary files differnew file mode 100644 index 000000000..e4c8c6cb5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-runfonts.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx Binary files differnew file mode 100644 index 000000000..7314d876a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-groupshape-sdt.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-picture-in-textframe.docx b/sw/qa/extras/ooxmlexport/data/dml-picture-in-textframe.docx Binary files differnew file mode 100644 index 000000000..7d5876108 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-picture-in-textframe.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-rectangle-relsize.docx b/sw/qa/extras/ooxmlexport/data/dml-rectangle-relsize.docx Binary files differnew file mode 100644 index 000000000..265dcbb4e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-rectangle-relsize.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-shape-fillbitmapcrop.docx b/sw/qa/extras/ooxmlexport/data/dml-shape-fillbitmapcrop.docx Binary files differnew file mode 100644 index 000000000..6c401bae9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-shape-fillbitmapcrop.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-shape-fillpattern.docx b/sw/qa/extras/ooxmlexport/data/dml-shape-fillpattern.docx Binary files differnew file mode 100644 index 000000000..9878c9964 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-shape-fillpattern.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-shape-relsize.docx b/sw/qa/extras/ooxmlexport/data/dml-shape-relsize.docx Binary files differnew file mode 100644 index 000000000..80ae02e02 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-shape-relsize.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-shape-title.docx b/sw/qa/extras/ooxmlexport/data/dml-shape-title.docx Binary files differnew file mode 100644 index 000000000..d354806f9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-shape-title.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-solidfill-alpha.docx b/sw/qa/extras/ooxmlexport/data/dml-solidfill-alpha.docx Binary files differnew file mode 100644 index 000000000..9f2c46d2e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-solidfill-alpha.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-textframe-vertadjust.docx b/sw/qa/extras/ooxmlexport/data/dml-textframe-vertadjust.docx Binary files differnew file mode 100644 index 000000000..bf5dcdde4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-textframe-vertadjust.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-textshape.docx b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx Binary files differnew file mode 100644 index 000000000..28e39c29a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-textshapeB.docx b/sw/qa/extras/ooxmlexport/data/dml-textshapeB.docx Binary files differnew file mode 100644 index 000000000..ab790a896 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-textshapeB.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-zorder.odt b/sw/qa/extras/ooxmlexport/data/dml-zorder.odt Binary files differnew file mode 100644 index 000000000..ba799a547 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dml-zorder.odt diff --git a/sw/qa/extras/ooxmlexport/data/drawinglayer-pic-pos.docx b/sw/qa/extras/ooxmlexport/data/drawinglayer-pic-pos.docx Binary files differnew file mode 100644 index 000000000..bb18ab38b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/drawinglayer-pic-pos.docx diff --git a/sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx b/sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx Binary files differnew file mode 100644 index 000000000..f10a83fac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/drawingml-flipv.docx diff --git a/sw/qa/extras/ooxmlexport/data/dropdown-in-cell.docx b/sw/qa/extras/ooxmlexport/data/dropdown-in-cell.docx Binary files differnew file mode 100644 index 000000000..8abe25f82 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/dropdown-in-cell.docx diff --git a/sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt b/sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt Binary files differnew file mode 100644 index 000000000..22b8a554f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt diff --git a/sw/qa/extras/ooxmlexport/data/effect-extent-inline.docx b/sw/qa/extras/ooxmlexport/data/effect-extent-inline.docx Binary files differnew file mode 100644 index 000000000..bb7db129a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/effect-extent-inline.docx diff --git a/sw/qa/extras/ooxmlexport/data/effect-extent.docx b/sw/qa/extras/ooxmlexport/data/effect-extent.docx Binary files differnew file mode 100644 index 000000000..f35fc3a4a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/effect-extent.docx diff --git a/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx b/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx Binary files differnew file mode 100644 index 000000000..22db162a7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/effectextent-margin.docx diff --git a/sw/qa/extras/ooxmlexport/data/em.docx b/sw/qa/extras/ooxmlexport/data/em.docx Binary files differnew file mode 100644 index 000000000..ee3137e70 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/em.docx diff --git a/sw/qa/extras/ooxmlexport/data/embedded-xlsx.docx b/sw/qa/extras/ooxmlexport/data/embedded-xlsx.docx Binary files differnew file mode 100644 index 000000000..3b9dd2a68 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/embedded-xlsx.docx diff --git a/sw/qa/extras/ooxmlexport/data/empty-annotation-mark.docx b/sw/qa/extras/ooxmlexport/data/empty-annotation-mark.docx Binary files differnew file mode 100644 index 000000000..854b6d726 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/empty-annotation-mark.docx diff --git a/sw/qa/extras/ooxmlexport/data/empty-date-control.odt b/sw/qa/extras/ooxmlexport/data/empty-date-control.odt Binary files differnew file mode 100644 index 000000000..acd5b8b94 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/empty-date-control.odt diff --git a/sw/qa/extras/ooxmlexport/data/empty.odt b/sw/qa/extras/ooxmlexport/data/empty.odt Binary files differnew file mode 100644 index 000000000..ba6886080 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/empty.odt diff --git a/sw/qa/extras/ooxmlexport/data/endingSectionProps.docx b/sw/qa/extras/ooxmlexport/data/endingSectionProps.docx Binary files differnew file mode 100644 index 000000000..e5dee2f60 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/endingSectionProps.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo106029.docx b/sw/qa/extras/ooxmlexport/data/fdo106029.docx Binary files differnew file mode 100644 index 000000000..b19d63d4c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo106029.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo38244.docx b/sw/qa/extras/ooxmlexport/data/fdo38244.docx Binary files differnew file mode 100644 index 000000000..2551f0c64 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo38244.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo38414.docx b/sw/qa/extras/ooxmlexport/data/fdo38414.docx Binary files differnew file mode 100644 index 000000000..135cd32c9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo38414.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo43093.docx b/sw/qa/extras/ooxmlexport/data/fdo43093.docx Binary files differnew file mode 100644 index 000000000..9d5de58b5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo43093.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo43093b.docx b/sw/qa/extras/ooxmlexport/data/fdo43093b.docx Binary files differnew file mode 100644 index 000000000..3e5a910e2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo43093b.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo44689_start_page_0.docx b/sw/qa/extras/ooxmlexport/data/fdo44689_start_page_0.docx Binary files differnew file mode 100644 index 000000000..f7e9331be --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo44689_start_page_0.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo44689_start_page_7.docx b/sw/qa/extras/ooxmlexport/data/fdo44689_start_page_7.docx Binary files differnew file mode 100644 index 000000000..25e58d395 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo44689_start_page_7.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo46361.docx b/sw/qa/extras/ooxmlexport/data/fdo46361.docx Binary files differnew file mode 100644 index 000000000..2f894e4b3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo46361.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo47669.docx b/sw/qa/extras/ooxmlexport/data/fdo47669.docx Binary files differnew file mode 100644 index 000000000..9c5ef6879 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo47669.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo48557.odt b/sw/qa/extras/ooxmlexport/data/fdo48557.odt Binary files differnew file mode 100644 index 000000000..35353baac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo48557.odt diff --git a/sw/qa/extras/ooxmlexport/data/fdo49940.docx b/sw/qa/extras/ooxmlexport/data/fdo49940.docx Binary files differnew file mode 100644 index 000000000..242284463 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo49940.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo51034.odt b/sw/qa/extras/ooxmlexport/data/fdo51034.odt Binary files differnew file mode 100644 index 000000000..9720cfb65 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo51034.odt diff --git a/sw/qa/extras/ooxmlexport/data/fdo51550.odt b/sw/qa/extras/ooxmlexport/data/fdo51550.odt Binary files differnew file mode 100644 index 000000000..4cade5b21 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo51550.odt diff --git a/sw/qa/extras/ooxmlexport/data/fdo52208.docx b/sw/qa/extras/ooxmlexport/data/fdo52208.docx Binary files differnew file mode 100644 index 000000000..be842ad2a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo52208.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo53985.docx b/sw/qa/extras/ooxmlexport/data/fdo53985.docx Binary files differnew file mode 100644 index 000000000..0c8b32fb6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo53985.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo55187.docx b/sw/qa/extras/ooxmlexport/data/fdo55187.docx Binary files differnew file mode 100644 index 000000000..59cd0a806 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo55187.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo55381.docx b/sw/qa/extras/ooxmlexport/data/fdo55381.docx Binary files differnew file mode 100644 index 000000000..ffeae1f87 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo55381.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo56679.docx b/sw/qa/extras/ooxmlexport/data/fdo56679.docx Binary files differnew file mode 100644 index 000000000..8ea689c3c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo56679.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo58577.odt b/sw/qa/extras/ooxmlexport/data/fdo58577.odt Binary files differnew file mode 100644 index 000000000..4c8656d7e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo58577.odt diff --git a/sw/qa/extras/ooxmlexport/data/fdo59273.docx b/sw/qa/extras/ooxmlexport/data/fdo59273.docx Binary files differnew file mode 100644 index 000000000..fcdfd7734 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo59273.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo59638.docx b/sw/qa/extras/ooxmlexport/data/fdo59638.docx Binary files differnew file mode 100644 index 000000000..d33e7cc0a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo59638.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo60922.docx b/sw/qa/extras/ooxmlexport/data/fdo60922.docx Binary files differnew file mode 100644 index 000000000..0d1ff2613 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo60922.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo60957-2.docx b/sw/qa/extras/ooxmlexport/data/fdo60957-2.docx Binary files differnew file mode 100644 index 000000000..3819aafd8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo60957-2.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo60990.odt b/sw/qa/extras/ooxmlexport/data/fdo60990.odt Binary files differnew file mode 100644 index 000000000..c855f327a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo60990.odt diff --git a/sw/qa/extras/ooxmlexport/data/fdo61343.docx b/sw/qa/extras/ooxmlexport/data/fdo61343.docx Binary files differnew file mode 100644 index 000000000..9ab99739b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo61343.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo63053.docx b/sw/qa/extras/ooxmlexport/data/fdo63053.docx Binary files differnew file mode 100644 index 000000000..43282b0df --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo63053.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo63685.docx b/sw/qa/extras/ooxmlexport/data/fdo63685.docx Binary files differnew file mode 100644 index 000000000..a1348fcff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo63685.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo64238_a.docx b/sw/qa/extras/ooxmlexport/data/fdo64238_a.docx Binary files differnew file mode 100644 index 000000000..7c43feaf7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo64238_a.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo64238_b.docx b/sw/qa/extras/ooxmlexport/data/fdo64238_b.docx Binary files differnew file mode 100644 index 000000000..bfaf92cca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo64238_b.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo64350.docx b/sw/qa/extras/ooxmlexport/data/fdo64350.docx Binary files differnew file mode 100644 index 000000000..6f41b6664 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo64350.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo64826.docx b/sw/qa/extras/ooxmlexport/data/fdo64826.docx Binary files differnew file mode 100644 index 000000000..ce4287cea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo64826.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65090.docx b/sw/qa/extras/ooxmlexport/data/fdo65090.docx Binary files differnew file mode 100644 index 000000000..4d45737dd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65090.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65265.docx b/sw/qa/extras/ooxmlexport/data/fdo65265.docx Binary files differnew file mode 100644 index 000000000..6267085fa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65265.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65295.docx b/sw/qa/extras/ooxmlexport/data/fdo65295.docx Binary files differnew file mode 100644 index 000000000..52a231afa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65295.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65400.docx b/sw/qa/extras/ooxmlexport/data/fdo65400.docx Binary files differnew file mode 100644 index 000000000..c247e9fff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65400.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65632.docx b/sw/qa/extras/ooxmlexport/data/fdo65632.docx Binary files differnew file mode 100644 index 000000000..8c336c20f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65632.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65655.docx b/sw/qa/extras/ooxmlexport/data/fdo65655.docx Binary files differnew file mode 100644 index 000000000..5fe9451bb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65655.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65718.docx b/sw/qa/extras/ooxmlexport/data/fdo65718.docx Binary files differnew file mode 100644 index 000000000..0af4f9002 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65718.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo65833.docx b/sw/qa/extras/ooxmlexport/data/fdo65833.docx Binary files differnew file mode 100644 index 000000000..097015eed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65833.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66145.docx b/sw/qa/extras/ooxmlexport/data/fdo66145.docx Binary files differnew file mode 100644 index 000000000..62ffdbe22 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66145.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66474.docx b/sw/qa/extras/ooxmlexport/data/fdo66474.docx Binary files differnew file mode 100644 index 000000000..0252746f5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66474.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66543.docx b/sw/qa/extras/ooxmlexport/data/fdo66543.docx Binary files differnew file mode 100644 index 000000000..585eb41e4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66543.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66688.docx b/sw/qa/extras/ooxmlexport/data/fdo66688.docx Binary files differnew file mode 100644 index 000000000..300b91504 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66688.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66773.docx b/sw/qa/extras/ooxmlexport/data/fdo66773.docx Binary files differnew file mode 100644 index 000000000..41f0abee7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66773.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66781.docx b/sw/qa/extras/ooxmlexport/data/fdo66781.docx Binary files differnew file mode 100644 index 000000000..13e5423f4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66781.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo66929.docx b/sw/qa/extras/ooxmlexport/data/fdo66929.docx Binary files differnew file mode 100644 index 000000000..7f0afac3c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo66929.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo67013.docx b/sw/qa/extras/ooxmlexport/data/fdo67013.docx Binary files differnew file mode 100644 index 000000000..5512550ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo67013.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo67737.docx b/sw/qa/extras/ooxmlexport/data/fdo67737.docx Binary files differnew file mode 100644 index 000000000..8be34ec71 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo67737.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo68418.docx b/sw/qa/extras/ooxmlexport/data/fdo68418.docx Binary files differnew file mode 100644 index 000000000..10b7c009c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo68418.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo68607.docx b/sw/qa/extras/ooxmlexport/data/fdo68607.docx Binary files differnew file mode 100644 index 000000000..11f57064c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo68607.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo68787.docx b/sw/qa/extras/ooxmlexport/data/fdo68787.docx Binary files differnew file mode 100644 index 000000000..c47b80995 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo68787.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo69548.docx b/sw/qa/extras/ooxmlexport/data/fdo69548.docx Binary files differnew file mode 100644 index 000000000..6799f5ef2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo69548.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo69616.docx b/sw/qa/extras/ooxmlexport/data/fdo69616.docx Binary files differnew file mode 100644 index 000000000..7c7f52e16 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo69616.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo69636.docx b/sw/qa/extras/ooxmlexport/data/fdo69636.docx Binary files differnew file mode 100644 index 000000000..b2f3069b5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo69636.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo69644.docx b/sw/qa/extras/ooxmlexport/data/fdo69644.docx Binary files differnew file mode 100644 index 000000000..1a254db3b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo69644.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo69649.docx b/sw/qa/extras/ooxmlexport/data/fdo69649.docx Binary files differnew file mode 100644 index 000000000..cb0f78999 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo69649.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo70457.docx b/sw/qa/extras/ooxmlexport/data/fdo70457.docx Binary files differnew file mode 100644 index 000000000..b9cabb119 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo70457.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo70812.docx b/sw/qa/extras/ooxmlexport/data/fdo70812.docx Binary files differnew file mode 100644 index 000000000..b9b5d52c2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo70812.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo70838.docx b/sw/qa/extras/ooxmlexport/data/fdo70838.docx Binary files differnew file mode 100644 index 000000000..ede97f7ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo70838.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo70942.docx b/sw/qa/extras/ooxmlexport/data/fdo70942.docx Binary files differnew file mode 100644 index 000000000..a04a78437 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo70942.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo71302.docx b/sw/qa/extras/ooxmlexport/data/fdo71302.docx Binary files differnew file mode 100644 index 000000000..1f62e87c5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo71302.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo71646.docx b/sw/qa/extras/ooxmlexport/data/fdo71646.docx Binary files differnew file mode 100644 index 000000000..d49d88b67 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo71646.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo71785.docx b/sw/qa/extras/ooxmlexport/data/fdo71785.docx Binary files differnew file mode 100644 index 000000000..e155e831f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo71785.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo71834.docx b/sw/qa/extras/ooxmlexport/data/fdo71834.docx Binary files differnew file mode 100644 index 000000000..154533450 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo71834.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560.docx b/sw/qa/extras/ooxmlexport/data/fdo72560.docx Binary files differnew file mode 100644 index 000000000..b21535bfd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo72560.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560b.docx b/sw/qa/extras/ooxmlexport/data/fdo72560b.docx Binary files differnew file mode 100644 index 000000000..dfe5176f3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo72560b.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560c.docx b/sw/qa/extras/ooxmlexport/data/fdo72560c.docx Binary files differnew file mode 100644 index 000000000..ed0b88822 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo72560c.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560d.docx b/sw/qa/extras/ooxmlexport/data/fdo72560d.docx Binary files differnew file mode 100644 index 000000000..000ae73d8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo72560d.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560e.docx b/sw/qa/extras/ooxmlexport/data/fdo72560e.docx Binary files differnew file mode 100644 index 000000000..7c3e89fb3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo72560e.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73215.docx b/sw/qa/extras/ooxmlexport/data/fdo73215.docx Binary files differnew file mode 100644 index 000000000..9b2c05b72 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73215.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73227.docx b/sw/qa/extras/ooxmlexport/data/fdo73227.docx Binary files differnew file mode 100644 index 000000000..015beb9d6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73227.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73247.docx b/sw/qa/extras/ooxmlexport/data/fdo73247.docx Binary files differnew file mode 100644 index 000000000..63ad782f6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73247.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73389.docx b/sw/qa/extras/ooxmlexport/data/fdo73389.docx Binary files differnew file mode 100644 index 000000000..02b55f74e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73389.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73541.docx b/sw/qa/extras/ooxmlexport/data/fdo73541.docx Binary files differnew file mode 100644 index 000000000..469d02520 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73541.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73550.docx b/sw/qa/extras/ooxmlexport/data/fdo73550.docx Binary files differnew file mode 100644 index 000000000..c6b7f15d9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73550.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73556.docx b/sw/qa/extras/ooxmlexport/data/fdo73556.docx Binary files differnew file mode 100644 index 000000000..50354076d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73556.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73596_AlphaSeparator.docx b/sw/qa/extras/ooxmlexport/data/fdo73596_AlphaSeparator.docx Binary files differnew file mode 100644 index 000000000..892bc553b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73596_AlphaSeparator.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo73596_RunInStyle.docx b/sw/qa/extras/ooxmlexport/data/fdo73596_RunInStyle.docx Binary files differnew file mode 100644 index 000000000..8f1863b46 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo73596_RunInStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74110.docx b/sw/qa/extras/ooxmlexport/data/fdo74110.docx Binary files differnew file mode 100644 index 000000000..6b7ab0e41 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74110.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74153.docx b/sw/qa/extras/ooxmlexport/data/fdo74153.docx Binary files differnew file mode 100644 index 000000000..4cbdd7bba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74153.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74357.docx b/sw/qa/extras/ooxmlexport/data/fdo74357.docx Binary files differnew file mode 100644 index 000000000..970372906 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74357.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74401.docx b/sw/qa/extras/ooxmlexport/data/fdo74401.docx Binary files differnew file mode 100644 index 000000000..fd3cbabdd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74401.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74566.docx b/sw/qa/extras/ooxmlexport/data/fdo74566.docx Binary files differnew file mode 100644 index 000000000..b197b946a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74566.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74605.docx b/sw/qa/extras/ooxmlexport/data/fdo74605.docx Binary files differnew file mode 100644 index 000000000..85231f151 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74605.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74745.docx b/sw/qa/extras/ooxmlexport/data/fdo74745.docx Binary files differnew file mode 100644 index 000000000..773567756 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74745.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74792.docx b/sw/qa/extras/ooxmlexport/data/fdo74792.docx Binary files differnew file mode 100644 index 000000000..3d00009a0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74792.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo75431.docx b/sw/qa/extras/ooxmlexport/data/fdo75431.docx Binary files differnew file mode 100644 index 000000000..492278403 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo75431.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76016.docx b/sw/qa/extras/ooxmlexport/data/fdo76016.docx Binary files differnew file mode 100644 index 000000000..79fa6b9a4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76016.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76098.docx b/sw/qa/extras/ooxmlexport/data/fdo76098.docx Binary files differnew file mode 100644 index 000000000..8a616e9b7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76098.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76101.docx b/sw/qa/extras/ooxmlexport/data/fdo76101.docx Binary files differnew file mode 100644 index 000000000..d2264f3f8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76101.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76163.docx b/sw/qa/extras/ooxmlexport/data/fdo76163.docx Binary files differnew file mode 100644 index 000000000..0c7cc7027 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76163.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76249.docx b/sw/qa/extras/ooxmlexport/data/fdo76249.docx Binary files differnew file mode 100644 index 000000000..9b50f5de6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76249.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76316.docx b/sw/qa/extras/ooxmlexport/data/fdo76316.docx Binary files differnew file mode 100644 index 000000000..5cfd9d937 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76316.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76586.docx b/sw/qa/extras/ooxmlexport/data/fdo76586.docx Binary files differnew file mode 100644 index 000000000..28ae05ee7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76586.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76587.docx b/sw/qa/extras/ooxmlexport/data/fdo76587.docx Binary files differnew file mode 100644 index 000000000..84c23adc7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76587.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76589.docx b/sw/qa/extras/ooxmlexport/data/fdo76589.docx Binary files differnew file mode 100644 index 000000000..d501b1b59 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76589.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76591.docx b/sw/qa/extras/ooxmlexport/data/fdo76591.docx Binary files differnew file mode 100644 index 000000000..8ca43879c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76591.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76597.docx b/sw/qa/extras/ooxmlexport/data/fdo76597.docx Binary files differnew file mode 100644 index 000000000..a970136b8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76597.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76741.docx b/sw/qa/extras/ooxmlexport/data/fdo76741.docx Binary files differnew file mode 100644 index 000000000..abe9985a1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76741.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76934.docx b/sw/qa/extras/ooxmlexport/data/fdo76934.docx Binary files differnew file mode 100644 index 000000000..0515cf2bf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76934.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo76979.docx b/sw/qa/extras/ooxmlexport/data/fdo76979.docx Binary files differnew file mode 100644 index 000000000..f8ee99520 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76979.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77117.docx b/sw/qa/extras/ooxmlexport/data/fdo77117.docx Binary files differnew file mode 100644 index 000000000..f2a1d447e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77117.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77129.docx b/sw/qa/extras/ooxmlexport/data/fdo77129.docx Binary files differnew file mode 100644 index 000000000..b0661e936 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77129.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77476.docx b/sw/qa/extras/ooxmlexport/data/fdo77476.docx Binary files differnew file mode 100644 index 000000000..08c38b066 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77476.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77716.docx b/sw/qa/extras/ooxmlexport/data/fdo77716.docx Binary files differnew file mode 100644 index 000000000..f70679100 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77716.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77718.docx b/sw/qa/extras/ooxmlexport/data/fdo77718.docx Binary files differnew file mode 100644 index 000000000..7a22485f7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77718.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77719.docx b/sw/qa/extras/ooxmlexport/data/fdo77719.docx Binary files differnew file mode 100644 index 000000000..e671b33f4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77719.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77725.docx b/sw/qa/extras/ooxmlexport/data/fdo77725.docx Binary files differnew file mode 100644 index 000000000..b06a4b4ee --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77725.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77727.docx b/sw/qa/extras/ooxmlexport/data/fdo77727.docx Binary files differnew file mode 100644 index 000000000..9f553e210 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77727.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77759.docx b/sw/qa/extras/ooxmlexport/data/fdo77759.docx Binary files differnew file mode 100644 index 000000000..655869069 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77759.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77812.docx b/sw/qa/extras/ooxmlexport/data/fdo77812.docx Binary files differnew file mode 100644 index 000000000..48fb49888 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77812.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77887.docx b/sw/qa/extras/ooxmlexport/data/fdo77887.docx Binary files differnew file mode 100644 index 000000000..cb3f4537d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77887.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo77890.docx b/sw/qa/extras/ooxmlexport/data/fdo77890.docx Binary files differnew file mode 100644 index 000000000..ac90174ff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo77890.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78284.docx b/sw/qa/extras/ooxmlexport/data/fdo78284.docx Binary files differnew file mode 100644 index 000000000..92145eb12 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78284.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78300.docx b/sw/qa/extras/ooxmlexport/data/fdo78300.docx Binary files differnew file mode 100644 index 000000000..40da0913d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78300.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78384.docx b/sw/qa/extras/ooxmlexport/data/fdo78384.docx Binary files differnew file mode 100644 index 000000000..ee102648f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78384.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78420.docx b/sw/qa/extras/ooxmlexport/data/fdo78420.docx Binary files differnew file mode 100644 index 000000000..6b253b189 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78420.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78432.docx b/sw/qa/extras/ooxmlexport/data/fdo78432.docx Binary files differnew file mode 100644 index 000000000..343e76ae2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78432.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78469.docx b/sw/qa/extras/ooxmlexport/data/fdo78469.docx Binary files differnew file mode 100644 index 000000000..7ae4d71be --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78469.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78474.docx b/sw/qa/extras/ooxmlexport/data/fdo78474.docx Binary files differnew file mode 100644 index 000000000..6468a8421 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78474.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78599.docx b/sw/qa/extras/ooxmlexport/data/fdo78599.docx Binary files differnew file mode 100644 index 000000000..3c81780da --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78599.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78651.docx b/sw/qa/extras/ooxmlexport/data/fdo78651.docx Binary files differnew file mode 100644 index 000000000..a510782b4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78651.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78654.docx b/sw/qa/extras/ooxmlexport/data/fdo78654.docx Binary files differnew file mode 100644 index 000000000..81d7bd0c4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78654.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78658.docx b/sw/qa/extras/ooxmlexport/data/fdo78658.docx Binary files differnew file mode 100644 index 000000000..1c0782e98 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78658.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78659.docx b/sw/qa/extras/ooxmlexport/data/fdo78659.docx Binary files differnew file mode 100644 index 000000000..cf0800373 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78659.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78663.docx b/sw/qa/extras/ooxmlexport/data/fdo78663.docx Binary files differnew file mode 100644 index 000000000..be35b6c00 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78663.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78882.docx b/sw/qa/extras/ooxmlexport/data/fdo78882.docx Binary files differnew file mode 100644 index 000000000..da591f9e7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78882.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78883.docx b/sw/qa/extras/ooxmlexport/data/fdo78883.docx Binary files differnew file mode 100644 index 000000000..a72ff9436 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78883.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78886.docx b/sw/qa/extras/ooxmlexport/data/fdo78886.docx Binary files differnew file mode 100644 index 000000000..e364948f1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78886.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78887.docx b/sw/qa/extras/ooxmlexport/data/fdo78887.docx Binary files differnew file mode 100644 index 000000000..db92fe4ed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78887.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78904.docx b/sw/qa/extras/ooxmlexport/data/fdo78904.docx Binary files differnew file mode 100644 index 000000000..c171ae2ca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78904.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78907.docx b/sw/qa/extras/ooxmlexport/data/fdo78907.docx Binary files differnew file mode 100644 index 000000000..abae6b4be --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78907.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78910.docx b/sw/qa/extras/ooxmlexport/data/fdo78910.docx Binary files differnew file mode 100644 index 000000000..e8a090bee --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78910.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78939.docx b/sw/qa/extras/ooxmlexport/data/fdo78939.docx Binary files differnew file mode 100644 index 000000000..2fc319863 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78939.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo78957.docx b/sw/qa/extras/ooxmlexport/data/fdo78957.docx Binary files differnew file mode 100644 index 000000000..38a18a3a6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo78957.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79008.docx b/sw/qa/extras/ooxmlexport/data/fdo79008.docx Binary files differnew file mode 100644 index 000000000..2b1758776 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79008.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79062.docx b/sw/qa/extras/ooxmlexport/data/fdo79062.docx Binary files differnew file mode 100644 index 000000000..181ea7283 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79062.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79256.docx b/sw/qa/extras/ooxmlexport/data/fdo79256.docx Binary files differnew file mode 100644 index 000000000..2358abb85 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79256.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79535.docx b/sw/qa/extras/ooxmlexport/data/fdo79535.docx Binary files differnew file mode 100644 index 000000000..64aab18e0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79535.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79540.docx b/sw/qa/extras/ooxmlexport/data/fdo79540.docx Binary files differnew file mode 100644 index 000000000..ce843d661 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79540.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79591.docx b/sw/qa/extras/ooxmlexport/data/fdo79591.docx Binary files differnew file mode 100644 index 000000000..32a61debd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79591.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79668.docx b/sw/qa/extras/ooxmlexport/data/fdo79668.docx Binary files differnew file mode 100644 index 000000000..793fd2adf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79668.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79738.docx b/sw/qa/extras/ooxmlexport/data/fdo79738.docx Binary files differnew file mode 100644 index 000000000..e6873e7a2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79738.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79817.docx b/sw/qa/extras/ooxmlexport/data/fdo79817.docx Binary files differnew file mode 100644 index 000000000..7e948c5c8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79817.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79822-SPECIAL.docx b/sw/qa/extras/ooxmlexport/data/fdo79822-SPECIAL.docx Binary files differnew file mode 100644 index 000000000..48fde8793 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79822-SPECIAL.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79822.docx b/sw/qa/extras/ooxmlexport/data/fdo79822.docx Binary files differnew file mode 100644 index 000000000..2844671d6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79822.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79915.docx b/sw/qa/extras/ooxmlexport/data/fdo79915.docx Binary files differnew file mode 100644 index 000000000..351674df0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79915.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79968.docx b/sw/qa/extras/ooxmlexport/data/fdo79968.docx Binary files differnew file mode 100644 index 000000000..2da7ddcc4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79968.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx Binary files differnew file mode 100644 index 000000000..0e413992b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsb.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx Binary files differnew file mode 100644 index 000000000..6fd11f397 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79969_xlsm.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80097.docx b/sw/qa/extras/ooxmlexport/data/fdo80097.docx Binary files differnew file mode 100644 index 000000000..3f8ba9f90 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80097.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80410.docx b/sw/qa/extras/ooxmlexport/data/fdo80410.docx Binary files differnew file mode 100644 index 000000000..7660d8444 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80410.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80522.docx b/sw/qa/extras/ooxmlexport/data/fdo80522.docx Binary files differnew file mode 100644 index 000000000..9445b733f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80522.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx b/sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx Binary files differnew file mode 100644 index 000000000..3140f3b6d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80523_pptm.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx b/sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx Binary files differnew file mode 100644 index 000000000..e50cda1a5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80523_sldm.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80555.docx b/sw/qa/extras/ooxmlexport/data/fdo80555.docx Binary files differnew file mode 100644 index 000000000..a15bdc1ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80555.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80800.docx b/sw/qa/extras/ooxmlexport/data/fdo80800.docx Binary files differnew file mode 100644 index 000000000..64ed7697f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80800.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80800b_tableStyle.docx b/sw/qa/extras/ooxmlexport/data/fdo80800b_tableStyle.docx Binary files differnew file mode 100644 index 000000000..bde907cf2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80800b_tableStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80895.docx b/sw/qa/extras/ooxmlexport/data/fdo80895.docx Binary files differnew file mode 100644 index 000000000..711882fd4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80895.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80897.docx b/sw/qa/extras/ooxmlexport/data/fdo80897.docx Binary files differnew file mode 100644 index 000000000..2f0957e69 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80897.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80898.docx b/sw/qa/extras/ooxmlexport/data/fdo80898.docx Binary files differnew file mode 100644 index 000000000..d4b9e1f23 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80898.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80902.docx b/sw/qa/extras/ooxmlexport/data/fdo80902.docx Binary files differnew file mode 100644 index 000000000..73a927f9a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80902.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo80997.docx b/sw/qa/extras/ooxmlexport/data/fdo80997.docx Binary files differnew file mode 100644 index 000000000..713e890af --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo80997.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81031.docx b/sw/qa/extras/ooxmlexport/data/fdo81031.docx Binary files differnew file mode 100644 index 000000000..d80111dec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81031.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81341.docx b/sw/qa/extras/ooxmlexport/data/fdo81341.docx Binary files differnew file mode 100644 index 000000000..3c243c0dd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81341.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81381.docx b/sw/qa/extras/ooxmlexport/data/fdo81381.docx Binary files differnew file mode 100644 index 000000000..bf4a860c7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81381.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81486.docx b/sw/qa/extras/ooxmlexport/data/fdo81486.docx Binary files differnew file mode 100644 index 000000000..6e680c350 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81486.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81492.docx b/sw/qa/extras/ooxmlexport/data/fdo81492.docx Binary files differnew file mode 100644 index 000000000..be3353b3c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81492.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81945.docx b/sw/qa/extras/ooxmlexport/data/fdo81945.docx Binary files differnew file mode 100644 index 000000000..51dee9cfe --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81945.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo81946.docx b/sw/qa/extras/ooxmlexport/data/fdo81946.docx Binary files differnew file mode 100644 index 000000000..b179f58bf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo81946.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo82123.docx b/sw/qa/extras/ooxmlexport/data/fdo82123.docx Binary files differnew file mode 100644 index 000000000..fc2632cb6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo82123.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo82492.docx b/sw/qa/extras/ooxmlexport/data/fdo82492.docx Binary files differnew file mode 100644 index 000000000..6533056f4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo82492.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo83044.docx b/sw/qa/extras/ooxmlexport/data/fdo83044.docx Binary files differnew file mode 100644 index 000000000..01d32bfdb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo83044.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo83048.docx b/sw/qa/extras/ooxmlexport/data/fdo83048.docx Binary files differnew file mode 100644 index 000000000..3ef6d995f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo83048.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo83057.docx b/sw/qa/extras/ooxmlexport/data/fdo83057.docx Binary files differnew file mode 100644 index 000000000..d4d42321d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo83057.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo83428.docx b/sw/qa/extras/ooxmlexport/data/fdo83428.docx Binary files differnew file mode 100644 index 000000000..9e9743a3e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo83428.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo85542.docx b/sw/qa/extras/ooxmlexport/data/fdo85542.docx Binary files differnew file mode 100644 index 000000000..db4940845 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo85542.docx diff --git a/sw/qa/extras/ooxmlexport/data/field-rotated.fodt b/sw/qa/extras/ooxmlexport/data/field-rotated.fodt new file mode 100644 index 000000000..079f35dfb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/field-rotated.fodt @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ooo="http://openoffice.org/2004/office" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta><meta:creation-date>2020-02-07T13:06:45.869388502</meta:creation-date><meta:editing-cycles>1</meta:editing-cycles><meta:editing-duration>PT1M18S</meta:editing-duration><dc:title>Rotationeering</dc:title><dc:date>2020-02-07T13:08:03.244415357</dc:date><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="1" meta:word-count="1" meta:character-count="14" meta:non-whitespace-character-count="14"/><meta:generator>LibreOfficeDev/7.0.0.0.alpha0$Linux_X86_64 LibreOffice_project/d2eff4b08869dd15b025c5801896e0332b14ba59</meta:generator></office:meta> + + <office:font-face-decls> + <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/> + <style:font-face style:name="Calibri" svg:font-family="Calibri" style:font-family-generic="swiss"/> + <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Sans CN" svg:font-family="'Source Han Sans CN'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Calibri" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/> + </style:default-style> + + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> + <style:text-properties style:text-rotation-angle="90" style:text-rotation-scale="line-height"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <text:p text:style-name="P1"><text:title>Rotationeering</text:title></text:p> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/file_crash.docx b/sw/qa/extras/ooxmlexport/data/file_crash.docx Binary files differnew file mode 100644 index 000000000..7a233aba5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/file_crash.docx diff --git a/sw/qa/extras/ooxmlexport/data/first-header-footer.docx b/sw/qa/extras/ooxmlexport/data/first-header-footer.docx Binary files differnew file mode 100644 index 000000000..d18eea586 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/first-header-footer.docx diff --git a/sw/qa/extras/ooxmlexport/data/fixed-date-field.docx b/sw/qa/extras/ooxmlexport/data/fixed-date-field.docx Binary files differnew file mode 100644 index 000000000..960e2db80 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fixed-date-field.docx diff --git a/sw/qa/extras/ooxmlexport/data/flip_and_rotate.odt b/sw/qa/extras/ooxmlexport/data/flip_and_rotate.odt Binary files differnew file mode 100644 index 000000000..4805bfa80 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/flip_and_rotate.odt diff --git a/sw/qa/extras/ooxmlexport/data/floating-table-position.docx b/sw/qa/extras/ooxmlexport/data/floating-table-position.docx Binary files differnew file mode 100644 index 000000000..de7a467aa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/floating-table-position.docx diff --git a/sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx b/sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx Binary files differnew file mode 100644 index 000000000..70dc7cf8b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/floating-tables-anchor.docx diff --git a/sw/qa/extras/ooxmlexport/data/floatingtbl_with_formula.docx b/sw/qa/extras/ooxmlexport/data/floatingtbl_with_formula.docx Binary files differnew file mode 100644 index 000000000..ecabbd6b2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/floatingtbl_with_formula.docx diff --git a/sw/qa/extras/ooxmlexport/data/font-name-is-empty.docx b/sw/qa/extras/ooxmlexport/data/font-name-is-empty.docx Binary files differnew file mode 100644 index 000000000..5ee8cad1a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/font-name-is-empty.docx diff --git a/sw/qa/extras/ooxmlexport/data/footer-body-distance.docx b/sw/qa/extras/ooxmlexport/data/footer-body-distance.docx Binary files differnew file mode 100644 index 000000000..0244d76c7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/footer-body-distance.docx diff --git a/sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx b/sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx Binary files differnew file mode 100644 index 000000000..42c68d5e1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx diff --git a/sw/qa/extras/ooxmlexport/data/footnote.docx b/sw/qa/extras/ooxmlexport/data/footnote.docx Binary files differnew file mode 100644 index 000000000..f5c94bd27 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/footnote.docx diff --git a/sw/qa/extras/ooxmlexport/data/footnotesep.fodt b/sw/qa/extras/ooxmlexport/data/footnotesep.fodt new file mode 100644 index 000000000..f786580bb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/footnotesep.fodt @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ooo="http://openoffice.org/2004/office" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta><meta:creation-date>2020-02-06T14:04:13.152283572</meta:creation-date><dc:date>2020-02-06T14:08:19.939509466</dc:date><meta:editing-duration>PT4M8S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="2" meta:paragraph-count="4" meta:word-count="4" meta:character-count="8" meta:non-whitespace-character-count="8"/><meta:generator>LibreOfficeDev/7.0.0.0.alpha0$Linux_X86_64 LibreOffice_project/d2eff4b08869dd15b025c5801896e0332b14ba59</meta:generator></office:meta> + <office:font-face-decls> + <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/> + <style:font-face style:name="Calibri" svg:font-family="Calibri" style:font-family-generic="swiss"/> + <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Sans CN" svg:font-family="'Source Han Sans CN'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Calibri" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Calibri" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Footnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties fo:margin-left="0.598cm" fo:margin-right="0cm" fo:text-indent="-0.598cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/> + <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="Footnote_20_Symbol" style:display-name="Footnote Symbol" style:family="text"/> + <style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor" style:family="text"> + <style:text-properties style:text-position="super 58%"/> + </style:style> + + <text:notes-configuration text:note-class="footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> + <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Footnote"> + <style:text-properties officeooo:rsid="00069b1f" officeooo:paragraph-rsid="00069b1f"/> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="Sep"> + <style:paragraph-properties style:page-number="auto"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + <style:page-layout style:name="pm2"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm2"/> + <style:master-page style:name="Sep" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text text:use-soft-page-breaks="true"> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> + </text:sequence-decls> + <text:p text:style-name="Standard"><text:note text:id="ftn0" text:note-class="footnote"><text:note-citation>1</text:note-citation><text:note-body> + <text:p text:style-name="P1">foo</text:p></text:note-body></text:note></text:p> + <text:p text:style-name="P2"><text:note text:id="ftn1" text:note-class="footnote"><text:note-citation>2</text:note-citation><text:note-body> + <text:p text:style-name="P1">bar</text:p></text:note-body></text:note></text:p> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx b/sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx Binary files differnew file mode 100644 index 000000000..6ad7fe059 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/frame-wrap-auto.docx diff --git a/sw/qa/extras/ooxmlexport/data/frame.fodt b/sw/qa/extras/ooxmlexport/data/frame.fodt new file mode 100644 index 000000000..c474b8de5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/frame.fodt @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Frame_20_contents" style:display-name="Frame contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"/> + <style:style style:name="Frame" style:family="graphic"> + <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.06pt solid #000000"/> + </style:style> + + <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> + <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame"> + <style:graphic-properties style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" draw:opacity="0%" draw:wrap-influence-on-position="once-concurrent"/> + </style:style> + <style:style style:name="fr2" style:family="graphic" style:parent-style-name="Frame"> + <style:graphic-properties style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" fo:background-color="#e8f2a1" draw:fill="solid" draw:fill-color="#e8f2a1" draw:wrap-influence-on-position="once-concurrent"/> + </style:style> + <style:style style:name="fr3" style:family="graphic" style:parent-style-name="Frame"> + <style:graphic-properties style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <text:p text:style-name="Standard"><draw:frame draw:style-name="fr3" draw:name="Frame1" text:anchor-type="paragraph" svg:x="0.87cm" svg:y="0cm" svg:width="2cm" draw:z-index="0"> + <draw:text-box fo:min-height="0.499cm"> + <text:p text:style-name="Frame_20_contents">opaque</text:p> + </draw:text-box> + </draw:frame><draw:frame draw:style-name="fr2" draw:name="Frame2" text:anchor-type="paragraph" svg:x="3.069cm" svg:y="0cm" svg:width="2cm" draw:z-index="1"> + <draw:text-box fo:min-height="0.499cm"> + <text:p text:style-name="Frame_20_contents">solid</text:p> + </draw:text-box> + </draw:frame><draw:frame draw:style-name="fr1" draw:name="Frame3" text:anchor-type="paragraph" svg:x="5.33cm" svg:y="0cm" svg:width="2.281cm" draw:z-index="2"> + <draw:text-box fo:min-height="0.499cm"> + <text:p text:style-name="Frame_20_contents">transparent</text:p> + </draw:text-box> + </draw:frame></text:p> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/grabbag.docx b/sw/qa/extras/ooxmlexport/data/grabbag.docx Binary files differnew file mode 100644 index 000000000..0aca64d6e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/grabbag.docx diff --git a/sw/qa/extras/ooxmlexport/data/gradient-fill-preservation.docx b/sw/qa/extras/ooxmlexport/data/gradient-fill-preservation.docx Binary files differnew file mode 100644 index 000000000..c9abc10d2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/gradient-fill-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx b/sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx Binary files differnew file mode 100644 index 000000000..2f95a2b85 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx diff --git a/sw/qa/extras/ooxmlexport/data/gridbefore.docx b/sw/qa/extras/ooxmlexport/data/gridbefore.docx Binary files differnew file mode 100644 index 000000000..571fb48ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/gridbefore.docx diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-picture.docx b/sw/qa/extras/ooxmlexport/data/groupshape-picture.docx Binary files differnew file mode 100644 index 000000000..4ecce56cf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/groupshape-picture.docx diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx b/sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx Binary files differnew file mode 100644 index 000000000..d63b5d073 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/groupshape-rotation.docx diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx b/sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx Binary files differnew file mode 100644 index 000000000..6fc1cb2e6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/groupshape-smarttag.docx diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-textbox.docx b/sw/qa/extras/ooxmlexport/data/groupshape-textbox.docx Binary files differnew file mode 100644 index 000000000..fca71bfcf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/groupshape-textbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-theme-font.docx b/sw/qa/extras/ooxmlexport/data/groupshape-theme-font.docx Binary files differnew file mode 100644 index 000000000..75011d7e5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/groupshape-theme-font.docx diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx b/sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx Binary files differnew file mode 100644 index 000000000..116721f39 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/groupshape-trackedchanges.docx diff --git a/sw/qa/extras/ooxmlexport/data/header-border.docx b/sw/qa/extras/ooxmlexport/data/header-border.docx Binary files differnew file mode 100644 index 000000000..18ee9f52a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/header-border.docx diff --git a/sw/qa/extras/ooxmlexport/data/headerfooter-link-to-prev.docx b/sw/qa/extras/ooxmlexport/data/headerfooter-link-to-prev.docx Binary files differnew file mode 100644 index 000000000..cc4ddc89b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/headerfooter-link-to-prev.docx diff --git a/sw/qa/extras/ooxmlexport/data/hello.docm b/sw/qa/extras/ooxmlexport/data/hello.docm Binary files differnew file mode 100644 index 000000000..a00aa58e7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hello.docm diff --git a/sw/qa/extras/ooxmlexport/data/hello.docx b/sw/qa/extras/ooxmlexport/data/hello.docx Binary files differnew file mode 100644 index 000000000..d5d8d43eb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hello.docx diff --git a/sw/qa/extras/ooxmlexport/data/hidemark.docx b/sw/qa/extras/ooxmlexport/data/hidemark.docx Binary files differnew file mode 100644 index 000000000..4a273d603 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hidemark.docx diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt Binary files differnew file mode 100644 index 000000000..0c265cf71 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink.docx b/sw/qa/extras/ooxmlexport/data/hyperlink.docx Binary files differnew file mode 100644 index 000000000..5f5289790 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hyperlink.docx diff --git a/sw/qa/extras/ooxmlexport/data/hyphenation.odt b/sw/qa/extras/ooxmlexport/data/hyphenation.odt Binary files differnew file mode 100644 index 000000000..13c1afaaa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hyphenation.odt diff --git a/sw/qa/extras/ooxmlexport/data/i120928.docx b/sw/qa/extras/ooxmlexport/data/i120928.docx Binary files differnew file mode 100644 index 000000000..ce78653e9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/i120928.docx diff --git a/sw/qa/extras/ooxmlexport/data/i124106.docx b/sw/qa/extras/ooxmlexport/data/i124106.docx Binary files differnew file mode 100644 index 000000000..de1d54293 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/i124106.docx diff --git a/sw/qa/extras/ooxmlexport/data/image-comment-at-char.docx b/sw/qa/extras/ooxmlexport/data/image-comment-at-char.docx Binary files differnew file mode 100644 index 000000000..677464de4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/image-comment-at-char.docx diff --git a/sw/qa/extras/ooxmlexport/data/image-noborder.docx b/sw/qa/extras/ooxmlexport/data/image-noborder.docx Binary files differnew file mode 100644 index 000000000..7e0fc90d2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/image-noborder.docx diff --git a/sw/qa/extras/ooxmlexport/data/image_data.docx b/sw/qa/extras/ooxmlexport/data/image_data.docx Binary files differnew file mode 100644 index 000000000..a2f89b146 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/image_data.docx diff --git a/sw/qa/extras/ooxmlexport/data/imgshadow.docx b/sw/qa/extras/ooxmlexport/data/imgshadow.docx Binary files differnew file mode 100644 index 000000000..efe0e9596 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/imgshadow.docx diff --git a/sw/qa/extras/ooxmlexport/data/indentation.docx b/sw/qa/extras/ooxmlexport/data/indentation.docx Binary files differnew file mode 100644 index 000000000..cf57aaf54 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/indentation.docx diff --git a/sw/qa/extras/ooxmlexport/data/indents.docx b/sw/qa/extras/ooxmlexport/data/indents.docx Binary files differnew file mode 100644 index 000000000..b16736791 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/indents.docx diff --git a/sw/qa/extras/ooxmlexport/data/inheritFirstHeader.docx b/sw/qa/extras/ooxmlexport/data/inheritFirstHeader.docx Binary files differnew file mode 100644 index 000000000..e3d7d20a2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/inheritFirstHeader.docx diff --git a/sw/qa/extras/ooxmlexport/data/inline-groupshape.docx b/sw/qa/extras/ooxmlexport/data/inline-groupshape.docx Binary files differnew file mode 100644 index 000000000..def5a05b4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/inline-groupshape.docx diff --git a/sw/qa/extras/ooxmlexport/data/internal_hyperlink_frame.odt b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_frame.odt Binary files differnew file mode 100644 index 000000000..2497d5926 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_frame.odt diff --git a/sw/qa/extras/ooxmlexport/data/internal_hyperlink_ole.odt b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_ole.odt Binary files differnew file mode 100644 index 000000000..844cf1be6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_ole.odt diff --git a/sw/qa/extras/ooxmlexport/data/internal_hyperlink_region.odt b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_region.odt Binary files differnew file mode 100644 index 000000000..abec2c5a8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_region.odt diff --git a/sw/qa/extras/ooxmlexport/data/internal_hyperlink_table.odt b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_table.odt Binary files differnew file mode 100644 index 000000000..f3144a30e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/internal_hyperlink_table.odt diff --git a/sw/qa/extras/ooxmlexport/data/invalid_date_form_field.docx b/sw/qa/extras/ooxmlexport/data/invalid_date_form_field.docx Binary files differnew file mode 100644 index 000000000..9dc24e768 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/invalid_date_form_field.docx diff --git a/sw/qa/extras/ooxmlexport/data/kde216114-1.odt b/sw/qa/extras/ooxmlexport/data/kde216114-1.odt Binary files differnew file mode 100644 index 000000000..536da7253 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/kde216114-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/kde302504-1.odt b/sw/qa/extras/ooxmlexport/data/kde302504-1.odt Binary files differnew file mode 100644 index 000000000..d0b7c6017 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/kde302504-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/kern.docx b/sw/qa/extras/ooxmlexport/data/kern.docx Binary files differnew file mode 100644 index 000000000..b66130d38 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/kern.docx diff --git a/sw/qa/extras/ooxmlexport/data/large-twips.docx b/sw/qa/extras/ooxmlexport/data/large-twips.docx Binary files differnew file mode 100644 index 000000000..6e9d82dfa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/large-twips.docx diff --git a/sw/qa/extras/ooxmlexport/data/libreoffice.png b/sw/qa/extras/ooxmlexport/data/libreoffice.png Binary files differnew file mode 100644 index 000000000..437f613c1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/libreoffice.png diff --git a/sw/qa/extras/ooxmlexport/data/lvlPicBulletId.docx b/sw/qa/extras/ooxmlexport/data/lvlPicBulletId.docx Binary files differnew file mode 100644 index 000000000..28e656bdd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/lvlPicBulletId.docx diff --git a/sw/qa/extras/ooxmlexport/data/mailmerge.docx b/sw/qa/extras/ooxmlexport/data/mailmerge.docx Binary files differnew file mode 100644 index 000000000..7e209a1b4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mailmerge.docx diff --git a/sw/qa/extras/ooxmlexport/data/margins_from_style.docx b/sw/qa/extras/ooxmlexport/data/margins_from_style.docx Binary files differnew file mode 100644 index 000000000..721982458 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/margins_from_style.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-accents.docx b/sw/qa/extras/ooxmlexport/data/math-accents.docx Binary files differnew file mode 100644 index 000000000..b623cb556 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-accents.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-d.docx b/sw/qa/extras/ooxmlexport/data/math-d.docx Binary files differnew file mode 100644 index 000000000..a18afdd81 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-d.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-escape.docx b/sw/qa/extras/ooxmlexport/data/math-escape.docx Binary files differnew file mode 100644 index 000000000..e935a83f5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-escape.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-escaping.docx b/sw/qa/extras/ooxmlexport/data/math-escaping.docx Binary files differnew file mode 100644 index 000000000..d51c47552 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-escaping.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-lim.docx b/sw/qa/extras/ooxmlexport/data/math-lim.docx Binary files differnew file mode 100644 index 000000000..6adb548ab --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-lim.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-literal.docx b/sw/qa/extras/ooxmlexport/data/math-literal.docx Binary files differnew file mode 100644 index 000000000..b62bd2351 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-literal.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-matrix.docx b/sw/qa/extras/ooxmlexport/data/math-matrix.docx Binary files differnew file mode 100644 index 000000000..d6b5b1871 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-matrix.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-mso2k7.docx b/sw/qa/extras/ooxmlexport/data/math-mso2k7.docx Binary files differnew file mode 100644 index 000000000..b6b16ef7c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-mso2k7.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-nary.docx b/sw/qa/extras/ooxmlexport/data/math-nary.docx Binary files differnew file mode 100644 index 000000000..f3bb781d6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-nary.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-overbrace_underbrace.docx b/sw/qa/extras/ooxmlexport/data/math-overbrace_underbrace.docx Binary files differnew file mode 100644 index 000000000..e4119f66f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-overbrace_underbrace.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-overstrike.docx b/sw/qa/extras/ooxmlexport/data/math-overstrike.docx Binary files differnew file mode 100644 index 000000000..9809edc8e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-overstrike.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-placeholders.docx b/sw/qa/extras/ooxmlexport/data/math-placeholders.docx Binary files differnew file mode 100644 index 000000000..1c32c048f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-placeholders.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-rad.docx b/sw/qa/extras/ooxmlexport/data/math-rad.docx Binary files differnew file mode 100644 index 000000000..39194dcca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-rad.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-subscripts.docx b/sw/qa/extras/ooxmlexport/data/math-subscripts.docx Binary files differnew file mode 100644 index 000000000..038925f63 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-subscripts.docx diff --git a/sw/qa/extras/ooxmlexport/data/math-vertical_stacks.docx b/sw/qa/extras/ooxmlexport/data/math-vertical_stacks.docx Binary files differnew file mode 100644 index 000000000..50dfab0ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/math-vertical_stacks.docx diff --git a/sw/qa/extras/ooxmlexport/data/mathtype.docx b/sw/qa/extras/ooxmlexport/data/mathtype.docx Binary files differnew file mode 100644 index 000000000..bf60f43b2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mathtype.docx diff --git a/sw/qa/extras/ooxmlexport/data/mce-nested.docx b/sw/qa/extras/ooxmlexport/data/mce-nested.docx Binary files differnew file mode 100644 index 000000000..907ac080c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mce-nested.docx diff --git a/sw/qa/extras/ooxmlexport/data/mce-wpg.docx b/sw/qa/extras/ooxmlexport/data/mce-wpg.docx Binary files differnew file mode 100644 index 000000000..bd0d84681 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mce-wpg.docx diff --git a/sw/qa/extras/ooxmlexport/data/mce.docx b/sw/qa/extras/ooxmlexport/data/mce.docx Binary files differnew file mode 100644 index 000000000..d4790de41 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mce.docx diff --git a/sw/qa/extras/ooxmlexport/data/missing-path.docx b/sw/qa/extras/ooxmlexport/data/missing-path.docx Binary files differnew file mode 100644 index 000000000..8d75e9f63 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/missing-path.docx diff --git a/sw/qa/extras/ooxmlexport/data/missing_newline.odt b/sw/qa/extras/ooxmlexport/data/missing_newline.odt Binary files differnew file mode 100644 index 000000000..b0f10ade8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/missing_newline.odt diff --git a/sw/qa/extras/ooxmlexport/data/mso-spt180.docx b/sw/qa/extras/ooxmlexport/data/mso-spt180.docx Binary files differnew file mode 100644 index 000000000..bf3a801a9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mso-spt180.docx diff --git a/sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx b/sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx Binary files differnew file mode 100644 index 000000000..132f23575 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/msobrightnesscontrast.docx diff --git a/sw/qa/extras/ooxmlexport/data/multi-column-line-separator-SAVED.docx b/sw/qa/extras/ooxmlexport/data/multi-column-line-separator-SAVED.docx Binary files differnew file mode 100644 index 000000000..96458833b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/multi-column-line-separator-SAVED.docx diff --git a/sw/qa/extras/ooxmlexport/data/multi-column-separator-with-line.docx b/sw/qa/extras/ooxmlexport/data/multi-column-separator-with-line.docx Binary files differnew file mode 100644 index 000000000..c19ed697b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/multi-column-separator-with-line.docx diff --git a/sw/qa/extras/ooxmlexport/data/multi-page-toc.docx b/sw/qa/extras/ooxmlexport/data/multi-page-toc.docx Binary files differnew file mode 100644 index 000000000..5b5b5949d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/multi-page-toc.docx diff --git a/sw/qa/extras/ooxmlexport/data/n592908-frame.docx b/sw/qa/extras/ooxmlexport/data/n592908-frame.docx Binary files differnew file mode 100644 index 000000000..ff59cacba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n592908-frame.docx diff --git a/sw/qa/extras/ooxmlexport/data/n592908-picture.docx b/sw/qa/extras/ooxmlexport/data/n592908-picture.docx Binary files differnew file mode 100644 index 000000000..2766d3691 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n592908-picture.docx diff --git a/sw/qa/extras/ooxmlexport/data/n652364.docx b/sw/qa/extras/ooxmlexport/data/n652364.docx Binary files differnew file mode 100644 index 000000000..0845509e8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n652364.docx diff --git a/sw/qa/extras/ooxmlexport/data/n693238.docx b/sw/qa/extras/ooxmlexport/data/n693238.docx Binary files differnew file mode 100644 index 000000000..5bcda0fff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n693238.docx diff --git a/sw/qa/extras/ooxmlexport/data/n705956-1.docx b/sw/qa/extras/ooxmlexport/data/n705956-1.docx Binary files differnew file mode 100644 index 000000000..edff3bac4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n705956-1.docx diff --git a/sw/qa/extras/ooxmlexport/data/n705956-2.docx b/sw/qa/extras/ooxmlexport/data/n705956-2.docx Binary files differnew file mode 100644 index 000000000..138818523 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n705956-2.docx diff --git a/sw/qa/extras/ooxmlexport/data/n747461.docx b/sw/qa/extras/ooxmlexport/data/n747461.docx Binary files differnew file mode 100644 index 000000000..1064e5db0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n747461.docx diff --git a/sw/qa/extras/ooxmlexport/data/n750255.docx b/sw/qa/extras/ooxmlexport/data/n750255.docx Binary files differnew file mode 100644 index 000000000..a0c737002 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n750255.docx diff --git a/sw/qa/extras/ooxmlexport/data/n750935.docx b/sw/qa/extras/ooxmlexport/data/n750935.docx Binary files differnew file mode 100644 index 000000000..0dd01592d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n750935.docx diff --git a/sw/qa/extras/ooxmlexport/data/n751054.docx b/sw/qa/extras/ooxmlexport/data/n751054.docx Binary files differnew file mode 100644 index 000000000..49d7d6af9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n751054.docx diff --git a/sw/qa/extras/ooxmlexport/data/n751117.docx b/sw/qa/extras/ooxmlexport/data/n751117.docx Binary files differnew file mode 100644 index 000000000..17cc9c53d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n751117.docx diff --git a/sw/qa/extras/ooxmlexport/data/n764005.docx b/sw/qa/extras/ooxmlexport/data/n764005.docx Binary files differnew file mode 100644 index 000000000..1c0dd9d07 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n764005.docx diff --git a/sw/qa/extras/ooxmlexport/data/n766481.docx b/sw/qa/extras/ooxmlexport/data/n766481.docx Binary files differnew file mode 100644 index 000000000..e1521ec82 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n766481.docx diff --git a/sw/qa/extras/ooxmlexport/data/n766487.docx b/sw/qa/extras/ooxmlexport/data/n766487.docx Binary files differnew file mode 100644 index 000000000..85eda0e7e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n766487.docx diff --git a/sw/qa/extras/ooxmlexport/data/n775906.docx b/sw/qa/extras/ooxmlexport/data/n775906.docx Binary files differnew file mode 100644 index 000000000..6b6dd1a6b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n775906.docx diff --git a/sw/qa/extras/ooxmlexport/data/n777337.docx b/sw/qa/extras/ooxmlexport/data/n777337.docx Binary files differnew file mode 100644 index 000000000..8bb377dcf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n777337.docx diff --git a/sw/qa/extras/ooxmlexport/data/n778828.docx b/sw/qa/extras/ooxmlexport/data/n778828.docx Binary files differnew file mode 100644 index 000000000..ad2e22d17 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n778828.docx diff --git a/sw/qa/extras/ooxmlexport/data/n778836.docx b/sw/qa/extras/ooxmlexport/data/n778836.docx Binary files differnew file mode 100644 index 000000000..ccd89e85b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n778836.docx diff --git a/sw/qa/extras/ooxmlexport/data/n779630.docx b/sw/qa/extras/ooxmlexport/data/n779630.docx Binary files differnew file mode 100644 index 000000000..97812d66c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n779630.docx diff --git a/sw/qa/extras/ooxmlexport/data/n779642.docx b/sw/qa/extras/ooxmlexport/data/n779642.docx Binary files differnew file mode 100644 index 000000000..2fe9a1766 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n779642.docx diff --git a/sw/qa/extras/ooxmlexport/data/n779834.docx b/sw/qa/extras/ooxmlexport/data/n779834.docx Binary files differnew file mode 100644 index 000000000..24b6db1a4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n779834.docx diff --git a/sw/qa/extras/ooxmlexport/data/n779941.docx b/sw/qa/extras/ooxmlexport/data/n779941.docx Binary files differnew file mode 100644 index 000000000..9889d81e2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n779941.docx diff --git a/sw/qa/extras/ooxmlexport/data/n780563.docx b/sw/qa/extras/ooxmlexport/data/n780563.docx Binary files differnew file mode 100644 index 000000000..508dc7474 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n780563.docx diff --git a/sw/qa/extras/ooxmlexport/data/n780843.docx b/sw/qa/extras/ooxmlexport/data/n780843.docx Binary files differnew file mode 100644 index 000000000..9b92f79aa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n780843.docx diff --git a/sw/qa/extras/ooxmlexport/data/n780843b.docx b/sw/qa/extras/ooxmlexport/data/n780843b.docx Binary files differnew file mode 100644 index 000000000..2ba9ab2c6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n780843b.docx diff --git a/sw/qa/extras/ooxmlexport/data/n780853.docx b/sw/qa/extras/ooxmlexport/data/n780853.docx Binary files differnew file mode 100644 index 000000000..fed8276fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n780853.docx diff --git a/sw/qa/extras/ooxmlexport/data/n782345.docx b/sw/qa/extras/ooxmlexport/data/n782345.docx Binary files differnew file mode 100644 index 000000000..f25709fed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n782345.docx diff --git a/sw/qa/extras/ooxmlexport/data/n783638.docx b/sw/qa/extras/ooxmlexport/data/n783638.docx Binary files differnew file mode 100644 index 000000000..93b587b92 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n783638.docx diff --git a/sw/qa/extras/ooxmlexport/data/n785767.docx b/sw/qa/extras/ooxmlexport/data/n785767.docx Binary files differnew file mode 100644 index 000000000..db356769b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n785767.docx diff --git a/sw/qa/extras/ooxmlexport/data/n789482.docx b/sw/qa/extras/ooxmlexport/data/n789482.docx Binary files differnew file mode 100644 index 000000000..493e8ee04 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n789482.docx diff --git a/sw/qa/extras/ooxmlexport/data/n792778.docx b/sw/qa/extras/ooxmlexport/data/n792778.docx Binary files differnew file mode 100644 index 000000000..d9541d4cc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n792778.docx diff --git a/sw/qa/extras/ooxmlexport/data/n793262.docx b/sw/qa/extras/ooxmlexport/data/n793262.docx Binary files differnew file mode 100644 index 000000000..7f2d2e0a8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n793262.docx diff --git a/sw/qa/extras/ooxmlexport/data/n793998.docx b/sw/qa/extras/ooxmlexport/data/n793998.docx Binary files differnew file mode 100644 index 000000000..fc96e2e97 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n793998.docx diff --git a/sw/qa/extras/ooxmlexport/data/n816593.docx b/sw/qa/extras/ooxmlexport/data/n816593.docx Binary files differnew file mode 100644 index 000000000..7d784e69d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n816593.docx diff --git a/sw/qa/extras/ooxmlexport/data/n820509.docx b/sw/qa/extras/ooxmlexport/data/n820509.docx Binary files differnew file mode 100644 index 000000000..bfaea9075 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n820509.docx diff --git a/sw/qa/extras/ooxmlexport/data/n822175.odt b/sw/qa/extras/ooxmlexport/data/n822175.odt Binary files differnew file mode 100644 index 000000000..d49a59194 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n822175.odt diff --git a/sw/qa/extras/ooxmlexport/data/n830205.docx b/sw/qa/extras/ooxmlexport/data/n830205.docx Binary files differnew file mode 100644 index 000000000..89cf1d843 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/n830205.docx diff --git a/sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx b/sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx Binary files differnew file mode 100644 index 000000000..3ae73db5c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/negative-cell-margin-twips.docx diff --git a/sw/qa/extras/ooxmlexport/data/nested-text-frames.odt b/sw/qa/extras/ooxmlexport/data/nested-text-frames.odt Binary files differnew file mode 100644 index 000000000..d2106f980 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/nested-text-frames.odt diff --git a/sw/qa/extras/ooxmlexport/data/nestedAlternateContent.docx b/sw/qa/extras/ooxmlexport/data/nestedAlternateContent.docx Binary files differnew file mode 100644 index 000000000..5b6b03c1a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/nestedAlternateContent.docx diff --git a/sw/qa/extras/ooxmlexport/data/no-numlevel-but-indented.odt b/sw/qa/extras/ooxmlexport/data/no-numlevel-but-indented.odt Binary files differnew file mode 100644 index 000000000..e435acdad --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/no-numlevel-but-indented.odt diff --git a/sw/qa/extras/ooxmlexport/data/noDefault.docx b/sw/qa/extras/ooxmlexport/data/noDefault.docx Binary files differnew file mode 100644 index 000000000..56bc26691 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/noDefault.docx diff --git a/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx b/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx Binary files differnew file mode 100644 index 000000000..345a55b5c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx diff --git a/sw/qa/extras/ooxmlexport/data/nonbmpchar.docx b/sw/qa/extras/ooxmlexport/data/nonbmpchar.docx Binary files differnew file mode 100644 index 000000000..a6b5d416c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/nonbmpchar.docx diff --git a/sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx b/sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx Binary files differnew file mode 100644 index 000000000..fe3142d54 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx diff --git a/sw/qa/extras/ooxmlexport/data/num-override-start.docx b/sw/qa/extras/ooxmlexport/data/num-override-start.docx Binary files differnew file mode 100644 index 000000000..b57a02cde --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/num-override-start.docx diff --git a/sw/qa/extras/ooxmlexport/data/num-parent-style.docx b/sw/qa/extras/ooxmlexport/data/num-parent-style.docx Binary files differnew file mode 100644 index 000000000..4b8c657af --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/num-parent-style.docx diff --git a/sw/qa/extras/ooxmlexport/data/numbering-font.docx b/sw/qa/extras/ooxmlexport/data/numbering-font.docx Binary files differnew file mode 100644 index 000000000..ccbbd9ed8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/numbering-font.docx diff --git a/sw/qa/extras/ooxmlexport/data/numbering1.docx b/sw/qa/extras/ooxmlexport/data/numbering1.docx Binary files differnew file mode 100644 index 000000000..55b4af3e8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/numbering1.docx diff --git a/sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt b/sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt Binary files differnew file mode 100644 index 000000000..0ced2b63a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/numlist-zhcn.odt diff --git a/sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt b/sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt Binary files differnew file mode 100644 index 000000000..62a729d51 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/numlist-zhtw.odt diff --git a/sw/qa/extras/ooxmlexport/data/object_cross_reference.odt b/sw/qa/extras/ooxmlexport/data/object_cross_reference.odt Binary files differnew file mode 100644 index 000000000..18b02a38c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/object_cross_reference.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo106020-1.odt b/sw/qa/extras/ooxmlexport/data/ooo106020-1.odt Binary files differnew file mode 100644 index 000000000..9cc774b17 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo106020-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo34469-1.odt b/sw/qa/extras/ooxmlexport/data/ooo34469-1.odt Binary files differnew file mode 100644 index 000000000..7cf031fb2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo34469-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf b/sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf new file mode 100644 index 000000000..df1467e4f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf @@ -0,0 +1,42 @@ +{\rtf1\ansi\ansicpg1250\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1060\deflangfe1060{\fonttbl{\f0\froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
+{\f1\fswiss\fcharset238\fprq2{\*\panose 020b0604020202020204}Arial;}{\f40\froman\fcharset0\fprq2 Times New Roman;}{\f39\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f41\froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f42\froman\fcharset162\fprq2 Times New Roman Tur;}{\f43\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f44\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f45\froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f46\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f50\fswiss\fcharset0\fprq2 Arial;}{\f49\fswiss\fcharset204\fprq2 Arial Cyr;}{\f51\fswiss\fcharset161\fprq2 Arial Greek;}{\f52\fswiss\fcharset162\fprq2 Arial Tur;}
+{\f53\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f54\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f55\fswiss\fcharset186\fprq2 Arial Baltic;}{\f56\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 \snext0 Normal;}{\*\cs10 \additive
+\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid3551688\rsid4459474}
+{\*\generator Microsoft Word 11.0.6359;}{\info{\author robi01}{\doccomm Produced by: PsQRFilters V2.11 for QuickReport (www.pragnaan.com)}{\operator robi01}{\creatim\yr2004\mo12\dy16\hr12\min51}{\revtim\yr2004\mo12\dy16\hr12\min51}{\version2}{\edmins1}
+{\nofpages1}{\nofwords256}{\nofchars1465}{\nofcharsws1718}{\vern24703}}\paperw11906\paperh16838\margl567\margr567\margt283\margb283 \widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120
+\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot3551688 \fet0\sectd \linex0\headery0\footery0\colsx708\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}
+{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
+{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9
+\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 {\lang1024\langfe1024\noproof\insrsid3551688
+}
+{\f1\insrsid3551688 \par }
+
+\pard \ql \li0\ri0\nowidctlpar\pvpg\phpg\posx702\posy11927\absw1095\faauto\rin0\lin0\itap0 {\f1\fs16\cf1\insrsid3551688
+\par }
+\pard \ql \li0\ri0\nowidctlpar\pvpg\phpg\posx1782\posy11927\absw1695\faauto\rin0\lin0\itap0 {\lang1024\langfe1024\noproof\insrsid3551688
+}
+
+\pard \qr \li0\ri0\nowidctlpar\pvpg\phpg\posx7347\posy11492\absw1785\faauto\rin0\lin0\itap0 {\b\f1\fs16\cf1\insrsid3551688 Za pla\'e8ilo: }
+
+{\lang1024\langfe1024\noproof\insrsid3551688
+{\shp{\*\shpinst\shpleft687\shptop12452\shpright11248\shpbottom13593\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz7\shplid1033{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}
+{\sp{\sn lTxid}{\sv 65536}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fShadow}{\sv 0}}
+{\sp{\sn posrelh}{\sv 1}}{\sp{\sn posrelv}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}{\sp{\sn fBehindDocument}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}{\shptxt \pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0
+\fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 {\b\f1\fs16\expnd-1\expndtw-6\insrsid3551688
+\par
+\par Pla\'e8ilo izvr\'9aite na transakcijski ra\'e8un NLB in se sklicujte na \'9atevilko predra\'e8una
+\par Do popolnega pla\'e8ila ostaja predmet pogodbe last podjetja TI, d.o.o. }{\f1\fs16\expnd-1\expndtw-6\insrsid3551688
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs16\expnd-1\expndtw-6\insrsid3551688
+\par }{\f1\insrsid3551688 _}}}{\shprslt{\*\do\dobxpage\dobypage\dodhgt7\dptxbx\dptxlrtb{\dptxbxtext\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 {\b\f1\fs16\expnd-1\expndtw-6\insrsid3551688
+\par
+\par Pla\'e8ilo izvr\'9aite na transakcijski ra\'e8un NLB in se sklicujte na \'9atevilko predra\'e8una
+\par Do popolnega pla\'e8ila ostaja predmet pogodbe last podjetja TI, d.o.o. }{\f1\fs16\expnd-1\expndtw-6\insrsid3551688
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs16\expnd-1\expndtw-6\insrsid3551688
+\par }{\f1\insrsid3551688 _}}\dpx687\dpy12452\dpxsize10561\dpysize1141\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat0\dplinehollow}}}}
+
+}
diff --git a/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt b/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt Binary files differnew file mode 100644 index 000000000..ee8d13935 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo47778-3.odt b/sw/qa/extras/ooxmlexport/data/ooo47778-3.odt Binary files differnew file mode 100644 index 000000000..69005b11e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo47778-3.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo47778-4.odt b/sw/qa/extras/ooxmlexport/data/ooo47778-4.odt Binary files differnew file mode 100644 index 000000000..ae6b56b8c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo47778-4.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo67471-2.odt b/sw/qa/extras/ooxmlexport/data/ooo67471-2.odt Binary files differnew file mode 100644 index 000000000..82daa5776 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo67471-2.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo72950-1.odt b/sw/qa/extras/ooxmlexport/data/ooo72950-1.odt Binary files differnew file mode 100644 index 000000000..df0ac9182 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo72950-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt b/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt Binary files differnew file mode 100644 index 000000000..35a1858e5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt diff --git a/sw/qa/extras/ooxmlexport/data/ooxml-triangle.docx b/sw/qa/extras/ooxmlexport/data/ooxml-triangle.docx Binary files differnew file mode 100644 index 000000000..4279fbfb0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooxml-triangle.docx diff --git a/sw/qa/extras/ooxmlexport/data/open-as-read-only.docx b/sw/qa/extras/ooxmlexport/data/open-as-read-only.docx Binary files differnew file mode 100644 index 000000000..057c67ff6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/open-as-read-only.docx diff --git a/sw/qa/extras/ooxmlexport/data/outline-number-types.odt b/sw/qa/extras/ooxmlexport/data/outline-number-types.odt Binary files differnew file mode 100644 index 000000000..2232ad64c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/outline-number-types.odt diff --git a/sw/qa/extras/ooxmlexport/data/page-background.docx b/sw/qa/extras/ooxmlexport/data/page-background.docx Binary files differnew file mode 100644 index 000000000..8c1f2ebdb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-background.docx diff --git a/sw/qa/extras/ooxmlexport/data/page-border-shadow.docx b/sw/qa/extras/ooxmlexport/data/page-border-shadow.docx Binary files differnew file mode 100644 index 000000000..65a2273f6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-border-shadow.docx diff --git a/sw/qa/extras/ooxmlexport/data/page-borders-export-case-2.docx b/sw/qa/extras/ooxmlexport/data/page-borders-export-case-2.docx Binary files differnew file mode 100644 index 000000000..f06471ecb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-borders-export-case-2.docx diff --git a/sw/qa/extras/ooxmlexport/data/page-break-before.docx b/sw/qa/extras/ooxmlexport/data/page-break-before.docx Binary files differnew file mode 100644 index 000000000..99d8c3a5d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-break-before.docx diff --git a/sw/qa/extras/ooxmlexport/data/page-content-bottom.docx b/sw/qa/extras/ooxmlexport/data/page-content-bottom.docx Binary files differnew file mode 100644 index 000000000..f955586f3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-content-bottom.docx diff --git a/sw/qa/extras/ooxmlexport/data/page-graphic-background.odt b/sw/qa/extras/ooxmlexport/data/page-graphic-background.odt Binary files differnew file mode 100644 index 000000000..15050e630 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-graphic-background.odt diff --git a/sw/qa/extras/ooxmlexport/data/pageBreak_after.odt b/sw/qa/extras/ooxmlexport/data/pageBreak_after.odt Binary files differnew file mode 100644 index 000000000..c3096b58a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/pageBreak_after.odt diff --git a/sw/qa/extras/ooxmlexport/data/pagerelsize.docx b/sw/qa/extras/ooxmlexport/data/pagerelsize.docx Binary files differnew file mode 100644 index 000000000..3b6c1ff44 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/pagerelsize.docx diff --git a/sw/qa/extras/ooxmlexport/data/para-adjust-distribute.docx b/sw/qa/extras/ooxmlexport/data/para-adjust-distribute.docx Binary files differnew file mode 100644 index 000000000..5389a7537 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/para-adjust-distribute.docx diff --git a/sw/qa/extras/ooxmlexport/data/para-auto-spacing.docx b/sw/qa/extras/ooxmlexport/data/para-auto-spacing.docx Binary files differnew file mode 100644 index 000000000..3cc8bd6fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/para-auto-spacing.docx diff --git a/sw/qa/extras/ooxmlexport/data/para-shading.docx b/sw/qa/extras/ooxmlexport/data/para-shading.docx Binary files differnew file mode 100644 index 000000000..9c2af1ad5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/para-shading.docx diff --git a/sw/qa/extras/ooxmlexport/data/para-shadow.docx b/sw/qa/extras/ooxmlexport/data/para-shadow.docx Binary files differnew file mode 100644 index 000000000..d35d5f958 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/para-shadow.docx diff --git a/sw/qa/extras/ooxmlexport/data/paragraph-mark-nonempty.odt b/sw/qa/extras/ooxmlexport/data/paragraph-mark-nonempty.odt Binary files differnew file mode 100644 index 000000000..b12cbf607 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/paragraph-mark-nonempty.odt diff --git a/sw/qa/extras/ooxmlexport/data/paragraph-mark.docx b/sw/qa/extras/ooxmlexport/data/paragraph-mark.docx Binary files differnew file mode 100644 index 000000000..4636e4d36 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/paragraph-mark.docx diff --git a/sw/qa/extras/ooxmlexport/data/paragraph-mark2.docx b/sw/qa/extras/ooxmlexport/data/paragraph-mark2.docx Binary files differnew file mode 100644 index 000000000..a465813dc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/paragraph-mark2.docx diff --git a/sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx b/sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx Binary files differnew file mode 100644 index 000000000..c86f599ed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx diff --git a/sw/qa/extras/ooxmlexport/data/paragraphWithComments.docx b/sw/qa/extras/ooxmlexport/data/paragraphWithComments.docx Binary files differnew file mode 100644 index 000000000..84a6f20a1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/paragraphWithComments.docx diff --git a/sw/qa/extras/ooxmlexport/data/parasplit-on-section-border.odt b/sw/qa/extras/ooxmlexport/data/parasplit-on-section-border.odt Binary files differnew file mode 100644 index 000000000..8a6e4aeb4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/parasplit-on-section-border.odt diff --git a/sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docx b/sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docx Binary files differnew file mode 100644 index 000000000..85f31d8c3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/picture-effects-preservation.docx b/sw/qa/extras/ooxmlexport/data/picture-effects-preservation.docx Binary files differnew file mode 100644 index 000000000..d26def49f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture-effects-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx b/sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx Binary files differnew file mode 100644 index 000000000..bfee0e141 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture-with-schemecolor.docx diff --git a/sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx b/sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx Binary files differnew file mode 100644 index 000000000..f858a05ad --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx diff --git a/sw/qa/extras/ooxmlexport/data/pictureWatermark.docx b/sw/qa/extras/ooxmlexport/data/pictureWatermark.docx Binary files differnew file mode 100644 index 000000000..b526ecf37 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/pictureWatermark.docx diff --git a/sw/qa/extras/ooxmlexport/data/picture_colormode_black_white.odt b/sw/qa/extras/ooxmlexport/data/picture_colormode_black_white.odt Binary files differnew file mode 100644 index 000000000..b2166bdd3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture_colormode_black_white.odt diff --git a/sw/qa/extras/ooxmlexport/data/picture_colormode_grayscale.docx b/sw/qa/extras/ooxmlexport/data/picture_colormode_grayscale.docx Binary files differnew file mode 100644 index 000000000..2bc6458ed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture_colormode_grayscale.docx diff --git a/sw/qa/extras/ooxmlexport/data/picture_colormode_watermark.odt b/sw/qa/extras/ooxmlexport/data/picture_colormode_watermark.odt Binary files differnew file mode 100644 index 000000000..70dd5e908 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/picture_colormode_watermark.odt diff --git a/sw/qa/extras/ooxmlexport/data/plausable-border.docx b/sw/qa/extras/ooxmlexport/data/plausable-border.docx Binary files differnew file mode 100644 index 000000000..c6f049fe2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/plausable-border.docx diff --git a/sw/qa/extras/ooxmlexport/data/position-and-rotation.docx b/sw/qa/extras/ooxmlexport/data/position-and-rotation.docx Binary files differnew file mode 100644 index 000000000..d883ad32e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/position-and-rotation.docx diff --git a/sw/qa/extras/ooxmlexport/data/preserve_Z_field_TOC.docx b/sw/qa/extras/ooxmlexport/data/preserve_Z_field_TOC.docx Binary files differnew file mode 100644 index 000000000..63ae40287 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/preserve_Z_field_TOC.docx diff --git a/sw/qa/extras/ooxmlexport/data/preset-shape.docx b/sw/qa/extras/ooxmlexport/data/preset-shape.docx Binary files differnew file mode 100644 index 000000000..922b906e2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/preset-shape.docx diff --git a/sw/qa/extras/ooxmlexport/data/protectedform.docx b/sw/qa/extras/ooxmlexport/data/protectedform.docx Binary files differnew file mode 100644 index 000000000..a67d88006 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/protectedform.docx diff --git a/sw/qa/extras/ooxmlexport/data/quicktables.docx b/sw/qa/extras/ooxmlexport/data/quicktables.docx Binary files differnew file mode 100644 index 000000000..5060d3dba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/quicktables.docx diff --git a/sw/qa/extras/ooxmlexport/data/rel-size-round.docx b/sw/qa/extras/ooxmlexport/data/rel-size-round.docx Binary files differnew file mode 100644 index 000000000..ccd076a15 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rel-size-round.docx diff --git a/sw/qa/extras/ooxmlexport/data/relative-link.docx b/sw/qa/extras/ooxmlexport/data/relative-link.docx Binary files differnew file mode 100644 index 000000000..c3688f3e8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/relative-link.docx diff --git a/sw/qa/extras/ooxmlexport/data/relorientation.docx b/sw/qa/extras/ooxmlexport/data/relorientation.docx Binary files differnew file mode 100644 index 000000000..22a04538b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/relorientation.docx diff --git a/sw/qa/extras/ooxmlexport/data/rhbz1180114.docx b/sw/qa/extras/ooxmlexport/data/rhbz1180114.docx Binary files differnew file mode 100644 index 000000000..23009ebbd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rhbz1180114.docx diff --git a/sw/qa/extras/ooxmlexport/data/rhbz988516.docx b/sw/qa/extras/ooxmlexport/data/rhbz988516.docx Binary files differnew file mode 100644 index 000000000..38e2dcff3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rhbz988516.docx diff --git a/sw/qa/extras/ooxmlexport/data/rot180-flipv.docx b/sw/qa/extras/ooxmlexport/data/rot180-flipv.docx Binary files differnew file mode 100644 index 000000000..2a8bb1967 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rot180-flipv.docx diff --git a/sw/qa/extras/ooxmlexport/data/rot270-flipv.docx b/sw/qa/extras/ooxmlexport/data/rot270-flipv.docx Binary files differnew file mode 100644 index 000000000..0aa19e08a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rot270-flipv.docx diff --git a/sw/qa/extras/ooxmlexport/data/rot90-fliph.docx b/sw/qa/extras/ooxmlexport/data/rot90-fliph.docx Binary files differnew file mode 100644 index 000000000..c2a916d80 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rot90-fliph.docx diff --git a/sw/qa/extras/ooxmlexport/data/rotated_shape.fodt b/sw/qa/extras/ooxmlexport/data/rotated_shape.fodt new file mode 100644 index 000000000..fce84f93e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rotated_shape.fodt @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/> + <style:font-face style:name="Lucida Sans" svg:font-family="'Lucida Sans'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="NSimSun" svg:font-family="NSimSun" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Times New Roman" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Times New Roman" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> + <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph"> + <style:paragraph-properties style:writing-mode="lr-tb"/> + </style:style> + <style:style style:name="P2" style:family="paragraph"> + <loext:graphic-properties draw:fill="none" draw:fill-color="#ffffff"/> + <style:paragraph-properties style:writing-mode="lr-tb"/> + <style:text-properties fo:font-size="11pt"/> + </style:style> + <style:style style:name="T1" style:family="text"> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="7pt" fo:language="de" fo:country="DE" style:font-name-asian="Times New Roman" style:font-size-asian="7pt" style:font-name-complex="Arial" style:font-size-complex="12pt" style:language-complex="ar" style:country-complex="SA"/> + </style:style> + <style:style style:name="gr1" style:family="graphic"> + <style:graphic-properties draw:stroke="none" draw:fill="none" draw:fill-color="#ffffff" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" draw:auto-grow-width="false" fo:padding-top="0.254cm" fo:padding-bottom="0.254cm" fo:padding-left="0.127cm" fo:padding-right="0.127cm" fo:wrap-option="wrap" draw:shadow="hidden" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/> + <style:paragraph-properties style:writing-mode="lr-tb"/> + </style:style> + <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"> + <style:graphic-properties style:horizontal-pos="from-left" style:horizontal-rel="paragraph" style:vertical-pos="from-top" style:vertical-rel="page" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <draw:frame text:anchor-type="page" text:anchor-page-number="1" draw:z-index="0" draw:name="Shape1" draw:style-name="gr1" draw:text-style-name="P2" svg:width="5.896cm" svg:height="0.957cm" draw:transform="rotate (1.5707963267949) translate (1.13418055555556cm 26.0579305555556cm)"> + <draw:text-box> + <text:p text:style-name="P1"><text:span text:style-name="T1"><text:s/></text:span><text:span text:style-name="T1">Foo</text:span></text:p> + </draw:text-box> + </draw:frame><draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="page" text:anchor-page-number="1" svg:width="0.67cm" svg:height="0.67cm" draw:z-index="0"><draw:image draw:mime-type="image/png" svg:x="2cm" svg:y="3cm"> + <office:binary-data>iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAAXNSR0IArs4c6QAAAAZiS0dE + AP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJBhI0A6HXrrIAAABl + SURBVDjLY/z//z8DtQATMYokl7D8p4phMIOIMZCJFBcRMpCJVK/hM5CJnDDCJc9EbmBjU8dE + jkG41DPhM+h5zB9GfHx0fTgjAJtGfOIMDAwMLMQoItZAJgYqglHDhpNhjNQsaQHF4y3hS/bS + HgAAAABJRU5ErkJggg== + </office:binary-data> + </draw:image> + </draw:frame> + <text:p text:style-name="Standard"/> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/rprchange_closed.docx b/sw/qa/extras/ooxmlexport/data/rprchange_closed.docx Binary files differnew file mode 100644 index 000000000..ff53871e9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rprchange_closed.docx diff --git a/sw/qa/extras/ooxmlexport/data/rubyhyperlink.fodt b/sw/qa/extras/ooxmlexport/data/rubyhyperlink.fodt new file mode 100644 index 000000000..a201d7c34 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/rubyhyperlink.fodt @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + + <office:font-face-decls> + <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Sans CN Normal" svg:font-family="'Source Han Sans CN Normal'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Normal" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text"> + <style:text-properties fo:color="#000080" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/> + </style:style> + + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> + <style:text-properties officeooo:rsid="001000a5" officeooo:paragraph-rsid="001000a5"/> + </style:style> + <style:style style:name="Ru1" style:family="ruby"> + <style:ruby-properties style:ruby-align="left" style:ruby-position="above"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <text:p text:style-name="P1"><text:ruby text:style-name="Ru1"><text:ruby-base>bar</text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby></text:p> + <text:p text:style-name="P1">foo<text:ruby text:style-name="Ru1"><text:ruby-base>bar</text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby>baz</text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:ruby text:style-name="Ru1"><text:ruby-base>bar</text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby>baz</text:p> + <text:p text:style-name="P1">foo<text:ruby text:style-name="Ru1"><text:ruby-base><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">bar</text:a></text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby>baz</text:p> + <text:p text:style-name="P1">foo<text:ruby text:style-name="Ru1"><text:ruby-base>bar</text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">baz</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:ruby text:style-name="Ru1"><text:ruby-base><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">bar</text:a></text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby>baz</text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:ruby text:style-name="Ru1"><text:ruby-base>bar</text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">baz</text:a></text:p> + <text:p text:style-name="P1">foo<text:ruby text:style-name="Ru1"><text:ruby-base><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">bar</text:a></text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">baz</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:ruby text:style-name="Ru1"><text:ruby-base><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">bar</text:a></text:ruby-base><text:ruby-text>quux</text:ruby-text></text:ruby><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">baz</text:a></text:p> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/sample.dotx b/sw/qa/extras/ooxmlexport/data/sample.dotx Binary files differnew file mode 100644 index 000000000..c0f4062c1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sample.dotx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-2-para.docx b/sw/qa/extras/ooxmlexport/data/sdt-2-para.docx Binary files differnew file mode 100644 index 000000000..b6d6565d6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-2-para.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-2-run.docx b/sw/qa/extras/ooxmlexport/data/sdt-2-run.docx Binary files differnew file mode 100644 index 000000000..6063ebc41 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-2-run.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-alias.docx b/sw/qa/extras/ooxmlexport/data/sdt-alias.docx Binary files differnew file mode 100644 index 000000000..f46ef693a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-alias.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx b/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx Binary files differnew file mode 100644 index 000000000..a83a76885 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-before-field.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx b/sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx Binary files differnew file mode 100644 index 000000000..cd97f934a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-company-multipara.docx b/sw/qa/extras/ooxmlexport/data/sdt-company-multipara.docx Binary files differnew file mode 100644 index 000000000..96d25ff75 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-company-multipara.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx b/sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx Binary files differnew file mode 100644 index 000000000..038ab111d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-header.docx b/sw/qa/extras/ooxmlexport/data/sdt-header.docx Binary files differnew file mode 100644 index 000000000..6a4bdfb2d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-header.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-ignored-footer.docx b/sw/qa/extras/ooxmlexport/data/sdt-ignored-footer.docx Binary files differnew file mode 100644 index 000000000..8330291af --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-ignored-footer.docx diff --git a/sw/qa/extras/ooxmlexport/data/sdt-run-picture.docx b/sw/qa/extras/ooxmlexport/data/sdt-run-picture.docx Binary files differnew file mode 100644 index 000000000..fa2d57c2b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sdt-run-picture.docx diff --git a/sw/qa/extras/ooxmlexport/data/section_break_numbering.docx b/sw/qa/extras/ooxmlexport/data/section_break_numbering.docx Binary files differnew file mode 100644 index 000000000..8b5378a77 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/section_break_numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/sectionprot.odt b/sw/qa/extras/ooxmlexport/data/sectionprot.odt Binary files differnew file mode 100644 index 000000000..1effc1951 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sectionprot.odt diff --git a/sw/qa/extras/ooxmlexport/data/sectionprot2.odt b/sw/qa/extras/ooxmlexport/data/sectionprot2.odt Binary files differnew file mode 100644 index 000000000..8f4a283f8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/sectionprot2.odt diff --git a/sw/qa/extras/ooxmlexport/data/shape-3d-effect-preservation.docx b/sw/qa/extras/ooxmlexport/data/shape-3d-effect-preservation.docx Binary files differnew file mode 100644 index 000000000..1e361bd4e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/shape-3d-effect-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx Binary files differnew file mode 100644 index 000000000..f2b91ea45 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/shape-in-floattable.docx b/sw/qa/extras/ooxmlexport/data/shape-in-floattable.docx Binary files differnew file mode 100644 index 000000000..46af86182 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/shape-in-floattable.docx diff --git a/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx Binary files differnew file mode 100644 index 000000000..134f629fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/signature-line-all-props-set.docx b/sw/qa/extras/ooxmlexport/data/signature-line-all-props-set.docx Binary files differnew file mode 100644 index 000000000..2f8401bf5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/signature-line-all-props-set.docx diff --git a/sw/qa/extras/ooxmlexport/data/simple-sdts.docx b/sw/qa/extras/ooxmlexport/data/simple-sdts.docx Binary files differnew file mode 100644 index 000000000..95c5d00a6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/simple-sdts.docx diff --git a/sw/qa/extras/ooxmlexport/data/smartart.docx b/sw/qa/extras/ooxmlexport/data/smartart.docx Binary files differnew file mode 100644 index 000000000..7a553f425 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/smartart.docx diff --git a/sw/qa/extras/ooxmlexport/data/strict-smartart.docx b/sw/qa/extras/ooxmlexport/data/strict-smartart.docx Binary files differnew file mode 100644 index 000000000..bab7c16bc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/strict-smartart.docx diff --git a/sw/qa/extras/ooxmlexport/data/strict.docx b/sw/qa/extras/ooxmlexport/data/strict.docx Binary files differnew file mode 100644 index 000000000..b46ce94b3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/strict.docx diff --git a/sw/qa/extras/ooxmlexport/data/style-inheritance.docx b/sw/qa/extras/ooxmlexport/data/style-inheritance.docx Binary files differnew file mode 100644 index 000000000..65ca38aed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/style-inheritance.docx diff --git a/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx b/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx Binary files differnew file mode 100644 index 000000000..5d27260ca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-alignment.docx b/sw/qa/extras/ooxmlexport/data/table-alignment.docx Binary files differnew file mode 100644 index 000000000..e1efaaefd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-alignment.docx 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 Binary files differnew file mode 100644 index 000000000..557edcb3c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size.docx 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 Binary files differnew file mode 100644 index 000000000..2125f09da --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-auto-column-fixed-size2.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-auto-nested.docx b/sw/qa/extras/ooxmlexport/data/table-auto-nested.docx Binary files differnew file mode 100644 index 000000000..85f47dbba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-auto-nested.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-black_fill.docx b/sw/qa/extras/ooxmlexport/data/table-black_fill.docx Binary files differnew file mode 100644 index 000000000..c9d4e2289 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-black_fill.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-borders.docx b/sw/qa/extras/ooxmlexport/data/table-borders.docx Binary files differnew file mode 100644 index 000000000..a18a93e79 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-borders.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlexport/data/table-btlr-center.docx Binary files differnew file mode 100644 index 000000000..79cb53eed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-btlr-center.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-cell-margin.docx b/sw/qa/extras/ooxmlexport/data/table-cell-margin.docx Binary files differnew file mode 100644 index 000000000..f59a5da11 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-cell-margin.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-floating-margins.docx b/sw/qa/extras/ooxmlexport/data/table-floating-margins.docx Binary files differnew file mode 100644 index 000000000..81f6f6cf1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-floating-margins.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-floating.docx b/sw/qa/extras/ooxmlexport/data/table-floating.docx Binary files differnew file mode 100644 index 000000000..1e0cb30ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-floating.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-pagebreak.docx b/sw/qa/extras/ooxmlexport/data/table-pagebreak.docx Binary files differnew file mode 100644 index 000000000..06ecf9535 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-pagebreak.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-position-14.docx b/sw/qa/extras/ooxmlexport/data/table-position-14.docx Binary files differnew file mode 100644 index 000000000..f59a5da11 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-position-14.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-position-15.docx b/sw/qa/extras/ooxmlexport/data/table-position-15.docx Binary files differnew file mode 100644 index 000000000..91fbdbef0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-position-15.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx b/sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx Binary files differnew file mode 100644 index 000000000..00c63d8fc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-rtl.docx b/sw/qa/extras/ooxmlexport/data/table-rtl.docx Binary files differnew file mode 100644 index 000000000..90fba0b92 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-rtl.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx Binary files differnew file mode 100644 index 000000000..d3bf3bc5d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-style-border-export.docx b/sw/qa/extras/ooxmlexport/data/table-style-border-export.docx Binary files differnew file mode 100644 index 000000000..eeb23ee84 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-style-border-export.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-style-border.docx b/sw/qa/extras/ooxmlexport/data/table-style-border.docx Binary files differnew file mode 100644 index 000000000..ceb0bd8a0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-style-border.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx b/sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx Binary files differnew file mode 100644 index 000000000..f622b9d84 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-style-cell-back-color.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-style-conf-nested.docx b/sw/qa/extras/ooxmlexport/data/table-style-conf-nested.docx Binary files differnew file mode 100644 index 000000000..e35612add --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-style-conf-nested.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-style-parprop.docx b/sw/qa/extras/ooxmlexport/data/table-style-parprop.docx Binary files differnew file mode 100644 index 000000000..1c68c704e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-style-parprop.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-style-rPr-sz.docx b/sw/qa/extras/ooxmlexport/data/table-style-rPr-sz.docx Binary files differnew file mode 100644 index 000000000..6b6f69424 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-style-rPr-sz.docx diff --git a/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx Binary files differnew file mode 100644 index 000000000..ae4ede04b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/table.fodt b/sw/qa/extras/ooxmlexport/data/table.fodt new file mode 100644 index 000000000..e8346ca42 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table.fodt @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ooo="http://openoffice.org/2004/office" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta><meta:creation-date>2020-02-07T17:21:48.094426929</meta:creation-date><dc:date>2020-02-07T17:22:23.469846014</dc:date><meta:editing-duration>PT37S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="1" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="1" meta:word-count="1" meta:character-count="3" meta:non-whitespace-character-count="3"/><meta:generator>LibreOfficeDev/7.0.0.0.alpha0$Linux_X86_64 LibreOffice_project/d2eff4b08869dd15b025c5801896e0332b14ba59</meta:generator></office:meta> + <office:font-face-decls> + <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/> + <style:font-face style:name="Calibri" svg:font-family="Calibri" style:font-family-generic="swiss"/> + <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Sans CN" svg:font-family="'Source Han Sans CN'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Calibri" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + + <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties fo:orphans="0" fo:widows="0" text:number-lines="false" text:line-number="0"/> + </style:style> + + </office:styles> + <office:automatic-styles> + <style:style style:name="Table1" style:family="table"> + <style:table-properties style:width="17cm" table:align="margins"/> + </style:style> + <style:style style:name="Table1.A" style:family="table-column"> + <style:table-column-properties style:column-width="17cm" style:rel-column-width="65535*"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:padding="0.097cm" fo:border="0.05pt solid #000000"/> + </style:style> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Contents"> + <style:text-properties officeooo:rsid="0006f2af" officeooo:paragraph-rsid="0006f2af"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <office:forms form:automatic-focus="false" form:apply-design-mode="false"/> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column table:style-name="Table1.A"/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p text:style-name="P1">foo</text:p> + </table:table-cell> + </table:table-row> + </table:table> + <text:p text:style-name="Standard"/> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/table.odt b/sw/qa/extras/ooxmlexport/data/table.odt Binary files differnew file mode 100644 index 000000000..25b2a5fea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table.odt diff --git a/sw/qa/extras/ooxmlexport/data/tableCurrupt.docx b/sw/qa/extras/ooxmlexport/data/tableCurrupt.docx Binary files differnew file mode 100644 index 000000000..1deda7ddc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tableCurrupt.docx diff --git a/sw/qa/extras/ooxmlexport/data/tablePreferredWidth.docx b/sw/qa/extras/ooxmlexport/data/tablePreferredWidth.docx Binary files differnew file mode 100644 index 000000000..6546be9b6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tablePreferredWidth.docx diff --git a/sw/qa/extras/ooxmlexport/data/table_atleast.docx b/sw/qa/extras/ooxmlexport/data/table_atleast.docx Binary files differnew file mode 100644 index 000000000..ec751aa58 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table_atleast.docx diff --git a/sw/qa/extras/ooxmlexport/data/table_cross_reference.odt b/sw/qa/extras/ooxmlexport/data/table_cross_reference.odt Binary files differnew file mode 100644 index 000000000..bd9c84016 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table_cross_reference.odt diff --git a/sw/qa/extras/ooxmlexport/data/table_cross_reference_custom_format.odt b/sw/qa/extras/ooxmlexport/data/table_cross_reference_custom_format.odt Binary files differnew file mode 100644 index 000000000..cbf03d34e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table_cross_reference_custom_format.odt diff --git a/sw/qa/extras/ooxmlexport/data/table_lineRule.docx b/sw/qa/extras/ooxmlexport/data/table_lineRule.docx Binary files differnew file mode 100644 index 000000000..d1d47ff24 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table_lineRule.docx diff --git a/sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx b/sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx Binary files differnew file mode 100644 index 000000000..003167ac3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tableborder-finedash.docx diff --git a/sw/qa/extras/ooxmlexport/data/tblppr-shape.docx b/sw/qa/extras/ooxmlexport/data/tblppr-shape.docx Binary files differnew file mode 100644 index 000000000..470bce424 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tblppr-shape.docx diff --git a/sw/qa/extras/ooxmlexport/data/tblr-height.docx b/sw/qa/extras/ooxmlexport/data/tblr-height.docx Binary files differnew file mode 100644 index 000000000..6a16c81dd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tblr-height.docx diff --git a/sw/qa/extras/ooxmlexport/data/tbrl-frame-vml.docx b/sw/qa/extras/ooxmlexport/data/tbrl-frame-vml.docx Binary files differnew file mode 100644 index 000000000..c697e5846 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tbrl-frame-vml.docx diff --git a/sw/qa/extras/ooxmlexport/data/tbrl-textbox.docx b/sw/qa/extras/ooxmlexport/data/tbrl-textbox.docx Binary files differnew file mode 100644 index 000000000..bdfcc5fff --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tbrl-textbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf100075.docx b/sw/qa/extras/ooxmlexport/data/tdf100075.docx Binary files differnew file mode 100644 index 000000000..6312050aa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf100075.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf100581.odt b/sw/qa/extras/ooxmlexport/data/tdf100581.odt Binary files differnew file mode 100644 index 000000000..f098385e3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf100581.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf100751_arrowBothFlip.docx b/sw/qa/extras/ooxmlexport/data/tdf100751_arrowBothFlip.docx Binary files differnew file mode 100644 index 000000000..8a57f69ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf100751_arrowBothFlip.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf101589_dontSplitTable.odt b/sw/qa/extras/ooxmlexport/data/tdf101589_dontSplitTable.odt Binary files differnew file mode 100644 index 000000000..4a0501882 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf101589_dontSplitTable.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf102466.docx b/sw/qa/extras/ooxmlexport/data/tdf102466.docx Binary files differnew file mode 100644 index 000000000..68a88799c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf102466.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103001.docx b/sw/qa/extras/ooxmlexport/data/tdf103001.docx Binary files differnew file mode 100644 index 000000000..332d41569 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103001.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103090.odt b/sw/qa/extras/ooxmlexport/data/tdf103090.odt Binary files differnew file mode 100644 index 000000000..d264f255a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103090.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf103389.docx b/sw/qa/extras/ooxmlexport/data/tdf103389.docx Binary files differnew file mode 100644 index 000000000..0ef80e6a1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103389.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103544.docx b/sw/qa/extras/ooxmlexport/data/tdf103544.docx Binary files differnew file mode 100644 index 000000000..2e18f2121 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103544.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103573.docx b/sw/qa/extras/ooxmlexport/data/tdf103573.docx Binary files differnew file mode 100644 index 000000000..34d7e3367 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103573.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103651.docx b/sw/qa/extras/ooxmlexport/data/tdf103651.docx Binary files differnew file mode 100644 index 000000000..de4c2d6c3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103651.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakB.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakB.docx Binary files differnew file mode 100644 index 000000000..a7b880d00 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakB.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakC.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakC.docx Binary files differnew file mode 100644 index 000000000..52767abb8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakC.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakD.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakD.docx Binary files differnew file mode 100644 index 000000000..37c752499 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakD.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakE.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakE.docx Binary files differnew file mode 100644 index 000000000..ac3eb9f7c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakE.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103976.docx b/sw/qa/extras/ooxmlexport/data/tdf103976.docx Binary files differnew file mode 100644 index 000000000..2081fcf07 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103976.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf103982.docx b/sw/qa/extras/ooxmlexport/data/tdf103982.docx Binary files differnew file mode 100644 index 000000000..13e645356 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103982.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx b/sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx Binary files differnew file mode 100644 index 000000000..b5d2a4fee --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104115.docx b/sw/qa/extras/ooxmlexport/data/tdf104115.docx Binary files differnew file mode 100644 index 000000000..9236f0e3a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104115.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104150.docx b/sw/qa/extras/ooxmlexport/data/tdf104150.docx Binary files differnew file mode 100644 index 000000000..989884642 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104150.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104162.docx b/sw/qa/extras/ooxmlexport/data/tdf104162.docx Binary files differnew file mode 100644 index 000000000..61b51c007 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104162.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx Binary files differnew file mode 100644 index 000000000..ef3d06533 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104354-2.docx b/sw/qa/extras/ooxmlexport/data/tdf104354-2.docx Binary files differnew file mode 100644 index 000000000..5b67e015f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104354-2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104354.docx b/sw/qa/extras/ooxmlexport/data/tdf104354.docx Binary files differnew file mode 100644 index 000000000..d8655f4e0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104354.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104354_firstParaInSection.docx b/sw/qa/extras/ooxmlexport/data/tdf104354_firstParaInSection.docx Binary files differnew file mode 100644 index 000000000..79ff44f25 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104354_firstParaInSection.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104420_lostParagraph.docx b/sw/qa/extras/ooxmlexport/data/tdf104420_lostParagraph.docx Binary files differnew file mode 100644 index 000000000..b5d998833 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104420_lostParagraph.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104539.odt b/sw/qa/extras/ooxmlexport/data/tdf104539.odt Binary files differnew file mode 100644 index 000000000..76be8af1f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104539.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx b/sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx Binary files differnew file mode 100644 index 000000000..514eeddba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104707_urlComment.odt b/sw/qa/extras/ooxmlexport/data/tdf104707_urlComment.odt Binary files differnew file mode 100644 index 000000000..4c63093fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104707_urlComment.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx b/sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx Binary files differnew file mode 100644 index 000000000..5114a0693 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf104797.docx b/sw/qa/extras/ooxmlexport/data/tdf104797.docx Binary files differnew file mode 100644 index 000000000..6e52190ce --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104797.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf105095.docx b/sw/qa/extras/ooxmlexport/data/tdf105095.docx Binary files differnew file mode 100644 index 000000000..0a6a7a2ac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105095.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf105215.docx b/sw/qa/extras/ooxmlexport/data/tdf105215.docx Binary files differnew file mode 100644 index 000000000..e464d460b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105215.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf105444.docx b/sw/qa/extras/ooxmlexport/data/tdf105444.docx Binary files differnew file mode 100644 index 000000000..a6e0ea873 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105444.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf105485.docx b/sw/qa/extras/ooxmlexport/data/tdf105485.docx Binary files differnew file mode 100644 index 000000000..be8a10e41 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105485.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docx b/sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docx Binary files differnew file mode 100644 index 000000000..6acb9f383 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docx b/sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docx Binary files differnew file mode 100644 index 000000000..e6512e075 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106001-2.odt b/sw/qa/extras/ooxmlexport/data/tdf106001-2.odt Binary files differnew file mode 100644 index 000000000..36d2650f4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106001-2.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf106001.docx b/sw/qa/extras/ooxmlexport/data/tdf106001.docx Binary files differnew file mode 100644 index 000000000..efe4104cf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106001.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106062_nonHangingFootnote.odt b/sw/qa/extras/ooxmlexport/data/tdf106062_nonHangingFootnote.odt Binary files differnew file mode 100644 index 000000000..af5e225ea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106062_nonHangingFootnote.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf106132.docx b/sw/qa/extras/ooxmlexport/data/tdf106132.docx Binary files differnew file mode 100644 index 000000000..e34289814 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106132.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106174_rtlParaAlign.docx b/sw/qa/extras/ooxmlexport/data/tdf106174_rtlParaAlign.docx Binary files differnew file mode 100644 index 000000000..a222f5881 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106174_rtlParaAlign.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106492.docx b/sw/qa/extras/ooxmlexport/data/tdf106492.docx Binary files differnew file mode 100644 index 000000000..72ff4be5d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106492.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odt b/sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odt Binary files differnew file mode 100644 index 000000000..2408ecf55 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf106690-cell.docx b/sw/qa/extras/ooxmlexport/data/tdf106690-cell.docx Binary files differnew file mode 100644 index 000000000..e2ea6f4b0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106690-cell.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106690.docx b/sw/qa/extras/ooxmlexport/data/tdf106690.docx Binary files differnew file mode 100644 index 000000000..b233ef81c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106690.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106724.docx b/sw/qa/extras/ooxmlexport/data/tdf106724.docx Binary files differnew file mode 100644 index 000000000..3cce6ea7c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106724.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106843.fodt b/sw/qa/extras/ooxmlexport/data/tdf106843.fodt new file mode 100644 index 000000000..37a97489a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106843.fodt @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:settings> + <config:config-item-set config:name="ooo:configuration-settings"> + <config:config-item config:name="RedlineProtectionKey" config:type="base64Binary">h/jtkVcSX/xNqeBqe4ARrYClP+E=</config:config-item> + </config:config-item-set> + </office:settings> + <office:body> + <office:text> + <text:tracked-changes text:track-changes="false"> + <text:changed-region xml:id="ct101395712" text:id="ct101395712"> + <text:deletion> + <office:change-info> + <dc:creator>Ismeretlen szerző</dc:creator> + <dc:date>2018-12-03T20:35:00</dc:date> + </office:change-info> + </text:deletion> + </text:changed-region> + <text:changed-region xml:id="ct101395264" text:id="ct101395264"> + <text:deletion> + <office:change-info> + <dc:creator>Ismeretlen szerző</dc:creator> + <dc:date>2018-12-03T20:34:58</dc:date> + </office:change-info> + </text:deletion> + </text:changed-region> + </text:tracked-changes> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> + </text:sequence-decls> + <text:p text:style-name="P1">Par1<text:change-start text:change-id="ct101395712"/>Par2<text:change-end text:change-id="ct101395712"/><text:change-start text:change-id="ct101395264"/></text:p> + <text:p text:style-name="P1"/> + <text:p text:style-name="P1"><text:change-end text:change-id="ct101395264"/><text:span text:style-name="T1">Format this...</text:span></text:p> + <text:p text:style-name="P1">Par3</text:p> + <text:p text:style-name="P1"/> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/tdf106953.docx b/sw/qa/extras/ooxmlexport/data/tdf106953.docx Binary files differnew file mode 100644 index 000000000..31dc0e28e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106953.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106970.docx b/sw/qa/extras/ooxmlexport/data/tdf106970.docx Binary files differnew file mode 100644 index 000000000..8a534558b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106970.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx b/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx Binary files differnew file mode 100644 index 000000000..e73cf5e28 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106974_int32Crop.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107020.docx b/sw/qa/extras/ooxmlexport/data/tdf107020.docx Binary files differnew file mode 100644 index 000000000..9c6cf6d95 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107020.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107033.docx b/sw/qa/extras/ooxmlexport/data/tdf107033.docx Binary files differnew file mode 100644 index 000000000..f4e08a3d3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107033.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107035.docx b/sw/qa/extras/ooxmlexport/data/tdf107035.docx Binary files differnew file mode 100644 index 000000000..a8ab045b6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107035.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107104.docx b/sw/qa/extras/ooxmlexport/data/tdf107104.docx Binary files differnew file mode 100644 index 000000000..2f8c87d8d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107104.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107111.docx b/sw/qa/extras/ooxmlexport/data/tdf107111.docx Binary files differnew file mode 100644 index 000000000..f89436fda --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107111.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107119.docx b/sw/qa/extras/ooxmlexport/data/tdf107119.docx Binary files differnew file mode 100644 index 000000000..98de4f2ac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107119.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107359-char-pitch.docx b/sw/qa/extras/ooxmlexport/data/tdf107359-char-pitch.docx Binary files differnew file mode 100644 index 000000000..970d722d3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107359-char-pitch.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107618.doc b/sw/qa/extras/ooxmlexport/data/tdf107618.doc Binary files differnew file mode 100644 index 000000000..8a6972f45 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107618.doc diff --git a/sw/qa/extras/ooxmlexport/data/tdf107626.odt b/sw/qa/extras/ooxmlexport/data/tdf107626.odt Binary files differnew file mode 100644 index 000000000..b7c8489cd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107626.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf107684.odt b/sw/qa/extras/ooxmlexport/data/tdf107684.odt Binary files differnew file mode 100644 index 000000000..0ca7c53d2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107684.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf107837.odt b/sw/qa/extras/ooxmlexport/data/tdf107837.odt Binary files differnew file mode 100644 index 000000000..a31a70c52 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107837.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf107889.docx b/sw/qa/extras/ooxmlexport/data/tdf107889.docx Binary files differnew file mode 100644 index 000000000..452c4aa13 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107889.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf107969.docx b/sw/qa/extras/ooxmlexport/data/tdf107969.docx Binary files differnew file mode 100644 index 000000000..e674bcb5d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf107969.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108269.docm b/sw/qa/extras/ooxmlexport/data/tdf108269.docm Binary files differnew file mode 100644 index 000000000..44e943531 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108269.docm diff --git a/sw/qa/extras/ooxmlexport/data/tdf108350_noFontdefaults.docx b/sw/qa/extras/ooxmlexport/data/tdf108350_noFontdefaults.docx Binary files differnew file mode 100644 index 000000000..ea8172279 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108350_noFontdefaults.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108493.docx b/sw/qa/extras/ooxmlexport/data/tdf108493.docx Binary files differnew file mode 100644 index 000000000..f1a51525e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108493.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108496.docx b/sw/qa/extras/ooxmlexport/data/tdf108496.docx Binary files differnew file mode 100644 index 000000000..123d9e0a6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108496.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108505.docx b/sw/qa/extras/ooxmlexport/data/tdf108505.docx Binary files differnew file mode 100644 index 000000000..50ebc3770 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108505.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108682.docx b/sw/qa/extras/ooxmlexport/data/tdf108682.docx Binary files differnew file mode 100644 index 000000000..1364025b8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108682.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx b/sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx Binary files differnew file mode 100644 index 000000000..177cb5b77 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx b/sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx Binary files differnew file mode 100644 index 000000000..fb81047c3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf109063.docx b/sw/qa/extras/ooxmlexport/data/tdf109063.docx Binary files differnew file mode 100644 index 000000000..70f4fe4e2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf109063.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf109184.docx b/sw/qa/extras/ooxmlexport/data/tdf109184.docx Binary files differnew file mode 100644 index 000000000..36e5232ae --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf109184.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf109306.docx b/sw/qa/extras/ooxmlexport/data/tdf109306.docx Binary files differnew file mode 100644 index 000000000..d46049f83 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf109306.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf109310_endnoteStyleForMSO.docx b/sw/qa/extras/ooxmlexport/data/tdf109310_endnoteStyleForMSO.docx Binary files differnew file mode 100644 index 000000000..9949b98d5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf109310_endnoteStyleForMSO.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf111964.docx b/sw/qa/extras/ooxmlexport/data/tdf111964.docx Binary files differnew file mode 100644 index 000000000..7cb85a1d8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf111964.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf112103_tablebgnofill.docx b/sw/qa/extras/ooxmlexport/data/tdf112103_tablebgnofill.docx Binary files differnew file mode 100644 index 000000000..cee8756ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112103_tablebgnofill.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf112118.docx b/sw/qa/extras/ooxmlexport/data/tdf112118.docx Binary files differnew file mode 100644 index 000000000..3ddb06839 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112118.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf112169.odt b/sw/qa/extras/ooxmlexport/data/tdf112169.odt Binary files differnew file mode 100644 index 000000000..51bb97f2e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112169.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf112287.docx b/sw/qa/extras/ooxmlexport/data/tdf112287.docx Binary files differnew file mode 100644 index 000000000..3464e2898 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112287.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odt b/sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odt Binary files differnew file mode 100644 index 000000000..b5ccb3562 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112312_AutoFitForLegacyShapes.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx b/sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx Binary files differnew file mode 100644 index 000000000..f14681dd5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf112446_frameStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf112446_frameStyle.docx Binary files differnew file mode 100644 index 000000000..7c92ae36f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112446_frameStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf112694.docx b/sw/qa/extras/ooxmlexport/data/tdf112694.docx Binary files differnew file mode 100644 index 000000000..f629a388e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112694.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf113183.docx b/sw/qa/extras/ooxmlexport/data/tdf113183.docx Binary files differnew file mode 100644 index 000000000..197f483ba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113183.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf113258.docx b/sw/qa/extras/ooxmlexport/data/tdf113258.docx Binary files differnew file mode 100644 index 000000000..d60a2ee64 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113258.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf113258_noBeforeAutospacing.docx b/sw/qa/extras/ooxmlexport/data/tdf113258_noBeforeAutospacing.docx Binary files differnew file mode 100644 index 000000000..de74eb226 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113258_noBeforeAutospacing.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf113399.doc b/sw/qa/extras/ooxmlexport/data/tdf113399.doc Binary files differnew file mode 100644 index 000000000..1f3ddc993 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113399.doc diff --git a/sw/qa/extras/ooxmlexport/data/tdf113547.docx b/sw/qa/extras/ooxmlexport/data/tdf113547.docx Binary files differnew file mode 100644 index 000000000..7b35ad72b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113547.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf113608_runAwayNumbering.docx b/sw/qa/extras/ooxmlexport/data/tdf113608_runAwayNumbering.docx Binary files differnew file mode 100644 index 000000000..f31cc8015 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113608_runAwayNumbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf113849_evenAndOddHeaders.odt b/sw/qa/extras/ooxmlexport/data/tdf113849_evenAndOddHeaders.odt Binary files differnew file mode 100644 index 000000000..d9aa0ae23 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf113849_evenAndOddHeaders.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf114308.docx b/sw/qa/extras/ooxmlexport/data/tdf114308.docx Binary files differnew file mode 100644 index 000000000..0796200fc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf114308.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf114703.docx b/sw/qa/extras/ooxmlexport/data/tdf114703.docx Binary files differnew file mode 100644 index 000000000..116b56a2b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf114703.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf114882.docx b/sw/qa/extras/ooxmlexport/data/tdf114882.docx Binary files differnew file mode 100644 index 000000000..8663f6b15 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf114882.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115030.docx b/sw/qa/extras/ooxmlexport/data/tdf115030.docx Binary files differnew file mode 100644 index 000000000..71b983295 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115030.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115094v3.docx b/sw/qa/extras/ooxmlexport/data/tdf115094v3.docx Binary files differnew file mode 100644 index 000000000..6c7535f7b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115094v3.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115212.docx b/sw/qa/extras/ooxmlexport/data/tdf115212.docx Binary files differnew file mode 100644 index 000000000..1a44fbd77 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115212.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115557.docx b/sw/qa/extras/ooxmlexport/data/tdf115557.docx Binary files differnew file mode 100644 index 000000000..1edceac48 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115557.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719.docx b/sw/qa/extras/ooxmlexport/data/tdf115719.docx Binary files differnew file mode 100644 index 000000000..99806d4dc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115719.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719b.docx b/sw/qa/extras/ooxmlexport/data/tdf115719b.docx Binary files differnew file mode 100644 index 000000000..f3e3925c8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115719b.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf115861.docx b/sw/qa/extras/ooxmlexport/data/tdf115861.docx Binary files differnew file mode 100644 index 000000000..f42a7bad2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115861.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116084.docx b/sw/qa/extras/ooxmlexport/data/tdf116084.docx Binary files differnew file mode 100644 index 000000000..61a9fdb13 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116084.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116194.docx b/sw/qa/extras/ooxmlexport/data/tdf116194.docx Binary files differnew file mode 100644 index 000000000..feec3ee98 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116194.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116371.odt b/sw/qa/extras/ooxmlexport/data/tdf116371.odt Binary files differnew file mode 100644 index 000000000..257696616 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116371.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf116410.docx b/sw/qa/extras/ooxmlexport/data/tdf116410.docx Binary files differnew file mode 100644 index 000000000..5352a233e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116410.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt b/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt Binary files differnew file mode 100644 index 000000000..45f4a1c54 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf116801.docx b/sw/qa/extras/ooxmlexport/data/tdf116801.docx Binary files differnew file mode 100644 index 000000000..f904546cf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116801.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116883.docx b/sw/qa/extras/ooxmlexport/data/tdf116883.docx Binary files differnew file mode 100644 index 000000000..52a9c4221 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116883.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116976.docx b/sw/qa/extras/ooxmlexport/data/tdf116976.docx Binary files differnew file mode 100644 index 000000000..70492a4af --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116976.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf116985.docx b/sw/qa/extras/ooxmlexport/data/tdf116985.docx Binary files differnew file mode 100644 index 000000000..2a8e20238 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116985.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf117137.docx b/sw/qa/extras/ooxmlexport/data/tdf117137.docx Binary files differnew file mode 100644 index 000000000..1c2cc92b2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117137.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf117297_tableStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf117297_tableStyle.docx Binary files differnew file mode 100644 index 000000000..57260f816 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117297_tableStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx b/sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx Binary files differnew file mode 100644 index 000000000..d86b0b4f1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf117805.odt b/sw/qa/extras/ooxmlexport/data/tdf117805.odt Binary files differnew file mode 100644 index 000000000..828384b36 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117805.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf117988.docx b/sw/qa/extras/ooxmlexport/data/tdf117988.docx Binary files differnew file mode 100644 index 000000000..5c92f209a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117988.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118169.docx b/sw/qa/extras/ooxmlexport/data/tdf118169.docx Binary files differnew file mode 100644 index 000000000..2510fb3e5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118169.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118242.odt b/sw/qa/extras/ooxmlexport/data/tdf118242.odt Binary files differnew file mode 100644 index 000000000..14b468d75 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118242.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx b/sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx Binary files differnew file mode 100644 index 000000000..8545cbf25 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118393.odt b/sw/qa/extras/ooxmlexport/data/tdf118393.odt Binary files differnew file mode 100644 index 000000000..ff8d54009 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118393.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf118521_marginsLR.docx b/sw/qa/extras/ooxmlexport/data/tdf118521_marginsLR.docx Binary files differnew file mode 100644 index 000000000..66170ede4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118521_marginsLR.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118682.fodt b/sw/qa/extras/ooxmlexport/data/tdf118682.fodt new file mode 100644 index 000000000..b80074592 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118682.fodt @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:ooow="http://openoffice.org/2004/writer" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:styles> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:default-style style:family="paragraph"> + <style:text-properties fo:language="en" fo:country="US"/> + </style:default-style> + </office:styles> + <office:body> + <office:text> + <table:table> + <table:table-column/> + <table:table-row> + <table:table-cell office:value-type="string"> + <text:p>1</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell office:value-type="string"> + <text:p>2</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell office:value-type="string"> + <text:p><text:table-formula text:formula="ooow: <A1>+<A2>" style:data-style-name="N0">3</text:table-formula></text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell office:value-type="string"> + <text:p><text:table-formula text:formula="ooow:SUM(<A1:A3>)" style:data-style-name="N0">6</text:table-formula></text:p> + </table:table-cell> + </table:table-row> + </table:table> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/tdf118691.docx b/sw/qa/extras/ooxmlexport/data/tdf118691.docx Binary files differnew file mode 100644 index 000000000..ce6c6c5cf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118691.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118702.odt b/sw/qa/extras/ooxmlexport/data/tdf118702.odt Binary files differnew file mode 100644 index 000000000..d55099242 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118702.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf118812_tableStyles-comprehensive.docx b/sw/qa/extras/ooxmlexport/data/tdf118812_tableStyles-comprehensive.docx Binary files differnew file mode 100644 index 000000000..e2cbffc20 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118812_tableStyles-comprehensive.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle.docx Binary files differnew file mode 100644 index 000000000..b5c55f6f3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle2.docx b/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle2.docx Binary files differnew file mode 100644 index 000000000..7c0825feb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119037.odt b/sw/qa/extras/ooxmlexport/data/tdf119037.odt Binary files differnew file mode 100644 index 000000000..b795b6b34 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119037.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf119054.docx b/sw/qa/extras/ooxmlexport/data/tdf119054.docx Binary files differnew file mode 100644 index 000000000..9c3657c24 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119054.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119143.docx b/sw/qa/extras/ooxmlexport/data/tdf119143.docx Binary files differnew file mode 100644 index 000000000..be0bc03f7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119143.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx b/sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx Binary files differnew file mode 100644 index 000000000..02b538685 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119201.docx b/sw/qa/extras/ooxmlexport/data/tdf119201.docx Binary files differnew file mode 100644 index 000000000..d454d6731 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119201.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119760_positionCellBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf119760_positionCellBorder.docx Binary files differnew file mode 100644 index 000000000..17a570e06 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119760_positionCellBorder.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119760_tableInTablePosition.docx b/sw/qa/extras/ooxmlexport/data/tdf119760_tableInTablePosition.docx Binary files differnew file mode 100644 index 000000000..0456fe206 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119760_tableInTablePosition.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119800.docx b/sw/qa/extras/ooxmlexport/data/tdf119800.docx Binary files differnew file mode 100644 index 000000000..35c4108d3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119800.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf119809.docx b/sw/qa/extras/ooxmlexport/data/tdf119809.docx Binary files differnew file mode 100644 index 000000000..977938253 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119809.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120224_textControlCrossRef.docx b/sw/qa/extras/ooxmlexport/data/tdf120224_textControlCrossRef.docx Binary files differnew file mode 100644 index 000000000..c76bbd691 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120224_textControlCrossRef.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120315.docx b/sw/qa/extras/ooxmlexport/data/tdf120315.docx Binary files differnew file mode 100644 index 000000000..d3943ea0b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120315.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120338.docx b/sw/qa/extras/ooxmlexport/data/tdf120338.docx Binary files differnew file mode 100644 index 000000000..94e0023ce --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120338.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120344_FontTypes.docx b/sw/qa/extras/ooxmlexport/data/tdf120344_FontTypes.docx Binary files differnew file mode 100644 index 000000000..74bcd59e2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120344_FontTypes.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120394.docx b/sw/qa/extras/ooxmlexport/data/tdf120394.docx Binary files differnew file mode 100644 index 000000000..39bd5886c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120394.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx b/sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx Binary files differnew file mode 100644 index 000000000..526d7d2c1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120412_400PercentSubscript.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx b/sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx Binary files differnew file mode 100644 index 000000000..6a6d6f17b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120760_ZOrderInHeader.docx b/sw/qa/extras/ooxmlexport/data/tdf120760_ZOrderInHeader.docx Binary files differnew file mode 100644 index 000000000..77a6d48dd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120760_ZOrderInHeader.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120852_readOnlyProtection.docx b/sw/qa/extras/ooxmlexport/data/tdf120852_readOnlyProtection.docx Binary files differnew file mode 100644 index 000000000..02869aa5a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120852_readOnlyProtection.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf120852_readOnlyUnProtected.docx b/sw/qa/extras/ooxmlexport/data/tdf120852_readOnlyUnProtected.docx Binary files differnew file mode 100644 index 000000000..143799ddb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf120852_readOnlyUnProtected.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121045.docx b/sw/qa/extras/ooxmlexport/data/tdf121045.docx Binary files differnew file mode 100644 index 000000000..271aca1ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121045.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121176.docx b/sw/qa/extras/ooxmlexport/data/tdf121176.docx Binary files differnew file mode 100644 index 000000000..f95c023b0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121176.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121374_sectionHF.odt b/sw/qa/extras/ooxmlexport/data/tdf121374_sectionHF.odt Binary files differnew file mode 100644 index 000000000..392fae1b6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121374_sectionHF.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf121374_sectionHF2.doc b/sw/qa/extras/ooxmlexport/data/tdf121374_sectionHF2.doc Binary files differnew file mode 100644 index 000000000..56a33d260 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121374_sectionHF2.doc diff --git a/sw/qa/extras/ooxmlexport/data/tdf121441.docx b/sw/qa/extras/ooxmlexport/data/tdf121441.docx Binary files differnew file mode 100644 index 000000000..d4c67feb5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121441.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121456.docx b/sw/qa/extras/ooxmlexport/data/tdf121456.docx Binary files differnew file mode 100644 index 000000000..a65870a9b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121456.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121456_tabsOffset.odt b/sw/qa/extras/ooxmlexport/data/tdf121456_tabsOffset.odt Binary files differnew file mode 100644 index 000000000..ff8d54009 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121456_tabsOffset.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf121597.odt b/sw/qa/extras/ooxmlexport/data/tdf121597.odt Binary files differnew file mode 100644 index 000000000..760b46e76 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121597.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf121658.docx b/sw/qa/extras/ooxmlexport/data/tdf121658.docx Binary files differnew file mode 100644 index 000000000..fe42b5cde --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121658.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121661.docx b/sw/qa/extras/ooxmlexport/data/tdf121661.docx Binary files differnew file mode 100644 index 000000000..dfd2f291e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121661.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121663.docx b/sw/qa/extras/ooxmlexport/data/tdf121663.docx Binary files differnew file mode 100644 index 000000000..dd2614169 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121663.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121665_back2backColumnBreaks.docx b/sw/qa/extras/ooxmlexport/data/tdf121665_back2backColumnBreaks.docx Binary files differnew file mode 100644 index 000000000..e9173a9ac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121665_back2backColumnBreaks.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121670_columnsInSectionsOnly.docx b/sw/qa/extras/ooxmlexport/data/tdf121670_columnsInSectionsOnly.docx Binary files differnew file mode 100644 index 000000000..d8ba10544 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121670_columnsInSectionsOnly.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121784.docx b/sw/qa/extras/ooxmlexport/data/tdf121784.docx Binary files differnew file mode 100644 index 000000000..30faeb284 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121784.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf121867.odt b/sw/qa/extras/ooxmlexport/data/tdf121867.odt Binary files differnew file mode 100644 index 000000000..361121d23 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121867.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt b/sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt Binary files differnew file mode 100644 index 000000000..76a6289f7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf122201_editUnprotectedText.odt b/sw/qa/extras/ooxmlexport/data/tdf122201_editUnprotectedText.odt Binary files differnew file mode 100644 index 000000000..217c8c38a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf122201_editUnprotectedText.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf122342.docx b/sw/qa/extras/ooxmlexport/data/tdf122342.docx Binary files differnew file mode 100644 index 000000000..0c7ecd67a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf122342.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf122563.docx b/sw/qa/extras/ooxmlexport/data/tdf122563.docx Binary files differnew file mode 100644 index 000000000..69168a382 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf122563.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf122594.docx b/sw/qa/extras/ooxmlexport/data/tdf122594.docx Binary files differnew file mode 100644 index 000000000..847d8ef59 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf122594.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123054.docx b/sw/qa/extras/ooxmlexport/data/tdf123054.docx Binary files differnew file mode 100644 index 000000000..d857479d5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123054.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123104.docx b/sw/qa/extras/ooxmlexport/data/tdf123104.docx Binary files differnew file mode 100644 index 000000000..73cad8617 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123104.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123116_oversizedRowSplit.odt b/sw/qa/extras/ooxmlexport/data/tdf123116_oversizedRowSplit.odt Binary files differnew file mode 100644 index 000000000..aafc27ae2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123116_oversizedRowSplit.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf123243.docx b/sw/qa/extras/ooxmlexport/data/tdf123243.docx Binary files differnew file mode 100644 index 000000000..9519a2a14 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123243.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123262_textFootnoteSeparators.docx b/sw/qa/extras/ooxmlexport/data/tdf123262_textFootnoteSeparators.docx Binary files differnew file mode 100644 index 000000000..ceccb767e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123262_textFootnoteSeparators.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx b/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx Binary files differnew file mode 100644 index 000000000..770bab263 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123351_UnderlineGroupSapeText.docx b/sw/qa/extras/ooxmlexport/data/tdf123351_UnderlineGroupSapeText.docx Binary files differnew file mode 100644 index 000000000..8726f7ee6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123351_UnderlineGroupSapeText.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123386.docx b/sw/qa/extras/ooxmlexport/data/tdf123386.docx Binary files differnew file mode 100644 index 000000000..1278068dd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123386.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123389.docx b/sw/qa/extras/ooxmlexport/data/tdf123389.docx Binary files differnew file mode 100644 index 000000000..4245464b8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123389.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123460.docx b/sw/qa/extras/ooxmlexport/data/tdf123460.docx Binary files differnew file mode 100644 index 000000000..c3b723b4e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123460.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123621.docx b/sw/qa/extras/ooxmlexport/data/tdf123621.docx Binary files differnew file mode 100644 index 000000000..471b6ef71 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123621.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123622.docx b/sw/qa/extras/ooxmlexport/data/tdf123622.docx Binary files differnew file mode 100644 index 000000000..54ef0cbd7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123622.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123627.docx b/sw/qa/extras/ooxmlexport/data/tdf123627.docx Binary files differnew file mode 100644 index 000000000..a85d44000 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123627.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123628.odt b/sw/qa/extras/ooxmlexport/data/tdf123628.odt Binary files differnew file mode 100644 index 000000000..53ce54ad2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123628.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak.docx b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak.docx Binary files differnew file mode 100644 index 000000000..6f7b4b144 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak2.docx b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak2.docx Binary files differnew file mode 100644 index 000000000..a876bea84 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak3.docx b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak3.docx Binary files differnew file mode 100644 index 000000000..1bcc335fd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak3.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak4.docx b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak4.docx Binary files differnew file mode 100644 index 000000000..3a9d86ee2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123636_newlinePageBreak4.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123705.docx b/sw/qa/extras/ooxmlexport/data/tdf123705.docx Binary files differnew file mode 100644 index 000000000..46e053fd4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123705.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123757.docx b/sw/qa/extras/ooxmlexport/data/tdf123757.docx Binary files differnew file mode 100644 index 000000000..6cfc8210c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123757.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123873.docx b/sw/qa/extras/ooxmlexport/data/tdf123873.docx Binary files differnew file mode 100644 index 000000000..b1de7f71f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123873.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf123912_protectedForm.odt b/sw/qa/extras/ooxmlexport/data/tdf123912_protectedForm.odt Binary files differnew file mode 100644 index 000000000..34e87467e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123912_protectedForm.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf124367.docx b/sw/qa/extras/ooxmlexport/data/tdf124367.docx Binary files differnew file mode 100644 index 000000000..0a1356dd0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124367.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124384.docx b/sw/qa/extras/ooxmlexport/data/tdf124384.docx Binary files differnew file mode 100644 index 000000000..a41be4b11 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124384.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124399_SingleCellTableBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf124399_SingleCellTableBorders.docx Binary files differnew file mode 100644 index 000000000..edb93b76e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124399_SingleCellTableBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124491.docx b/sw/qa/extras/ooxmlexport/data/tdf124491.docx Binary files differnew file mode 100644 index 000000000..dad4d7c54 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124491.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124594.docx b/sw/qa/extras/ooxmlexport/data/tdf124594.docx Binary files differnew file mode 100644 index 000000000..27abe1841 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124594.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124600b.docx b/sw/qa/extras/ooxmlexport/data/tdf124600b.docx Binary files differnew file mode 100644 index 000000000..aa25ada91 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124600b.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124604.docx b/sw/qa/extras/ooxmlexport/data/tdf124604.docx Binary files differnew file mode 100644 index 000000000..1bac640ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124604.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124637_sectionMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf124637_sectionMargin.docx Binary files differnew file mode 100644 index 000000000..19aa819ac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124637_sectionMargin.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf124986.docx b/sw/qa/extras/ooxmlexport/data/tdf124986.docx Binary files differnew file mode 100644 index 000000000..e5bb8f496 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf124986.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125038.docx b/sw/qa/extras/ooxmlexport/data/tdf125038.docx Binary files differnew file mode 100644 index 000000000..b4dd622f9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125038.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125038b.docx b/sw/qa/extras/ooxmlexport/data/tdf125038b.docx Binary files differnew file mode 100644 index 000000000..3aa189dad --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125038b.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125038c.docx b/sw/qa/extras/ooxmlexport/data/tdf125038c.docx Binary files differnew file mode 100644 index 000000000..10234b864 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125038c.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125298_crossreflink_nonascii_charlimit.docx b/sw/qa/extras/ooxmlexport/data/tdf125298_crossreflink_nonascii_charlimit.docx Binary files differnew file mode 100644 index 000000000..d15739971 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125298_crossreflink_nonascii_charlimit.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125324.docx b/sw/qa/extras/ooxmlexport/data/tdf125324.docx Binary files differnew file mode 100644 index 000000000..9382e295f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125324.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125518.odt b/sw/qa/extras/ooxmlexport/data/tdf125518.odt Binary files differnew file mode 100644 index 000000000..92df094a8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125518.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf125546.docx b/sw/qa/extras/ooxmlexport/data/tdf125546.docx Binary files differnew file mode 100644 index 000000000..92e3bdcd1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125546.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125657.docx b/sw/qa/extras/ooxmlexport/data/tdf125657.docx Binary files differnew file mode 100644 index 000000000..eeaad7a4b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125657.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx b/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx Binary files differnew file mode 100644 index 000000000..dd5d323e5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf125894.docx b/sw/qa/extras/ooxmlexport/data/tdf125894.docx Binary files differnew file mode 100644 index 000000000..1214f2c09 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf125894.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf126245.docx b/sw/qa/extras/ooxmlexport/data/tdf126245.docx Binary files differnew file mode 100644 index 000000000..7cdc26143 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126245.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf126363_LineWidthRounding.docx b/sw/qa/extras/ooxmlexport/data/tdf126363_LineWidthRounding.docx Binary files differnew file mode 100644 index 000000000..180383ec6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126363_LineWidthRounding.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf126590.docx b/sw/qa/extras/ooxmlexport/data/tdf126590.docx Binary files differnew file mode 100644 index 000000000..147db4565 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126590.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf126723.docx b/sw/qa/extras/ooxmlexport/data/tdf126723.docx Binary files differnew file mode 100644 index 000000000..297ea322f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126723.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf126768.docx b/sw/qa/extras/ooxmlexport/data/tdf126768.docx Binary files differnew file mode 100644 index 000000000..7a3440e79 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126768.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf126792.odt b/sw/qa/extras/ooxmlexport/data/tdf126792.odt Binary files differnew file mode 100644 index 000000000..7eb43e78a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126792.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt Binary files differnew file mode 100644 index 000000000..e650076a0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt Binary files differnew file mode 100644 index 000000000..da2eae76b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx b/sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx Binary files differnew file mode 100644 index 000000000..9025ce652 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf127085.docx b/sw/qa/extras/ooxmlexport/data/tdf127085.docx Binary files differnew file mode 100644 index 000000000..65556fe38 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127085.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf127116.odt b/sw/qa/extras/ooxmlexport/data/tdf127116.odt Binary files differnew file mode 100644 index 000000000..2825b34c0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127116.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt b/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt Binary files differnew file mode 100644 index 000000000..95987d456 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf127339.docx b/sw/qa/extras/ooxmlexport/data/tdf127339.docx Binary files differnew file mode 100644 index 000000000..7f0239ddb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127339.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf127362.odt b/sw/qa/extras/ooxmlexport/data/tdf127362.odt Binary files differnew file mode 100644 index 000000000..488f1528f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127362.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf127579.odt b/sw/qa/extras/ooxmlexport/data/tdf127579.odt Binary files differnew file mode 100644 index 000000000..a35fb47a0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127579.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf127605.odt b/sw/qa/extras/ooxmlexport/data/tdf127605.odt Binary files differnew file mode 100644 index 000000000..583f7fdee --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127605.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf127741.docx b/sw/qa/extras/ooxmlexport/data/tdf127741.docx Binary files differnew file mode 100644 index 000000000..1bedb9ade --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127741.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf127814.docx b/sw/qa/extras/ooxmlexport/data/tdf127814.docx Binary files differnew file mode 100644 index 000000000..10ed2348f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127814.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf127925.odt b/sw/qa/extras/ooxmlexport/data/tdf127925.odt Binary files differnew file mode 100644 index 000000000..b91e48f05 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127925.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf128156.docx b/sw/qa/extras/ooxmlexport/data/tdf128156.docx Binary files differnew file mode 100644 index 000000000..b499f6e50 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128156.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf128207.docx b/sw/qa/extras/ooxmlexport/data/tdf128207.docx Binary files differnew file mode 100644 index 000000000..c234ec8bc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128207.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf128245.docx b/sw/qa/extras/ooxmlexport/data/tdf128245.docx Binary files differnew file mode 100644 index 000000000..618f72030 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128245.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf128290.odt b/sw/qa/extras/ooxmlexport/data/tdf128290.odt Binary files differnew file mode 100644 index 000000000..81ea0c677 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128290.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf128304.odt b/sw/qa/extras/ooxmlexport/data/tdf128304.odt Binary files differnew file mode 100644 index 000000000..6c5cbd120 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128304.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf128646.docx b/sw/qa/extras/ooxmlexport/data/tdf128646.docx Binary files differnew file mode 100644 index 000000000..9648df35a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128646.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf128752.docx b/sw/qa/extras/ooxmlexport/data/tdf128752.docx Binary files differnew file mode 100644 index 000000000..0e4929141 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128752.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf128820.fodt b/sw/qa/extras/ooxmlexport/data/tdf128820.fodt new file mode 100644 index 000000000..576fd966e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128820.fodt @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:body> + <office:text> + <text:p><draw:g text:anchor-type="as-char" draw:name="A"> + <draw:frame svg:width="1cm" svg:height="1cm" svg:x="1cm" svg:y="1cm"> + <draw:image> + <office:binary-data>PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciLz4</office:binary-data> + <text:p>json</text:p> + </draw:image> + </draw:frame> + </draw:g></text:p> + </office:text> + </office:body> +</office:document>
\ No newline at end of file diff --git a/sw/qa/extras/ooxmlexport/data/tdf128889.fodt b/sw/qa/extras/ooxmlexport/data/tdf128889.fodt new file mode 100644 index 000000000..6dc1c4202 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf128889.fodt @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> + <style:paragraph-properties fo:break-after="page"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <text:p text:style-name="P1">para1</text:p> + <text:p>para2</text:p> + </office:text> + </office:body> +</office:document>
\ No newline at end of file diff --git a/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx Binary files differnew file mode 100644 index 000000000..58045c971 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129353.docx b/sw/qa/extras/ooxmlexport/data/tdf129353.docx Binary files differnew file mode 100644 index 000000000..c5cf8865e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129353.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx Binary files differnew file mode 100644 index 000000000..57ad24b61 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx Binary files differnew file mode 100644 index 000000000..df00bfe04 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129452_BottomBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf129452_BottomBorders.docx Binary files differnew file mode 100644 index 000000000..0e8ddd6d3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129452_BottomBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129522_removeShadowStyle.odt b/sw/qa/extras/ooxmlexport/data/tdf129522_removeShadowStyle.odt Binary files differnew file mode 100644 index 000000000..7ced9fc64 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129522_removeShadowStyle.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf129525.rtf b/sw/qa/extras/ooxmlexport/data/tdf129525.rtf new file mode 100644 index 000000000..1865d15ca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129525.rtf @@ -0,0 +1,262 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang3082\deflangfe3082\themelang3082\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
+{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma{\*\falt Times};}
+{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
+{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
+{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
+{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
+{\f1577\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}{\f1578\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f1580\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
+{\f1581\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\f1582\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f1583\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}
+{\f1584\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}{\f1585\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\f1917\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
+{\f1918\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f1920\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f1921\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f1924\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
+{\f1925\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f1957\fbidi \fswiss\fcharset238\fprq2 Tahoma CE{\*\falt Times};}{\f1958\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr{\*\falt Times};}
+{\f1960\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek{\*\falt Times};}{\f1961\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur{\*\falt Times};}{\f1962\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew){\*\falt Times};}
+{\f1963\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic){\*\falt Times};}{\f1964\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic{\*\falt Times};}{\f1965\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese){\*\falt Times};}
+{\f1966\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai){\*\falt Times};}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}
+{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}
+{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}
+{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}
+{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
+{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}
+{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
+{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
+{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
+{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
+{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
+{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
+{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
+{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
+{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
+{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
+{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
+{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
+{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
+{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
+{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
+{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
+{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}
+{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
+{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}
+{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }
+\noqfpromote {\stylesheet{\ql \li0\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082
+\snext0 \sqformat \spriority0 Normal;}{\s1\qj \li0\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs32\alang1025 \ltrch\fcs0
+\b\fs32\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\qj \fi-360\li360\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\adjustright\rin0\lin360\itap0
+\rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0 \b\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{
+\s3\qj \li0\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel2\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ai\af0\afs24\alang1025 \ltrch\fcs0 \i\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082
+\sbasedon0 \snext0 \slink17 \sqformat heading 3;}{\s4\qc \fi-360\li720\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel3\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \ab\af0\afs32\alang1025 \ltrch\fcs0
+\b\fs32\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \slink18 \sqformat heading 4;}{\s5\qj \fi-720\li720\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel4\adjustright\rin0\lin720\itap0
+\rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \slink19 \sqformat heading 5;}{
+\s6\qj \fi720\li0\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel5\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082
+\sbasedon0 \snext0 \slink20 \sqformat heading 6;}{\s7\qj \li720\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel6\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0
+\b\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \slink21 \sqformat heading 7;}{\s8\qj \li720\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel7\adjustright\rin0\lin720\itap0 \rtlch\fcs1
+\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \slink22 \sqformat heading 8;}{
+\s9\qj \fi720\li720\ri0\sa120\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel8\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0 \b\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082
+\sbasedon0 \snext0 \slink23 \sqformat heading 9;}{\*\cs10 \additive Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang3082\langfe3082\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp3082\langfenp3082 \snext11 \ssemihidden \sunhideused
+Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af31503\afs32 \ltrch\fcs0 \b\fs32\lang1033\langfe0\kerning32\loch\f31502\hich\af31502\dbch\af31501\langnp1033 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1
+\ab\ai\af31503\afs28 \ltrch\fcs0 \b\i\fs28\lang1033\langfe0\loch\f31502\hich\af31502\dbch\af31501\langnp1033 \sbasedon10 \slink2 \slocked \ssemihidden \spriority9 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \ab\af31503\afs26 \ltrch\fcs0
+\b\fs26\lang1033\langfe0\loch\f31502\hich\af31502\dbch\af31501\langnp1033 \sbasedon10 \slink3 \slocked \ssemihidden \spriority9 Heading 3 Char;}{\*\cs18 \additive \rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\fs28\lang1033\langfe0\langnp1033
+\sbasedon10 \slink4 \slocked \ssemihidden \spriority9 Heading 4 Char;}{\*\cs19 \additive \rtlch\fcs1 \ab\ai\af0\afs26 \ltrch\fcs0 \b\i\fs26\lang1033\langfe0\langnp1033 \sbasedon10 \slink5 \slocked \ssemihidden \spriority9 Heading 5 Char;}{\*\cs20
+\additive \rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\lang1033\langfe0\langnp1033 \sbasedon10 \slink6 \slocked \ssemihidden \spriority9 Heading 6 Char;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\lang1033\langfe0\langnp1033
+\sbasedon10 \slink7 \slocked \ssemihidden \spriority9 Heading 7 Char;}{\*\cs22 \additive \rtlch\fcs1 \ai\af0\afs24 \ltrch\fcs0 \i\fs24\lang1033\langfe0\langnp1033 \sbasedon10 \slink8 \slocked \ssemihidden \spriority9 Heading 8 Char;}{\*\cs23 \additive
+\rtlch\fcs1 \af31503 \ltrch\fcs0 \lang1033\langfe0\loch\f31502\hich\af31502\dbch\af31501\langnp1033 \sbasedon10 \slink9 \slocked \ssemihidden \spriority9 Heading 9 Char;}{\s24\ql \li0\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0
+\cbpat9 \rtlch\fcs1 \af38\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext24 \slink25 Document Map;}{\*\cs25 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0
+\f38\fs16\lang1033\langfe0\langnp1033 \sbasedon10 \slink24 \slocked \ssemihidden Document Map Char;}{\s26\qj \li0\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
+\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext26 \slink27 Body Text;}{\*\cs27 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe0\langnp1033
+\sbasedon10 \slink26 \slocked \ssemihidden Body Text Char;}{\s28\qj \fi360\li0\ri0\sa120\nowidctlpar\tx0\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
+\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext28 \slink29 Body Text 2;}{\*\cs29 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe0\langnp1033
+\sbasedon10 \slink28 \slocked \ssemihidden Body Text 2 Char;}{\s30\qc \li0\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs40\alang1025 \ltrch\fcs0
+\b\fs40\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext30 \slink31 \sqformat Title;}{\*\cs31 \additive \rtlch\fcs1 \ab\af31503\afs32 \ltrch\fcs0
+\b\fs32\lang1033\langfe0\kerning28\loch\f31502\hich\af31502\dbch\af31501\langnp1033 \sbasedon10 \slink30 \slocked \spriority10 Title Char;}{\s32\qj \fi-270\li630\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin630\itap0 \rtlch\fcs1
+\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext32 \slink33 Body Text Indent 2;}{\*\cs33 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0
+\f0\fs24\lang1033\langfe0\langnp1033 \sbasedon10 \slink32 \slocked \ssemihidden Body Text Indent 2 Char;}{\s34\qj \fi-270\li720\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
+\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext34 \slink35 Body Text Indent 3;}{\*\cs35 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\lang1033\langfe0\langnp1033
+\sbasedon10 \slink34 \slocked \ssemihidden Body Text Indent 3 Char;}{\s36\qc \li0\ri0\sa120\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\ai\af0\afs28\alang1025 \ltrch\fcs0
+\b\i\fs28\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext36 \slink37 \sqformat Subtitle;}{\*\cs37 \additive \rtlch\fcs1 \af31503\afs24 \ltrch\fcs0
+\fs24\lang1033\langfe0\loch\f31502\hich\af31502\dbch\af31501\langnp1033 \sbasedon10 \slink36 \slocked \spriority11 Subtitle Char;}{\s38\ql \li0\ri0\sa120\nowidctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext38 \slink39 footer;}{\*\cs39 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe0\langnp1033
+\sbasedon10 \slink38 \slocked \ssemihidden Footer Char;}{\*\cs40 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 page number;}{\s41\ql \li0\ri0\sa120\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\ab\af0\afs24\alang1025 \ltrch\fcs0 \b\caps\fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd \spriority39 toc 1;}{\s42\ql \li245\ri0\sa120\nowidctlpar
+\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin245\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd toc 2;}{
+\s43\ql \li480\ri0\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin480\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd
+toc 3;}{\s44\ql \li720\ri0\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082
+\sbasedon0 \snext0 \sautoupd toc 4;}{\s45\ql \li960\ri0\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin960\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0
+\fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd toc 5;}{\s46\ql \li1200\ri0\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin1200\itap0 \rtlch\fcs1 \af0\afs20\alang1025
+\ltrch\fcs0 \fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd toc 6;}{\s47\ql \li1440\ri0\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin1440\itap0 \rtlch\fcs1
+\af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd toc 7;}{\s48\ql \li1680\ri0\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin1680\itap0
+\rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd toc 8;}{\s49\ql \li1920\ri0\nowidctlpar
+\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin1920\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext0 \sautoupd toc 9;}{
+\s50\qj \fi-270\li1710\ri-720\sa120\widctlpar\wrapdefault\faauto\adjustright\rin-720\lin1710\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\f0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sbasedon0 \snext50
+Block Text;}}{\*\listtable{\list\listtemplateid0\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat3\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1800
+\jclisttab\tx1800\lin1800 }{\listname ;}\listid1}{\list\listtemplateid-1315301230\listsimple{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat4\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0
+\ltrch\fcs0 \fbias0 \fi-720\li720\jclisttab\tx720\lin720 }{\listname ;}\listid323165344}{\list\listtemplateid-2135629362\listsimple{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
+\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \fi-720\li720\jclisttab\tx720\lin720 }{\listname ;}\listid429664987}{\list\listtemplateid1066166024\listsimple{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\levelold\levelspace0\levelindent720{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b \fi-720\li720\lin720 }{\listname ;}\listid467551770}{\list\listtemplateid67698707\listsimple{\listlevel\levelnfc1\levelnfcn1
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\jclisttab\tx720\lin720 }{\listname ;}\listid499321070}{\list\listtemplateid67698707
+\listsimple{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\jclisttab\tx720\lin720 }{\listname
+;}\listid505092311}{\list\listtemplateid67698709\listsimple{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat10\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360
+\jclisttab\tx360\lin360 }{\listname ;}\listid1328901394}{\list\listtemplateid266515624\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1
+\af0 \ltrch\fcs0 \fbias0 \fi-360\li1800\jclisttab\tx1800\lin1800 }{\listname ;}\listid1822691375}{\list\listtemplateid2081336888\listsimple{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat3\levelspace0\levelindent0{\leveltext
+\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-420\li420\jclisttab\tx420\lin420 }{\listname ;}\listid1903103825}}{\*\listoverridetable{\listoverride\listid467551770\listoverridecount0\ls1}{\listoverride\listid1822691375
+\listoverridecount0\ls2}{\listoverride\listid1\listoverridecount0\ls3}{\listoverride\listid1328901394\listoverridecount0\ls4}{\listoverride\listid429664987\listoverridecount0\ls5}{\listoverride\listid505092311\listoverridecount0\ls6}
+{\listoverride\listid499321070\listoverridecount0\ls7}{\listoverride\listid1903103825\listoverridecount0\ls8}{\listoverride\listid323165344\listoverridecount0\ls9}}{\*\rsidtbl \rsid1993739\rsid4991862\rsid7286274\rsid7288753}{\mmathPr\mmathFont34\mbrkBin0
+\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\title VARIFLEX MANUAL}{\author Chemistry Department}{\operator xisco}{\creatim\yr1999\mo7\dy16\hr9\min53}{\revtim\yr2020\mo4\dy20\hr14\min59}
+{\printim\yr1999\mo7\dy16\hr10\min14}{\version9}{\edmins34}{\nofpages1}{\nofwords25}{\nofchars142}{\*\company }{\nofcharsws166}{\vern49247}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
+\paperw12240\paperh15840\margl1440\margr1440\margt1296\margb1296\gutter0\ltrsect
+\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\hyphcaps0\horzdoc\dghspace120\dgvspace120
+\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot7286274 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0
+\rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4991862 \chftnsep
+\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4991862 \chftnsepc
+\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4991862 \chftnsep
+\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 {
+\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4991862 \chftnsepc
+\par }}\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\footerr \ltrpar \pard\plain \ltrpar\s38\ql \li0\ri0\sa120\nowidctlpar\tqc\tx4320\tqr\tx8640\pvpara\phmrg\posxc\posy0\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
+\ltrch\fcs0 \fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 {\field{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs40\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 PAGE }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0
+\cs40\lang1024\langfe1024\noproof\insrsid1993739 \hich\af0\dbch\af31505\loch\f0 1}}}\sectd \ltrsect\linex0\endnhere\sectdefaultcl\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs40\insrsid4991862
+\par }\pard \ltrpar\s38\ql \li0\ri0\sa120\nowidctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4991862
+\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}
+{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
+\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\s41\ql \li0\ri0\sa120\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin0\itap0
+\rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0 \b\caps\fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 {\field\fldedit{\*\fldinst {\rtlch\fcs1 \ai\af0 \ltrch\fcs0 \i\insrsid4991862 \hich\af0\dbch\af31505\loch\f0
+ TOC \\o "1-3" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 Overv\hich\af0\dbch\af31505\loch\f0 iew\tab }{\field\flddirty{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0
+\caps0\lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 GOTOBUTTON _Toc434317063 }{\field{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \caps0\lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0
+ PAGEREF _Toc434317063 }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \caps0\lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 3}}}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj }}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1
+\af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid4991862
+\par }\pard \ltrpar\s41\ql \li0\ri0\sa120\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin0\itap0\pararsid1993739 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 More detailed description
+\tab }{\field\flddirty{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \caps0\lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 GOTOBUTTON _Toc434317064 }{\field{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0
+\caps0\lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 PAGEREF _Toc434317064 }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \caps0\lang1024\langfe1024\noproof\insrsid4991862 \hich\af0\dbch\af31505\loch\f0 4}}}\sectd \ltrsect
+\linex0\sectdefaultcl\sftnbj }}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid4991862
+\par }}}\pard\plain \ltrpar\s41\ql \li0\ri0\sa120\nowidctlpar\tqr\tx9360\wrapdefault\faauto\adjustright\rin0\lin0\itap0\pararsid1993739 \rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0
+\b\caps\fs24\lang1033\langfe3082\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp3082 \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4991862
+\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
+9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
+5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
+b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
+0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
+a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
+c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
+0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
+a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
+6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
+4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
+4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
+7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
+615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
+79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
+5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
+999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
+699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
+8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
+0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
+9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
+15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
+3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
+32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
+f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
+e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
+fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
+ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
+a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
+399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
+4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
+0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
+c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
+689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
+5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
+aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
+316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
+545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
+c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
+0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
+8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
+d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
+1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
+bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
+a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
+0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
+0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
+00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
+{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
+617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
+6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
+656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
+{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 1;
+\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 2;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 3;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 4;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 5;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 6;
+\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 7;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 8;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 heading 9;\lsdunhideused1 \lsdlocked0 index 1;\lsdunhideused1 \lsdlocked0 index 2;
+\lsdunhideused1 \lsdlocked0 index 3;\lsdunhideused1 \lsdlocked0 index 4;\lsdunhideused1 \lsdlocked0 index 5;\lsdunhideused1 \lsdlocked0 index 6;\lsdunhideused1 \lsdlocked0 index 7;\lsdunhideused1 \lsdlocked0 index 8;\lsdunhideused1 \lsdlocked0 index 9;
+\lsdpriority39 \lsdlocked0 toc 1;\lsdunhideused1 \lsdlocked0 Normal Indent;\lsdunhideused1 \lsdlocked0 footnote text;\lsdunhideused1 \lsdlocked0 annotation text;\lsdunhideused1 \lsdlocked0 header;\lsdunhideused1 \lsdlocked0 index heading;
+\lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdunhideused1 \lsdlocked0 table of figures;\lsdunhideused1 \lsdlocked0 envelope address;\lsdunhideused1 \lsdlocked0 envelope return;\lsdunhideused1 \lsdlocked0 footnote reference;
+\lsdunhideused1 \lsdlocked0 annotation reference;\lsdunhideused1 \lsdlocked0 line number;\lsdunhideused1 \lsdlocked0 endnote reference;\lsdunhideused1 \lsdlocked0 endnote text;\lsdunhideused1 \lsdlocked0 table of authorities;
+\lsdunhideused1 \lsdlocked0 macro;\lsdunhideused1 \lsdlocked0 toa heading;\lsdunhideused1 \lsdlocked0 List;\lsdunhideused1 \lsdlocked0 List Bullet;\lsdunhideused1 \lsdlocked0 List Number;\lsdunhideused1 \lsdlocked0 List 2;
+\lsdunhideused1 \lsdlocked0 List 3;\lsdunhideused1 \lsdlocked0 List 4;\lsdunhideused1 \lsdlocked0 List 5;\lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdunhideused1 \lsdlocked0 List Bullet 3;\lsdunhideused1 \lsdlocked0 List Bullet 4;
+\lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdunhideused1 \lsdlocked0 List Number 2;\lsdunhideused1 \lsdlocked0 List Number 3;\lsdunhideused1 \lsdlocked0 List Number 4;\lsdunhideused1 \lsdlocked0 List Number 5;
+\lsdsemihidden0 \lsdqformat1 \lsdlocked0 Title;\lsdunhideused1 \lsdlocked0 Closing;\lsdunhideused1 \lsdlocked0 Signature;\lsdunhideused1 \lsdlocked0 Body Text Indent;\lsdunhideused1 \lsdlocked0 List Continue;\lsdunhideused1 \lsdlocked0 List Continue 2;
+\lsdunhideused1 \lsdlocked0 List Continue 3;\lsdunhideused1 \lsdlocked0 List Continue 4;\lsdunhideused1 \lsdlocked0 List Continue 5;\lsdunhideused1 \lsdlocked0 Message Header;\lsdsemihidden0 \lsdqformat1 \lsdlocked0 Subtitle;
+\lsdunhideused1 \lsdlocked0 Salutation;\lsdunhideused1 \lsdlocked0 Date;\lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdunhideused1 \lsdlocked0 Note Heading;
+\lsdunhideused1 \lsdlocked0 Body Text 3;\lsdunhideused1 \lsdlocked0 Hyperlink;\lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdsemihidden0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
+\lsdunhideused1 \lsdlocked0 Plain Text;\lsdunhideused1 \lsdlocked0 E-mail Signature;\lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdunhideused1 \lsdlocked0 Normal (Web);
+\lsdunhideused1 \lsdlocked0 HTML Acronym;\lsdunhideused1 \lsdlocked0 HTML Address;\lsdunhideused1 \lsdlocked0 HTML Cite;\lsdunhideused1 \lsdlocked0 HTML Code;\lsdunhideused1 \lsdlocked0 HTML Definition;\lsdunhideused1 \lsdlocked0 HTML Keyboard;
+\lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdunhideused1 \lsdlocked0 HTML Sample;\lsdunhideused1 \lsdlocked0 HTML Typewriter;\lsdunhideused1 \lsdlocked0 HTML Variable;\lsdunhideused1 \lsdlocked0 Normal Table;
+\lsdunhideused1 \lsdlocked0 annotation subject;\lsdunhideused1 \lsdlocked0 No List;\lsdunhideused1 \lsdlocked0 Outline List 1;\lsdunhideused1 \lsdlocked0 Outline List 2;\lsdunhideused1 \lsdlocked0 Outline List 3;\lsdunhideused1 \lsdlocked0 Table Simple 1;
+\lsdunhideused1 \lsdlocked0 Table Simple 2;\lsdunhideused1 \lsdlocked0 Table Simple 3;\lsdunhideused1 \lsdlocked0 Table Classic 1;\lsdunhideused1 \lsdlocked0 Table Classic 2;\lsdunhideused1 \lsdlocked0 Table Classic 3;
+\lsdunhideused1 \lsdlocked0 Table Classic 4;\lsdunhideused1 \lsdlocked0 Table Colorful 1;\lsdunhideused1 \lsdlocked0 Table Colorful 2;\lsdunhideused1 \lsdlocked0 Table Colorful 3;\lsdunhideused1 \lsdlocked0 Table Columns 1;
+\lsdunhideused1 \lsdlocked0 Table Columns 2;\lsdunhideused1 \lsdlocked0 Table Columns 3;\lsdunhideused1 \lsdlocked0 Table Columns 4;\lsdunhideused1 \lsdlocked0 Table Columns 5;\lsdunhideused1 \lsdlocked0 Table Grid 1;
+\lsdunhideused1 \lsdlocked0 Table Grid 2;\lsdunhideused1 \lsdlocked0 Table Grid 3;\lsdunhideused1 \lsdlocked0 Table Grid 4;\lsdunhideused1 \lsdlocked0 Table Grid 5;\lsdunhideused1 \lsdlocked0 Table Grid 6;\lsdunhideused1 \lsdlocked0 Table Grid 7;
+\lsdunhideused1 \lsdlocked0 Table Grid 8;\lsdunhideused1 \lsdlocked0 Table List 1;\lsdunhideused1 \lsdlocked0 Table List 2;\lsdunhideused1 \lsdlocked0 Table List 3;\lsdunhideused1 \lsdlocked0 Table List 4;\lsdunhideused1 \lsdlocked0 Table List 5;
+\lsdunhideused1 \lsdlocked0 Table List 6;\lsdunhideused1 \lsdlocked0 Table List 7;\lsdunhideused1 \lsdlocked0 Table List 8;\lsdunhideused1 \lsdlocked0 Table 3D effects 1;\lsdunhideused1 \lsdlocked0 Table 3D effects 2;
+\lsdunhideused1 \lsdlocked0 Table 3D effects 3;\lsdunhideused1 \lsdlocked0 Table Contemporary;\lsdunhideused1 \lsdlocked0 Table Elegant;\lsdunhideused1 \lsdlocked0 Table Professional;\lsdunhideused1 \lsdlocked0 Table Subtle 1;
+\lsdunhideused1 \lsdlocked0 Table Subtle 2;\lsdunhideused1 \lsdlocked0 Table Web 1;\lsdunhideused1 \lsdlocked0 Table Web 2;\lsdunhideused1 \lsdlocked0 Table Web 3;\lsdunhideused1 \lsdlocked0 Balloon Text;
+\lsdsemihidden0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading;
+\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid;\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2;
+\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1;\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
+\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading;\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List;
+\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;
+\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;
+\lsdsemihidden0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
+\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
+\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
+\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
+\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
+\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
+\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
+\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
+\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
+\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
+\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
+\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
+\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
+\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
+\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
+\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
+\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
+\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
+\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
+\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
+\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
+\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
+\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
+\lsdsemihidden0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
+\lsdsemihidden0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
+\lsdsemihidden0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
+\lsdsemihidden0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
+\lsdsemihidden0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;\lsdsemihidden0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;
+\lsdsemihidden0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdsemihidden0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography;
+\lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
+d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000b09e
+73861317d601feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000105000000000000}}
\ No newline at end of file diff --git a/sw/qa/extras/ooxmlexport/data/tdf129575-directAfter.docx b/sw/qa/extras/ooxmlexport/data/tdf129575-directAfter.docx Binary files differnew file mode 100644 index 000000000..c9856b028 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129575-directAfter.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129575-directBefore.docx b/sw/qa/extras/ooxmlexport/data/tdf129575-directBefore.docx Binary files differnew file mode 100644 index 000000000..5e75ef1be --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129575-directBefore.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129575-docDefault.docx b/sw/qa/extras/ooxmlexport/data/tdf129575-docDefault.docx Binary files differnew file mode 100644 index 000000000..d7cdf2ec4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129575-docDefault.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129575-styleAfter.docx b/sw/qa/extras/ooxmlexport/data/tdf129575-styleAfter.docx Binary files differnew file mode 100644 index 000000000..97439011f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129575-styleAfter.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129888dml.docx b/sw/qa/extras/ooxmlexport/data/tdf129888dml.docx Binary files differnew file mode 100644 index 000000000..1f6b03034 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129888dml.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf129888vml.docx b/sw/qa/extras/ooxmlexport/data/tdf129888vml.docx Binary files differnew file mode 100644 index 000000000..ee7c60f8a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf129888vml.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf130120.docx b/sw/qa/extras/ooxmlexport/data/tdf130120.docx Binary files differnew file mode 100644 index 000000000..5ca2adc76 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf130120.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf130494.docx b/sw/qa/extras/ooxmlexport/data/tdf130494.docx Binary files differnew file mode 100644 index 000000000..bc2050fea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf130494.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott Binary files differnew file mode 100644 index 000000000..35937d9a8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott diff --git a/sw/qa/extras/ooxmlexport/data/tdf130690.docx b/sw/qa/extras/ooxmlexport/data/tdf130690.docx Binary files differnew file mode 100644 index 000000000..ab08dd99a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf130690.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf130814.docx b/sw/qa/extras/ooxmlexport/data/tdf130814.docx Binary files differnew file mode 100644 index 000000000..30c17120e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf130814.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf130907.docx b/sw/qa/extras/ooxmlexport/data/tdf130907.docx Binary files differnew file mode 100644 index 000000000..c0c25fc89 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf130907.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131258.docx b/sw/qa/extras/ooxmlexport/data/tdf131258.docx Binary files differnew file mode 100644 index 000000000..10b8f9de2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131258.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131260.docx b/sw/qa/extras/ooxmlexport/data/tdf131260.docx Binary files differnew file mode 100644 index 000000000..72e07abfd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131260.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131420.docx b/sw/qa/extras/ooxmlexport/data/tdf131420.docx Binary files differnew file mode 100644 index 000000000..360073524 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131420.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131537.odt b/sw/qa/extras/ooxmlexport/data/tdf131537.odt Binary files differnew file mode 100644 index 000000000..21f396368 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131537.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf131539.odt b/sw/qa/extras/ooxmlexport/data/tdf131539.odt Binary files differnew file mode 100644 index 000000000..d0e446522 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131539.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf131594.docx b/sw/qa/extras/ooxmlexport/data/tdf131594.docx Binary files differnew file mode 100644 index 000000000..009c6d56b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131594.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx b/sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx Binary files differnew file mode 100644 index 000000000..a7d34d6f2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx b/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx Binary files differnew file mode 100644 index 000000000..3fd4ab1f5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131801.docx b/sw/qa/extras/ooxmlexport/data/tdf131801.docx Binary files differnew file mode 100644 index 000000000..61872b539 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131801.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx b/sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx Binary files differnew file mode 100644 index 000000000..afd5ec57a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132185.docx b/sw/qa/extras/ooxmlexport/data/tdf132185.docx Binary files differnew file mode 100644 index 000000000..955de5097 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132185.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132305.docx b/sw/qa/extras/ooxmlexport/data/tdf132305.docx Binary files differnew file mode 100644 index 000000000..e6b9ad6b7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132305.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132483.docx b/sw/qa/extras/ooxmlexport/data/tdf132483.docx Binary files differnew file mode 100644 index 000000000..e4ebf4b78 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132483.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx b/sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx Binary files differnew file mode 100644 index 000000000..aa5528b31 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132514.docx b/sw/qa/extras/ooxmlexport/data/tdf132514.docx Binary files differnew file mode 100644 index 000000000..d32f84104 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132514.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132754.docx b/sw/qa/extras/ooxmlexport/data/tdf132754.docx Binary files differnew file mode 100644 index 000000000..baec54f5e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132754.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132766.docx b/sw/qa/extras/ooxmlexport/data/tdf132766.docx Binary files differnew file mode 100644 index 000000000..aba5e8231 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132766.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132802.docx b/sw/qa/extras/ooxmlexport/data/tdf132802.docx Binary files differnew file mode 100644 index 000000000..c4c2d9a1e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132802.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132807.docx b/sw/qa/extras/ooxmlexport/data/tdf132807.docx Binary files differnew file mode 100644 index 000000000..b1e4115c5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132807.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docx Binary files differnew file mode 100644 index 000000000..2f1c5560c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132976_testRelativeAnchorWidthFromLeftMargin.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx b/sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx Binary files differnew file mode 100644 index 000000000..567f38265 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133030.docx b/sw/qa/extras/ooxmlexport/data/tdf133030.docx Binary files differnew file mode 100644 index 000000000..e23f09adf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133030.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133035.docx b/sw/qa/extras/ooxmlexport/data/tdf133035.docx Binary files differnew file mode 100644 index 000000000..c28c119db --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133035.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133052.docx b/sw/qa/extras/ooxmlexport/data/tdf133052.docx Binary files differnew file mode 100644 index 000000000..937554fac --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133052.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133065.odt b/sw/qa/extras/ooxmlexport/data/tdf133065.odt Binary files differnew file mode 100644 index 000000000..a5e1b3587 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133065.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx b/sw/qa/extras/ooxmlexport/data/tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx Binary files differnew file mode 100644 index 000000000..2625a9a56 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx b/sw/qa/extras/ooxmlexport/data/tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx Binary files differnew file mode 100644 index 000000000..155e74857 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133163.fodt b/sw/qa/extras/ooxmlexport/data/tdf133163.fodt new file mode 100644 index 000000000..8fdda1cdc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133163.fodt @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:ooow="http://openoffice.org/2004/writer" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:styles> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:default-style style:family="paragraph"> + <style:text-properties fo:language="en" fo:country="US"/> + </style:default-style> + </office:styles> + <office:body> + <office:text> + <table:table> + <table:table-column/> + <table:table-row> + <table:table-cell office:value-type="string"> + <text:p>1</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell office:value-type="string"> + <text:p>2</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:formula="ooow:<A1>+<A2>" office:value-type="float" office:value="3"> + <text:p>3</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:formula="ooow:SUM(<A1:A3>)" office:value-type="float" office:value="6"> + <text:p>6</text:p> + </table:table-cell> + </table:table-row> + </table:table> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/tdf133334_followPgStyle.odt b/sw/qa/extras/ooxmlexport/data/tdf133334_followPgStyle.odt Binary files differnew file mode 100644 index 000000000..56f21545a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133334_followPgStyle.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf133370_columnBreak.odt b/sw/qa/extras/ooxmlexport/data/tdf133370_columnBreak.odt Binary files differnew file mode 100644 index 000000000..1848638ab --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133370_columnBreak.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf133455.docx b/sw/qa/extras/ooxmlexport/data/tdf133455.docx Binary files differnew file mode 100644 index 000000000..e85297699 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133455.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133457.docx b/sw/qa/extras/ooxmlexport/data/tdf133457.docx Binary files differnew file mode 100644 index 000000000..8fb6730b0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133457.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133605.docx b/sw/qa/extras/ooxmlexport/data/tdf133605.docx Binary files differnew file mode 100644 index 000000000..d248d5e1a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133605.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133605_2.docx b/sw/qa/extras/ooxmlexport/data/tdf133605_2.docx Binary files differnew file mode 100644 index 000000000..8d3c5acba --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133605_2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133647.docx b/sw/qa/extras/ooxmlexport/data/tdf133647.docx Binary files differnew file mode 100644 index 000000000..fb525446c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133647.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx Binary files differnew file mode 100644 index 000000000..68f24370a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133670_testRelativeAnchorWidthFromRightMargin.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133701.docx b/sw/qa/extras/ooxmlexport/data/tdf133701.docx Binary files differnew file mode 100644 index 000000000..dfef409c2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133701.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133771.odt b/sw/qa/extras/ooxmlexport/data/tdf133771.odt Binary files differnew file mode 100644 index 000000000..fd54160af --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133771.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx Binary files differnew file mode 100644 index 000000000..453320f38 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf133924.docx b/sw/qa/extras/ooxmlexport/data/tdf133924.docx Binary files differnew file mode 100644 index 000000000..3bdbe8d6f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133924.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf134063.docx b/sw/qa/extras/ooxmlexport/data/tdf134063.docx Binary files differnew file mode 100644 index 000000000..372fed20e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf134063.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf134648.docx b/sw/qa/extras/ooxmlexport/data/tdf134648.docx Binary files differnew file mode 100644 index 000000000..36e856ca0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf134648.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf134784.docx b/sw/qa/extras/ooxmlexport/data/tdf134784.docx Binary files differnew file mode 100644 index 000000000..2099db66e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf134784.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf135665.docx b/sw/qa/extras/ooxmlexport/data/tdf135665.docx Binary files differnew file mode 100644 index 000000000..2400a1c1a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf135665.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf135973.odt b/sw/qa/extras/ooxmlexport/data/tdf135973.odt Binary files differnew file mode 100644 index 000000000..0eb42080f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf135973.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt b/sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt Binary files differnew file mode 100644 index 000000000..61c9632b3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf137593.docx b/sw/qa/extras/ooxmlexport/data/tdf137593.docx Binary files differnew file mode 100644 index 000000000..8b63fd39a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf137593.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf138612.docx b/sw/qa/extras/ooxmlexport/data/tdf138612.docx Binary files differnew file mode 100644 index 000000000..dd116044b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf138612.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf36117_verticalAdjustment.docx b/sw/qa/extras/ooxmlexport/data/tdf36117_verticalAdjustment.docx Binary files differnew file mode 100644 index 000000000..70fdec72d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf36117_verticalAdjustment.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docx b/sw/qa/extras/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docx Binary files differnew file mode 100644 index 000000000..d89baaf08 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf38778_properties_in_run_for_field.doc b/sw/qa/extras/ooxmlexport/data/tdf38778_properties_in_run_for_field.doc Binary files differnew file mode 100644 index 000000000..5f0f7238a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf38778_properties_in_run_for_field.doc diff --git a/sw/qa/extras/ooxmlexport/data/tdf41542_borderlessPadding.odt b/sw/qa/extras/ooxmlexport/data/tdf41542_borderlessPadding.odt Binary files differnew file mode 100644 index 000000000..9585041de --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf41542_borderlessPadding.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt b/sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt Binary files differnew file mode 100644 index 000000000..019e19f24 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf44832_section_new_header.odt b/sw/qa/extras/ooxmlexport/data/tdf44832_section_new_header.odt Binary files differnew file mode 100644 index 000000000..9db311db1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf44832_section_new_header.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf44986.docx b/sw/qa/extras/ooxmlexport/data/tdf44986.docx Binary files differnew file mode 100644 index 000000000..7859ab402 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf44986.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf46938_clearTabStop.docx b/sw/qa/extras/ooxmlexport/data/tdf46938_clearTabStop.docx Binary files differnew file mode 100644 index 000000000..8dea12fcb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf46938_clearTabStop.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf46940_dontEquallyDistributeColumns.docx b/sw/qa/extras/ooxmlexport/data/tdf46940_dontEquallyDistributeColumns.docx Binary files differnew file mode 100644 index 000000000..657da5eb0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf46940_dontEquallyDistributeColumns.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf48569.odt b/sw/qa/extras/ooxmlexport/data/tdf48569.odt Binary files differnew file mode 100644 index 000000000..3ae5ac393 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf48569.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf49073.docx b/sw/qa/extras/ooxmlexport/data/tdf49073.docx Binary files differnew file mode 100644 index 000000000..ddcbb62fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf49073.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf53856_conflictingStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf53856_conflictingStyle.docx Binary files differnew file mode 100644 index 000000000..71b925a9a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf53856_conflictingStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf55427_footnote2endnote.odt b/sw/qa/extras/ooxmlexport/data/tdf55427_footnote2endnote.odt Binary files differnew file mode 100644 index 000000000..7f77f6d39 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf55427_footnote2endnote.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx b/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx Binary files differnew file mode 100644 index 000000000..d12b85b2d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf58944-repeating-table-header.docx b/sw/qa/extras/ooxmlexport/data/tdf58944-repeating-table-header.docx Binary files differnew file mode 100644 index 000000000..56e37362a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf58944-repeating-table-header.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf59274.docx b/sw/qa/extras/ooxmlexport/data/tdf59274.docx Binary files differnew file mode 100644 index 000000000..38aad9ae9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf59274.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf59699.docx b/sw/qa/extras/ooxmlexport/data/tdf59699.docx Binary files differnew file mode 100644 index 000000000..158ac338f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf59699.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs.docx b/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs.docx Binary files differnew file mode 100644 index 000000000..228b9b547 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx b/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx Binary files differnew file mode 100644 index 000000000..cf674f3c4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf64264.docx b/sw/qa/extras/ooxmlexport/data/tdf64264.docx Binary files differnew file mode 100644 index 000000000..e2fea64da --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf64264.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docx b/sw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docx Binary files differnew file mode 100644 index 000000000..20ad82bb5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf65955.odt b/sw/qa/extras/ooxmlexport/data/tdf65955.odt Binary files differnew file mode 100644 index 000000000..e133938e0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf65955.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf65955_2.odt b/sw/qa/extras/ooxmlexport/data/tdf65955_2.odt Binary files differnew file mode 100644 index 000000000..5ad9146dc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf65955_2.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf66398_permissions.docx b/sw/qa/extras/ooxmlexport/data/tdf66398_permissions.docx Binary files differnew file mode 100644 index 000000000..d5c855994 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf66398_permissions.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf66401.docx b/sw/qa/extras/ooxmlexport/data/tdf66401.docx Binary files differnew file mode 100644 index 000000000..2e2ddca37 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf66401.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf66496.docx b/sw/qa/extras/ooxmlexport/data/tdf66496.docx Binary files differnew file mode 100644 index 000000000..6f168d38e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf66496.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf67207.docx b/sw/qa/extras/ooxmlexport/data/tdf67207.docx Binary files differnew file mode 100644 index 000000000..b0604c266 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf67207.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf70234.docx b/sw/qa/extras/ooxmlexport/data/tdf70234.docx Binary files differnew file mode 100644 index 000000000..33ef99430 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf70234.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf73547-dash.docx b/sw/qa/extras/ooxmlexport/data/tdf73547-dash.docx Binary files differnew file mode 100644 index 000000000..40e741ebb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf73547-dash.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf76683_negativeTwipsMeasure.docx b/sw/qa/extras/ooxmlexport/data/tdf76683_negativeTwipsMeasure.docx Binary files differnew file mode 100644 index 000000000..eb769fdcc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf76683_negativeTwipsMeasure.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx b/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx Binary files differnew file mode 100644 index 000000000..bcfdcf377 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx b/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx Binary files differnew file mode 100644 index 000000000..7de2b4c39 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx b/sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx Binary files differnew file mode 100644 index 000000000..2bb2c0978 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf77236_MissingSolidFill.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf77417.docx b/sw/qa/extras/ooxmlexport/data/tdf77417.docx Binary files differnew file mode 100644 index 000000000..4b4fb20fe --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf77417.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf77796.docx b/sw/qa/extras/ooxmlexport/data/tdf77796.docx Binary files differnew file mode 100644 index 000000000..e42c37daa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf77796.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf78352.docx b/sw/qa/extras/ooxmlexport/data/tdf78352.docx Binary files differnew file mode 100644 index 000000000..6f85f2e2a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf78352.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf78657_picture_hyperlink.docx b/sw/qa/extras/ooxmlexport/data/tdf78657_picture_hyperlink.docx Binary files differnew file mode 100644 index 000000000..bc4759ecc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf78657_picture_hyperlink.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf78749.docx b/sw/qa/extras/ooxmlexport/data/tdf78749.docx Binary files differnew file mode 100644 index 000000000..db498849e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf78749.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf78902.docx b/sw/qa/extras/ooxmlexport/data/tdf78902.docx Binary files differnew file mode 100644 index 000000000..3cf3a443a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf78902.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx b/sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx Binary files differnew file mode 100644 index 000000000..4d5ea67bd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf79329.docx b/sw/qa/extras/ooxmlexport/data/tdf79329.docx Binary files differnew file mode 100644 index 000000000..142f29522 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf79329.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf79435_legacyInputFields.doc b/sw/qa/extras/ooxmlexport/data/tdf79435_legacyInputFields.doc Binary files differnew file mode 100644 index 000000000..da7fade80 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf79435_legacyInputFields.doc diff --git a/sw/qa/extras/ooxmlexport/data/tdf79639.docx b/sw/qa/extras/ooxmlexport/data/tdf79639.docx Binary files differnew file mode 100644 index 000000000..b84aaea70 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf79639.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf81100.docx b/sw/qa/extras/ooxmlexport/data/tdf81100.docx Binary files differnew file mode 100644 index 000000000..cd46100f0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf81100.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf81345.docx b/sw/qa/extras/ooxmlexport/data/tdf81345.docx Binary files differnew file mode 100644 index 000000000..4f18b1eea --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf81345.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82065_Ind_start_strict.docx b/sw/qa/extras/ooxmlexport/data/tdf82065_Ind_start_strict.docx Binary files differnew file mode 100644 index 000000000..6cbdbdc97 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82065_Ind_start_strict.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx Binary files differnew file mode 100644 index 000000000..d38a65943 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82173_footnoteStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf82173_footnoteStyle.docx Binary files differnew file mode 100644 index 000000000..4fa7b0a24 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82173_footnoteStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx b/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx Binary files differnew file mode 100644 index 000000000..e9df3b704 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82177_insideCellBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf82177_insideCellBorders.docx Binary files differnew file mode 100644 index 000000000..f1f0d272d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82177_insideCellBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82177_outsideCellBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf82177_outsideCellBorders.docx Binary files differnew file mode 100644 index 000000000..75c9a656d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82177_outsideCellBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docx Binary files differnew file mode 100644 index 000000000..88a237cf6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf8255.docx b/sw/qa/extras/ooxmlexport/data/tdf8255.docx Binary files differnew file mode 100644 index 000000000..366e49885 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf8255.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf83227.docx b/sw/qa/extras/ooxmlexport/data/tdf83227.docx Binary files differnew file mode 100644 index 000000000..bca19a955 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf83227.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf83300.docx b/sw/qa/extras/ooxmlexport/data/tdf83300.docx Binary files differnew file mode 100644 index 000000000..aa3ad22d1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf83300.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf83309.docx b/sw/qa/extras/ooxmlexport/data/tdf83309.docx Binary files differnew file mode 100644 index 000000000..03e079787 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf83309.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf84678.docx b/sw/qa/extras/ooxmlexport/data/tdf84678.docx Binary files differnew file mode 100644 index 000000000..f79922861 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf84678.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf85161.docx b/sw/qa/extras/ooxmlexport/data/tdf85161.docx Binary files differnew file mode 100644 index 000000000..e079b4906 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf85161.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf86374.docx b/sw/qa/extras/ooxmlexport/data/tdf86374.docx Binary files differnew file mode 100644 index 000000000..7fd772d79 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf86374.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf86926_A3.docx b/sw/qa/extras/ooxmlexport/data/tdf86926_A3.docx Binary files differnew file mode 100644 index 000000000..a4392dcf2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf86926_A3.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf87348_linkedTextboxes.docx b/sw/qa/extras/ooxmlexport/data/tdf87348_linkedTextboxes.docx Binary files differnew file mode 100644 index 000000000..8f9eb97d8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf87348_linkedTextboxes.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf87460.docx b/sw/qa/extras/ooxmlexport/data/tdf87460.docx Binary files differnew file mode 100644 index 000000000..c443dbe45 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf87460.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf87569_drawingml.docx b/sw/qa/extras/ooxmlexport/data/tdf87569_drawingml.docx Binary files differnew file mode 100644 index 000000000..7f00a46e2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf87569_drawingml.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf87569_vml.docx b/sw/qa/extras/ooxmlexport/data/tdf87569_vml.docx Binary files differnew file mode 100644 index 000000000..0223ad71d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf87569_vml.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf87924.docx b/sw/qa/extras/ooxmlexport/data/tdf87924.docx Binary files differnew file mode 100644 index 000000000..5265d6638 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf87924.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf88496.docx b/sw/qa/extras/ooxmlexport/data/tdf88496.docx Binary files differnew file mode 100644 index 000000000..b34f30389 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf88496.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf88583.odt b/sw/qa/extras/ooxmlexport/data/tdf88583.odt Binary files differnew file mode 100644 index 000000000..307ab1e78 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf88583.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf89165.docx b/sw/qa/extras/ooxmlexport/data/tdf89165.docx Binary files differnew file mode 100644 index 000000000..a060ca444 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89165.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf89377_tableWithBreakBeforeParaStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf89377_tableWithBreakBeforeParaStyle.docx Binary files differnew file mode 100644 index 000000000..bf673e86e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89377_tableWithBreakBeforeParaStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf89702.docx b/sw/qa/extras/ooxmlexport/data/tdf89702.docx Binary files differnew file mode 100644 index 000000000..5542d1cbe --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89702.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf89774.fodt b/sw/qa/extras/ooxmlexport/data/tdf89774.fodt new file mode 100644 index 000000000..18e1e7ac4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89774.fodt @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta> + <meta:editing-duration>PT1M5S</meta:editing-duration> + </office:meta> + <office:body> + <office:text> + <text:p>hello</text:p> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/tdf89791.docx b/sw/qa/extras/ooxmlexport/data/tdf89791.docx Binary files differnew file mode 100644 index 000000000..7ea98aa58 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89791.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf89890.docx b/sw/qa/extras/ooxmlexport/data/tdf89890.docx Binary files differnew file mode 100644 index 000000000..8b3e8ebe1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89890.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf89991.docx b/sw/qa/extras/ooxmlexport/data/tdf89991.docx Binary files differnew file mode 100644 index 000000000..a074d9679 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf89991.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90153.docx b/sw/qa/extras/ooxmlexport/data/tdf90153.docx Binary files differnew file mode 100644 index 000000000..decbfa29d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90153.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90611.docx b/sw/qa/extras/ooxmlexport/data/tdf90611.docx Binary files differnew file mode 100644 index 000000000..ac54feedd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90611.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90681-1.odt b/sw/qa/extras/ooxmlexport/data/tdf90681-1.odt Binary files differnew file mode 100644 index 000000000..009e006ca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90681-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf90681-2.odt b/sw/qa/extras/ooxmlexport/data/tdf90681-2.odt Binary files differnew file mode 100644 index 000000000..3d9d46fc4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90681-2.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf90697_complexBreaksHeaders.docx b/sw/qa/extras/ooxmlexport/data/tdf90697_complexBreaksHeaders.docx Binary files differnew file mode 100644 index 000000000..b5e7ef023 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90697_complexBreaksHeaders.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90789-2.docx b/sw/qa/extras/ooxmlexport/data/tdf90789-2.docx Binary files differnew file mode 100644 index 000000000..2f831d722 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90789-2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90789.docx b/sw/qa/extras/ooxmlexport/data/tdf90789.docx Binary files differnew file mode 100644 index 000000000..b94b2ad7f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90789.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90810short.docx b/sw/qa/extras/ooxmlexport/data/tdf90810short.docx Binary files differnew file mode 100644 index 000000000..85b6369fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90810short.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90906_colAuto.docx b/sw/qa/extras/ooxmlexport/data/tdf90906_colAuto.docx Binary files differnew file mode 100644 index 000000000..3df6b65c8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90906_colAuto.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf90906_colAutoB.docx b/sw/qa/extras/ooxmlexport/data/tdf90906_colAutoB.docx Binary files differnew file mode 100644 index 000000000..84825201b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf90906_colAutoB.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91122.docx b/sw/qa/extras/ooxmlexport/data/tdf91122.docx Binary files differnew file mode 100644 index 000000000..c7a45e4dd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91122.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91260.docx b/sw/qa/extras/ooxmlexport/data/tdf91260.docx Binary files differnew file mode 100644 index 000000000..4888f498d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91260.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91261.docx b/sw/qa/extras/ooxmlexport/data/tdf91261.docx Binary files differnew file mode 100644 index 000000000..6edb8b875 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91261.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91417.docx b/sw/qa/extras/ooxmlexport/data/tdf91417.docx Binary files differnew file mode 100644 index 000000000..1427f8cb3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91417.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91429.docx b/sw/qa/extras/ooxmlexport/data/tdf91429.docx Binary files differnew file mode 100644 index 000000000..5fc5f533a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91429.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91594.docx b/sw/qa/extras/ooxmlexport/data/tdf91594.docx Binary files differnew file mode 100644 index 000000000..ea539afa3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91594.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92045.docx b/sw/qa/extras/ooxmlexport/data/tdf92045.docx Binary files differnew file mode 100644 index 000000000..d41f523c7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92045.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92124.docx b/sw/qa/extras/ooxmlexport/data/tdf92124.docx Binary files differnew file mode 100644 index 000000000..299931193 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92124.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92157.docx b/sw/qa/extras/ooxmlexport/data/tdf92157.docx Binary files differnew file mode 100644 index 000000000..ba5bc2a8f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92157.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92335.docx b/sw/qa/extras/ooxmlexport/data/tdf92335.docx Binary files differnew file mode 100644 index 000000000..28cf521c2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92335.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92454.docx b/sw/qa/extras/ooxmlexport/data/tdf92454.docx Binary files differnew file mode 100644 index 000000000..70426685e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92454.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92470_footnoteRestart.docx b/sw/qa/extras/ooxmlexport/data/tdf92470_footnoteRestart.docx Binary files differnew file mode 100644 index 000000000..b8746968b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92470_footnoteRestart.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92472.docx b/sw/qa/extras/ooxmlexport/data/tdf92472.docx Binary files differnew file mode 100644 index 000000000..6cf2b50e9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92472.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92521.odt b/sw/qa/extras/ooxmlexport/data/tdf92521.odt Binary files differnew file mode 100644 index 000000000..8148e49a2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92521.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf92524_autoColor.doc b/sw/qa/extras/ooxmlexport/data/tdf92524_autoColor.doc Binary files differnew file mode 100644 index 000000000..147e9c133 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92524_autoColor.doc diff --git a/sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt b/sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt Binary files differnew file mode 100644 index 000000000..fffd9b9b2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docx b/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docx Binary files differnew file mode 100644 index 000000000..808d05697 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex2.docx b/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex2.docx Binary files differnew file mode 100644 index 000000000..18b63c07c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt b/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt Binary files differnew file mode 100644 index 000000000..37d621b90 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf93919.docx b/sw/qa/extras/ooxmlexport/data/tdf93919.docx Binary files differnew file mode 100644 index 000000000..c7454690c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf93919.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf94043.docx b/sw/qa/extras/ooxmlexport/data/tdf94043.docx Binary files differnew file mode 100644 index 000000000..fa47be076 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf94043.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf94374.docx b/sw/qa/extras/ooxmlexport/data/tdf94374.docx Binary files differnew file mode 100644 index 000000000..d5d8d43eb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf94374.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf94628.docx b/sw/qa/extras/ooxmlexport/data/tdf94628.docx Binary files differnew file mode 100644 index 000000000..aa1d22684 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf94628.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf94801.docx b/sw/qa/extras/ooxmlexport/data/tdf94801.docx Binary files differnew file mode 100644 index 000000000..bdbd3f5e5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf94801.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95031.docx b/sw/qa/extras/ooxmlexport/data/tdf95031.docx Binary files differnew file mode 100644 index 000000000..ef082f752 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95031.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95033.docx b/sw/qa/extras/ooxmlexport/data/tdf95033.docx Binary files differnew file mode 100644 index 000000000..5d2cc73db --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95033.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95189.docx b/sw/qa/extras/ooxmlexport/data/tdf95189.docx Binary files differnew file mode 100644 index 000000000..456276b20 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95189.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95213.docx b/sw/qa/extras/ooxmlexport/data/tdf95213.docx Binary files differnew file mode 100644 index 000000000..831d543b9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95213.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95367_inheritFollowStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf95367_inheritFollowStyle.docx Binary files differnew file mode 100644 index 000000000..96d91ddca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95367_inheritFollowStyle.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95374.docx b/sw/qa/extras/ooxmlexport/data/tdf95374.docx Binary files differnew file mode 100644 index 000000000..49599953a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95374.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95376.docx b/sw/qa/extras/ooxmlexport/data/tdf95376.docx Binary files differnew file mode 100644 index 000000000..9bd2d05b2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95376.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95377.docx b/sw/qa/extras/ooxmlexport/data/tdf95377.docx Binary files differnew file mode 100644 index 000000000..be5551dca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95377.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95495.docx b/sw/qa/extras/ooxmlexport/data/tdf95495.docx Binary files differnew file mode 100644 index 000000000..21f534b11 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95495.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95775.docx b/sw/qa/extras/ooxmlexport/data/tdf95775.docx Binary files differnew file mode 100644 index 000000000..a4c1293a5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95775.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95777.docx b/sw/qa/extras/ooxmlexport/data/tdf95777.docx Binary files differnew file mode 100644 index 000000000..e71fdea60 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95777.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95848.docx b/sw/qa/extras/ooxmlexport/data/tdf95848.docx Binary files differnew file mode 100644 index 000000000..3bf17f692 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95848.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf95848_2.docx b/sw/qa/extras/ooxmlexport/data/tdf95848_2.docx Binary files differnew file mode 100644 index 000000000..33c1773d5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95848_2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docx b/sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docx Binary files differnew file mode 100644 index 000000000..612078b26 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf97090.docx b/sw/qa/extras/ooxmlexport/data/tdf97090.docx Binary files differnew file mode 100644 index 000000000..3ba402718 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf97090.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf97371.docx b/sw/qa/extras/ooxmlexport/data/tdf97371.docx Binary files differnew file mode 100644 index 000000000..87e67ddf8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf97371.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx b/sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx Binary files differnew file mode 100644 index 000000000..686fd6803 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt b/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt Binary files differnew file mode 100644 index 000000000..ae675b82f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt b/sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt Binary files differnew file mode 100644 index 000000000..4ed96da55 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf99074.docx b/sw/qa/extras/ooxmlexport/data/tdf99074.docx Binary files differnew file mode 100644 index 000000000..d7be418fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99074.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99090_pgbrkAfterTable.docx b/sw/qa/extras/ooxmlexport/data/tdf99090_pgbrkAfterTable.docx Binary files differnew file mode 100644 index 000000000..c914f350e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99090_pgbrkAfterTable.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99140.docx b/sw/qa/extras/ooxmlexport/data/tdf99140.docx Binary files differnew file mode 100644 index 000000000..42fa73d2f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99140.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99227.docx b/sw/qa/extras/ooxmlexport/data/tdf99227.docx Binary files differnew file mode 100644 index 000000000..27ec4eb38 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99227.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99602_charStyleSubscript.docx b/sw/qa/extras/ooxmlexport/data/tdf99602_charStyleSubscript.docx Binary files differnew file mode 100644 index 000000000..a88c122ee --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99602_charStyleSubscript.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99602_charStyleSubscript2.odt b/sw/qa/extras/ooxmlexport/data/tdf99602_charStyleSubscript2.odt Binary files differnew file mode 100644 index 000000000..a82c81564 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99602_charStyleSubscript2.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf99602_subscript_charStyleSize.docx b/sw/qa/extras/ooxmlexport/data/tdf99602_subscript_charStyleSize.docx Binary files differnew file mode 100644 index 000000000..6283b8de7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99602_subscript_charStyleSize.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx b/sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx Binary files differnew file mode 100644 index 000000000..825108a3c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf99631.docx b/sw/qa/extras/ooxmlexport/data/tdf99631.docx Binary files differnew file mode 100644 index 000000000..c72950b72 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf99631.docx diff --git a/sw/qa/extras/ooxmlexport/data/test76108.docx b/sw/qa/extras/ooxmlexport/data/test76108.docx Binary files differnew file mode 100644 index 000000000..3476dc58c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test76108.docx diff --git a/sw/qa/extras/ooxmlexport/data/test76317.docx b/sw/qa/extras/ooxmlexport/data/test76317.docx Binary files differnew file mode 100644 index 000000000..2c86cdc38 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test76317.docx diff --git a/sw/qa/extras/ooxmlexport/data/test76317_2K10.docx b/sw/qa/extras/ooxmlexport/data/test76317_2K10.docx Binary files differnew file mode 100644 index 000000000..553206340 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test76317_2K10.docx diff --git a/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx b/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx Binary files differnew file mode 100644 index 000000000..5e0e114a5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx diff --git a/sw/qa/extras/ooxmlexport/data/test77219.docx b/sw/qa/extras/ooxmlexport/data/test77219.docx Binary files differnew file mode 100644 index 000000000..29aca1beb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test77219.docx diff --git a/sw/qa/extras/ooxmlexport/data/testCrashWhileSave.docx b/sw/qa/extras/ooxmlexport/data/testCrashWhileSave.docx Binary files differnew file mode 100644 index 000000000..205995171 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testCrashWhileSave.docx diff --git a/sw/qa/extras/ooxmlexport/data/testFootnote.docx b/sw/qa/extras/ooxmlexport/data/testFootnote.docx Binary files differnew file mode 100644 index 000000000..5bba6d8c9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testFootnote.docx diff --git a/sw/qa/extras/ooxmlexport/data/testGlossary.docx b/sw/qa/extras/ooxmlexport/data/testGlossary.docx Binary files differnew file mode 100644 index 000000000..eb05758d2 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testGlossary.docx diff --git a/sw/qa/extras/ooxmlexport/data/testOuterShdw.docx b/sw/qa/extras/ooxmlexport/data/testOuterShdw.docx Binary files differnew file mode 100644 index 000000000..cc559a323 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testOuterShdw.docx diff --git a/sw/qa/extras/ooxmlexport/data/testPageref.docx b/sw/qa/extras/ooxmlexport/data/testPageref.docx Binary files differnew file mode 100644 index 000000000..65ca38aed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testPageref.docx diff --git a/sw/qa/extras/ooxmlexport/data/testPgMargin.docx b/sw/qa/extras/ooxmlexport/data/testPgMargin.docx Binary files differnew file mode 100644 index 000000000..aa54f6ad7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testPgMargin.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTOCFlag_u.docx b/sw/qa/extras/ooxmlexport/data/testTOCFlag_u.docx Binary files differnew file mode 100644 index 000000000..077bccfef --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTOCFlag_u.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTcBorders.docx b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx Binary files differnew file mode 100644 index 000000000..b7fb81ad4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTdf130167_spilloverHeader.docx b/sw/qa/extras/ooxmlexport/data/testTdf130167_spilloverHeader.docx Binary files differnew file mode 100644 index 000000000..6bcafa285 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTdf130167_spilloverHeader.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTitlePage.docx b/sw/qa/extras/ooxmlexport/data/testTitlePage.docx Binary files differnew file mode 100644 index 000000000..72bfdf81f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTitlePage.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedEmptyParagraph.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedEmptyParagraph.docx Binary files differnew file mode 100644 index 000000000..bd332efa4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedEmptyParagraph.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedParagraphMark.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedParagraphMark.docx Binary files differnew file mode 100644 index 000000000..5d85f326d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedParagraphMark.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedTableCell.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedTableCell.docx Binary files differnew file mode 100644 index 000000000..c4d8394bf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedTableCell.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedTableRow.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedTableRow.docx Binary files differnew file mode 100644 index 000000000..71c499878 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesDeletedTableRow.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesEmptyParagraphsInADeletion.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesEmptyParagraphsInADeletion.docx Binary files differnew file mode 100644 index 000000000..fcd78e9cd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesEmptyParagraphsInADeletion.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedParagraphMark.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedParagraphMark.docx Binary files differnew file mode 100644 index 000000000..33b451613 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedParagraphMark.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedTableCell.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedTableCell.docx Binary files differnew file mode 100644 index 000000000..d1450be67 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedTableCell.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedTableRow.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedTableRow.docx Binary files differnew file mode 100644 index 000000000..a7c0f56ed --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesInsertedTableRow.docx diff --git a/sw/qa/extras/ooxmlexport/data/testTrackChangesParagraphProperties.docx b/sw/qa/extras/ooxmlexport/data/testTrackChangesParagraphProperties.docx Binary files differnew file mode 100644 index 000000000..4a8585c1d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTrackChangesParagraphProperties.docx diff --git a/sw/qa/extras/ooxmlexport/data/testWordArtWithinDraingtool.docx b/sw/qa/extras/ooxmlexport/data/testWordArtWithinDraingtool.docx Binary files differnew file mode 100644 index 000000000..c860828fa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testWordArtWithinDraingtool.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_GIF_ImageCrop.docx b/sw/qa/extras/ooxmlexport/data/test_GIF_ImageCrop.docx Binary files differnew file mode 100644 index 000000000..8fe7ff222 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_GIF_ImageCrop.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_PNG_ImageCrop.docx b/sw/qa/extras/ooxmlexport/data/test_PNG_ImageCrop.docx Binary files differnew file mode 100644 index 000000000..7fda32144 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_PNG_ImageCrop.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_extra_image.docx b/sw/qa/extras/ooxmlexport/data/test_extra_image.docx Binary files differnew file mode 100644 index 000000000..cdb05afa4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_extra_image.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_indentation.docx b/sw/qa/extras/ooxmlexport/data/test_indentation.docx Binary files differnew file mode 100644 index 000000000..b39e06658 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_indentation.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_line_spacing.docx b/sw/qa/extras/ooxmlexport/data/test_line_spacing.docx Binary files differnew file mode 100644 index 000000000..2f92afbb7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_line_spacing.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_msword_hang.docx b/sw/qa/extras/ooxmlexport/data/test_msword_hang.docx Binary files differnew file mode 100644 index 000000000..cae7814f9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_msword_hang.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_ole_object.docx b/sw/qa/extras/ooxmlexport/data/test_ole_object.docx Binary files differnew file mode 100644 index 000000000..4391946f0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_ole_object.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_segfault_while_save.docx b/sw/qa/extras/ooxmlexport/data/test_segfault_while_save.docx Binary files differnew file mode 100644 index 000000000..1c364dd0d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_segfault_while_save.docx diff --git a/sw/qa/extras/ooxmlexport/data/test_tdf120412.docx b/sw/qa/extras/ooxmlexport/data/test_tdf120412.docx Binary files differnew file mode 100644 index 000000000..6ce527842 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/test_tdf120412.docx diff --git a/sw/qa/extras/ooxmlexport/data/textWatermark.docx b/sw/qa/extras/ooxmlexport/data/textWatermark.docx Binary files differnew file mode 100644 index 000000000..c8bff75e0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textWatermark.docx diff --git a/sw/qa/extras/ooxmlexport/data/text_cardinal_list.docx b/sw/qa/extras/ooxmlexport/data/text_cardinal_list.docx Binary files differnew file mode 100644 index 000000000..9a1efd7c6 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/text_cardinal_list.docx diff --git a/sw/qa/extras/ooxmlexport/data/text_number_list.docx b/sw/qa/extras/ooxmlexport/data/text_number_list.docx Binary files differnew file mode 100644 index 000000000..674c4e797 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/text_number_list.docx diff --git a/sw/qa/extras/ooxmlexport/data/text_ordinal_list.docx b/sw/qa/extras/ooxmlexport/data/text_ordinal_list.docx Binary files differnew file mode 100644 index 000000000..bb5b4f520 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/text_ordinal_list.docx diff --git a/sw/qa/extras/ooxmlexport/data/textbox-right-edge.docx b/sw/qa/extras/ooxmlexport/data/textbox-right-edge.docx Binary files differnew file mode 100644 index 000000000..990d1e49e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textbox-right-edge.docx diff --git a/sw/qa/extras/ooxmlexport/data/textbox-rounded-corners.docx b/sw/qa/extras/ooxmlexport/data/textbox-rounded-corners.docx Binary files differnew file mode 100644 index 000000000..012e071cd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textbox-rounded-corners.docx diff --git a/sw/qa/extras/ooxmlexport/data/textbox-table.docx b/sw/qa/extras/ooxmlexport/data/textbox-table.docx Binary files differnew file mode 100644 index 000000000..8c06f5eeb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textbox-table.docx diff --git a/sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx b/sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx Binary files differnew file mode 100644 index 000000000..cd853f97d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textbox-wpg-only.docx diff --git a/sw/qa/extras/ooxmlexport/data/textbox_picturefill.docx b/sw/qa/extras/ooxmlexport/data/textbox_picturefill.docx Binary files differnew file mode 100644 index 000000000..f4fab1b1f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textbox_picturefill.docx diff --git a/sw/qa/extras/ooxmlexport/data/textframe-borders.docx b/sw/qa/extras/ooxmlexport/data/textframe-borders.docx Binary files differnew file mode 100644 index 000000000..424ed2a32 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textframe-borders.docx diff --git a/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx b/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx Binary files differnew file mode 100644 index 000000000..e5ed0689d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textframe-gradient.docx diff --git a/sw/qa/extras/ooxmlexport/data/textframes.odt b/sw/qa/extras/ooxmlexport/data/textframes.odt Binary files differnew file mode 100644 index 000000000..301744af3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textframes.odt diff --git a/sw/qa/extras/ooxmlexport/data/textinput.odt b/sw/qa/extras/ooxmlexport/data/textinput.odt Binary files differnew file mode 100644 index 000000000..3a5da684a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textinput.odt diff --git a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx Binary files differnew file mode 100644 index 000000000..2de4374da --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/data/toc_doc.docx b/sw/qa/extras/ooxmlexport/data/toc_doc.docx Binary files differnew file mode 100644 index 000000000..26fa3dc71 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/toc_doc.docx diff --git a/sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx b/sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx Binary files differnew file mode 100644 index 000000000..8fb2668b3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tools-line-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt b/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt new file mode 100644 index 000000000..b1323f6f4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/toxmarkhyperlink.fodt @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + + <office:font-face-decls> + <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Sans CN Normal" svg:font-family="'Source Han Sans CN Normal'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Normal" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text"> + <style:text-properties fo:color="#000080" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/> + </style:style> + + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> + <style:text-properties officeooo:rsid="001000a5" officeooo:paragraph-rsid="001000a5"/> + </style:style> + <style:style style:name="Ru1" style:family="ruby"> + <style:ruby-properties style:ruby-align="left" style:ruby-position="above"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <text:p text:style-name="P1"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/></text:p> + <text:p text:style-name="P1"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/></text:p> + <text:p text:style-name="P1"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/>foo</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo<text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/></text:a></text:p> + <text:p text:style-name="P1"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/>foo</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo<text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:alphabetical-index-mark text:string-value="foo" text:key1="baz"/><text:alphabetical-index-mark text:string-value="foo" text:key1="quux"/></text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:alphabetical-index-mark text:string-value="foo" text:key1="bar"/><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">bar</text:a></text:p> + <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a><text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><text:bibliography-mark text:identifier="fuh" text:bibliography-type="www" text:author="FB" text:title="foobar" text:url="http://example.com/">[fuh]</text:bibliography-mark></text:a></text:p> + + <!-- +<text:a xlink:type="simple" xlink:href="http://example.com/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">foo</text:a> + --> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/ooxmlexport/data/transparent-shadow.docx b/sw/qa/extras/ooxmlexport/data/transparent-shadow.docx Binary files differnew file mode 100644 index 000000000..267eb1a86 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/transparent-shadow.docx diff --git a/sw/qa/extras/ooxmlexport/data/tscp.docx b/sw/qa/extras/ooxmlexport/data/tscp.docx Binary files differnew file mode 100644 index 000000000..bbb32b178 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tscp.docx diff --git a/sw/qa/extras/ooxmlexport/data/unbalanced-columns.docx b/sw/qa/extras/ooxmlexport/data/unbalanced-columns.docx Binary files differnew file mode 100644 index 000000000..da6f93f76 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/unbalanced-columns.docx diff --git a/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx b/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx Binary files differnew file mode 100644 index 000000000..a8565742f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx diff --git a/sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx b/sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx Binary files differnew file mode 100644 index 000000000..1b05dbd6e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/vml-text-vertical-adjust.docx diff --git a/sw/qa/extras/ooxmlexport/data/watermark-font.docx b/sw/qa/extras/ooxmlexport/data/watermark-font.docx Binary files differnew file mode 100644 index 000000000..5a09dc9f7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/watermark-font.docx diff --git a/sw/qa/extras/ooxmlexport/data/watermark-shapetype.docx b/sw/qa/extras/ooxmlexport/data/watermark-shapetype.docx Binary files differnew file mode 100644 index 000000000..423f3cf71 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/watermark-shapetype.docx diff --git a/sw/qa/extras/ooxmlexport/data/watermark.docx b/sw/qa/extras/ooxmlexport/data/watermark.docx Binary files differnew file mode 100644 index 000000000..98c305af8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/watermark.docx diff --git a/sw/qa/extras/ooxmlexport/data/wpg-nested.docx b/sw/qa/extras/ooxmlexport/data/wpg-nested.docx Binary files differnew file mode 100644 index 000000000..eba2aad0e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/wpg-nested.docx diff --git a/sw/qa/extras/ooxmlexport/data/wpg-only.docx b/sw/qa/extras/ooxmlexport/data/wpg-only.docx Binary files differnew file mode 100644 index 000000000..7c86361f9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/wpg-only.docx diff --git a/sw/qa/extras/ooxmlexport/data/wps-char-color.docx b/sw/qa/extras/ooxmlexport/data/wps-char-color.docx Binary files differnew file mode 100644 index 000000000..a027e92be --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/wps-char-color.docx diff --git a/sw/qa/extras/ooxmlexport/data/wps-only.docx b/sw/qa/extras/ooxmlexport/data/wps-only.docx Binary files differnew file mode 100644 index 000000000..7f7b8c75b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/wps-only.docx diff --git a/sw/qa/extras/ooxmlexport/data/wrap-tight-through.docx b/sw/qa/extras/ooxmlexport/data/wrap-tight-through.docx Binary files differnew file mode 100644 index 000000000..1ea9e1478 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/wrap-tight-through.docx diff --git a/sw/qa/extras/ooxmlexport/data/zoom.docx b/sw/qa/extras/ooxmlexport/data/zoom.docx Binary files differnew file mode 100644 index 000000000..ce93a1a9b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/zoom.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx b/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx new file mode 100644 index 000000000..c0d6d2ba9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} + +protected: + bool mustTestImportOf(const char* filename) const override + { + return OString(filename).endsWith(".docx"); + } +}; + +DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2007, "Encrypted_MSO2007_abc.docx", "abc", Test) +{ + // Standard encryption format, AES 128, SHA1 + uno::Reference<text::XTextRange> xParagraph(getParagraph(1)); + CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph->getString()); +} + +DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2010, "Encrypted_MSO2010_abc.docx", "abc", Test) +{ + // Agile encryption format, AES 128, CBC, SHA1 + uno::Reference<text::XTextRange> xParagraph(getParagraph(1)); + CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph->getString()); +} + +DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2013, "Encrypted_MSO2013_abc.docx", "abc", Test) +{ + // Agile encryption format, AES 256, CBC, SHA512 + uno::Reference<text::XTextRange> xParagraph(getParagraph(1)); + CPPUNIT_ASSERT_EQUAL(OUString("ABC"), xParagraph->getString()); +} + +DECLARE_SW_ROUNDTRIP_TEST(testPasswordLOStandard, "Encrypted_LO_Standard_abc.docx", "abc", Test) +{ + // Standard encryption format, AES 128, SHA1 + uno::Reference<text::XTextRange> xParagraph(getParagraph(1)); + CPPUNIT_ASSERT_EQUAL(OUString("ABC"), xParagraph->getString()); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx new file mode 100644 index 000000000..0ea9cc9f7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -0,0 +1,1066 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/awt/FontSlant.hpp> +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/style/BreakType.hpp> +#include <com/sun/star/text/FontEmphasis.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/text/XTextRangeCompare.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/text/TableColumnSeparator.hpp> +#include <o3tl/cppunittraitshelper.hxx> +#include <oox/drawingml/drawingmltypes.hxx> + +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 { + const char* aBlacklist[] = { + "math-escape.docx", + "math-mso2k7.docx", + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end()); + } + + /** + * Validation handling + */ + bool mustValidate(const char* filename) const override + { + const char* aWhitelist[] = { + "paragraph-mark-nonempty.odt" + }; + std::vector<const char*> vWhitelist(aWhitelist, aWhitelist + SAL_N_ELEMENTS(aWhitelist)); + + return std::find(vWhitelist.begin(), vWhitelist.end(), filename) != vWhitelist.end(); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testfdo81381, "fdo81381.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", "Icon"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAlias, "sdt-alias.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + + // <w:alias> was completely missing. + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:alias", "val", "Subtitle"); +} + +DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, "footer-body-distance.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + // Page break was exported as section break, this was 0 + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); +} + +// Check for correct header/footer with special first page with TOC inside: +// - DECLARE_ODFEXPORT_TEST(testTdf118393, "tdf118393.odt") +// - DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt") +DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt") +{ + CPPUNIT_ASSERT_EQUAL( 7, getPages() ); + + // First page has no header/footer + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // check first page + xmlXPathObjectPtr pXmlPage1Header = getXPathNode(pXmlDoc, "/root/page[1]/header"); + CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlPage1Header->nodesetval)); + + xmlXPathObjectPtr pXmlPage1Footer = getXPathNode(pXmlDoc, "/root/page[1]/footer"); + CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlPage1Footer->nodesetval)); + + // check second page in the same way + xmlXPathObjectPtr pXmlPage2Header = getXPathNode(pXmlDoc, "/root/page[2]/header"); + CPPUNIT_ASSERT_EQUAL(1, xmlXPathNodeSetGetLength(pXmlPage2Header->nodesetval)); + + xmlXPathObjectPtr pXmlPage2Footer = getXPathNode(pXmlDoc, "/root/page[2]/footer"); + CPPUNIT_ASSERT_EQUAL(1, xmlXPathNodeSetGetLength(pXmlPage2Footer->nodesetval)); + } + + // All other pages should have header/footer + + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/footer/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/footer/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/footer/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/footer/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/footer/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/footer/txt/text()")); +} + +DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx") +{ + // vml image was not rendered + // As there are also numPicBullets in the file, + // the fragmentPath was not changed hence relationships were not resolved. + + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> xImage(image, uno::UNO_QUERY); + uno::Reference<graphic::XGraphic> xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic"); + uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(381), xBitmap->getSize().Width ); + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(148), xBitmap->getSize().Height ); +} + +DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx") +{ + // sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders. + if (xmlDocUniquePtr pXmlDoc = parseExport()) + // Page break was exported as section break, this was 0 + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); + + CPPUNIT_ASSERT_EQUAL( 2, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testUnwantedSectionBreak, "unwanted-section-break.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + // This was 2: an additional sectPr was added to the document. + assertXPath(pXmlDoc, "//w:sectPr", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80897 , "fdo80897.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:prstTxWarp", "prst", "textTriangle"); +} + + +DECLARE_OOXMLEXPORT_TEST(testFdo80997, "fdo80997.docx") +{ + // The problem was that the DOCX exporter not able to export text behind textbox, if textbox has a wrap property. + uno::Reference< text::XTextRange > xParagraph = getParagraph( 1 ); + getRun( xParagraph, 1, " text"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80902, "fdo80902.docx") +{ + // The problem was that the docGrid type was set as default so fix it for other grid type + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:docGrid", "type", "lines"); +} + +DECLARE_OOXMLEXPORT_TEST(testParaShading, "para-shading.docx") +{ + // Make sure the themeColor attribute is not written when it would be empty. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", "themeColor"); +} + +DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.docx") +{ + // Test import and export of a section's headerf/footerf properties. + // (copied from a ww8export test, with doc converted to docx using Word) + + CPPUNIT_ASSERT_EQUAL( 6, getPages() ); + + // The document has 6 pages. Note that we don't test if 4 or just 2 page + // styles are created, the point is that layout should be correct. + CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO83044, "fdo83044.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testfdo83428, "fdo83428.docx") +{ + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<document::XDocumentProperties> xProps(xDocumentPropertiesSupplier->getDocumentProperties()); + uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Document"), getProperty<OUString>(xUDProps, "Testing")); +} + +DECLARE_OOXMLEXPORT_TEST(testShapeInFloattable, "shape-in-floattable.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // No nested drawingML w:txbxContent. + assertXPath(pXmlDoc, "//mc:Choice//w:txbxContent//w:txbxContent", 0); + // Instead, make sure we have a separate shape and a table + assertXPath(pXmlDoc, "//mc:AlternateContent//mc:Choice[@Requires='wpg']", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 1); + } +} + +DECLARE_OOXMLEXPORT_TEST(testEmptyAnnotationMark, "empty-annotation-mark.docx") +{ + if (mbExported) + { + // Delete the word that is commented, and save again. + uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 3); + CPPUNIT_ASSERT_EQUAL(OUString("with"), xRun->getString()); + xRun->setString(""); + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + xStorable->store(); + + // Then inspect the OOXML markup of the modified document model. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // There were two commentReference nodes. + assertXPath(pXmlDoc, "//w:commentReference", "id", "0"); + // Empty comment range was not ignored on export, this was 1. + assertXPath(pXmlDoc, "//w:commentRangeStart", 0); + // Ditto. + assertXPath(pXmlDoc, "//w:commentRangeEnd", 0); + } +} + +DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, "dropdown-in-cell.docx") +{ + // First problem: table was missing from the document, this was 0. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + + // Second problem: dropdown shape wasn't anchored inside the B1 cell. + if (getShapes() > 0) + { + uno::Reference<text::XTextContent> xShape(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xAnchor = xShape->getAnchor(); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xCell, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextRangeCompare->compareRegionStarts(xAnchor, xCell)); + } + else + { + // ComboBox was imported as DropDown text field + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + uno::Any aField = xFields->nextElement(); + uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // This was LEFT_AND_WIDTH, i.e. table alignment wasn't imported correctly. + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient")); +} + +DECLARE_OOXMLEXPORT_TEST(testSdtIgnoredFooter, "sdt-ignored-footer.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // This was 1, make sure no w:sdt sneaks into the main document from the footer. + assertXPath(pXmlDoc, "//w:sdt", 0); + } +} + +DECLARE_OOXMLEXPORT_TEST(testSdtRunPicture, "sdt-run-picture.docx") +{ + // SDT around run was exported as SDT around paragraph + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // This was 1: there was an SDT around w:p. + assertXPath(pXmlDoc, "//w:body/w:sdt", 0); + // This was 0: there were no SDT around w:r. + assertXPath(pXmlDoc, "//w:body/w:p/w:sdt", 1); + } +} + +DECLARE_OOXMLEXPORT_TEST(testChartDupe, "chart-dupe.docx") +{ + // Single chart was exported back as two charts. + uno::Reference<text::XTextEmbeddedObjectsSupplier> xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); + // This was 2, on second import we got a duplicated chart copy. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xEmbeddedObjects->getCount()); + + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); + + if (!pXmlDocCT) + return; // initial import + + assertXPath(pXmlDocCT, + "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']", + "ContentType", + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"); + assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Worksheet1.xlsx']", "ContentType", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Worksheet1.xlsx']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocChart1 = parseExport("word/charts/chart1.xml"); + assertXPath(pXmlDocChart1, + "/c:chartSpace/c:externalData", + "id", + "rId1"); +} + +DECLARE_OOXMLEXPORT_TEST(testPositionAndRotation, "position-and-rotation.docx") +{ + // The document should look like: "This line is tricky, <image> because only 'This line is tricky,' is on the left." + // But the image was pushed down, so it did not break the line into two text portions. + uno::Reference<drawing::XShape> xShape = getShape(1); + // Should be 1559, was -5639 + CPPUNIT_ASSERT(xShape->getPosition().X > 1500); + // Should be 88, was 473 + CPPUNIT_ASSERT(xShape->getPosition().Y < 100); +} + +DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx") +{ + // check that the original numrule font name is still Calibri + uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName("ListLabel 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Calibri"), getProperty<OUString>(xStyle, "CharFontName")); + + uno::Reference<text::XTextRange> xPara = getParagraph(2); + uno::Reference<beans::XPropertySet> properties(xPara, uno::UNO_QUERY); + uno::Any aValue = properties->getPropertyValue("ListAutoFormat"); + CPPUNIT_ASSERT(aValue.hasValue()); + uno::Sequence<beans::NamedValue> aListAutoFormat; + CPPUNIT_ASSERT(aValue >>= aListAutoFormat); + auto it = std::find_if(std::cbegin(aListAutoFormat), std::cend(aListAutoFormat), + [](const css::beans::NamedValue& val) { return val.Name == "CharFontName"; }); + CPPUNIT_ASSERT(it != std::cend(aListAutoFormat)); + OUString sOverrideFontName; + CPPUNIT_ASSERT(it->Value >>= sOverrideFontName); + // but the overridden font name is Verdana + CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), sOverrideFontName); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noinheritChapterNumbering.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // in LO, it appears that styles based on the Chapter Numbering style explicitly set the + // numbering style/outline level to 0 by default, and that LO prevents inheriting directly from "Outline" style. + // Adding this preventative unit test to ensure that any fix for tdf106541 doesn't make incorrect assumptions. + +//reverting tdf#76817 hard-codes the numbering style on the paragraph, preventing RT of "Outline" style +// CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(1), "NumberingStyleName")); + + OUString sPara3NumberingStyle = getProperty<OUString>(getParagraph(3), "NumberingStyleName"); + CPPUNIT_ASSERT_EQUAL(sPara3NumberingStyle, getProperty<OUString>(getParagraph(4), "NumberingStyleName")); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "//body/txt/Special", 3); //three of the four paragraphs have numbering + assertXPath(pXmlDoc, "//body/txt[1]/Special", "rText", "1"); + assertXPath(pXmlDoc, "//body/txt[2]/Special", 0); //second paragraph style disables numbering + assertXPath(pXmlDoc, "//body/txt[3]/Special", "rText", "I."); + assertXPath(pXmlDoc, "//body/txt[4]/Special", "rText", "II."); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf53856_conflictingStyle, "tdf53856_conflictingStyle.docx") +{ + // The "Text" style conflicted with builtin paragraph style Caption -> Text + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Text"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), getProperty<OUString>(xStyle, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(awt::FontSlant_NONE, getProperty<awt::FontSlant>(xStyle, "CharPosture")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104713_undefinedStyles, "tdf104713_undefinedStyles.docx") +{ + // Normal paragraph style was not defined, so don't replace conflicting styles + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(212), getProperty<sal_Int32>(xStyle, "ParaBottomMargin")); + + // tdf108765: once importing is finished, use default values for any styles not yet defined. + xStyle.set( getStyles("ParagraphStyles")->getByName("Footnote"), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Font size", 10.f, getProperty<float>(xStyle, "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testDrawingmlFlipv, "drawingml-flipv.docx") +{ + // The problem was that the shape had vertical flip only, but then we added rotation as well on export. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "rot"); +} + +DECLARE_OOXMLEXPORT_TEST(testRot90Fliph, "rot90-fliph.docx") +{ + // The problem was that a shape rotation of 90° got turned into 270° after roundtrip. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + assertXPath(pXmlDoc, "//a:xfrm", "flipH", "1"); + // This was 16200000 (270 * 60000). + assertXPath(pXmlDoc, "//a:xfrm", "rot", "5400000"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testRot180Flipv, "rot180-flipv.docx") +{ + // 180° rotation got lost after roundtrip. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1"); + // This attribute was completely missing. + assertXPath(pXmlDoc, "//a:xfrm", "rot", "10800000"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testRot270Flipv, "rot270-flipv.docx") +{ + // 270° rotation got turned into 90° after roundtrip. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1"); + // This was 5400000. + assertXPath(pXmlDoc, "//a:xfrm", "rot", "16200000"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testMsoPosition, "bnc884615-mso-position.docx") +{ + if(xmlDocUniquePtr doc = parseExport("word/footer1.xml")) + { + // We write the frames out in different order than they were read, so check it's the correct + // textbox first by checking width. These tests may need reordering if that gets fixed. + OUString style1 = getXPath(doc, "/w:ftr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style"); + CPPUNIT_ASSERT( style1.indexOf( ";width:531pt;" ) >= 0 ); + CPPUNIT_ASSERT( style1.indexOf( ";mso-position-vertical-relative:page" ) >= 0 ); + CPPUNIT_ASSERT( style1.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 ); + OUString style2 = getXPath(doc, "/w:ftr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style"); + CPPUNIT_ASSERT( style2.indexOf( ";width:549pt;" ) >= 0 ); + CPPUNIT_ASSERT( style2.indexOf( ";mso-position-vertical-relative:text" ) >= 0 ); + CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal:center" ) >= 0 ); + CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal-relative:text" ) >= 0 ); + OUString style3 = getXPath(doc, "/w:ftr/w:p/w:r[5]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style"); + CPPUNIT_ASSERT( style3.indexOf( ";width:36pt;" ) >= 0 ); + CPPUNIT_ASSERT( style3.indexOf( ";mso-position-horizontal-relative:text" ) >= 0 ); + CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:text" ) >= 0 ); + } + + xmlDocUniquePtr doc = parseExport("word/header1.xml"); + if(!doc) + return; + + OUString style1 = getXPath(doc, "/w:hdr/w:p/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style"); + CPPUNIT_ASSERT( style1.indexOf( ";width:335.75pt;" ) >= 0 ); + CPPUNIT_ASSERT( style1.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 ); + CPPUNIT_ASSERT( style1.indexOf( ";mso-position-vertical-relative:page" ) >= 0 ); + OUString style2 = getXPath(doc, "/w:hdr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style"); + CPPUNIT_ASSERT( style2.indexOf( ";width:138.15pt;" ) >= 0 ); + CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 ); + CPPUNIT_ASSERT( style2.indexOf( ";mso-position-vertical-relative:page" ) >= 0 ); + OUString style3 = getXPath(doc, "/w:hdr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style"); + CPPUNIT_ASSERT( style3.indexOf( ";width:163.8pt;" ) >= 0 ); + CPPUNIT_ASSERT( style3.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 ); + CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:page" ) >= 0 ); + +} + +DECLARE_OOXMLEXPORT_TEST(testWpsCharColor, "wps-char-color.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + // This was -1, i.e. the character color was default (-1), not white. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape->getStart(), "CharColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableStyleCellBackColor, "table-style-cell-back-color.docx") +{ + // The problem was that cell background was white, not green. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + // This was 0xffffff. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(xCell, "BackColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableStyleBorder, "table-style-border.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + // This was 0, the second cell was missing its right border. + uno::Reference<table::XCell> xCell = xTable->getCellByName("A2"); + CPPUNIT_ASSERT(getProperty<table::BorderLine2>(xCell, "RightBorder").LineWidth > 0); + + // This was also 0 (even after fixing the previous problem), the first cell was missing its right border, too. + xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT(getProperty<table::BorderLine2>(xCell, "RightBorder").LineWidth > 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTableStyleBorderExport, "table-style-border-export.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A3"); + // Bottom border was white, so this was 0xffffff. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x8064A2), getProperty<table::BorderLine2>(xCell, "BottomBorder").Color); +} + +DECLARE_OOXMLEXPORT_TEST(testAnchorPosition, "anchor-position.docx") +{ + // The problem was that the at-char anchored picture was at the end of the + // paragraph, so there were only two positions: a Text, then a Frame one. + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(getRun(getParagraph(1), 1), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(getRun(getParagraph(1), 3), "TextPortionType")); +} + +DECLARE_OOXMLEXPORT_TEST(testMultiPageToc, "multi-page-toc.docx") +{ + // Import of this document triggered an STL assertion. + + // Document has a ToC from its second paragraph. + uno::Reference<container::XNamed> xTextSection = getProperty< uno::Reference<container::XNamed> >(getParagraph(2), "TextSection"); + CPPUNIT_ASSERT_EQUAL(OUString("Table of Contents1"), xTextSection->getName()); + // There should be a field in the header as well. + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty<OUString>(getRun(getParagraphOfText(1, xHeaderText), 1), "TextPortionType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTextboxTable, "textbox-table.docx") +{ + // We wrote not-well-formed XML during export for this one: + // Shape with textbox, having a table and also anchored inside a table. + + // Just make sure that we have both tables. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testCropPixel, "crop-pixel.docx") +{ + // If map mode of the graphic is in pixels, then we used to handle original + // size of the graphic as mm100, but it was in pixels. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // This is 17667 in the original document, was 504666 (so the image + // become invisible), now is around 19072. + CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() <= 22452); + } +} + +DECLARE_OOXMLEXPORT_TEST(testEffectExtent, "effect-extent.docx") +{ + // The problem was that in case there were no shadows on the picture, we + // wrote a <wp:effectExtent> full or zeros. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + // E.g. this was 0. + assertXPath(pXmlDoc, "//wp:effectExtent", "l", "114300"); +} + +DECLARE_OOXMLEXPORT_TEST(testEffectExtentInline, "effect-extent-inline.docx") +{ + // The problem was that in case there was inline rotated picture, we + // wrote a <wp:effectExtent> full or zeros. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // E.g. this was 0. + assertXPath(pXmlDoc, "//wp:effectExtent", "l", "609600"); + assertXPath(pXmlDoc, "//wp:effectExtent", "r", "590550"); + assertXPath(pXmlDoc, "//wp:effectExtent", "t", "590550"); + assertXPath(pXmlDoc, "//wp:effectExtent", "b", "571500"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testEm, "em.docx") +{ + // Test all possible <w:em> arguments. + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE, getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharEmphasis")); + // This was ACCENT_ABOVE. + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE, getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEmphasis")); + // This was DOT_ABOVE. + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::ACCENT_ABOVE, getProperty<sal_Int16>(getRun(getParagraph(1), 3), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::CIRCLE_ABOVE, getProperty<sal_Int16>(getRun(getParagraph(1), 4), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_BELOW, getProperty<sal_Int16>(getRun(getParagraph(1), 5), "CharEmphasis")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo77716, "fdo77716.docx") +{ + // The problem was that there should be 200 twips spacing between the two paragraphs, but there wasn't any. + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY); + // This was 0. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(200)), getProperty<sal_Int32>(xStyle, "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testAfterlines, "afterlines.docx") +{ + // This was 353, i.e. the value of <w:spacing w:after="200"> from <w:pPrDefault>, instead of <w:spacing w:afterLines="100"/> from <w:pPr>. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(423), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testParagraphMark, "paragraph-mark.docx") +{ + // The problem was that we didn't handle the situation when an empty paragraph's marker had both a char style and some direct formatting. + + // This was 11. + CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(getParagraph(1), "CharHeight")); + // This was empty. + CPPUNIT_ASSERT_EQUAL(OUString("Emphasis"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharStyleName")); +} + +DECLARE_OOXMLEXPORT_TEST(testParagraphMark2, "paragraph-mark2.docx") +{ + // The problem was that we didn't handle the situation when an empty paragraph's marker had both a char style and some direct formatting. + + // This was Segoe UI, set by Char Style FontStyle11 presumably. + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName")); + // This was 11, set by Char Style FontStyle11 presumably. + CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getRun(getParagraph(1), 1), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testParagraphMarkNonempty, "paragraph-mark-nonempty.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport()) + // There were two <w:sz> elements, make sure the 40 one is dropped and the 20 one is kept. + assertXPath(pXmlDoc, "//w:p/w:pPr/w:rPr/w:sz", "val", "20"); +} + +DECLARE_OOXMLEXPORT_TEST(testPageBreakBefore, "page-break-before.docx") +{ + // This was style::BreakType_PAGE_BEFORE, i.e. page break wasn't ignored, as it should have been. + CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableRtl, "table-rtl.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // This was text::WritingMode2::LR_TB, i.e. direction of the table was ignored. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode")); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist30, "cjklist30.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::TIAN_GAN_ZH, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist31, "cjklist31.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::DI_ZI_ZH, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist34, "cjklist34.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH_TW, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist35, "cjklist35.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist44, "cjklist44.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_HANGUL_KO, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlTextNumberList, "text_number_list.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::TEXT_NUMBER, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlTextCardinalList, "text_cardinal_list.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::TEXT_CARDINAL, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlTextOrdinalList, "text_ordinal_list.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::TEXT_ORDINAL, numFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlSymbolChicagoList, "symbol_chicago_list.docx") +{ + sal_Int16 numFormat = getNumberingTypeOfParagraph(1); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::SYMBOL_CHICAGO, numFormat); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHTW, "numlist-zhtw.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + + assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","taiwaneseCountingThousand" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHCN, "numlist-zhcn.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + + assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","chineseCountingThousand" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOOxmlOutlineNumberTypes, "outline-number-types.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pStyle", "val", "Heading1"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val", "none"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[2]/w:numFmt", "val", "decimalEnclosedCircle"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[3]/w:numFmt", "val", "decimal"); // CHARS_GREEK_UPPER_LETTER fallback to decimal + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[4]/w:numFmt", "val", "decimal"); // CHARS_GREEK_LOWER_LETTER fallback to decimal + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[5]/w:numFmt", "val", "arabicAlpha"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[6]/w:numFmt", "val", "hindiVowels"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[7]/w:numFmt", "val", "thaiLetters"); + + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[1]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[2]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[3]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[4]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[5]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[6]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[7]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[8]/w:numFmt", "val", "decimal"); + + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[1]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[2]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[3]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[4]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[5]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[6]/w:numFmt", "val", "decimal"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[7]/w:numFmt", "val", "decimal"); + +} + +DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx") +{ + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), + getProperty<sal_Int32>(getParagraph(1), "OutlineLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(getParagraph(1), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), + getProperty<sal_Int32>(getParagraph(2), "OutlineLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(getParagraph(2), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), + getProperty<sal_Int32>(getParagraph(3), "OutlineLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(getParagraph(3), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), + getProperty<sal_Int32>(getParagraph(4), "OutlineLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("2.1"), getProperty<OUString>(getParagraph(4), "ListLabelString")); +} + +DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx") +{ + uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); + // This was 1, i.e. the numbering on the second level was "1", not "1.1". + // Check the paragraph properties, not the list ones, since they can differ due to overrides + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString")); + + // The paragraph marker's red font color was inherited by the number portion, this was ff0000. + CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), parseDump("//Special[@nType='PortionType::Number']/SwFont", "color")); +} + +DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, "num-override-start.docx") +{ + uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); + // List starts with "1.1" + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["StartWith"].get<sal_Int16>()); + // But paragraph starts with "1.3" + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + OUString listId; + CPPUNIT_ASSERT(xPara->getPropertyValue("ListId") >>= listId); + CPPUNIT_ASSERT_EQUAL(OUString("1.3"), getProperty<OUString>(xPara, "ListLabelString")); +} + +DECLARE_OOXMLEXPORT_TEST(testTextboxRightEdge, "textbox-right-edge.docx") +{ + // I'm fairly sure this is not specific to DOCX, but the doc model created + // by the ODF import doesn't trigger this bug, so let's test this here + // instead of uiwriter. + int nShapeLeft = parseDump("//SwAnchoredDrawObject/bounds", "left").toInt32(); + int nShapeWidth = parseDump("//SwAnchoredDrawObject/bounds", "width").toInt32(); + int nTextboxLeft = parseDump("//fly/infos/bounds", "left").toInt32(); + int nTextboxWidth = parseDump("//fly/infos/bounds", "width").toInt32(); + // This is a rectangle, make sure the right edge of the textbox is still + // inside the draw shape. + CPPUNIT_ASSERT(nShapeLeft + nShapeWidth >= nTextboxLeft + nTextboxWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin, "effectextent-margin.docx") +{ + // This was 318, i.e. oox::drawingml::convertEmuToHmm(114300), effectExtent + // wasn't part of the margin, leading to the fly not taking enough space + // around itself. + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(114300+95250), getProperty<sal_Int32>(getShape(1), "LeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf88583, "tdf88583.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), getProperty<sal_Int32>(getParagraph(1), "FillColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf97090, "tdf97090.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x95B3D7), getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor")); + + uno::Reference<container::XEnumerationAccess> paraEnumAccess(xTable->getCellByName("A1"), uno::UNO_QUERY); + assert( paraEnumAccess.is() ); + uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration(); + + assert( paraEnum.is() ); + uno::Reference<beans::XPropertySet> paragraphProperties(paraEnum->nextElement(), uno::UNO_QUERY); + assert( paragraphProperties.is() ); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(paragraphProperties, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), getProperty<sal_Int32>(paragraphProperties, "FillColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf89791, "tdf89791.docx") +{ + if (mbExported) + { + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("docProps/custom.xml"))); + } + + //tdf#102619 - setting FollowStyle with a not-yet-created style was failing. (Titre is created before Corps de texte). + uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Titre"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Corps de texte"), getProperty<OUString>(properties, "FollowStyle")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf91261, "tdf91261.docx") +{ + bool snapToGrid = true; + uno::Reference< text::XTextRange > xPara = getParagraph( 2 ); + uno::Reference< beans::XPropertySet > properties( xPara, uno::UNO_QUERY); + properties->getPropertyValue("SnapToGrid") >>= snapToGrid ; + CPPUNIT_ASSERT_EQUAL(false, snapToGrid); + + uno::Reference< beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + sal_Int16 nGridMode; + xStyle->getPropertyValue("GridMode") >>= nGridMode; + CPPUNIT_ASSERT_EQUAL( sal_Int16(2), nGridMode); + + bool bGridSnapToChars; + xStyle->getPropertyValue("GridSnapToChars") >>= bGridSnapToChars; + CPPUNIT_ASSERT_EQUAL(true, bGridSnapToChars); + +} + +DECLARE_OOXMLEXPORT_TEST(testTdf79639, "tdf79639.docx") +{ + // This was 0, floating table in header wasn't converted to a TextFrame. + CPPUNIT_ASSERT_EQUAL(1, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf89890, "tdf89890.docx") +{ + // Numbering picture bullet was too large. + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + bool bFound = false; + for (beans::PropertyValue const & rProp : std::as_const(aProps)) + { + if (rProp.Name == "GraphicSize") + { + // Height of the graphic was too large: 4382 after import, then 2485 after roundtrip. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(279), rProp.Value.get<awt::Size>().Height); + bFound = true; + } + } + CPPUNIT_ASSERT(bFound); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf91594, "tdf91594.docx") +{ + uno::Reference<text::XTextRange> xPara1(getParagraph(1)); + CPPUNIT_ASSERT_EQUAL(u'\xf0fb', xPara1->getString()[0] ); + uno::Reference<text::XTextRange> xPara2(getParagraph(2)); + CPPUNIT_ASSERT_EQUAL(u'\xf0fc', xPara2->getString()[0] ); + uno::Reference<text::XTextRange> xPara3(getParagraph(3)); + CPPUNIT_ASSERT_EQUAL(u'\xf0fd', xPara3->getString()[0] ); + uno::Reference<text::XTextRange> xPara4(getParagraph(4)); + CPPUNIT_ASSERT_EQUAL(u'\xf0fe', xPara4->getString()[0] ); + + uno::Reference<beans::XPropertySet> xRun(getRun(xPara1,1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontNameAsian")); + CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontNameComplex")); +} +DECLARE_OOXMLEXPORT_TEST(testTDF99434, "protectedform.docx") +{ + css::uno::Reference<css::lang::XMultiServiceFactory> m_xTextFactory(mxComponent, uno::UNO_QUERY); + uno::Reference< beans::XPropertySet > xSettings(m_xTextFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); + uno::Any aProtect = xSettings->getPropertyValue("ProtectForm"); + bool bProt = false; + aProtect >>= bProt; + CPPUNIT_ASSERT(bProt); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf44986, "tdf44986.docx") +{ + // Check that the table at the second paragraph. + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTable->getRows(); + // Check the first row of the table, it should have two cells (one separator). + // This was 0: the first row had no separators, so it had only one cell, which was too wide. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); + // Check content of cells, including the newly added gridAfter cell + CPPUNIT_ASSERT_EQUAL(OUString("A1"), uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY_THROW)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("A2"), uno::Reference<text::XTextRange>(xTable->getCellByName("A2"), uno::UNO_QUERY_THROW)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString(""), uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY_THROW)->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118682, "tdf118682.fodt") +{ + // Support cell references in table formulas + xmlDocUniquePtr pXmlDoc = parseExport(); + + // Formula fields were completely missing. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar", 3); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r/w:fldChar", 3); + + // Cell references were parenthesized: <A1>+<A2> and SUM(<A1:A3>) + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText", " = A1+A2"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText", " = SUM(A1:A3)"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133163, "tdf133163.fodt") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + + // Formula cells were completely missing. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar", 3); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r/w:fldChar", 3); + + // Cell references were parenthesized: <A1>+<A2> and SUM(<A1:A3>) + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText", " = A1+A2"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText", " = SUM(A1:A3)"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133647, "tdf133647.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + if (!pXmlDoc) + return; + + // Keep original formula during round-trip + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " = SUM(A1,B1)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText", " = SUM(C1:D1)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText", " = SUM(A1,5,B1:C1,6)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc[4]/w:p/w:r[2]/w:instrText", " = (1+2)*SUM(C1,D1)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc[4]/w:p/w:r[2]/w:instrText", " = 3*(2+SUM(A1:C1)+7)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[4]/w:p/w:r[2]/w:instrText", " = 1+(SUM(1,2))"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[10]/w:tc[4]/w:p/w:r[2]/w:instrText", " = (SUM(C1,5)*(2+7))*(3+SUM(1,B1))"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[4]/w:p/w:r[2]/w:instrText", " = sum(a1,b1)"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123386, "tdf123386.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + if (!pXmlDoc) + return; + + // Keep original formula during round-trip + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText", " = A1 < 2"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " = B1 > 1"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText", " = C1=3"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText", " = D1 <> 3"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc[4]/w:p/w:r[2]/w:instrText", " = AND(A1=1,B1=2)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc[4]/w:p/w:r[2]/w:instrText", " = AND((A1<1),(B1<>2))"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[4]/w:p/w:r[2]/w:instrText", " = OR(A1=1,B1=2)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[10]/w:tc[4]/w:p/w:r[2]/w:instrText", " = OR(TRUE,FALSE)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[4]/w:p/w:r[2]/w:instrText", " = NOT(TRUE)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[12]/w:tc[4]/w:p/w:r[2]/w:instrText", " = AND(1,DEFINED(ABC1))"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123389, "tdf123389.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + if (!pXmlDoc) + return; + + // Keep original formula during round-trip + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText", " = ROUND(2.345,1)"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " = ROUND(A1,2)"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106953, "tdf106953.docx") +{ + uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); + // This was -635, so the tab of the numbering expanded to a small value instead of matching Word's larger value. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), comphelper::SequenceAsHashMap(xRules->getByIndex(0))["FirstLineIndent"].get<sal_Int32>()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115094v3, "tdf115094v3.docx") +{ + // floating table is now exported directly without surrounding frame + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpX", "1996"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "1064"); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx new file mode 100644 index 000000000..87a5223cc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -0,0 +1,1364 @@ +/* -*- 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 <memory> + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/awt/FontSlant.hpp> +#include <com/sun/star/awt/FontUnderline.hpp> +#include <com/sun/star/awt/FontWeight.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/TableColumnSeparator.hpp> +#include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/text/XBookmarksSupplier.hpp> +#include <com/sun/star/text/XFootnote.hpp> +#include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/text/XTextColumns.hpp> +#include <com/sun/star/text/XTextFrame.hpp> +#include <com/sun/star/text/XTextFramesSupplier.hpp> +#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/text/SizeType.hpp> +#include <com/sun/star/text/XDocumentIndex.hpp> +#include <com/sun/star/style/CaseMap.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <unotools/fltrcfg.hxx> +#include <comphelper/sequenceashashmap.hxx> +#include <swtypes.hxx> +#include <drawdoc.hxx> +#include <IDocumentDrawModelAccess.hxx> +#include <oox/drawingml/drawingmltypes.hxx> +#include <unotools/streamwrap.hxx> +#include <comphelper/propertysequence.hxx> +#include <svx/svdpage.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} + + virtual std::unique_ptr<Resetter> preTest(const char* filename) override + { + if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx" ) + { + std::unique_ptr<Resetter> 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<text::XTextRange>& xTextRange) + { + uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.WriterFilter"), uno::UNO_QUERY_THROW); + uno::Reference<document::XImporter> xImporter(xFilter, uno::UNO_QUERY_THROW); + xImporter->setTargetDocument(mxComponent); + std::unique_ptr<SvStream> pStream = utl::UcbStreamHelper::CreateStream(m_directories.getURLFromSrc("/sw/qa/extras/ooxmlexport/data/") + rFilename, StreamMode::READ); + uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(std::move(pStream))); + uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence( + { + {"InputStream", uno::makeAny(xStream)}, + {"InputMode", uno::makeAny(true)}, + {"TextInsertModeRange", uno::makeAny(xTextRange)}, + })); + return xFilter->filter(aDescriptor); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xGroup->getCount()); // background, 3 rectangles and an arrow in the group + + uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(2), 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<text::XTextRange> xTextRange(xGroup->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text + + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> 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") +{ + if (!mbExported) + return; + + // The problem was that the last space in target URL was removed + CPPUNIT_ASSERT_EQUAL(OUString("#this_is_a_bookmark"), getProperty<OUString>(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<drawing::XShape> xShape = getShape(1); + text::TextContentAnchorType eValue = getProperty<text::TextContentAnchorType>(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(oox::drawingml::convertEmuToHmm(671830), xShape->getPosition().X); + + // Left margin should be 0, as margins are not relevant for <wp:wrapNone/>. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "LeftMargin")); + // Wrap type was PARALLEL. + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty<text::WrapTextMode>(xShape, "Surround")); + // Confirm that the deprecated (incorrectly spelled) _THROUGHT also matches + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty<text::WrapTextMode>(xShape, "Surround")); + + // This should be in front of text. + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xShape, "Opaque")); + // And this should be behind the document. + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(2), "Opaque")); +} + +DECLARE_OOXMLEXPORT_TEST(testWpgOnly, "wpg-only.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + // Check position, it was nearly 0. This is a shape, so use getPosition(), not a property. + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(548005), xShape->getPosition().X); +} + +DECLARE_OOXMLEXPORT_TEST(testWpgNested, "wpg-nested.docx") +{ + uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShapeDescriptor> 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 failed, the right edge of the shape was outside the page + // boundaries. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "left").toInt32(); + sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32(); + sal_Int32 nShapeLeft + = getXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/SwAnchoredDrawObject/bounds", "left") + .toInt32(); + sal_Int32 nShapeWidth + = getXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/SwAnchoredDrawObject/bounds", "width") + .toInt32(); + // Make sure the shape is within the page bounds. + CPPUNIT_ASSERT_GREATEREQUAL(nShapeLeft + nShapeWidth, nPageLeft + nPageWidth); +} + +DECLARE_OOXMLEXPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") +{ + uno::Reference<drawing::XShape> 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<sal_Int16>(xShape, "HoriOrientRelation")); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "VertOrientRelation")); + // Make sure the shape is not in the background, as we have behindDoc="0" in the doc. + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(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<container::XIndexAccess> xGroup(xShape, uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY_THROW)->getText(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf120412_400PercentSubscript, "tdf120412_400PercentSubscript.docx") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + // The word "Base" should not be subscripted. + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1, "Base"), "CharEscapement"), 0); + // The word "Subscript" should be 12pt, subscripted by 400% (48pt). + CPPUNIT_ASSERT_DOUBLES_EQUAL( -400.f, getProperty<float>(getRun(xPara, 2, "Subscript"), "CharEscapement"), 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontEsc, "test_tdf120412.docx") +{ + xmlDocUniquePtr pXmlDoc =parseExport("word/document.xml"); + // don't lose the run with superscript formatting + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 2); + // Superscript should be raised by 100% (11pt). Was 110% (12pt) + // calculated using docDefault with fontsize 10pt (note only w:szCs defined as 11pt, not w:sz) + // instead of inherited normal paraStyle fontsize 11pt (related to tdf#99602) + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:position","val", "22"); +} + +DECLARE_OOXMLEXPORT_TEST(testMceWpg, "mce-wpg.docx") +{ + // Make sure that we read the primary branch, if wpg is requested as a feature. + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY_THROW)->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<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + // positionV's posOffset from the bugdoc, was 0. + CPPUNIT_ASSERT(6879 <= getProperty<sal_Int32>(xShape, "VertOrientPosition")); + // This was -1 (default), make sure the background color is set. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape, "FillColor")); + + uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor = getShape(2); + // 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<container::XIndexAccess> xGroup(getShape(2), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText, "[Year]"); + CPPUNIT_ASSERT_EQUAL(48.f, getProperty<float>(getRun(xParagraph, 1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xParagraph, 1), "CharWeight")); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xGroup->getByIndex(1), "TextVerticalAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testMissingPath, "missing-path.docx") +{ + comphelper::SequenceAsHashMap aCustomShapeGeometry(getProperty<beans::PropertyValues>(getShape(1), "CustomShapeGeometry")); + comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"].get<beans::PropertyValues>()); + uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aCoordinates = aPath["Coordinates"].get< uno::Sequence<drawing::EnhancedCustomShapeParameterPair> >(); + // 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 + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + // Check: the angle of the shape is 45º + CPPUNIT_ASSERT_EQUAL(sal_Int32(4500), getProperty<sal_Int32>(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<uno::XInterface> xParaLeftRTL(getParagraph( 1, "RTL LEFT")); + uno::Reference<uno::XInterface> xParaRightLTR(getParagraph( 2, "LTR RIGHT")); + + // this will test the text direction and alignment for paragraphs + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( xParaLeftRTL, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), getProperty< sal_Int32 >( xParaLeftRTL, "ParaAdjust" )); + + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>( xParaRightLTR, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), getProperty< sal_Int32 >( xParaRightLTR, "ParaAdjust" )); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo72560b, "fdo72560b.docx") +{ + // The problem was libreoffice confuse when RTL was specified in non-default style + uno::Reference<uno::XInterface> xParaEndRTL(getParagraph( 2, "RTL END")); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( xParaEndRTL, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32(style::ParagraphAdjust_LEFT), getProperty< sal_Int32 >( xParaEndRTL, "ParaAdjust" )); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo72560c, "fdo72560c.docx") +{ + // The problem was libreoffice confuse when RTL was specified in DocDefaults + uno::Reference<uno::XInterface> xParaEndRTL(getParagraph( 2, "RTL END")); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( xParaEndRTL, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32(style::ParagraphAdjust_LEFT), getProperty< sal_Int32 >( xParaEndRTL, "ParaAdjust" )); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo72560d, "fdo72560d.docx") +{ + // The problem was libreoffice confuse when RTL was specified in "Normal" when not using Normal at all + CPPUNIT_ASSERT_EQUAL( sal_Int32(style::ParagraphAdjust_RIGHT), getProperty< sal_Int32 >( getParagraph(1), "ParaAdjust" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32(style::ParagraphAdjust_RIGHT), getProperty< sal_Int32 >( getParagraph(2), "ParaAdjust" )); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo72560e, "fdo72560e.docx") +{ + // The problem was libreoffice confuse when *locale* is RTL, but w:bidi / w:jc are never defined. + // This unit test would only be noticed if the testing environment is set to something like an Arabic locale. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>( getParagraph(2), "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_LEFT), getProperty<sal_Int32>( getParagraph(2), "ParaAdjust" )); + + // widow/orphan control is on when never specified. + CPPUNIT_ASSERT_EQUAL(sal_Int8(2), getProperty<sal_Int8>( getParagraph(2), "ParaWidows" )); +} + +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<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + // The first row had two cells, instead of a single horizontally merged one. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<text::TableColumnSeparator> >(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<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexes = xIndexSupplier->getDocumentIndexes( ); + uno::Reference<text::XDocumentIndex> xTOCIndex(xIndexes->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange = xTOCIndex->getAnchor(); + uno::Reference<text::XText> xText = xTextRange->getText( ); + uno::Reference<text::XTextCursor> xTextCursor = xText->createTextCursor( ); + xTextCursor->gotoRange(xTextRange->getStart(),false); + xTextCursor->gotoRange(xTextRange->getEnd(),true); + OUString aTocString(xTextCursor->getString()); + + // heading 15 on the 15th page + aTocString = aTocString.copy(aTocString.indexOf("Heading 15.1:\t") + strlen("Heading 15.1:\t")); + CPPUNIT_ASSERT(aTocString.startsWithIgnoreAsciiCase( "15" ) ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73389,"fdo73389.docx") +{ + // The width of the inner table was too large. The first fix still converted + // the "auto" table width to a fixed one. The second fix used variable width. + // The recent fix uses fixed width again, according to the fixed width cells. + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","type","dxa"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","w","1611"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133735, "fdo73389.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); + // This was 200 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:spacing", "after", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[3]/w:p/w:pPr/w:spacing", "after", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf59274, "tdf59274.docx") +{ + // Table with "auto" table width and incomplete grid: 11 columns, but only 4 gridCol elements. + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW", "type", "dxa"); + // This was 7349: sum of the cell widths in first row, but the table width is determined by a longer row later. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW", "w", "9048"); + // This was 1224: too narrow first cell in first row + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcW", "w", "4291"); + // This was 3674: too wide last cell in first row + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcW", "w", "1695"); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx") +{ + uno::Reference<drawing::XShapes> 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<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW)->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testDmlCharheightDefault, "dml-charheight-default.docx") +{ + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> 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<float>(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<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText(); + // 2nd line is written with uppercase letters + CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(getRun(getParagraphOfText(2, xText), 1), "CharCaseMap")); + // 3rd line has no capitalization + CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty<sal_Int16>(getRun(getParagraphOfText(3, xText), 1), "CharCaseMap")); + // 4th line has written with small capitals + CPPUNIT_ASSERT_EQUAL(style::CaseMap::SMALLCAPS, getProperty<sal_Int16>(getRun(getParagraphOfText(4, xText), 1), "CharCaseMap")); + // 5th line has no capitalization + CPPUNIT_ASSERT_EQUAL(style::CaseMap::NONE, getProperty<sal_Int16>(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<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY); + uno::Reference<graphic::XGraphic> xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic"); + Graphic aVclGraphic(xGraphic); + BitmapEx aBitmap(aVclGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL(341L, aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(181L, aBitmap.GetSizePixel().Height()); + Color aColor(aBitmap.GetPixelColor(120, 30)); + CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xb1, 0xc8, 0xdd )); + aColor = aBitmap.GetPixelColor(260, 130); + CPPUNIT_ASSERT_EQUAL(aColor, Color( 0xb1, 0xc8, 0xdd )); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8153), getProperty<sal_Int32>(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<text::XTextContent> xTextContent(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xTextContent->getAnchor(); + uno::Reference<text::XText> xText = xRange->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); + + xTextContent.set(getShape(2), uno::UNO_QUERY); + xRange = xTextContent->getAnchor(); + xText = xRange->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testAnnotationFormatting, "annotation-formatting.docx") +{ + uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(2), 2), "TextField"); + uno::Reference<text::XText> xText = getProperty< uno::Reference<text::XText> >(xTextField, "TextRange"); + // Make sure we test the right annotation. + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText, "days"); + // Formatting was lost: the second text portion was NONE, not SINGLE. + CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<sal_Int16>(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<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1); + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty<OUString>(xRun, "CharFontNameComplex")); + CPPUNIT_ASSERT_EQUAL(OUString("MS Mincho"), getProperty<OUString>(xRun, "CharFontNameAsian")); +} + +DECLARE_OOXMLEXPORT_TEST(testStrict, "strict.docx") +{ + uno::Reference<beans::XPropertySet> 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<sal_Int32>(xPageStyle, "BottomMargin")); + // This was only 1397, same issue + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(792 * 20)), getProperty<sal_Int32>(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<text::XText> xHeaderText(xPageStyle->getPropertyValue("HeaderText"), uno::UNO_QUERY); + getParagraphOfText(1, xHeaderText, "This is a header."); + + // Picture was missing. + uno::Reference<lang::XServiceInfo> xServiceInfo(getShapeByName("Picture 2"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextGraphicObject")); + + // SmartArt was missing. + xServiceInfo.set(getShape(1), 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<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + // This was 0, SmartArt was visually missing. + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), xGroup->getCount()); // background, 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<text::WrapTextMode>(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_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<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableColumns> xTableColumns = xTextTable->getColumns(); + 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 + CPPUNIT_ASSERT_EQUAL(0, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo74401, "fdo74401.docx") +{ + uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShapeDescriptor> 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()); + + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextRange> xCharRun = getRun(getParagraphOfText(1, xText), 1, "Triangle "); + + // tdf#128153 Paragraph Style Normal (Web) should not overwrite the 11pt directly applied fontsize. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Fontsize", 11.f, getProperty<float>(xCharRun, "CharHeight")); + // but paragraph Style Normal (Web) should provide the font name + CPPUNIT_ASSERT_EQUAL_MESSAGE("Font", OUString("Times New Roman"), getProperty<OUString>(xCharRun, "CharFontName")); +} + +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<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableColumns> xTableColumns = xTextTable->getColumns(); + 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_EXPORTONLY_TEST(testTdf116194, "tdf116194.docx") +{ + // The problem was that the importer lost consecutive tables with w:gridBefore + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2); +} + +DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx") +{ + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); + uno::Reference<graphic::XGraphic> graphic; + imageProperties->getPropertyValue( "Graphic" ) >>= graphic; + Graphic aVclGraphic(graphic); + BitmapEx aBitmap(aVclGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL(58L, aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(320L, aBitmap.GetSizePixel().Height()); + Color aColor(aBitmap.GetPixelColor(20, 30)); + CPPUNIT_ASSERT_EQUAL(Color( 0xce, 0xce, 0xce ), aColor); +} + +DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx") +{ + // When chart was in a TextFrame, its size was too large. + uno::Reference<text::XTextEmbeddedObjectsSupplier> xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); + // This was 10954. + CPPUNIT_ASSERT_EQUAL(sal_Int32(6008), getProperty<sal_Int32>(xEmbeddedObjects->getByIndex(0), "Width")); + + // Layout modified the document when it had this chart. + uno::Reference<util::XModifiable> 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<bool>(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. + // Check to make sure the document loaded. Note that the page number may + // be 1 or 2 depending on the environment. + CPPUNIT_ASSERT(getPages() > 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. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +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<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + for( int i = 0; + i < xIndexAccess->getCount(); + ++i ) + { + uno::Reference<text::XTextFrame> frame(xIndexAccess->getByIndex( i ), uno::UNO_QUERY); + uno::Reference<text::XTextRange> range = frame->getAnchor(); + uno::Reference<lang::XServiceInfo> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> text = textDocument->getText(); + CPPUNIT_ASSERT_EQUAL( OUString( "Text" ), text->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testCaption, "caption.docx") +{ + uno::Reference<beans::XPropertySet> 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<awt::FontSlant>(xStyle, "CharPosture")); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeTrackedchanges, "groupshape-trackedchanges.docx") +{ + uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> 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<OUString>(getParagraph(1), "NumberingStyleName")); +} + +DECLARE_OOXMLEXPORT_TEST(testFootnote, "footnote.docx") +{ + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XTextRange> 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") +{ + // Note that this is btLr text, so layout and doc model horizontal/vertical is the opposite of + // each other. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A2"); + // Cell vertical alignment was CENTER, should be NONE. + CPPUNIT_ASSERT_EQUAL(text::VertOrientation::NONE, getProperty<sal_Int16>(xCell, "VertOrient")); + + // Cell horizontal alignment should be CENTER. + uno::Reference<text::XText> xCellText(xCell, uno::UNO_QUERY); + auto nActual = getProperty<sal_Int32>(getParagraphOfText(1, xCellText), "ParaAdjust"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(style::ParagraphAdjust_CENTER), nActual); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo80555, "fdo80555.docx") +{ + uno::Reference<drawing::XShape> 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 <w:hideMark> cell property was ignored. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + // Height should be minimal + CPPUNIT_ASSERT_EQUAL(convertTwipToMm100(MINLAY), getProperty<sal_Int64>(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<sal_Int16>(xTableRows->getByIndex(1), "SizeType")); + + //tdf#104876: Width was not recognized during import when table size was 'auto' + CPPUNIT_ASSERT_MESSAGE("table size is less than 7000?",sal_Int32(7000) > getProperty<sal_Int32>(xTextTable, "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testHidemarkb, "tdf99616_hidemarkb.docx") +{ + // Problem was that the smallest possible height was forced, not the min specified size. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + // Height should be .5cm + CPPUNIT_ASSERT_EQUAL(sal_Int64(501), getProperty<sal_Int64>(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<sal_Int16>(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(testTdf123104, "tdf123104.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("E1"); + // See SwXCell::getPropertyValue(), we really put 'long' into an Any there. + // Without the accompanying fix in place, this test would have failed with 'Expected: 3;Actual : + // 2', i.e. the vertical merge covered one less cell, resulting in a cell with white background. + CPPUNIT_ASSERT_EQUAL(static_cast<long>(3), getProperty<long>(xCell, "RowSpan")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo85542, "fdo85542.docx") +{ + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), xBookmarksByIdx->getCount()); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("B1")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("B2")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("B3")); + // B1 + uno::Reference<text::XTextContent> xContent1(xBookmarksByName->getByName("B1"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange1 = xContent1->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("ABB"), xRange1->getString()); + // B2 + uno::Reference<text::XTextContent> xContent2(xBookmarksByName->getByName("B2"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange2 = xContent2->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("BBC"), xRange2->getString()); + // B3 -- testing a collapsed bookmark + uno::Reference<text::XTextContent> xContent3(xBookmarksByName->getByName("B3"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange3 = xContent3->getAnchor(); + CPPUNIT_ASSERT_EQUAL(xRange3->getString(), OUString()); + uno::Reference<text::XText> xText = xRange3->getText( ); + uno::Reference<text::XTextCursor> xNeighborhoodCursor = xText->createTextCursor( ); + xNeighborhoodCursor->gotoRange(xRange3, false); + xNeighborhoodCursor->goLeft(1, false); + xNeighborhoodCursor->goRight(2, true); + CPPUNIT_ASSERT_EQUAL(OUString("AB"), xNeighborhoodCursor->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf65955, "tdf65955.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xBookmarksByIdx->getCount()); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("a")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("b")); + // a + uno::Reference<text::XTextContent> xContent3(xBookmarksByName->getByName("a"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange3 = xContent3->getAnchor(); + CPPUNIT_ASSERT_EQUAL(xRange3->getString(), OUString()); + // b + uno::Reference<text::XTextContent> xContent2(xBookmarksByName->getByName("b"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange2 = xContent2->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("r"), xRange2->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf65955_2, "tdf65955_2.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xBookmarksByIdx->getCount()); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("test")); + + uno::Reference<text::XTextContent> xContent3(xBookmarksByName->getByName("test"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange3 = xContent3->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("foo bar"), xRange3->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testChtOutlineNumberingOoxml, "chtoutline.docx") +{ + const sal_Unicode aExpectedNumbering[] = { 0x7b2c, ' ', '1', ' ', 0x7ae0 }; + + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering,SAL_N_ELEMENTS(aExpectedNumbering)), + getProperty<OUString>(xPara, "ListLabelString")); +} + +DECLARE_OOXMLEXPORT_TEST(mathtype, "mathtype.docx") +{ + uno::Reference<text::XTextEmbeddedObjectsSupplier> xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); + // This failed as the Model property was empty. + auto xModel = getProperty< uno::Reference<lang::XServiceInfo> >(xEmbeddedObjects->getByIndex(0), "Model"); + CPPUNIT_ASSERT(xModel->supportsService("com.sun.star.formula.FormulaProperties")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf8255, "tdf8255.docx") +{ + // This was 1: a full-page-wide multi-page floating table was imported as a TextFrame. + CPPUNIT_ASSERT_EQUAL(0, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf87460, "tdf87460.docx") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(xTextDocument, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEndnotes = xEndnotesSupplier->getEndnotes(); + // This was 0: endnote was lost on import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xEndnotes->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90611, "tdf90611.docx") +{ + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XText> xFootnoteText; + xFootnotes->getByIndex(0) >>= xFootnoteText; + // This was 11. + CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(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<text::XTextRange> xParagraph = getParagraph(1); + auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules"); + uno::Sequence<beans::PropertyValue> 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<OUString>(); + + // Make sure that the font name is Arial, this was Verdana. + uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xStyle, "CharFontName")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf86374, "tdf86374.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTable->getRows(); + // 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<sal_Int16>(xTableRows->getByIndex(0), "SizeType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf87924, "tdf87924.docx") +{ + uno::Reference<beans::XPropertySet> 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<sal_Int32>(0), aGeometry["TextPreRotateAngle"].get<sal_Int32>()); +} + +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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + size_t paraIndex = 0; + do + { + uno::Reference<lang::XServiceInfo> xServiceInfo; + if (xParaEnum->nextElement() >>= xServiceInfo) + { + uno::Reference<beans::XPropertySet> 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<beans::XPropertyState> 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(testTdf95377, "tdf95377.docx") +{ + uno::Reference<beans::XPropertyState> xParagraph(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xParagraph, "ParaRightMargin")); + + xParagraph.set(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-501), getProperty<sal_Int32>(xParagraph, "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); + + xParagraph.set(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-250), getProperty<sal_Int32>(xParagraph, "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); + + //default style has numbering enabled. Styles inherit numbering unless specifically disabled + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "//body/txt/Special", 3); //first three paragraphs have numbering + assertXPath(pXmlDoc, "//body/txt[1]/Special", "rText", "a."); + assertXPath(pXmlDoc, "//body/txt[2]/Special", "rText", "b."); + assertXPath(pXmlDoc, "//body/txt[3]/Special", "rText", "c."); + assertXPath(pXmlDoc, "/root/page/body/txt[4]/Special", 0); //last paragraph style disables numbering +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95376, "tdf95376.docx") +{ + uno::Reference<beans::XPropertyState> 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")); + + //tdf#131321 - paragraph styles lost their numbering. Bullet+space inherits WWNum1 from Bullet + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Bullet+space"), uno::UNO_QUERY); + CPPUNIT_ASSERT(!(getProperty<OUString>(xStyle, "NumberingStyleName")).isEmpty()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92124, "tdf92124.docx") +{ + // Get the second paragraph's numbering style's 1st level's suffix. + uno::Reference<text::XTextRange> xParagraph = getParagraph(2); + auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules"); + uno::Sequence<beans::PropertyValue> 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<OUString>(); + // Make sure it's empty as the source document contains <w:suff w:val="nothing"/>. + 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<text::TextContentAnchorType>(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<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf91417, "tdf91417.docx") +{ + // The first paragraph should contain a link to "http://www.google.com/" + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextCursor> xTextCursor = xTextDocument->getText()->createTextCursor( ); + uno::Reference<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XFootnotesSupplier> xFootnoteSupp(xTextDocument, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnoteIdxAcc = xFootnoteSupp->getFootnotes(); + uno::Reference<text::XFootnote> xFootnote(xFootnoteIdxAcc->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XText> xFootnoteText(xFootnote, uno::UNO_QUERY); + OUString sFootnoteText = xFootnoteText->getString(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(89), 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 +} + +CPPUNIT_TEST_FIXTURE(Test, testTdf94374) +{ + load(mpTestDocumentPath, "hello.docx"); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText = xTextDocument->getText(); + uno::Reference<text::XTextRange> 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<OUString>(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") +{ + uno::Reference<beans::XPropertySet> xProps(getParagraph(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("1st page: first paragraph erroneous numbering", + !xProps->getPropertyValue("NumberingRules").hasValue()); + // paragraph with numbering and section break was removed by writerfilter + // but its numbering was copied to all following paragraphs + CPPUNIT_ASSERT_MESSAGE("2nd page: first paragraph missing numbering", + getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(2), "NumberingRules").is()); + xProps = uno::Reference<beans::XPropertySet>(getParagraph(3), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("2nd page: second paragraph erroneous numbering", + !xProps->getPropertyValue("NumberingRules").hasValue()); + + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf94043, "tdf94043.docx") +{ + auto xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + auto xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + // This was 0, the separator line was not visible due to 0 width. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), getProperty<sal_Int32>(xTextColumns, "SeparatorLineWidth")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95213, "tdf95213.docx") +{ + // Get the second paragraph's numbering style's 2nd level's character style name. + uno::Reference<text::XTextRange> xParagraph = getParagraph(2); + auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules"); + uno::Sequence<beans::PropertyValue> 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<OUString>(); + + uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName(aName), uno::UNO_QUERY); + // This was awt::FontWeight::BOLD. + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xStyle, "CharWeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf97371, "tdf97371.docx") +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(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") +{ + // This was 1: a multi-page floating table was imported as a TextFrame. + CPPUNIT_ASSERT_EQUAL(0, getShapes()); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> 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<sal_Int16>(xTableProperties, "HoriOrient")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableMarginAdjustment, "table.fodt") +{ + // Writer, (new) Word: margin 0 means table border starts at 0 + // (old) Word: margin 0 means paragraph in table starts at 0 + + auto const xTable(getParagraphOrTable(1)); + // shifted very slightly to account for half of the thin border width, so 4, not 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), getProperty<sal_Int32>(xTable, "LeftMargin")); + + // Now that compatibilityMode is set to 2013's 15 (new), expect the new values, + // since LO is exporting in the NEW way now instead of the OLD way. + // This was 55 when using 2007's compatibilityMode of 12 (old) + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type", "dxa"); + assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "w", "0"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf119760_tableInTablePosition, "tdf119760_tableInTablePosition.docx") +{ + if ( mbExported ) + { + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type", "dxa"); + assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]//w:tblPr[1]/w:tblInd[1]", "w", "0"); + } + + uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); + uno::Reference< container::XIndexAccess > xTables( xTablesSupplier->getTextTables(), uno::UNO_QUERY ); + uno::Reference< text::XTextTable > xTable( xTables->getByIndex(0), uno::UNO_QUERY ); + // For compatibilityMode 15: margin 0 means table border starts at 0, + // shifted to account for half of the thick border width, so 106, not 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(106), getProperty<sal_Int32>(xTable, "LeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" ) +{ + sal_Int32 const cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; + + uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); + uno::Reference< container::XIndexAccess > xTables( xTablesSupplier->getTextTables(), uno::UNO_QUERY ); + + for ( int i = 0; i < 4; i++ ) + { + uno::Reference< text::XTextTable > xTable1( xTables->getByIndex( i ), uno::UNO_QUERY ); + + // Verify left margin of 1st cell : + // * Office left margins are measured relative to the right of the border + // * LO left spacing is measured from the center of the border + uno::Reference< table::XCell > xCell = xTable1->getCellByName( "A1" ); + uno::Reference< beans::XPropertySet > xPropSet( xCell, uno::UNO_QUERY_THROW ); + sal_Int32 aLeftMargin = -1; + xPropSet->getPropertyValue( "LeftBorderDistance" ) >>= aLeftMargin; + uno::Any aLeftBorder = xPropSet->getPropertyValue( "LeftBorder" ); + table::BorderLine2 aLeftBorderLine; + aLeftBorder >>= aLeftBorderLine; + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect left spacing computed from docx cell margin", + cellLeftMarginFromOffice[i], aLeftMargin - 0.5 * aLeftBorderLine.LineWidth, 1 ); + // The 'a' in the fourth table should not be partly hidden by the border + if ( i == 3 ) + { + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect cell left padding", + 0.5 * aLeftBorderLine.LineWidth, aLeftMargin, 1); + // tdf#119885: cell's edit area must touch right border + sal_Int32 aRightMargin = -1; + xPropSet->getPropertyValue("RightBorderDistance") >>= aRightMargin; + uno::Any aRightBorder = xPropSet->getPropertyValue("RightBorder"); + table::BorderLine2 aRightBorderLine; + aRightBorder >>= aRightBorderLine; + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect cell right padding", + 0.5 * aRightBorderLine.LineWidth, aRightMargin, 1); + } + } +} + +// tdf#106742 for DOCX with compatibility level <= 14 (MS Word up to and incl. ver.2010), we should use cell margins when calculating table left border position +DECLARE_OOXMLEXPORT_TEST( testTablePosition14, "table-position-14.docx" ) +{ + sal_Int32 const aXCoordsFromOffice[] = { 2500, -1000, 0, 0 }; + + uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); + uno::Reference< frame::XModel > xModel( mxComponent, uno::UNO_QUERY ); + uno::Reference< container::XIndexAccess > xTables( xTablesSupplier->getTextTables(), uno::UNO_QUERY ); + + for ( int i = 0; i < 4; i++ ) + { + uno::Reference< text::XTextTable > xTable1( xTables->getByIndex( i ), uno::UNO_QUERY ); + + // Verify X coord + uno::Reference< view::XSelectionSupplier > xCtrl( xModel->getCurrentController(), uno::UNO_QUERY ); + xCtrl->select( uno::makeAny( xTable1 ) ); + uno::Reference< text::XTextViewCursorSupplier > xTextViewCursorSupplier( xCtrl, uno::UNO_QUERY ); + uno::Reference< text::XTextViewCursor > xCursor = xTextViewCursorSupplier->getViewCursor(); + awt::Point pos = xCursor->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect X coord computed from docx", + aXCoordsFromOffice[i], pos.X, 1 ); + } +} + +// tdf#106742 for DOCX with compatibility level > 14 (MS Word since ver.2013), +// we should NOT use cell margins when calculating table left border position. But we do need to use border width. +DECLARE_OOXMLEXPORT_TEST( testTablePosition15, "table-position-15.docx" ) +{ + sal_Int32 const aXCoordsFromOffice[] = { 2751, -899, 1, 212 }; + + uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); + uno::Reference< frame::XModel > xModel( mxComponent, uno::UNO_QUERY ); + uno::Reference< container::XIndexAccess > xTables( xTablesSupplier->getTextTables(), uno::UNO_QUERY ); + + for ( int i = 0; i < 4; i++ ) + { + uno::Reference< text::XTextTable > xTable1( xTables->getByIndex( i ), uno::UNO_QUERY ); + + // Verify X coord + uno::Reference< view::XSelectionSupplier > xCtrl( xModel->getCurrentController(), uno::UNO_QUERY ); + xCtrl->select( uno::makeAny( xTable1 ) ); + uno::Reference< text::XTextViewCursorSupplier > xTextViewCursorSupplier( xCtrl, uno::UNO_QUERY ); + uno::Reference< text::XTextViewCursor > xCursor = xTextViewCursorSupplier->getViewCursor(); + awt::Point pos = xCursor->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect X coord computed from docx", + aXCoordsFromOffice[i], pos.X, 1 ); + } +} + +DECLARE_OOXMLEXPORT_TEST( testTdf107359, "tdf107359-char-pitch.docx" ) +{ + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + + bool bGridSnapToChars; + xPropertySet->getPropertyValue("GridSnapToChars") >>= bGridSnapToChars; + CPPUNIT_ASSERT_EQUAL( false, bGridSnapToChars ); + + sal_Int32 nRubyHeight; + xPropertySet->getPropertyValue("GridRubyHeight") >>= nRubyHeight; + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), nRubyHeight ); + + sal_Int32 nBaseHeight; + xPropertySet->getPropertyValue("GridBaseHeight") >>= nBaseHeight; + CPPUNIT_ASSERT_EQUAL( sal_Int32(convertTwipToMm100(18 * 20)), nBaseHeight ); + + sal_Int32 nBaseWidth; + xPropertySet->getPropertyValue("GridBaseWidth") >>= nBaseWidth; + CPPUNIT_ASSERT_EQUAL( sal_Int32(convertTwipToMm100(24 * 20)), nBaseWidth ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf77236_MissingSolidFill, "tdf77236_MissingSolidFill.docx") +{ + // tdf#77236: solidFill of VML shape was not exported if the colors of line and style were the same + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "//mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf105875_VmlShapeRotationWithFlip, "tdf105875_VmlShapeRotationWithFlip.docx") +{ + // tdf#105875: check whether the rotation of the VML bezier shape is ok (with flip too) + // TODO: fix export too + if (mbExported) + return; + + { + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>()); + } + + { + uno::Reference<beans::XPropertySet> xPropertySet(getShape(2), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(220 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1); + } + + { + uno::Reference<beans::XPropertySet> xPropertySet(getShape(3), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(320 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1); + } + + { + uno::Reference<beans::XPropertySet> xPropertySet(getShape(4), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(140 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1); + } + + { + uno::Reference<beans::XPropertySet> xPropertySet(getShape(5), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(40 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1); + } + +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx new file mode 100644 index 000000000..984564415 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -0,0 +1,1304 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/style/BreakType.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/table/BorderLine.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/text/XDependentTextField.hpp> +#include <com/sun/star/text/XFootnotesSupplier.hpp> +#include <com/sun/star/text/RubyAdjust.hpp> +#include <com/sun/star/text/RubyPosition.hpp> +#include <com/sun/star/text/XDocumentIndex.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> + +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(testTdf57589_hashColor, "tdf57589_hashColor.docx") +{ + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTMAGENTA, Color(getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"))); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(getParagraph(2), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(getParagraph(2), "ParaBackColor"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90906_colAuto, "tdf90906_colAuto.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(getRun(xPara, 1, "Nazwa"), "CharBackColor"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90906_colAutoB, "tdf90906_colAutoB.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, Color(getProperty<sal_uInt32>(xCell, "BackColor"))); + xCell.set(xTable->getCellByName("A2")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xCell, "BackColor"))); + xCell.set(xTable->getCellByName("B1")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xCell, "BackColor"))); + xCell.set(xTable->getCellByName("B2")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(getProperty<sal_uInt32>(xCell, "BackColor"))); + + uno::Reference<text::XTextRange> xText(getParagraph(2, "Paragraphs too")); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xText, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xText, "ParaBackColor"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") +{ + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116436_rowFill, "tdf116436_rowFill.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121665_back2backColumnBreaks, "tdf121665_back2backColumnBreaks.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Column break type", + style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent0, "tdf126795_TabsRelativeToIndent0.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence<style::TabStop> >(getParagraph( 2 ), "ParaTabStops"); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); + CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(499), stops[ 0 ].Position ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent1, "tdf126795_TabsRelativeToIndent1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence<style::TabStop> >(getParagraph( 2 ), "ParaTabStops"); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); + CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(499), stops[ 0 ].Position ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx") +{ + // Number of tabstops should be zero, overriding the one in the style + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops").getLength()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf63561_clearTabs, "tdf63561_clearTabs.docx") +{ + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops").getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), getProperty< uno::Sequence<style::TabStop> >(getParagraph(3), "ParaTabStops").getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), getProperty< uno::Sequence<style::TabStop> >(getParagraph(4), "ParaTabStops").getLength()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf63561_clearTabs2, "tdf63561_clearTabs2.docx") +{ + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops").getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<style::TabStop> >(getParagraph(3), "ParaTabStops").getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), getProperty< uno::Sequence<style::TabStop> >(getParagraph(4), "ParaTabStops").getLength()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf124384, "tdf124384.docx") +{ + // There should be no crash during loading of the document + // so, let's check just how much pages we have + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121456_tabsOffset, "tdf121456_tabsOffset.odt") +{ + for (int i=2; i<8; i++) + { + uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence<style::TabStop> >(getParagraph( i ), "ParaTabStops"); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); + CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_RIGHT, stops[ 0 ].Alignment ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(17000), stops[ 0 ].Position ); + } +} + +// tdf#121561: make sure w:sdt/w:sdtContent around TOC is written during ODT->DOCX conversion +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121561_tocTitle, "tdf121456_tabsOffset.odt") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:t", "Inhaltsverzeichnis"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:instrText", " TOC \\f \\o \"1-9\" \\h"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery", "val", "Table of Contents"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf129525, "tdf129525.rtf") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[4]/w:t", "Overview"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t", "3"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[1]/w:t", "More detailed description"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[2]/w:t", "4"); +} + +// Related issue tdf#121561: w:sdt/w:sdtContent around TOC +DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx") +{ + uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> text = textDocument->getText(); + // -1 if the 'Y' character does not occur + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('Y')); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('y')); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121561_tocTitleDocx, "tdf121456_tabsOffset.odt") +{ + CPPUNIT_ASSERT_EQUAL(7, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport(); + + // get TOC node + uno::Reference<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexes = xIndexSupplier->getDocumentIndexes( ); + uno::Reference<text::XDocumentIndex> xTOCIndex(xIndexes->getByIndex(0), uno::UNO_QUERY); + + // ensure TOC title was set in TOC properties + CPPUNIT_ASSERT_EQUAL(OUString("Inhaltsverzeichnis"), getProperty<OUString>(xTOCIndex, "Title")); + + // ensure TOC end-field mark is placed inside TOC section + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[16]/w:r/w:fldChar", "fldCharType", "end"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106174_rtlParaAlign, "tdf106174_rtlParaAlign.docx") +{ + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_CENTER), getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_CENTER), getProperty<sal_Int16>(getParagraph(2), "ParaAdjust")); + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Another paragraph aligned to right"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(xPropertySet, "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(3), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(4), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(5), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getParagraph(6), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(7), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(8), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getParagraph(9), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getParagraph(10), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(11), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getParagraph(12), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_LEFT), getProperty<sal_Int16>(getParagraph(13), "ParaAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getParagraph(14), "ParaAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82065_Ind_start_strict, "tdf82065_Ind_start_strict.docx") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + bool bFoundIndentAt = false; + for (beans::PropertyValue const & rProp : std::as_const(aProps)) + { + if (rProp.Name == "IndentAt") + { + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("IndentAt", double(6001), rProp.Value.get<double>(), 10 ); + bFoundIndentAt = true; + } + } + CPPUNIT_ASSERT_EQUAL_MESSAGE("IndentAt defined", true, bFoundIndentAt); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf76683_negativeTwipsMeasure, "tdf76683_negativeTwipsMeasure.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col", 2); + sal_uInt32 nColumn1 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]", "w").toUInt32(); + sal_uInt32 nColumn2 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]", "w").toUInt32(); + CPPUNIT_ASSERT( nColumn1 > nColumn2 ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf112694, "tdf112694.docx") +{ + uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); + // Header was on when header for file was for explicit first pages only + // (marked via <w:titlePg>). + CPPUNIT_ASSERT(!getProperty<bool>(aPageStyle, "HeaderIsOn")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113849_evenAndOddHeaders, "tdf113849_evenAndOddHeaders.odt") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Header2 text", OUString("L. J. Kendall"), parseDump("/root/page[2]/header/txt")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer2 text", OUString("*"), parseDump("/root/page[2]/footer/txt")); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Header3 text", OUString("Shadow Hunt"), parseDump("/root/page[3]/header/txt")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer3 text", OUString("*"), parseDump("/root/page[3]/footer/txt")); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Header4 text", OUString("L. J. Kendall"), parseDump("/root/page[4]/header/txt")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer4 text", OUString("*"), parseDump("/root/page[4]/footer/txt")); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer5 text", OUString(""), parseDump("/root/page[5]/footer/txt")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer6 text", OUString(""), parseDump("/root/page[6]/footer/txt")); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages", 6, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118361_RTLfootnoteSeparator, "tdf118361_RTLfootnoteSeparator.docx") +{ + uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote separator RTL", sal_Int16(2), getProperty<sal_Int16>(aPageStyle, "FootnoteLineAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf115861, "tdf115861.docx") +{ + // Second item in the paragraph enumeration was a table, 2nd paragraph was + // lost. + CPPUNIT_ASSERT_EQUAL(OUString("(k)"), getParagraph(2)->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.docx") +{ + uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 2), "TextField"); + CPPUNIT_ASSERT(xTextField.is()); + uno::Reference<lang::XServiceInfo> xServiceInfo(xTextField, uno::UNO_QUERY_THROW); + uno::Reference<text::XDependentTextField> xDependent(xTextField, uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextField.Database")); + OUString sValue; + xTextField->getPropertyValue("Content") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8(u8"«Name»"), sValue); + + uno::Reference<beans::XPropertySet> xFiledMaster = xDependent->getTextFieldMaster(); + uno::Reference<lang::XServiceInfo> xFiledMasterServiceInfo(xFiledMaster, uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xFiledMasterServiceInfo->supportsService("com.sun.star.text.fieldmaster.Database")); + + // Defined properties: DataBaseName, Name, DataTableName, DataColumnName, DependentTextFields, DataCommandType, InstanceName, DataBaseURL + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("Name") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("Name"), sValue); + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("DataColumnName") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("Name"), sValue); + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("InstanceName") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.text.fieldmaster.DataBase.Name"), sValue); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf115719, "tdf115719.docx") +{ + // This was a single page, instead of pushing the textboxes to the second + // page. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf115719b, "tdf115719b.docx") +{ + // This is similar to testTdf115719, but here the left textbox is not aligned "from left, by + // 0cm" but simply aligned to left, which is a different codepath. + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2 + // - Actual : 1 + // i.e. the textboxes did not appear on the 2nd page, but everything was on a single page. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123243, "tdf123243.docx") +{ + // Without the accompanying fix in place, this test would have failed with 'Expected: 1; Actual: + // 2'; i.e. unexpected paragraph margin created 2 pages. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116410, "tdf116410.docx") +{ + // Opposite of the above, was 2 pages, should be 1 page. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testDefaultStyle, "defaultStyle.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Default Style", OUString("Title"), getProperty<OUString>(getParagraph(1), "ParaStyleName") ); + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf117988, "tdf117988.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf94801, "tdf94801.docx") +{ + // This was a 2-page document with unwanted line breaking in table cells, because + // the table was narrower, than defined (< 1/100 mm loss during twip to 1/100 mm conversion) + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphSplitOnSectionBorder, "parasplit-on-section-border.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Test document has only two paragraphs. After splitting, it should contain + // three of them. + assertXPath(pXmlDoc, "//w:sectPr", 2); + assertXPath(pXmlDoc, "//w:p", 3); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf44832_testSectionWithDifferentHeader, "tdf44832_section_new_header.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.docx") +{ + uno::Reference<drawing::XShape> xSignatureLineShape = getShape(1); + uno::Reference<beans::XPropertySet> xPropSet(xSignatureLineShape, uno::UNO_QUERY); + + bool bIsSignatureLine; + xPropSet->getPropertyValue("IsSignatureLine") >>= bIsSignatureLine; + CPPUNIT_ASSERT_EQUAL(true, bIsSignatureLine); + + bool bShowSignDate; + xPropSet->getPropertyValue("SignatureLineShowSignDate") >>= bShowSignDate; + CPPUNIT_ASSERT_EQUAL(true, bShowSignDate); + + bool bCanAddComment; + xPropSet->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment; + CPPUNIT_ASSERT_EQUAL(true, bCanAddComment); + + OUString aSignatureLineId; + xPropSet->getPropertyValue("SignatureLineId") >>= aSignatureLineId; + CPPUNIT_ASSERT_EQUAL(OUString("{0EBE47D5-A1BD-4C9E-A52E-6256E5C345E9}"), aSignatureLineId); + + OUString aSuggestedSignerName; + xPropSet->getPropertyValue("SignatureLineSuggestedSignerName") >>= aSuggestedSignerName; + CPPUNIT_ASSERT_EQUAL(OUString("John Doe"), aSuggestedSignerName); + + OUString aSuggestedSignerTitle; + xPropSet->getPropertyValue("SignatureLineSuggestedSignerTitle") >>= aSuggestedSignerTitle; + CPPUNIT_ASSERT_EQUAL(OUString("Farmer"), aSuggestedSignerTitle); + + OUString aSuggestedSignerEmail; + xPropSet->getPropertyValue("SignatureLineSuggestedSignerEmail") >>= aSuggestedSignerEmail; + CPPUNIT_ASSERT_EQUAL(OUString("john@thefarmers.com"), aSuggestedSignerEmail); + + OUString aSigningInstructions; + xPropSet->getPropertyValue("SignatureLineSigningInstructions") >>= aSigningInstructions; + CPPUNIT_ASSERT_EQUAL(OUString("Check the machines!"), aSigningInstructions); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf117805, "tdf117805.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess + = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), + maTempFile.GetURL()); + // This failed, the header was lost. It's still referenced at an incorrect + // location in document.xml, though. + CPPUNIT_ASSERT(xNameAccess->hasByName("word/header1.xml")); + + uno::Reference<text::XText> textbox(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(8, getParagraphs(textbox)); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113183, "tdf113183.docx") +{ + // The horizontal positioning of the star shape affected the positioning of + // the triangle one, so the triangle was outside the page frame. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "left").toInt32(); + sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32(); + sal_Int32 nShapeLeft + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "left") + .toInt32(); + sal_Int32 nShapeWidth + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "width") + .toInt32(); + // Make sure the second triangle shape is within the page bounds (with ~1px tolerance). + CPPUNIT_ASSERT_GREATEREQUAL(nShapeLeft + nShapeWidth, nPageLeft + nPageWidth + 21); +} + +DECLARE_OOXMLEXPORT_TEST(testGraphicObjectFliph, "graphic-object-fliph.docx") +{ + CPPUNIT_ASSERT(getProperty<bool>(getShape(1), "HoriMirroredOnEvenPages")); + CPPUNIT_ASSERT(getProperty<bool>(getShape(1), "HoriMirroredOnOddPages")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113547, "tdf113547.docx") +{ + uno::Reference<beans::XPropertySet> xPropertySet( + getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels( + xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aProps(xLevels->getByIndex(0)); // 1st level + // This was 0, first-line left margin of the numbering was lost. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-635), aProps["FirstLineIndent"].get<sal_Int32>()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113399, "tdf113399.doc") +{ + // 0 padding was not preserved + // In LO 0 is the default, but in OOXML format the default is 254 / 127 + uno::Reference<beans::XPropertySet> xPropSet(getShape(1), uno::UNO_QUERY); + sal_Int32 nPaddingValue; + xPropSet->getPropertyValue("TextLeftDistance") >>= nPaddingValue; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nPaddingValue); + xPropSet->getPropertyValue("TextRightDistance") >>= nPaddingValue; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nPaddingValue); + xPropSet->getPropertyValue("TextUpperDistance") >>= nPaddingValue; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nPaddingValue); + xPropSet->getPropertyValue("TextLowerDistance") >>= nPaddingValue; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nPaddingValue); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf114882, "tdf114882.docx") +{ + // fastserializer must not fail assertion because of mismatching elements +} + +DECLARE_OOXMLEXPORT_TEST(testTdf49073, "tdf49073.docx") +{ + // test case for Asian phontic guide (ruby text.) + sal_Unicode aRuby[3] = {0x304D,0x3082,0x3093}; + OUString sRuby(aRuby, SAL_N_ELEMENTS(aRuby)); + CPPUNIT_ASSERT_EQUAL(sRuby,getProperty<OUString>(getParagraph(1)->getStart(), "RubyText")); + OUString sStyle = getProperty<OUString>( getParagraph(1)->getStart(), "RubyCharStyleName"); + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("CharacterStyles")->getByName(sStyle), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(5.f, getProperty<float>(xPropertySet, "CharHeight")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_CENTER) ,getProperty<sal_Int16>(getParagraph(2)->getStart(),"RubyAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_BLOCK) ,getProperty<sal_Int16>(getParagraph(3)->getStart(),"RubyAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_INDENT_BLOCK),getProperty<sal_Int16>(getParagraph(4)->getStart(),"RubyAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_LEFT) ,getProperty<sal_Int16>(getParagraph(5)->getStart(),"RubyAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_RIGHT) ,getProperty<sal_Int16>(getParagraph(6)->getStart(),"RubyAdjust")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyPosition::INTER_CHARACTER) ,getProperty<sal_Int16>(getParagraph(7)->getStart(),"RubyPosition")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf114703, "tdf114703.docx") +{ + uno::Reference<container::XIndexAccess> xRules + = getProperty<uno::Reference<container::XIndexAccess>>( + getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); + // This was 0, level override "default" replaced the non-default value from + // the abstract level. + CPPUNIT_ASSERT_EQUAL( + static_cast<sal_Int32>(-1000), + comphelper::SequenceAsHashMap(xRules->getByIndex(0))["FirstLineIndent"].get<sal_Int32>()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113258, "tdf113258.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + // This was 494, i.e. automatic spacing resulted in non-zero paragraph top + // margin for the first paragraph in a shape. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), + getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113258_noBeforeAutospacing, "tdf113258_noBeforeAutospacing.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + // This was 0, i.e. disabled automatic spacing still resulted in zero paragraph + // top margin for the first paragraph in a shape. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1764), + getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, "tdf120511_eatenSection.docx") +{ + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nHeight = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "height").toInt32(); + sal_Int32 nWidth = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "width").toInt32(); + CPPUNIT_ASSERT_MESSAGE( "Page1 is portrait", nWidth < nHeight ); + nHeight = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", "height").toInt32(); + nWidth = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", "width").toInt32(); + CPPUNIT_ASSERT_MESSAGE( "Page2 is landscape", nWidth > nHeight ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104354, "tdf104354.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + // This was 494, i.e. automatic spacing resulted in non-zero paragraph top + // margin for the first paragraph in a text frame. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), + getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin")); + // still 494 in the second paragraph + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), + getProperty<sal_Int32>(xShape->getEnd(), "ParaTopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104354_firstParaInSection, "tdf104354_firstParaInSection.docx") +{ + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XText> xText(xFootnotes->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), + getProperty<sal_Int32>(getParagraphOfText(1, xText), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testPageBreak_after, "pageBreak_after.odt") +{ + // The problem was that the page breakAfter put the empty page BEFORE the table + xmlDocUniquePtr pDump = parseLayoutDump(); + assertXPath(pDump, "/root/page[1]/body/tab", 1); + // There should be two pages actually - a blank page after a page break. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix?? Table should be on page one of two", 1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf107035, "tdf107035.docx") +{ + // Select the second run containing the page number field + auto xPgNumRun = getRun(getParagraph(1), 2, "1"); + + // Check that the page number field colour is set to "automatic". + sal_Int32 nPgNumColour = getProperty<sal_Int32>(xPgNumRun, "CharColor"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_AUTO), nPgNumColour); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf112118_DOCX, "tdf112118.docx") +{ + // The resulting left margin width (2081) differs from its DOC counterpart from ww8export2.cxx, + // because DOCX import does two conversions between mm/100 and twips on the route, losing one + // twip on the road and arriving with a value that is 2 mm/100 less. I don't see an obvious way + // to avoid that. + static const struct { + const char* styleName; + struct { + const char* sideName; + sal_Int32 nMargin; + sal_Int32 nBorderDistance; + sal_Int32 nBorderWidth; + } sideParams[4]; + } styleParams[] = { // Margin (MS-style), border distance, border width + { + "Standard", + { + { "Top", 496, 847, 159 }, // 851 twip, 24 pt (from text), 4.5 pt + { "Left", 2081, 706, 212 }, // 1701 twip, 20 pt (from text), 6.0 pt + { "Bottom", 1401, 564, 35 }, // 1134 twip, 16 pt (from text), 1.0 pt + { "Right", 3471, 423, 106 } // 2268 twip, 12 pt (from text), 3.0 pt + } + }, + { + "Converted1", + { + { "Top", 847, 496, 159 }, // 851 twip, 24 pt (from edge), 4.5 pt + { "Left", 706, 2081, 212 }, // 1701 twip, 20 pt (from edge), 6.0 pt + { "Bottom", 564, 1401, 35 }, // 1134 twip, 16 pt (from edge), 1.0 pt + { "Right", 423, 3471, 106 } // 2268 twip, 12 pt (from edge), 3.0 pt + } + } + }; + auto xStyles = getStyles("PageStyles"); + + for (const auto& style : styleParams) + { + const OUString sName = OUString::createFromAscii(style.styleName); + uno::Reference<beans::XPropertySet> xStyle(xStyles->getByName(sName), uno::UNO_QUERY_THROW); + for (const auto& side : style.sideParams) + { + const OUString sSide = OUString::createFromAscii(side.sideName); + const OString sStage = style.styleName + OStringLiteral(" ") + side.sideName; + + sal_Int32 nMargin = getProperty<sal_Int32>(xStyle, sSide + "Margin"); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(sStage + " margin width").getStr(), + side.nMargin, nMargin); + + sal_Int32 nBorderDistance = getProperty<sal_Int32>(xStyle, sSide + "BorderDistance"); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(sStage + " border distance").getStr(), + side.nBorderDistance, nBorderDistance); + + table::BorderLine aBorder = getProperty<table::BorderLine>(xStyle, sSide + "Border"); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(sStage + " border width").getStr(), + side.nBorderWidth, + sal_Int32(aBorder.OuterLineWidth + aBorder.InnerLineWidth + aBorder.LineDistance)); + + // tdf#116472: check that AUTO border color is imported as black + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(sStage + " border color").getStr(), + sal_Int32(COL_BLACK), aBorder.Color); + } + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82177_outsideCellBorders, "tdf82177_outsideCellBorders.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference< text::XTextTable > xTable( xTables->getByIndex(0), uno::UNO_QUERY ); + uno::Reference< table::XCell > xCell = xTable->getCellByName( "E4" ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "TopBorder").LineWidth); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82177_insideCellBorders, "tdf82177_insideCellBorders.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference< text::XTextTable > xTable( xTables->getByIndex(0), uno::UNO_QUERY ); + uno::Reference< table::XCell > xCell = xTable->getCellByName( "E4" ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "TopBorder").LineWidth); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82177_tblBorders, "tdf82177_tblBorders.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference< text::XTextTable > xTable( xTables->getByIndex(0), uno::UNO_QUERY ); + uno::Reference< table::XCell > xCell = xTable->getCellByName( "A5" ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "BottomBorder").LineWidth); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth); + xCell.set(xTable->getCellByName( "E5" )); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "TopBorder").LineWidth); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf119760_positionCellBorder, "tdf119760_positionCellBorder.docx") +{ + //inconsistent in Word even. 2016 positions on last row, 2003 positions on first cell. + sal_Int32 nRowLeft = parseDump("/root/page/body/tab[4]/row[1]/infos/bounds", "left").toInt32(); + sal_Int32 nTextLeft = parseDump("/root/page/body/tab[4]/row[1]/cell[1]/txt/infos/bounds", "left").toInt32(); + CPPUNIT_ASSERT( nRowLeft < nTextLeft ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf98620_environmentBiDi, "tdf98620_environmentBiDi.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( getParagraph(1), "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_RIGHT), getProperty<sal_Int32>( getParagraph(1), "ParaAdjust" )); + + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>( getParagraph(2), "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_RIGHT), getProperty<sal_Int32>( getParagraph(2), "ParaAdjust" )); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116976, "tdf116976.docx") +{ + // This was 0, relative size of shape after bitmap was ignored. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(40), + getProperty<sal_Int16>(getShape(1), "RelativeWidth")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116985, "tdf116985.docx") +{ + // Body frame width is 10800, 40% is the requested relative width, with 144 + // spacing to text on the left/right side. So ideal width would be 4032, + // was 3431. Allow one pixel tolerance, though. + sal_Int32 nWidth + = parseDump("/root/page[1]/body/txt[1]/anchored/fly/infos/bounds", "width").toInt32(); + CPPUNIT_ASSERT(nWidth > 4000); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116801, "tdf116801.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), + uno::UNO_QUERY); + // This raised a lang::IndexOutOfBoundsException, table was missing from + // the import result. + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("D1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("D1"), xCell->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf107969, "tdf107969.docx") +{ + // A VML object in a footnote's tracked changes caused write past end of document.xml at export to docx. + // After that, importing after export failed with + // SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word/document.xml'. +} + +DECLARE_OOXMLEXPORT_TEST(testOpenDocumentAsReadOnly, "open-as-read-only.docx") +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT(pTextDoc->GetDocShell()->IsSecurityOptOpenReadOnly()); +} + +DECLARE_OOXMLEXPORT_TEST(testNoDefault, "noDefault.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + + // Row 1: color directly applied to the paragraph, overrides table and style colors + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(xPara,1), "CharColor")); + + // Row2: (still part of firstRow table-style) ought to use the Normal style color, not the table-style color(5B9BD5) + //xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + //xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + //xParaEnum = xParaEnumAccess->createEnumeration(); + //xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + //CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_LIGHTMAGENTA), getProperty<sal_Int32>(getRun(xPara,1), "CharColor")); + + // Row 3+: Normal style still applied, even if nothing is specified with w:default="1" + xCell.set(xTable->getCellByName("A3"), uno::UNO_QUERY); + xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + xParaEnum = xParaEnumAccess->createEnumeration(); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_LIGHTMAGENTA), getProperty<sal_Int32>(getRun(xPara,1), "CharColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testMarginsFromStyle, "margins_from_style.docx") +{ + // tdf#118521 paragraphs with direct formatting of top or bottom margins have + // lost the other margin comes from paragraph style, getting a bad + // margin from the default style + + // from direct formatting + CPPUNIT_ASSERT_EQUAL(sal_Int32(35), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin")); + // from paragraph style + CPPUNIT_ASSERT_EQUAL(sal_Int32(106), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); + + // from paragraph style + CPPUNIT_ASSERT_EQUAL(sal_Int32(388), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin")); + // from direct formatting + CPPUNIT_ASSERT_EQUAL(sal_Int32(600), getProperty<sal_Int32>(getParagraph(3), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf134784, "tdf134784.docx") +{ + uno::Reference<text::XText> textbox(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(3, getParagraphs(textbox)); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, textbox); + CPPUNIT_ASSERT_EQUAL(sal_Int32(212), getProperty<sal_Int32>(xParagraph, "ParaBottomMargin")); + + // This wasn't zero (it was inherited from style of the previous paragraph in the main text) + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xParagraph, "ParaTopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104348_contextMargin, "tdf104348_contextMargin.docx") +{ + // tdf#104348 shows that ContextMargin belongs with Top/Bottom handling + + uno::Reference<beans::XPropertySet> xMyStyle(getStyles("ParagraphStyles")->getByName("MyStyle"), uno::UNO_QUERY); + // from paragraph style - this is what direct formatting should equal + sal_Int32 nMargin = getProperty<sal_Int32>(xMyStyle, "ParaBottomMargin"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nMargin); + // from direct formatting + CPPUNIT_ASSERT_EQUAL(nMargin, getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118521_marginsLR, "tdf118521_marginsLR.docx") +{ + // tdf#118521 paragraphs with direct formatting of only some of left, right, or first margins have + // lost the other unset margins coming from paragraph style, getting a bad margin from the default style instead + + uno::Reference<beans::XPropertySet> xMyStyle(getStyles("ParagraphStyles")->getByName("MyStyle"), uno::UNO_QUERY); + // from paragraph style - this is what direct formatting should equal + sal_Int32 nMargin = getProperty<sal_Int32>(xMyStyle, "ParaLeftMargin"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nMargin); + // from direct formatting + CPPUNIT_ASSERT_EQUAL(nMargin, getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + + nMargin = getProperty<sal_Int32>(xMyStyle, "ParaRightMargin"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1900), nMargin); + CPPUNIT_ASSERT_EQUAL(nMargin, getProperty<sal_Int32>(getParagraph(2), "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(882), getProperty<sal_Int32>(getParagraph(2), "ParaFirstLineIndent")); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf104797, "tdf104797.docx") +{ + // check moveFrom and moveTo + CPPUNIT_ASSERT_EQUAL( OUString( "Will this sentence be duplicated?" ), getParagraph( 1 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Delete"),getProperty<OUString>(getRun(getParagraph(1), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(1), 2), "IsStart")); + CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence. Will this sentence be duplicated ADDED STUFF?" ), + getParagraph( 2 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 1 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence." ), getRun( getParagraph( 2 ), 2 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 3 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 3), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(2), 3), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(2), 3), "IsStart")); + CPPUNIT_ASSERT_EQUAL( OUString( " Will this sentence be duplicated ADDED STUFF?" ), getRun( getParagraph( 2 ), 4 )->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf113608_runAwayNumbering, "tdf113608_runAwayNumbering.docx") +{ + // check that an incorrect numbering style is not applied + // after removing a w:r-less paragraph + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(2), "NumberingStyleName")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf119188_list_margin_in_cell, "tdf119188_list_margin_in_cell.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + + // lists with auto margins in cells: top margin of the first paragraph is zero, + // but not the bottom margin of the last paragraph, also other list items have got + // zero margins. + + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChart_BorderLine_Style, "Chart_BorderLine_Style.docx") +{ + /* DOCX containing Chart with BorderLine Style as Dash Type should get preserved + * inside an XML tag <a:prstDash> with value "dash", "sysDot, "lgDot", etc. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:spPr/a:ln/a:prstDash", "val", "sysDot"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:spPr/a:ln/a:prstDash", "val", "sysDash"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:spPr/a:ln/a:prstDash", "val", "dash"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChart_Plot_BorderLine_Style, "Chart_Plot_BorderLine_Style.docx") +{ + /* DOCX containing Chart wall (plot area) and Chart Page with BorderLine Style as Dash Type + * should get preserved inside an XML tag <a:prstDash> with value "dash", "sysDot, "lgDot", etc. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:prstDash", "val", "lgDashDot"); + assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:ln/a:prstDash", "val", "sysDash"); + +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedEmptyParagraph, "testTrackChangesDeletedEmptyParagraph.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:del"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesEmptyParagraphsInADeletion, "testTrackChangesEmptyParagraphsInADeletion.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + for (int i = 1; i < 12; ++i) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[" + OString::number(i) + "]/w:pPr/w:rPr/w:del"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf70234, "tdf70234.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // import field with tracked deletion + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r[1]/w:fldChar"); + + // export multiple runs of a field with tracked deletion + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r", 6); + + // export w:delInstrText + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r/w:delInstrText"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115212, "tdf115212.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // export field with tracked deletion + assertXPath(pXmlDoc, "//w:p[2]/w:del[1]/w:r[1]/w:fldChar"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf126243, "tdf120338.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // export change tracking rejection data for tracked paragraph style change + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pPrChange/w:pPr/w:pStyle", "val", "Heading3"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf126245, "tdf126245.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // export change tracking rejection data for tracked numbering change + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange/w:pPr/w:numPr/w:numId", "val", "1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124491, "tdf124491.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // import format change of empty lines, FIXME: change w:r with w:pPr in export + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/*/w:rPr/w:rPrChange"); + // empty line without format change + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/w:rPrChange", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/*/w:rPrChange", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105485, "tdf105485.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // import change tracking of deleted comments + assertXPath(pXmlDoc, "//w:del/w:r/w:commentReference"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125894, "tdf125894.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // import change tracking in frames + assertXPath(pXmlDoc, "//w:del", 2); + assertXPath(pXmlDoc, "//w:ins"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128156, "tdf128156.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // import change tracking in frames + assertXPath(pXmlDoc, "//w:ins"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125546, "tdf125546.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // compress redlines (it was 15) + assertXPath(pXmlDoc, "//w:rPrChange", 2); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLabelWidthAndPosition_Left_FirstLineIndent, "Hau_min_list2.fodt") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // list is LABEL_WIDTH_AND_POSITION with SvxAdjust::Left + // I) LTR + // a) all LTR cases with no number text look good in Word + // 1) negative first line indent on paragraph: + // no list width/indent: this one was 0 previously; this looks good + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", "399"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "end", "0"); + // list width: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "hanging", "966"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "end", "0"); + // list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "hanging", "399"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "end", "0"); + // list width + list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "start", "1134"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "hanging", "966"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "end", "0"); + // 2) positive first line indent on paragraph: + // no list width/indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "firstLine", "420"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "end", "0"); + // list width: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "hanging", "147"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "end", "0"); + // list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "firstLine", "420"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "end", "0"); + // list width + list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "start", "1134"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "hanging", "147"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "end", "0"); + // b) all LTR cases with number text: the indent looks good but some tabs are wrong + // 1) negative first line indent on paragraph: + // no list width/indent: this one was 0 previously; this looks good + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "hanging", "399"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "end", "0"); + // list width: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "hanging", "966"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "end", "0"); + // list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "hanging", "399"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "end", "0"); + // list width + list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "start", "1134"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "hanging", "966"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "end", "0"); + // 2) positive first line indent on paragraph: + // no list width/indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "firstLine", "420"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "end", "0"); + // list width: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "hanging", "147"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "end", "0"); + // list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "start", "567"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "firstLine", "420"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "end", "0"); + // list width + list indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "start", "1134"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "hanging", "147"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "end", "0"); + // (w:p[17] is empty) + // I) RTL + // a) only RTL cases with no number text and no width/indent look good in Word + // 1) negative first line indent on paragraph: + // no list width/indent + assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "hanging", "399"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "end", "0"); + // 2) positive first line indent on paragraph: + // no list width/indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "firstLine", "420"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "end", "0"); + // b) RTL cases with number text: the indent looks good but some tabs are wrong + // 1) negative first line indent on paragraph: + // no list width/indent + assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "hanging", "399"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "end", "0"); + // 2) positive first line indent on paragraph: + // no list width/indent: + assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "start", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "firstLine", "420"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "end", "0"); + // TODO: other cases +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124604, "tdf124604.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // If the numbering comes from a base style, indentation of the base style has also priority. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95374, "tdf95374.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Numbering disabled by non-existent numId=0, disabling also inheritance of indentation of parent styles + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "1136"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108493, "tdf108493.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // set in the paragraph + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "709"); + // set in the numbering style (this was 0) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "hanging", "709"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118691, "tdf118691.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), + uno::UNO_QUERY); + // Text "Before" stays in the first cell, not removed before the table because of + // bad handling of <w:cr> + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Before\nAfter"), xCell->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf64264, "tdf64264.docx") +{ + // DOCX table rows with tblHeader setting mustn't modify the count of the + // repeated table header rows, when there is rows before them without tblHeader settings. + xmlDocUniquePtr pDump = parseLayoutDump(); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + // table starts on page 1 and finished on page 2 + // and it has got only a single repeating header line + assertXPath(pDump, "/root/page[2]/body/tab", 1); + assertXPath(pDump, "/root/page[2]/body/tab/row", 47); + CPPUNIT_ASSERT_EQUAL(OUString("Repeating Table Header"), + parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), + parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-table-header.docx") +{ + // DOCX tables with more than 10 repeating header lines imported without repeating header lines + // as a workaround for MSO's limitation of header line repetition + xmlDocUniquePtr pDump = parseLayoutDump(); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + // table starts on page 1 and finished on page 2 + // instead of showing only a part of it on page 2 + assertXPath(pDump, "/root/page[1]/body/tab", 1); + assertXPath(pDump, "/root/page[1]/body/tab/row", 11); + CPPUNIT_ASSERT_EQUAL(OUString("Test1"), + parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Test2"), + parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf81100, "tdf81100.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // keep "repeat table header" setting of table styles + assertXPath(pXmlDoc, "/w:styles/w:style/w:tblStylePr/w:trPr/w:tblHeader", 4); + + xmlDocUniquePtr pDump = parseLayoutDump(); + CPPUNIT_ASSERT_EQUAL(3, getPages()); + + // table starts on page 1 and finished on page 2 + // and it has got only a single repeating header line + assertXPath(pDump, "/root/page[2]/body/tab[1]", 1); + assertXPath(pDump, "/root/page[2]/body/tab[1]/row", 2); + assertXPath(pDump, "/root/page[3]/body/tab", 1); + if (!mbExported) // TODO export tblHeader=false + assertXPath(pDump, "/root/page[3]/body/tab/row", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf88496, "tdf88496.docx") +{ + // Switch off repeating header, there is no place for it. + // Now there are only 3 pages with complete table content + // instead of a 51-page long table only with header. + CPPUNIT_ASSERT_EQUAL(3, getPages()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77417, "tdf77417.docx") +{ + // MSO 2010 compatibility mode: terminating white spaces are ignored in tables. + // This was 3 pages with the first invisible blank page. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130494, "tdf130494.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", "yellow"); + // keep direct formatting of table cell paragraph with removed highlighting + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r/w:rPr/w:highlight", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130690, "tdf130690.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", "yellow"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:rPr/w:highlight", 1); + // keep direct formatting of table cell paragraph with removed highlighting + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:highlight", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105215, "tdf105215.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts", "ascii", "Linux Libertine G"); + + // These were "Linux Libertine G" + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/w:rPr", 5); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[2]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[3]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[4]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[5]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // check paragraphs with removed paragraph mark + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123189_tableBackground, "table-black_fill.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, Color(getProperty<sal_uInt32>(xCell, "BackColor"))); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf116084, "tdf116084.docx") +{ + // tracked line is not a single text portion: w:del is recognized within w:ins + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL( OUString( "There should be a better start to this. " ), getRun( getParagraph( 1 ), 2 )->getString()); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf121176, "tdf121176.docx") +{ + // w:del is imported correctly when it is in a same size w:ins + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 2 )->getString()); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf123054, "tdf123054.docx") +{ + CPPUNIT_ASSERT_EQUAL(OUString("No Spacing"), + getProperty<OUString>(getParagraph(20), "ParaStyleName")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD_DATABASE, "tdf67207.docx") +{ + // database fields use the database "database" and its table "Sheet1" + uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(2), 2), "TextField"); + CPPUNIT_ASSERT(xTextField.is()); + uno::Reference<lang::XServiceInfo> xServiceInfo(xTextField, uno::UNO_QUERY_THROW); + uno::Reference<text::XDependentTextField> xDependent(xTextField, uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextField.Database")); + OUString sValue; + xTextField->getPropertyValue("Content") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("<c1>"), sValue); + + uno::Reference<beans::XPropertySet> xFiledMaster = xDependent->getTextFieldMaster(); + uno::Reference<lang::XServiceInfo> xFiledMasterServiceInfo(xFiledMaster, uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xFiledMasterServiceInfo->supportsService("com.sun.star.text.fieldmaster.Database")); + + // Defined properties: DataBaseName, Name, DataTableName, DataColumnName, DependentTextFields, DataCommandType, InstanceName, DataBaseURL + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("DataBaseName") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("database"), sValue); + sal_Int32 nCommandType; + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("DataCommandType") >>= nCommandType); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nCommandType); // css::sdb::CommandType::TABLE + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("DataTableName") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), sValue); + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("DataColumnName") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("c1"), sValue); + CPPUNIT_ASSERT(xFiledMaster->getPropertyValue("InstanceName") >>= sValue); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.text.fieldmaster.DataBase.database.Sheet1.c1"), sValue); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx new file mode 100644 index 000000000..1ae45cb04 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -0,0 +1,1080 @@ +/* -*- 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 <sstream> + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/text/XBookmarksSupplier.hpp> +#include <com/sun/star/text/XFormField.hpp> +#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp> + +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(testTableCrossReference, "table_cross_reference.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // tdf#42346: Cross references to tables were not saved + // MSO uses simple bookmarks for referencing table caption, so we do the same by export + if (!mbExported) + return; + + // Check whether we have all the necessary bookmarks exported and imported back + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xBookmarksByIdx->getCount()); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_number_only")); + + // Check bookmark text ranges + { + uno::Reference<text::XTextContent> xContent(xBookmarksByName->getByName("Ref_Table0_full"), + uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table 1: Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table0_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table 1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table0_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table0_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1"), xRange->getString()); + } + + // Check reference fields + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess( + xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + + sal_uInt16 nIndex = 0; + while (xFields->hasMoreElements()) + { + uno::Reference<lang::XServiceInfo> xServiceInfo(xFields->nextElement(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xServiceInfo, uno::UNO_QUERY); + switch (nIndex) + { + // Full reference to table caption + case 0: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Table 1: Table caption"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_full"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + // Page style reference / exported as simple page reference + case 1: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_full"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + // Reference to table number + case 2: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_number_only"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + // Reference to caption only + case 3: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Table caption"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_caption_only"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + // Reference to category and number + case 4: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Table 1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_label_and_number"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + // Reference to page of the table + case 5: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_full"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + // Above / below reference + case 6: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + sal_Int16 nValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("above"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Table0_full"), sValue); + xPropertySet->getPropertyValue("SequenceNumber") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nValue); + break; + } + default: + break; + } + ++nIndex; + } + + CPPUNIT_ASSERT_EQUAL(sal_uInt16(8), nIndex); +} + +DECLARE_OOXMLEXPORT_TEST(testTableCrossReferenceCustomFormat, + "table_cross_reference_custom_format.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // tdf#42346: Cross references to tables were not saved + // Check also captions with custom formatting + if (!mbExported) + return; + + // Check whether we have all the necessary bookmarks exported and imported back + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(16), xBookmarksByIdx->getCount()); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table0_number_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table1_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table1_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table1_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table1_number_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table2_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table2_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table2_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table2_number_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table3_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table3_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table3_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Table3_number_only")); + + // Check bookmark text ranges + // First table's caption + { + uno::Reference<text::XTextContent> xContent(xBookmarksByName->getByName("Ref_Table0_full"), + uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1. Table: Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table0_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1. Table"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table0_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table0_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1"), xRange->getString()); + } + // Second table's caption + { + uno::Reference<text::XTextContent> xContent(xBookmarksByName->getByName("Ref_Table1_full"), + uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("2. TableTable caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table1_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("2. Table"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table1_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table1_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("2"), xRange->getString()); + } + // Third table's caption + { + uno::Reference<text::XTextContent> xContent(xBookmarksByName->getByName("Ref_Table2_full"), + uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("3) Table Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table2_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("3) Table"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table2_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table2_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("3"), xRange->getString()); + } + // Fourth table's caption + { + uno::Reference<text::XTextContent> xContent(xBookmarksByName->getByName("Ref_Table3_full"), + uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table 4- Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table3_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table 4"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table3_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Table caption"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Table3_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("4"), xRange->getString()); + } +} + +DECLARE_OOXMLEXPORT_TEST(testObjectCrossReference, "object_cross_reference.odt") +{ + CPPUNIT_ASSERT_EQUAL(10, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + // tdf#42346: Cross references to objects were not saved + // MSO uses simple bookmarks for referencing table caption, so we do the same by export + if (!mbExported) + return; + + // Check whether we have all the necessary bookmarks exported and imported back + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(15), xBookmarksByIdx->getCount()); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Drawing0_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Drawing0_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Drawing0_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Drawing0_number_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Drawing1_full")); + + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Illustration0_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Illustration0_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Illustration0_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Illustration0_number_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Illustration1_caption_only")); + + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Text0_full")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Text0_label_and_number")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Text0_caption_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Text0_number_only")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("Ref_Text1_label_and_number")); + + // Check bookmark text ranges + // Cross references to shapes + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Drawing0_full"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Drawing 1: A rectangle"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Drawing0_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Drawing 1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Drawing0_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("A rectangle"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Drawing0_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Drawing1_full"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Drawing 2: a circle"), xRange->getString()); + } + + // Cross references to pictures + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Illustration0_full"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Illustration 1: A picture"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Illustration0_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Illustration 1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Illustration0_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("A picture"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Illustration0_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Illustration1_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("an other image"), xRange->getString()); + } + + // Cross references to text frames + { + uno::Reference<text::XTextContent> xContent(xBookmarksByName->getByName("Ref_Text0_full"), + uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Text 1: A frame"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Text0_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Text 1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Text0_caption_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("A frame"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Text0_number_only"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("1"), xRange->getString()); + } + { + uno::Reference<text::XTextContent> xContent( + xBookmarksByName->getByName("Ref_Text1_label_and_number"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xContent->getAnchor(); + CPPUNIT_ASSERT_EQUAL(OUString("Text 2"), xRange->getString()); + } + + // Check reference fields + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess( + xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + + sal_uInt16 nIndex = 0; + while (xFields->hasMoreElements()) + { + uno::Reference<lang::XServiceInfo> xServiceInfo(xFields->nextElement(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xServiceInfo, uno::UNO_QUERY); + switch (nIndex) + { + // Reference to image number + case 0: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Illustration0_number_only"), sValue); + break; + } + // Full reference to the circle shape + case 1: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Drawing 2: a circle"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Drawing1_full"), sValue); + break; + } + // Caption only reference to the second picture + case 2: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("an other image"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Illustration1_caption_only"), sValue); + break; + } + // Category and number reference to second text frame + case 3: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Text 2"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Text1_label_and_number"), sValue); + break; + } + // Full reference to rectangle shape + case 4: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Drawing 1: A rectangle"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Drawing0_full"), sValue); + break; + } + // Caption only reference to rectangle shape + case 5: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("A rectangle"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Drawing0_caption_only"), sValue); + break; + } + // Category and number reference to rectangle shape + case 6: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Drawing 1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Drawing0_label_and_number"), sValue); + break; + } + // Reference to rectangle shape's number + case 7: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Drawing0_number_only"), sValue); + break; + } + // Full reference to first text frame + case 8: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Text 1: A frame"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Text0_full"), sValue); + break; + } + // Caption only reference to first text frame + case 9: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("A frame"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Text0_caption_only"), sValue); + break; + } + // Category and number reference to first text frame + case 10: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Text 1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Text0_label_and_number"), sValue); + break; + } + // Number only reference to first text frame + case 11: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Text0_number_only"), sValue); + break; + } + // Full reference to first picture + case 12: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Illustration 1: A picture"), + sValue.trim()); // fails on MAC without trim + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Illustration0_full"), sValue); + break; + } + // Reference to first picture' caption + case 13: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("A picture"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Illustration0_caption_only"), sValue); + break; + } + // Category and number reference to first picture + case 14: + { + CPPUNIT_ASSERT( + xServiceInfo->supportsService("com.sun.star.text.TextField.GetReference")); + OUString sValue; + xPropertySet->getPropertyValue("CurrentPresentation") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Illustration 1"), sValue); + xPropertySet->getPropertyValue("SourceName") >>= sValue; + CPPUNIT_ASSERT_EQUAL(OUString("Ref_Illustration0_label_and_number"), sValue); + break; + } + default: + break; + } + ++nIndex; + } + + CPPUNIT_ASSERT_EQUAL(sal_uInt16(21), nIndex); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx") +{ + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // page 1 header: 1 paragraph, 2 flys, 1 draw object + assertXPath(pXmlDoc, "/root/page[1]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/fly", 2); + if (mbExported) // somehow there's an additional shape on re-import? + assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 2); + else + assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 1); + + // page 2 header: 3 paragraphs, 1 table, 1 fly on last paragraph + assertXPath(pXmlDoc, "/root/page[2]/header/txt", 3); + assertXPath(pXmlDoc, "/root/page[2]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/header/txt/anchored/fly", 1); + + // page 3 header: 1 table, 1 paragraph, no text + assertXPath(pXmlDoc, "/root/page[3]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[3]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[3]/header/tab/row/cell/txt/Text", 0); + assertXPath(pXmlDoc, "/root/page[3]/header//anchored", 0); + + // page 4 header: 1 table, 1 paragraph, with text + assertXPath(pXmlDoc, "/root/page[4]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[4]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion", + "Titel der studentischen Arbeit"); + assertXPath(pXmlDoc, "/root/page[4]/header//anchored", 0); + + // page 5: same as page 4 + assertXPath(pXmlDoc, "/root/page[5]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[5]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion", + "Titel der studentischen Arbeit"); + assertXPath(pXmlDoc, "/root/page[5]/header//anchored", 0); + + // page 6: same as page 4 + assertXPath(pXmlDoc, "/root/page[6]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[6]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[6]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion", + "Titel der studentischen Arbeit"); + assertXPath(pXmlDoc, "/root/page[6]/header//anchored", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFields.doc") +{ + //using .doc input file to verify cross-format compatibility. + uno::Reference<text::XFormField> xFormField + = getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(5), 3), "Bookmark"); + uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters()); + + OUString sTmp; + // Doc import problems, so disabling tests + //xParameters->getByName("EntryMacro") >>= sTmp; + //CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp); + //xParameters->getByName("Help") >>= sTmp; + //CPPUNIT_ASSERT_EQUAL(OUString("F1Help"), sTmp); + //xParameters->getByName("ExitMacro") >>= sTmp; + //CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp); + xParameters->getByName("Hint") >>= sTmp; + CPPUNIT_ASSERT_EQUAL(OUString("StatusHelp"), sTmp); + //xParameters->getByName("Content") >>= sTmp; + //CPPUNIT_ASSERT_EQUAL(OUString("Camelcase"), sTmp); + //xParameters->getByName("Format") >>= sTmp; + //CPPUNIT_ASSERT_EQUAL(OUString("TITLE CASE"), sTmp); + + sal_uInt16 nMaxLength = 0; + xParameters->getByName("MaxLength") >>= nMaxLength; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Max Length", sal_uInt16(10), nMaxLength); + + // too bad this is based on character runs - just found try trial and error. + xFormField + = getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(6), 2), "Bookmark"); + xParameters.set(xFormField->getParameters()); + xParameters->getByName("Type") >>= sTmp; + CPPUNIT_ASSERT_EQUAL(OUString("calculated"), sTmp); + + xFormField + = getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(7), 2), "Bookmark"); + xParameters.set(xFormField->getParameters()); + xParameters->getByName("Type") >>= sTmp; + CPPUNIT_ASSERT_EQUAL(OUString("currentDate"), sTmp); + + xFormField + = getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(7), 7), "Bookmark"); + xParameters.set(xFormField->getParameters()); + xParameters->getByName("Type") >>= sTmp; + CPPUNIT_ASSERT_EQUAL(OUString("currentTime"), sTmp); + + xFormField + = getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(8), 2), "Bookmark"); + xParameters.set(xFormField->getParameters()); + xParameters->getByName("Type") >>= sTmp; + CPPUNIT_ASSERT_EQUAL(OUString("number"), sTmp); + + xFormField + = getProperty<uno::Reference<text::XFormField>>(getRun(getParagraph(8), 7), "Bookmark"); + xParameters.set(xFormField->getParameters()); + xParameters->getByName("Type") >>= sTmp; + CPPUNIT_ASSERT_EQUAL(OUString("date"), sTmp); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, "tdf120224_textControlCrossRef.docx") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), + uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + xRunEnum->nextElement(); //Text + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), + getProperty<OUString>(xPropertySet, "TextPortionType")); + uno::Reference<container::XNamed> xBookmark( + getProperty<uno::Reference<beans::XPropertySet>>(xPropertySet, "Bookmark"), uno::UNO_QUERY); + + // Critical test: does TextField's bookmark name match cross-reference? + const OUString& sTextFieldName(xBookmark->getName()); + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess( + xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sTextFieldName, getProperty<OUString>(xPropertySet, "SourceName")); + + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), + uno::UNO_QUERY); + // TextFields should not be turned into real bookmarks. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xBookmarksByIdx->getCount()); + + // The actual name isn't critical, but if it fails, it is worth asking why. + CPPUNIT_ASSERT_EQUAL(OUString("Text1"), sTextFieldName); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf117504_numberingIndent, "tdf117504_numberingIndent.docx") +{ + OUString sName = getProperty<OUString>(getParagraph(1), "NumberingStyleName"); + CPPUNIT_ASSERT_MESSAGE("Paragraph has numbering style", !sName.isEmpty()); + + uno::Reference<beans::XPropertySet> xPropertySet( + getStyles("ParagraphStyles")->getByName("Revision"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(353), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); + xPropertySet.set(getStyles("ParagraphStyles")->getByName("Body Note"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + + sal_Int32 nHeight = xShape->getSize().Height; + + // Rounding errors + sal_Int32 nDifference = 5150 - nHeight; + std::stringstream ss; + ss << "Difference: " << nDifference << " TotalHeight: " << nHeight; + CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference <= 4); + CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4); +} + +DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + + // Rounding errors + sal_Int32 nHeight = xShape->getSize().Height; + sal_Int32 nDifference = 8729 - nHeight; + std::stringstream ss; + ss << "Difference: " << nDifference << " TotalHeight: " << nHeight; + CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference <= 4); + CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf73547, "tdf73547-dash.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + double nD = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "d").toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(105000.0, nD, 5000.0); // was 100000 + double nSp = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "sp").toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(35000.0, nSp, 5000.0); // was 100000 +} + +DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx") +{ + // The runs inside <w:dir> were ignored + const OUString sParaText = getParagraph(1)->getString(); + CPPUNIT_ASSERT_EQUAL( + OUString::fromUtf8( + u8"عندما يريد العالم أن يتكلّم ، فهو يتحدّث " + u8"بلغة " + u8"يونيكود. تسجّل الآن لحضور المؤتمر الدولي العاشر " + u8"ليونيكود (Unicode Conference)، الذي سيعقد في 10-12 " + u8"آذار 1997 بمدينة مَايِنْتْس، ألمانيا. و سيجمع المؤتمر " + u8"بين خبراء من كافة قطاعات الصناعة على الشبكة " + u8"العالمية انترنيت ويونيكود، حيث ستتم، على الصعيدين " + u8"الدولي والمحلي على حد سواء مناقشة سبل استخدام " + u8"يونكود في النظم القائمة وفيما يخص التطبيقات " + u8"الحاسوبية، الخطوط، تصميم النصوص والحوسبة متعددة " + u8"اللغات."), + sParaText); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf105444, "tdf105444.docx") +{ + xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml"); + if (!pXmlComm) + return; + // there is no extra paragraph on Win32, only a single one. + assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf117137, "tdf117137.docx") +{ + // Paragraphs were not part of a numbering anymore after roundtrip. + uno::Reference<beans::XPropertySet> xPara1(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPara1.is()); + CPPUNIT_ASSERT(xPara1->getPropertyValue("NumberingRules").hasValue()); + + uno::Reference<beans::XPropertySet> xPara2(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPara2.is()); + CPPUNIT_ASSERT(xPara2->getPropertyValue("NumberingRules").hasValue()); + + uno::Reference<beans::XPropertySet> xPara3(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPara3.is()); + CPPUNIT_ASSERT(xPara3->getPropertyValue("NumberingRules").hasValue()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99631, "tdf99631.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "//w:object", 2); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 2); + // first XSLX OLE object (1:1 scale) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object[1]", "dxaOrig", "2560"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object[1]", "dyaOrig", "513"); + // second XLSX OLE object (same content + 1 row, but zoomed) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dxaOrig", "2560"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dyaOrig", "768"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf122563, "tdf122563.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1); + // Size of the embedded OLE spreadsheet was the bad "width:28.35pt;height:28.35pt" + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object/v:shape", "style", + "width:255.75pt;height:63.75pt"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf94628, "tdf94628.docx") +{ + uno::Reference<beans::XPropertySet> xPropertySet( + getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels( + xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + OUString sBulletChar = std::find_if(aProps.begin(), aProps.end(), + [](const beans::PropertyValue& rValue) { + return rValue.Name == "BulletChar"; + }) + ->Value.get<OUString>(); + // Actually for 'BLACK UPPER RIGHT TRIANGLE' is \u25E5 + // But we use Wingdings 3 font here, so code is different + CPPUNIT_ASSERT_EQUAL(OUString(u"\uF07B"), sBulletChar); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx") +{ + // test import/export of ActiveTable (visible sheet) of embedded XLSX OLE objects + uno::Reference<text::XTextEmbeddedObjectsSupplier> xEmbeddedObjectsSupplier(mxComponent, + uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xObjects(xEmbeddedObjectsSupplier->getEmbeddedObjects(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xObjects->getCount()); + + uno::Reference<beans::XPropertySet> xSheets; + xObjects->getByIndex(0) >>= xSheets; + + uno::Reference<frame::XModel> xModel; + xSheets->getPropertyValue("Model") >>= xModel; + uno::Reference<document::XViewDataSupplier> xViewDataSupplier(xModel, uno::UNO_QUERY); + + uno::Reference<container::XIndexAccess> xIndexAccess(xViewDataSupplier->getViewData()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xIndexAccess->getCount()); + + uno::Sequence<beans::PropertyValue> aSeq; + sal_Int32 nCheck = 0; + if (xIndexAccess->getByIndex(0) >>= aSeq) + { + sal_Int32 nCount(aSeq.getLength()); + for (sal_Int32 i = 0; i < nCount; ++i) + { + OUString sName(aSeq[i].Name); + if (sName == "ActiveTable") + { + OUString sTabName; + if (aSeq[i].Value >>= sTabName) + { + // Sheet2, not Sheet1 + CPPUNIT_ASSERT_EQUAL(OUString("Munka2"), sTabName); + nCheck++; + } + } + // tdf#122624 column and row viewarea positions + else if (sName == "PositionLeft") + { + sal_Int32 nPosLeft; + aSeq[i].Value >>= nPosLeft; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nPosLeft); + nCheck++; + } + else if (sName == "PositionTop") + { + sal_Int32 nPosTop; + aSeq[i].Value >>= nPosTop; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nPosTop); + nCheck++; + } + } + } + + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), nCheck); +} + +DECLARE_OOXMLEXPORT_TEST(testLanguageInGroupShape, "tdf131922_LanguageInGroupShape.docx") +{ + // tdf#131922: Check if good language is used in shape group texts + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + if (!pXml) + return; + assertXPath(pXml, + "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/" + "a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:lang", + "val", "de-DE"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116883, "tdf116883.docx") +{ + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>1>"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2>"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2>1>1>"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2>2>"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2>3>"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>1)"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(7), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2)"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2>1<1)"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(9), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2.2)"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(10), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1>2.3)"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131420, "tdf131420.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:pPr/w:pBdr[2]"); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx new file mode 100644 index 000000000..1b9621b47 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -0,0 +1,1222 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/text/WritingMode.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/text/XTextFrame.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <editeng/escapementitem.hxx> +#include <editeng/frmdiritem.hxx> +#include <IDocumentSettingAccess.hxx> +#include <xmloff/odffields.hxx> + +#include <editsh.hxx> +#include <frmatr.hxx> +#include <frameformats.hxx> + +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") || OString(filename) == "ooo39250-1-min.rtf"; + } +}; + +// TODO: the re-import doesn't work just yet, but that isn't a regression... +DECLARE_SW_EXPORT_TEST(testFlyInFly, "ooo39250-1-min.rtf", nullptr, Test) +{ + // check that anchor of text frame is in other text frame + uno::Reference<text::XTextContent> const xAnchored(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT(xAnchored.is()); + CPPUNIT_ASSERT_EQUAL(OUString(""), uno::Reference<container::XNamed>(xAnchored, uno::UNO_QUERY_THROW)->getName()); + uno::Reference<text::XText> const xAnchorText(xAnchored->getAnchor()->getText()); + uno::Reference<text::XTextFrame> const xAnchorFrame(xAnchorText, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAnchorFrame.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), uno::Reference<container::XNamed>(xAnchorFrame, uno::UNO_QUERY_THROW)->getName()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf125778_lostPageBreakTOX, "tdf125778_lostPageBreakTOX.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf126994_lostPageBreak, "tdf126994_lostPageBreak.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF, "tdf121374_sectionHF.odt") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xFooterText = getProperty< uno::Reference<text::XTextRange> >(xPageStyle, "FooterText"); + CPPUNIT_ASSERT_EQUAL( OUString("footer"), xFooterText->getString() ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 6, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 6, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF2, "tdf121374_sectionHF2.doc") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xHeaderText = getProperty< uno::Reference<text::XTextRange> >(xPageStyle, "HeaderText"); + CPPUNIT_ASSERT( xHeaderText->getString().startsWith("virkamatka-anomus") ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95848, "tdf95848.docx") +{ + OUString listId; + OUString listStyle; + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle); + CPPUNIT_ASSERT(listStyle.startsWith("WWNum")); + CPPUNIT_ASSERT(xPara->getPropertyValue("ListId") >>= listId); + CPPUNIT_ASSERT_EQUAL(OUString("1.1.1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(listStyle, getProperty<OUString>(xPara, "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + CPPUNIT_ASSERT_EQUAL(OUString("1.1.2"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + // different numbering style + OUString listStyle3; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle3); + CPPUNIT_ASSERT(listStyle3.startsWith("WWNum")); + CPPUNIT_ASSERT(listStyle3 != listStyle); + // but same list + CPPUNIT_ASSERT_EQUAL(OUString("1.1.3"), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95848_2, "tdf95848_2.docx") +{ + OUString listId; + OUString listStyle; + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle); + CPPUNIT_ASSERT(listStyle.startsWith("WWNum")); + CPPUNIT_ASSERT(xPara->getPropertyValue("ListId") >>= listId); + CPPUNIT_ASSERT_EQUAL(OUString("1)"), getProperty<OUString>(xPara, "ListLabelString")); + // check indent of list style + auto xLevels = getProperty<uno::Reference<container::XIndexAccess>>(xPara, "NumberingRules"); + uno::Sequence<beans::PropertyValue> aLevel; + xLevels->getByIndex(0) >>= aLevel; // top level + sal_Int32 nIndent = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "FirstLineIndent"; })->Value.get<sal_Int32>(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), nIndent); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + // different numbering style + OUString listStyle2; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle2); + CPPUNIT_ASSERT(listStyle2.startsWith("WWNum")); + CPPUNIT_ASSERT(listStyle2 != listStyle); + // but same list + CPPUNIT_ASSERT_EQUAL(OUString("2)"), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + // check indent of list style - override + auto xLevels = getProperty<uno::Reference<container::XIndexAccess>>(xPara, "NumberingRules"); + uno::Sequence<beans::PropertyValue> aLevel; + xLevels->getByIndex(0) >>= aLevel; // top level + sal_Int32 nIndent = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "FirstLineIndent"; })->Value.get<sal_Int32>(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9366), nIndent); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + // different numbering style + OUString listStyle3; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle3); + CPPUNIT_ASSERT(listStyle3.startsWith("WWNum")); + CPPUNIT_ASSERT(listStyle3 != listStyle); + // and different list + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT(listId != getProperty<OUString>(xPara, "ListId")); + } + { + // continue the first list + uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(listStyle, getProperty<OUString>(xPara, "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + CPPUNIT_ASSERT_EQUAL(OUString("3)"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(listStyle, getProperty<OUString>(xPara, "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + CPPUNIT_ASSERT_EQUAL(OUString("4)"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf108496, "tdf108496.docx") +{ + OUString listId; + OUString listStyle; + // Lists with override + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle); + CPPUNIT_ASSERT(listStyle.startsWith("WWNum")); + CPPUNIT_ASSERT(xPara->getPropertyValue("ListId") >>= listId); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(listStyle, getProperty<OUString>(xPara, "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + // different numbering style + OUString listStyle2; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle2); + CPPUNIT_ASSERT(listStyle2.startsWith("WWNum")); + CPPUNIT_ASSERT(listStyle2 != listStyle); + // restarted numeration due to override + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY); + // different numbering style + OUString listStyle2; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle2); + CPPUNIT_ASSERT(listStyle2.startsWith("WWNum")); + // restarted numeration due to override + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + } + + // Lists without override + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle); + CPPUNIT_ASSERT(listStyle.startsWith("WWNum")); + CPPUNIT_ASSERT(xPara->getPropertyValue("ListId") >>= listId); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(9), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(listStyle, getProperty<OUString>(xPara, "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(11), uno::UNO_QUERY); + // different numbering style + OUString listStyle2; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle2); + CPPUNIT_ASSERT(listStyle2.startsWith("WWNum")); + CPPUNIT_ASSERT(listStyle2 != listStyle); + // numeration is continued + CPPUNIT_ASSERT_EQUAL(OUString("3"), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(12), uno::UNO_QUERY); + // different numbering style + OUString listStyle2; + CPPUNIT_ASSERT(xPara->getPropertyValue("NumberingStyleName") >>= listStyle2); + CPPUNIT_ASSERT(listStyle2.startsWith("WWNum")); + // numeration is continued + CPPUNIT_ASSERT_EQUAL(OUString("4"), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(listId, getProperty<OUString>(xPara, "ListId")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf126723, "tdf126723.docx") +{ + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(2), "ParaLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testendingSectionProps, "endingSectionProps.docx") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xHeaderText = getProperty< uno::Reference<text::XTextRange> >(xPageStyle, "HeaderText"); + CPPUNIT_ASSERT_EQUAL( OUString("General header"), xHeaderText->getString()); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(0), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("# of paragraphs", 2, getParagraphs()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Section is RightToLeft", text::WritingMode2::RL_TB, getProperty<sal_Int16>(xSect, "WritingMode")); + //regression: tdf124637 + //CPPUNIT_ASSERT_EQUAL_MESSAGE("Section Left Margin", sal_Int32(2540), getProperty<sal_Int32>(xSect, "SectionLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTbrlTextbox, "tbrl-textbox.docx") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + // Without the accompanying fix in place, this test would have failed with 'Expected: -90; + // Actual: 0', i.e. tbRl writing direction was imported as lrTb. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-90), + aGeometry["TextPreRotateAngle"].get<sal_Int32>()); +} + +DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx") +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rFormats.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(RES_DRAWFRMFMT), rFormats[0]->Which()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(RES_FLYFRMFMT), rFormats[1]->Which()); + // Without the accompanying fix in place, this test would have failed with 'Expected: 5, Actual: + // 4', i.e. the textbox inherited its writing direction instead of having an explicit btlr + // value. + CPPUNIT_ASSERT_EQUAL(SvxFrameDirection::Vertical_LR_BT, + rFormats[1]->GetAttrSet().GetFrameDir().GetValue()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf127316_autoEscapement, "tdf127316_autoEscapement.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // This should be roughly .8*35% of the ORIGINAL(non-reduced) size. However, during export the + // proportional height has to be changed into direct formatting, which then changes the relative percent. + // In this case, a 24pt font, proportional at 65% becomes roughly a 16pt font. + // Thus an escapement of 28% (6.72pt) becomes roughly 42% for the 16pt font. + uno::Reference<text::XTextRange> xPara = getParagraph(1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1), "CharEscapement"), 0); + CPPUNIT_ASSERT_DOUBLES_EQUAL(42.f, getProperty<float>(getRun(xPara, 2), "CharEscapement"), 1); + + // Subscripts are different. Automatic escapement SHOULD BE limited by the font bottom line(?) + // and so the calculations ought to be different. There is room for a lot of export improvement here. + xPara.set(getParagraph(2)); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1, "Normal text "), "CharEscapement"), 0); + // Negative escapements (subscripts) were decreasing by 1% every round-trip due to bad manual rounding. + // This should be roughly .2*35% of the ORIGINAL (non-reduced) size. However, during export the + // proportional height has to be changed into direct formatting, which then changes the relative percent. + // In this case, a 24pt font, proportional at 65% becomes roughly a 16pt font. + // Thus an escapement of 7% (1.68pt) becomes roughly 10.5% for the 16pt font. + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Subscript", -10.f, getProperty<float>(getRun(xPara, 2), "CharEscapement"), 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf99602_subscript_charStyleSize, "tdf99602_subscript_charStyleSize.docx") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + // The word "Base" should not be subscripted. + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1, "Base"), "CharEscapement"), 0); + // The word "Subscript" should be 48pt, subscripted by 25% (12pt). + CPPUNIT_ASSERT_DOUBLES_EQUAL( -25.f, getProperty<float>(getRun(xPara, 2, "Subscript"), "CharEscapement"), 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript, "tdf99602_charStyleSubscript.docx") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + // The word "Base" should not be subscripted. + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1, "Base"), "CharEscapement"), 0); + // The word "Subscript" should be 48pt, automatically subscripted, and automatic propertioned. + CPPUNIT_ASSERT_EQUAL( sal_Int16(DFLT_ESC_AUTO_SUB), getProperty<sal_Int16>(getRun(xPara, 2, "Subscript"), "CharEscapement") ); + CPPUNIT_ASSERT_EQUAL( sal_Int16(DFLT_ESC_PROP), getProperty<sal_Int16>(getRun(xPara, 2), "CharEscapementHeight") ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript2, "tdf99602_charStyleSubscript2.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // *_In styles_*, don't let the proportionality/escapement affect the fontsize - otherwise it starts doubling up, + // so instead just throw away the values and use the default settings instead - meaning fontsize is unaffected. + // subscript custom: Proportional size is 80%, lower by 25%. + uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName("subscript custom"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("CharStyle has 12pt font size", 12.f, getProperty<float>(xStyle, "CharHeight")); + // subscript larger font: Proportional size is 80%, lowered by DFLT_ESC_AUTO_SUB + xStyle.set(getStyles("CharacterStyles")->getByName("subscript larger font"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Auto CharStyle has 12pt font size", 12.f, getProperty<float>(xStyle, "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf124637_sectionMargin, "tdf124637_sectionMargin.docx") +{ + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + // sections 0 and 1 must be related to footnotes... + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(2), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Section Left Margin", sal_Int32(0), getProperty<sal_Int32>(xSect, "SectionLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak, "tdf123636_newlinePageBreak.docx") +{ + //MS Compatibility flag: SplitPgBreakAndParaMark + //special case: split first empty paragraph in a section. + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 2, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak2, "tdf123636_newlinePageBreak2.docx") +{ + //WITHOUT SplitPgBreakAndParaMark: a following anchored shape should force a page break + //CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 2, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(2, ""), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak3, "tdf123636_newlinePageBreak3.docx") +{ + //MS Compatibility flag: SplitPgBreakAndParaMark + //proof case: split any non-empty paragraphs, not just the first paragraph of a section. + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 5, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); + + xmlDocUniquePtr pDump = parseLayoutDump(); + assertXPath(pDump, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "Last line on page 1"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak4, "tdf123636_newlinePageBreak4.docx") +{ + //MS Compatibility flag: SplitPgBreakAndParaMark + //special case: an empty paragraph doesn't split (except if first paragraph). + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 3, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); + + xmlDocUniquePtr pDump = parseLayoutDump(); + assertXPath(pDump, "/root/page[2]/body/txt[1]/Text", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, "tdf118947_tableStyle.docx") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Table grid settings set line-spacing to 250% instead of single-spacing, which is set as a document default."), xPara->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("TextBody has 10pt font size", 11.f, getProperty<float>(xPara, "CharHeight")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("TextBody has 1pt space below paragraph", sal_Int32(35), getProperty<sal_Int32>(xPara, "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Table has 10pt space above paragraph", sal_Int32(353), getProperty<sal_Int32>(xPara, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaRightMargin")); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("TextBody has 1.07 line-spacing", sal_Int16(107), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height, 1); + // table-style based paragraph background color + CPPUNIT_ASSERT_EQUAL_MESSAGE("Missing paragraph background color in cell A1", sal_Int32(0xCCFFCC), getProperty<sal_Int32>(xPara, "ParaBackColor")); + + // This cell is affected by compatSetting overrideTableStyleFontSizeAndJustification=0 (the default value) + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + xParaEnum = xParaEnumAccess->createEnumeration(); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Notice that this is 8pt font, right aligned in compatibility mode."), xPara->getString()); + // Even though not specified, Table-Style distributes the properties in DocDefault. DocDefault fontsize is 8pt. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Compat mode has 8pt font size", 8.f, getProperty<float>(getRun(xPara,1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Normal has 0pt space below paragraph", sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Table sets 10pt space above paragraph", sal_Int32(353), getProperty<sal_Int32>(xPara, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaRightMargin")); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table sets 2.5 line-spacing", sal_Int16(250), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height, 1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph background color in cell A2", sal_Int32(-1), getProperty<sal_Int32>(xPara, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Compat mode overrides left adjust", style::ParagraphAdjust_RIGHT, + static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle2, "tdf118947_tableStyle2.docx") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + // This cell is affected by compatSetting overrideTableStyleFontSizeAndJustification=1 (no goofy exception) + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A2"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(OUString("Notice that this is 12pt font, left aligned in non-compatibility mode."), xPara->getString()); + // Even though not specified, Table-Style tries to distribute the properties in DocDefault. DocDefault fontsize is 8pt. + // However, this is overridden by the default style's specified fontsize of 12 and left justify. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Non-Compat mode has 12pt font size", 12.f, getProperty<float>(getRun(xPara,1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Non-Compat mode keeps the style's left adjust", style::ParagraphAdjust_LEFT, + static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); +} + +DECLARE_OOXMLEXPORT_TEST(tdf123912_protectedForm, "tdf123912_protectedForm.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Compatibility: Protect form", true, + pDoc->getIDocumentSettingAccess().get( DocumentSettingId::PROTECT_FORM ) ); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(0), uno::UNO_QUERY); + if ( xSect.is() ) + CPPUNIT_ASSERT_EQUAL_MESSAGE("Section1 is protected", false, getProperty<bool>(xSect, "IsProtected")); +} + +DECLARE_OOXMLEXPORT_TEST(tdf124600b, "tdf124600b.docx") +{ + // <wp:anchor allowOverlap="0"> was lost on roundtrip, we always wrote "1" on export. + bool bAllowOverlap1 = getProperty<bool>(getShape(1), "AllowOverlap"); + CPPUNIT_ASSERT(!bAllowOverlap1); + bool bAllowOverlap2 = getProperty<bool>(getShape(2), "AllowOverlap"); + CPPUNIT_ASSERT(!bAllowOverlap2); +} + +DECLARE_OOXMLEXPORT_TEST(testDateControl, "empty-date-control.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Check that we exported the empty date control correctly + // Date form field is converted to date content control. + if (!mbExported) + return ; + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); + ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*pMarkAccess->getAllMarksBegin()); + + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); + + const sw::mark::IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); + OUString sDateFormat; + auto pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT); + if (pResult != pParameters->end()) + { + pResult->second >>= sDateFormat; + } + + OUString sLang; + pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT_LANGUAGE); + if (pResult != pParameters->end()) + { + pResult->second >>= sLang; + } + + OUString sCurrentDate; + pResult = pParameters->find(ODF_FORMDATE_CURRENTDATE); + if (pResult != pParameters->end()) + { + pResult->second >>= sCurrentDate; + } + + CPPUNIT_ASSERT_EQUAL(OUString("dd/MM/yyyy"), sDateFormat); + CPPUNIT_ASSERT_EQUAL(OUString("en-US"), sLang); + CPPUNIT_ASSERT_EQUAL(OUString(""), sCurrentDate); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121867, "tdf121867.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + SwEditShell* pEditShell = pTextDoc->GetDocShell()->GetEditShell(); + // Without the accompanying fix in place, this test would have failed with + // 'Expected: 3; Actual : 0', i.e. page width zoom was lost on export. + CPPUNIT_ASSERT_EQUAL(SvxZoomType::PAGEWIDTH, pEditShell->GetViewOptions()->GetZoomType()); +} + +DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, "para-adjust-distribute.docx") +{ + // Without the accompanying fix in place, this test would have failed with + // 'Expected: 2; Actual : 0', i.e. the first paragraph's ParaAdjust was + // left, not block. + CPPUNIT_ASSERT_EQUAL( + style::ParagraphAdjust_BLOCK, + static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_BLOCK, + static_cast<style::ParagraphAdjust>( + getProperty<sal_Int16>(getParagraph(1), "ParaLastLineAdjust"))); + + CPPUNIT_ASSERT_EQUAL( + style::ParagraphAdjust_BLOCK, + static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(2), "ParaAdjust"))); + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_LEFT, + static_cast<style::ParagraphAdjust>( + getProperty<sal_Int16>(getParagraph(2), "ParaLastLineAdjust"))); +} + +DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (!mbExported || getShapes() == 0) // importing the ODT, an input field + { + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + uno::Any aField = xFields->nextElement(); + uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown")); + } + else // importing the DOCX, a form control + { + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox")); + CPPUNIT_ASSERT(getProperty<bool>(xPropertySet, "Dropdown")); + auto const items(getProperty<uno::Sequence<OUString>>(xPropertySet, "StringItemList")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), items.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("1"), items[0]); + CPPUNIT_ASSERT_EQUAL(OUString("2"), items[1]); + CPPUNIT_ASSERT_EQUAL(OUString("3"), items[2]); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPropertySet, "DefaultText")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf116371, "tdf116371.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Make sure the rotation is exported correctly, and size not distorted + auto xShape(getShape(1)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4700.0, getProperty<double>(xShape, "RotateAngle"), 10); + auto frameRect = getProperty<awt::Rectangle>(xShape, "FrameRect"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(24070), frameRect.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(24188), frameRect.Width); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFrameSizeExport, "floating-tables-anchor.docx") +{ + // Make sure the table width is 4000 + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW", "w", "4000"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf119201, "tdf119201.docx") +{ + // Visibility of shapes wasn't imported/exported, for now base printable property on that, too + auto xShape(getShape(1)); + CPPUNIT_ASSERT_MESSAGE("First shape should be visible.", getProperty<bool>(xShape, "Visible")); + CPPUNIT_ASSERT_MESSAGE("First shape should be printable.", getProperty<bool>(xShape, "Printable")); + xShape = getShapeByName("Rectangle 1"); + CPPUNIT_ASSERT_MESSAGE("Second shape should not be visible.", !getProperty<bool>(xShape, "Visible")); + CPPUNIT_ASSERT_MESSAGE("Second shape should not be printable.", !getProperty<bool>(xShape, "Printable")); + xShape = getShapeByName("Oval 2"); + CPPUNIT_ASSERT_MESSAGE("Third shape should be visible.", getProperty<bool>(xShape, "Visible")); + CPPUNIT_ASSERT_MESSAGE("Third shape should be printable.", getProperty<bool>(xShape, "Printable")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") +{ + xmlDocUniquePtr pDump = parseLayoutDump(); + // Without the accompanying fix in place, this test would have failed, as the portion text was + // only "Er horte leise Schritte hinter", which means the 1st line of the 2nd paragraph was + // split into two by a Special portion, i.e. the top margin of the shape was too large. + assertXPath(pDump, "/root/page/body/txt[2]/Text[1]", "Portion", + "Er horte leise Schritte hinter sich. Das bedeutete nichts Gutes. Wer wu"); // ... until the bookmark. +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTextInput, "textinput.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + + // test the exported DOCX + + // no hint, empty + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " FILLIN \"\""); + assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:fldChar", "fldCharType", "end"); + + // no hint, content + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText", " FILLIN \"\""); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:t", "content without hint"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[6]/w:fldChar", "fldCharType", "end"); + + // hint, empty + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[3]/w:instrText", " FILLIN \"hint empty\""); + assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[5]", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[5]/w:rPr", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[6]/w:fldChar", "fldCharType", "end"); + + // hint, content + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[3]/w:instrText", " FILLIN \"hint content\""); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[5]/w:t", "content with hint"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[6]/w:fldChar", "fldCharType", "end"); + + // test the imported DOCX + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + int nElements = 0; + + do + { + uno::Any aField = xFields->nextElement(); + uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.Input")); + uno::Reference<beans::XPropertySet> xPropertySet(aField, uno::UNO_QUERY); + uno::Reference<text::XTextContent> xText(aField, uno::UNO_QUERY); + + // why is the enumeration not in the same order then the fields in the document? + // it seems to be stable and the navigation in the GUI is actually correct. + OUString sContent, sHint; + switch (nElements) + { + case 1: + sContent = "content with hint"; + sHint = "hint content"; + break; + case 2: + sHint = "hint empty"; + break; + case 3: + sContent = "content without hint"; + break; + } + CPPUNIT_ASSERT_EQUAL(uno::makeAny(sContent), xPropertySet->getPropertyValue("Content")); + CPPUNIT_ASSERT_EQUAL(sContent, xText->getAnchor()->getString()); + CPPUNIT_ASSERT_EQUAL(uno::makeAny(sHint), xPropertySet->getPropertyValue("Hint")); + nElements++; + } + while (xFields->hasMoreElements()); + CPPUNIT_ASSERT_EQUAL(4, nElements); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf123460, "tdf123460.docx") +{ + // check paragraph mark deletion at terminating moveFrom + CPPUNIT_ASSERT_EQUAL(true,getParagraph( 2 )->getString().startsWith("Nunc")); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 1 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Delete"),getProperty<OUString>(getRun(getParagraph(2), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(true, getRun( getParagraph( 2 ), 2 )->getString().endsWith("tellus.")); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 3 )->getString()); + bool bCaught = false; + try + { + getRun( getParagraph( 2 ), 4 ); + } + catch (container::NoSuchElementException&) + { + bCaught = true; + } + CPPUNIT_ASSERT_EQUAL(true, bCaught); +} + +//tdf#125298: fix charlimit restrictions in bookmarknames and field references if they contain non-ascii characters +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125298, "tdf125298_crossreflink_nonascii_charlimit.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // check whether test file keeps non-ascii values or not + OUString bookmarkName1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart[1]", "name"); + CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("\u00e1rv\u00edzt\u0171r\u0151_t\u00fck\u00f6rf\u00far\u00f3g\u00e9p"), bookmarkName1); + + OUString bookmarkName2 = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart[1]", "name"); + CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("\u00e91\u00e12\u01713\u01514\u00fa5\u00f66\u00fc7\u00f38\u00ed9"), bookmarkName2); + OUString fieldName1 = getXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[2]/w:instrText[1]"); + OUString expectedFieldName1 = " REF " + bookmarkName1 + " \\h "; + CPPUNIT_ASSERT_EQUAL(expectedFieldName1, fieldName1); + OUString fieldName2 = getXPathContent(pXmlDoc, "/w:document/w:body/w:p[7]/w:r[2]/w:instrText[1]"); + OUString expectedFieldName2 = " REF " + bookmarkName2 + " \\h "; + CPPUNIT_ASSERT_EQUAL(expectedFieldName2, fieldName2); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf121784, "tdf121784.docx") +{ + // check tracked insertion of footnotes + CPPUNIT_ASSERT_EQUAL( OUString( "Text1" ), getParagraph( 1 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 2 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(1), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL( OUString( "1" ), getRun( getParagraph( 1 ), 3 )->getString()); + + // check tracked insertion of endnotes + CPPUNIT_ASSERT_EQUAL( OUString( "texti" ), getParagraph( 2 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 2 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(2), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL( OUString( "i" ), getRun( getParagraph( 2 ), 3 )->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testTbrlFrameVml, "tbrl-frame-vml.docx") +{ + uno::Reference<beans::XPropertySet> xTextFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextFrame.is()); + + if (mbExported) + { + // DML import: creates a TextBox, eaVert read back as TB_RL in TextWritingMode + + auto eMode = getProperty<text::WritingMode>(xTextFrame, "TextWritingMode"); + CPPUNIT_ASSERT_EQUAL(text::WritingMode::WritingMode_TB_RL, eMode); + } + else + { + // VML import: creates a TextFrame. + + auto nActual = getProperty<sal_Int16>(xTextFrame, "WritingMode"); + // Without the accompanying fix in place, this test would have failed with 'Expected: 2; Actual: + // 4', i.e. writing direction was inherited from page, instead of explicit tbrl. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL, nActual); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119037, "tdf119037.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:top", "val", "single"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:left", "val", "single"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:right", "val", "single"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:bottom", "val", "single"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:top", "val", "dotted"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:left", "val", "dotted"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:right", "val", "dotted"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:bottom", "val", "dotted"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:top", "val", "dashed"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:left", "val", "dashed"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:right", "val", "dashed"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:bottom", "val", "dashed"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:top", "val", "dashSmallGap"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:left", "val", "dashSmallGap"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:right", "val", "dashSmallGap"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:bottom", "val", "dashSmallGap"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:top", "val", "dotDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:left", "val", "dotDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:right", "val", "dotDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:bottom", "val", "dotDash"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:top", "val", "dotDotDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:left", "val", "dotDotDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:right", "val", "dotDotDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:bottom", "val", "dotDotDash"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:top", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:left", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:right", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:bottom", "val", "double"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:top", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:left", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:right", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:bottom", "val", "double"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:top", "val", "thinThickSmallGap"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:left", "val", "thinThickSmallGap"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:right", "val", "thinThickSmallGap"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:bottom", "val", "thinThickSmallGap"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:top", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:left", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:right", "val", "double"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:bottom", "val", "double"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125657, "tdf125657.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + auto checkAttrIsInt = [&](const OString& sAttrName) { + OUString sAttr = getXPath(pXmlDoc, + "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:srcRect", + sAttrName); + OString sAssertMsg("Attribute " + sAttrName + " value " + sAttr.toUtf8() + + " is not a valid integer"); + CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), !sAttr.isEmpty()); + // Only decimal characters allowed, optionally prepended with '-'; no '.' + CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), + sAttr[0] == '-' || (sAttr[0] >= '0' && sAttr[0] <= '9')); + for (sal_Int32 i = 1; i < sAttr.getLength(); ++i) + CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), sAttr[i] >= '0' && sAttr[i] <= '9'); + }; + // check that we export all coordinates of srcRect as integers + checkAttrIsInt("l"); + checkAttrIsInt("t"); + checkAttrIsInt("r"); + checkAttrIsInt("b"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx") +{ + discardDumpedLayout(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/tab/infos/bounds", "top", "4193"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf78657, "tdf78657_picture_hyperlink.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc || !pXmlRels) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:nvPicPr/pic:cNvPr/a:hlinkClick", 1); + assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='http://www.google.com']", "TargetMode", "External"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBtlrFrame, "btlr-frame.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + // Without the accompanying fix in place, this test would have failed with 'Expected: + // -270; Actual: 0', i.e. the writing direction of the frame was lost. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-270), + aGeometry["TextPreRotateAngle"].get<sal_Int32>()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125518, "tdf125518.odt") +{ + CPPUNIT_ASSERT_EQUAL(4, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + + // First diagram is anchored + OUString anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:drawing/wp:anchor/wp:docPr", "name"); + CPPUNIT_ASSERT_EQUAL(OUString("Object1"), anchorName); + + // Second diagram has anchor + anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing/wp:anchor/wp:docPr", "name"); + CPPUNIT_ASSERT_EQUAL(OUString("Objekt1"), anchorName); + + // Third diagram has no anchor + anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:r[2]/w:drawing/wp:inline/wp:docPr", "name"); + CPPUNIT_ASSERT_EQUAL(OUString("Object2"), anchorName); + + // 4th diagram has anchor too + anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:r[3]/w:drawing/wp:anchor/wp:docPr", "name"); + CPPUNIT_ASSERT_EQUAL(OUString("Object3"), anchorName); +} + +DECLARE_OOXMLEXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.docx") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), + getProperty<OUString>(getRun(xPara, 1), "TextPortionType")); + // Without the accompanying fix in place, this test would have failed with 'Expected: + // Annotation; Actual: Frame', i.e. the comment start before the image was lost. + CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), + getProperty<OUString>(getRun(xPara, 2), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Frame"), + getProperty<OUString>(getRun(xPara, 3), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), + getProperty<OUString>(getRun(xPara, 4), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), + getProperty<OUString>(getRun(xPara, 5), "TextPortionType")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131594, "tdf131594.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // lnNumType should not be exported if w:countBy="0" + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121663, "tdf121663.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // auto distance of line numbering is 0.5 cm + assertXPath(pXmlDoc, "//w:lnNumType", "distance", "283"); +} + +DECLARE_OOXMLEXPORT_TEST(testInvalidDateFormField, "invalid_date_form_field.docx") +{ + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pMarkAccess->getAllMarksCount()); + + int nIndex = 0; + for(auto aIter = pMarkAccess->getAllMarksBegin(); aIter != pMarkAccess->getAllMarksEnd(); ++aIter) + { + ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter); + + if(!pFieldmark) + continue; + + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); + + // Check date field's parameters. + const sw::mark::IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); + OUString sDateFormat; + auto pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT); + if (pResult != pParameters->end()) + { + pResult->second >>= sDateFormat; + } + + OUString sLang; + pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT_LANGUAGE); + if (pResult != pParameters->end()) + { + pResult->second >>= sLang; + } + + OUString sCurrentDate; + pResult = pParameters->find(ODF_FORMDATE_CURRENTDATE); + if (pResult != pParameters->end()) + { + pResult->second >>= sCurrentDate; + } + + // The first one has invalid date format (invalid = LO can't parse it) + if(nIndex == 0) + { + + CPPUNIT_ASSERT_EQUAL(OUString("YYYY.MM.DDT00:00:00Z"), sDateFormat); + CPPUNIT_ASSERT_EQUAL(OUString("en-US"), sLang); + CPPUNIT_ASSERT_EQUAL(OUString(""), sCurrentDate); + + CPPUNIT_ASSERT_EQUAL(sal_uLong(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pFieldmark->GetMarkStart().nContent.GetIndex()); + } + else if (nIndex == 1) // The second has wrong date + { + CPPUNIT_ASSERT_EQUAL(OUString("MM/DD/YY"), sDateFormat); + CPPUNIT_ASSERT_EQUAL(OUString("en-US"), sLang); + CPPUNIT_ASSERT_EQUAL(OUString("2019.06.34"), sCurrentDate); + + CPPUNIT_ASSERT_EQUAL(sal_uLong(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(15), pFieldmark->GetMarkStart().nContent.GetIndex()); + } + else // The third one has wrong local + { + CPPUNIT_ASSERT_EQUAL(OUString("[NatNum12 MMMM=abbreviation]YYYY\". \"MMMM D."), sDateFormat); + CPPUNIT_ASSERT_EQUAL(OUString("xxxx"), sLang); + CPPUNIT_ASSERT_EQUAL(OUString("2019.06.11"), sCurrentDate); + + CPPUNIT_ASSERT_EQUAL(sal_uLong(9), pFieldmark->GetMarkStart().nNode.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(35), pFieldmark->GetMarkStart().nContent.GetIndex()); + } + ++nIndex; + } + CPPUNIT_ASSERT_EQUAL(int(3), nIndex); +} + +DECLARE_OOXMLEXPORT_TEST(tdf127085, "tdf127085.docx") +{ + // Fill transparency was lost during export + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(50), getProperty<sal_Int16>(xShape, "FillTransparence")); +} + +DECLARE_OOXMLEXPORT_TEST(tdf119809, "tdf119809.docx") +{ + // Combobox without an item list lost during import + if (getShapes() > 0) + { + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox"))); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength()); + } + else + { + // ComboBox was imported as DropDown text field + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + uno::Any aField = xFields->nextElement(); + uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown")); + + uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(aField, "Items"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aItems.getLength()); + } +} + +DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx") +{ + // Unicode characters were converted to question marks. + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.CheckBox"))); + CPPUNIT_ASSERT_EQUAL(OUString(u"őőőőőőőőőőőűűűű"), getProperty<OUString>(xPropertySet, "Label")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127116, "tdf127116.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink", "anchor"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf127339, "tdf127339.docx") +{ + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); + if (!pXmlRels) + return; + + assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='#bookmark']", "TargetMode"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127362, "tdf127362.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); + if (!pXmlRels) + return; + + OUString bookmarkName = "#" + getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']", "Target"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127605, "tdf127605.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127732, "internal_hyperlink_frame.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127733, "internal_hyperlink_ole.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127734, "internal_hyperlink_region.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127735, "internal_hyperlink_table.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:bookmarkStart", "name"); + OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); + CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123628, "tdf123628.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='InternetLink']/w:name", "val", "Hyperlink"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + uno::Reference<beans::XPropertySet> xRun(getRun(xPara,1), uno::UNO_QUERY); + OUString unVisitedStyleName = getProperty<OUString>(xRun, "UnvisitedCharStyleName"); + CPPUNIT_ASSERT(unVisitedStyleName.equalsIgnoreAsciiCase("Internet Link")); + OUString visitedStyleName = getProperty<OUString>(xRun, "VisitedCharStyleName"); + CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='VisitedInternetLink']/w:name", "val", "FollowedHyperlink"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127579, "tdf127579.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf128304, "tdf128304.odt") +{ + CPPUNIT_ASSERT_EQUAL(4, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + css::text::WritingMode eMode; + uno::Reference<beans::XPropertySet> xProps1(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps1->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); + + uno::Reference<beans::XPropertySet> xProps2(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps2->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); + + uno::Reference<beans::XPropertySet> xProps3(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps3->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); + + uno::Reference<beans::XPropertySet> xProps4(getShape(4), uno::UNO_QUERY); + CPPUNIT_ASSERT(xProps4->getPropertyValue("TextWritingMode") >>= eMode); + CPPUNIT_ASSERT_EQUAL(css::text::WritingMode::WritingMode_TB_RL, eMode); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx new file mode 100644 index 000000000..e3f8e6caf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -0,0 +1,1188 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/awt/FontUnderline.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <IDocumentSettingAccess.hxx> + +#include <editsh.hxx> +#include <frmatr.hxx> +#include <tools/lineend.hxx> +#include <oox/drawingml/drawingmltypes.hxx> +#include <com/sun/star/table/ShadowFormat.hpp> +#include <com/sun/star/text/TableColumnSeparator.hpp> +#include <com/sun/star/text/XDocumentIndex.hpp> +#include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/awt/FontWeight.hpp> +#include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/style/LineSpacingMode.hpp> +#include <com/sun/star/text/XDependentTextField.hpp> +#include <com/sun/star/text/XTextContentAppend.hpp> + +char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/"; + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase(DATA_DIRECTORY, "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_OOXMLIMPORT_TEST(Tdf130907, "tdf130907.docx") +{ + uno::Reference<text::XTextRange> xPara1 = getParagraph(2); + CPPUNIT_ASSERT(xPara1.is()); + uno::Reference<beans::XPropertySet> xFormula1Props(xPara1, uno::UNO_QUERY); + CPPUNIT_ASSERT(xFormula1Props.is()); + sal_Int16 nHOri1; + xFormula1Props->getPropertyValue("ParaAdjust") >>= nHOri1; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not left!", + sal_Int16(style::ParagraphAdjust::ParagraphAdjust_LEFT), nHOri1); + + uno::Reference<text::XTextRange> xPara2 = getParagraph(3); + CPPUNIT_ASSERT(xPara2.is()); + uno::Reference<beans::XPropertySet> xFormula2Props(xPara2, uno::UNO_QUERY); + CPPUNIT_ASSERT(xFormula2Props.is()); + sal_Int16 nHOri2; + xFormula2Props->getPropertyValue("ParaAdjust") >>= nHOri2; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not center!", + sal_Int16(style::ParagraphAdjust::ParagraphAdjust_CENTER), nHOri2); + + uno::Reference<text::XTextRange> xPara3 = getParagraph(5); + CPPUNIT_ASSERT(xPara3.is()); + uno::Reference<beans::XPropertySet> xFormula3Props(xPara3, uno::UNO_QUERY); + CPPUNIT_ASSERT(xFormula3Props.is()); + sal_Int16 nHOri3; + xFormula3Props->getPropertyValue("ParaAdjust") >>= nHOri3; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not right!", + sal_Int16(style::ParagraphAdjust::ParagraphAdjust_RIGHT), nHOri3); +} + +CPPUNIT_TEST_FIXTURE(Test, testTdf128197) +{ + load(mpTestDocumentPath, "128197_compat14.docx"); + xmlDocUniquePtr pLayout14 = parseLayoutDump(); + sal_Int32 nHeight14 = getXPath(pLayout14, "//page[1]/body/txt[1]/infos/bounds", "height").toInt32(); + + load(mpTestDocumentPath, "128197_compat15.docx"); + xmlDocUniquePtr pLayout15 = parseLayoutDump(); + sal_Int32 nHeight15 = getXPath(pLayout15, "//page[1]/body/txt[1]/infos/bounds", "height").toInt32(); + + // In compat mode=14 second line has size of the shape thus entire paragraph height is smaller + // So nHeight14 < nHeight15 + CPPUNIT_ASSERT_LESS(nHeight15, nHeight14); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf123622, "tdf123622.docx") +{ + uno::Reference<beans::XPropertySet> XPropsRight(getShape(1),uno::UNO_QUERY); + sal_Int16 nRelativePosR = 0; + XPropsRight->getPropertyValue("HoriOrientRelation")>>=nRelativePosR; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape inside the margin", sal_Int16(4), nRelativePosR); + + uno::Reference<beans::XPropertySet> XPropsLeft(getShape(2), uno::UNO_QUERY); + sal_Int16 nRelativePosL = 0; + XPropsLeft->getPropertyValue("HoriOrientRelation") >>= nRelativePosL; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape inside the margin", sal_Int16(3), nRelativePosL); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf78749, "tdf78749.docx") +{ + //Shape lost the background image before, now check if it still has... + auto xShape = getShape(1); + uno::Reference<beans::XPropertySet> xShpProps(xShape, uno::UNO_QUERY); + OUString aPropertyVal; + xShpProps->getPropertyValue("FillBitmapName") >>= aPropertyVal; + CPPUNIT_ASSERT(!aPropertyVal.isEmpty()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128207, "tdf128207.docx") +{ + //There was the charts on each other, because their horizontal and vertical position was 0! + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(p_XmlDoc); + assertXPathContent(p_XmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor/wp:positionH/wp:posOffset", "4445"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123873, "tdf123873.docx") +{ + //OLE Object were overlapped due to missing wrap import + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(p_XmlDoc); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing/wp:anchor/wp:wrapTopAndBottom"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Tdf133065, "tdf133065.odt") +{ + auto pxmldoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pxmldoc); + OUString aVal; + + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[3]/w:r[2]/w:object/v:shape/w10:wrap", "type"); + CPPUNIT_ASSERT(aVal.indexOf("square") > -1); + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[3]/w:r[2]/w:object/v:shape/w10:wrap", "side"); + CPPUNIT_ASSERT(aVal.indexOf("left") > -1); + + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[8]/w:r[2]/w:object/v:shape/w10:wrap", "type"); + CPPUNIT_ASSERT(aVal.indexOf("square") > -1); + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[8]/w:r[2]/w:object/v:shape/w10:wrap", "side"); + CPPUNIT_ASSERT(aVal.indexOf("right") > -1); + + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[12]/w:r[2]/w:object/v:shape/w10:wrap", "type"); + CPPUNIT_ASSERT(aVal.indexOf("square") > -1); + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[12]/w:r[2]/w:object/v:shape/w10:wrap", "side"); + CPPUNIT_ASSERT(aVal.indexOf("largest") > -1); + + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[20]/w:r[2]/w:object/v:shape/w10:wrap", "type"); + CPPUNIT_ASSERT(aVal.indexOf("topAndBottom") > -1); + + aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[24]/w:r[2]/w:object/v:shape/w10:wrap", "type"); + CPPUNIT_ASSERT(aVal.indexOf("square") > -1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf130814model, "tdf130814.docx") +{ + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x1F497D), getProperty<sal_Int32>(getRun(getParagraph(2), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(double(16), getProperty<double>(getRun(getParagraph(2), 1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<sal_Int16>(getRun(getParagraph(2), 1), "CharUnderline")); + CPPUNIT_ASSERT_EQUAL(OUString("Candara"), getProperty<OUString>(getRun(getParagraph(2), 1), "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty<OUString>(getRun(getParagraph(2), 1), "CharFontNameAsian")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107020, "tdf107020.docx") +{ + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(p_XmlDoc); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "l", "4910"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "t", "27183"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "r", "57638"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "b", "48360"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130814ooxml, "tdf130814.docx") +{ + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(p_XmlDoc); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "eastAsia", "Arial Unicode MS"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "ascii", "Candara"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "hAnsi", "Candara"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:color", "val", "1F497D"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:sz", "val", "32"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:szCs", "val", "32"); + assertXPath( + p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:u", "val", "single"); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf129888vml, "tdf129888vml.docx") +{ + //the line shape has anchor in the first cell however it has to + //be positioned to an another cell. To reach this we must handle + //the o:allowincell attribute of the shape, and its position has + //to be calculated from the page frame instead of the table: + + uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY); + bool bValue; + xShapeProperties->getPropertyValue("IsFollowingTextFlow") >>= bValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("tdf129888vml The line shape has bad place!", + false, bValue); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf129888dml, "tdf129888dml.docx") +{ + //the shape has anchor in the first cell however it has to + //be positioned to the right side of the page. To reach this we must handle + //the layoutInCell attribute of the shape, and its position has + //to be calculated from the page frame instead of the table: + + uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY); + bool bValue; + xShapeProperties->getPropertyValue("IsFollowingTextFlow") >>= bValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("tdf129888dml The shape has bad place!", + false, bValue); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130120, "tdf130120.docx") +{ + //Text for exporting the allowincell attribute: + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); + assertXPath(p_XmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/" + "mc:Choice/w:drawing/wp:anchor", "layoutInCell", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Tdf133030, "tdf133030.docx") +{ + auto pExport = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pExport); + + assertXPath(pExport, "/w:document/w:body/w:p[3]/m:oMathPara/m:oMathParaPr/m:jc", "val", "center"); + assertXPath(pExport, "/w:document/w:body/w:p[5]/m:oMathPara/m:oMathParaPr/m:jc", "val", "left"); + assertXPath(pExport, "/w:document/w:body/w:p[7]/m:oMathPara/m:oMathParaPr/m:jc", "val", "right"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf87569v, "tdf87569_vml.docx") +{ + //the original tdf87569 sample has vml shapes... + uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY); + bool bValue; + xShapeProperties->getPropertyValue("IsFollowingTextFlow") >>= bValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("tdf87569_vml: The Shape is not in the table!", + true, bValue); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133000_numStyleFormatting, "tdf133000_numStyleFormatting.docx") +{ + // Paragraph style's LeftMargin should not override numbering's Left Margin + xmlDocUniquePtr pDump = parseLayoutDump(); + assertXPathContent(pDump, "/root/page[1]/body/txt[2]", "First line"); + const sal_Int32 nLevel1Margin = getXPath(pDump, "//page[1]/body/txt[2]/infos/prtBounds", "left").toInt32(); + assertXPathContent(pDump, "/root/page[1]/body/txt[4]", "One sublevel"); + const sal_Int32 nLevel2Margin = getXPath(pDump, "//page[1]/body/txt[4]/infos/prtBounds", "left").toInt32(); + CPPUNIT_ASSERT( nLevel1Margin < nLevel2Margin ); +} + +DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules"); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 64 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO), + aMap["NumberingType"].get<sal_uInt16>()); +} + +DECLARE_ODFEXPORT_TEST(testArabicZero3Numbering, "arabic-zero3-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules"); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 65 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO3. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO3), + aMap["NumberingType"].get<sal_uInt16>()); +} + +DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules"); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 66 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO4. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO4), + aMap["NumberingType"].get<sal_uInt16>()); +} + +DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules"); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 67 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO5. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO5), + aMap["NumberingType"].get<sal_uInt16>()); +} + +CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) +{ + // Create a document, set footnote numbering type to ARABIC_ZERO. + loadURL("private:factory/swriter", nullptr); + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFootnoteSettings + = xFootnotesSupplier->getFootnoteSettings(); + sal_uInt16 nNumberingType = style::NumberingType::ARABIC_ZERO; + xFootnoteSettings->setPropertyValue("NumberingType", uno::makeAny(nNumberingType)); + + // Insert a footnote. + uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContent> xFootnote( + xFactory->createInstance("com.sun.star.text.Footnote"), uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContentAppend> xTextContentAppend(xTextDocument->getText(), + uno::UNO_QUERY); + xTextContentAppend->appendTextContent(xFootnote, {}); + + reload("Office Open XML Text", ""); + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Without the accompanying fix in place, this test would have failed with: + // XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect + // because the exporter had no idea what markup to use for ARABIC_ZERO. + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt", "val", "decimalZero"); +} + +CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote) +{ + // Create a document, set footnote numbering type to SYMBOL_CHICAGO. + loadURL("private:factory/swriter", nullptr); + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFootnoteSettings + = xFootnotesSupplier->getFootnoteSettings(); + sal_uInt16 nNumberingType = style::NumberingType::SYMBOL_CHICAGO; + xFootnoteSettings->setPropertyValue("NumberingType", uno::makeAny(nNumberingType)); + + // Insert a footnote. + uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContent> xFootnote( + xFactory->createInstance("com.sun.star.text.Footnote"), uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContentAppend> xTextContentAppend(xTextDocument->getText(), + uno::UNO_QUERY); + xTextContentAppend->appendTextContent(xFootnote, {}); + + reload("Office Open XML Text", ""); + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Without the accompanying fix in place, this test would have failed with: + // XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect + // because the exporter had no idea what markup to use for SYMBOL_CHICAGO. + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt", "val", "chicago"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf87569d, "tdf87569_drawingml.docx") +{ + //if the original tdf87569 sample is upgraded it will have drawingml shapes... + uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY); + bool bValue; + xShapeProperties->getPropertyValue("IsFollowingTextFlow") >>= bValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("tdf87569_drawingml: The Shape is not in the table!", + true, bValue); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // check character properties + { + uno::Reference<beans::XPropertySet> xStyle( + getStyles("CharacterStyles")->getByName("WollMuxRoemischeZiffer"), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, getProperty<float>(xStyle, "CharWeight")); + } + + // check paragraph properties + { + uno::Reference<beans::XPropertySet> xStyle( + getStyles("ParagraphStyles")->getByName("WollMuxVerfuegungspunkt"), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, getProperty<float>(xStyle, "CharWeight")); + } + + // check inline text properties + { + xmlDocUniquePtr pXmlDoc =parseExport("word/document.xml"); + if (pXmlDoc) + { + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b"); + } + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121045, "tdf121045.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:fldChar", "fldCharType", "begin"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:instrText", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:fldChar", "fldCharType", "separate"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:fldChar", "fldCharType", "end"); + // form control keeps its direct formatted font size + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:szCs", "val", "20"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + // Ensure that width of first tab is close to zero (previous value was ~1000 twips) + int nWidth = parseDump("/root/page/body/txt[1]/Text[@nType='PortionType::TabLeft']", "nWidth").toInt32(); + CPPUNIT_ASSERT_LESS(150, nWidth); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf92472, "tdf92472.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:fldChar", "fldCharType", "begin"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:fldChar", "fldCharType", "separate"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:fldChar", "fldCharType", "end"); + // form control keeps its direct formatted font size + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[4]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[4]/w:rPr/w:szCs", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:rPr/w:sz", "val", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:rPr/w:szCs", "val", "20"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Tdf133035, "tdf133035.docx") +{ + auto pxml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pxml); + OUString aXmlVal = getXPath(pxml, "/w:document/w:body/w:p[1]/w:r[1]/w:object/v:shape", "style"); + CPPUNIT_ASSERT(aXmlVal.indexOf("margin-left:186.6pt") > -1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf131260, "tdf131260.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), + uno::UNO_QUERY); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 3 + // - Actual : 2 + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTables->getCount()); +} +DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx") +{ + // tdf#120315 cells of the second column weren't vertically merged + // because their horizontal positions are different a little bit + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), + uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + CPPUNIT_ASSERT_EQUAL(getProperty<uno::Sequence<text::TableColumnSeparator>>( + xTableRows->getByIndex(0), "TableColumnSeparators")[0] + .Position, + getProperty<uno::Sequence<text::TableColumnSeparator>>( + xTableRows->getByIndex(1), "TableColumnSeparators")[2] + .Position); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf108350_noFontdefaults, "tdf108350_noFontdefaults.docx") +{ + uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles"); + uno::Reference< beans::XPropertySet > xStyleProps(paragraphStyles->getByName("NoParent"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), getProperty<OUString>(xStyleProps, "CharFontName")); + //CPPUNIT_ASSERT_EQUAL_MESSAGE("Font size", 10.f, getProperty<float>(xStyleProps, "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123116_oversizedRowSplit, "tdf123116_oversizedRowSplit.odt") +{ + // Intentionally require a very non-backward-compatible, natural continuation of the table + // instead of an ugly "page break" like MS Word does (and LO used to do). + CPPUNIT_ASSERT_EQUAL_MESSAGE("Row splits over 4 pages", 4, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testPageContentBottom, "page-content-bottom.docx") +{ + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + sal_Int16 nExpected = text::RelOrientation::PAGE_PRINT_AREA_BOTTOM; + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 10 (PAGE_PRINT_AREA_BOTTOM) + // - Actual : 0 (FRAME) + // i.e. the bottom-of-body relation was lost. + CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int16>(xShape, "VertOrientRelation")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf129522_removeShadowStyle, "tdf129522_removeShadowStyle.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles"); + uno::Reference< beans::XPropertySet > xStyleProps(paragraphStyles->getByName("Shadow"), uno::UNO_QUERY_THROW); + table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xStyleProps, "ParaShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); + + // Shadows were inherited regardless of whether the style disabled them. + xStyleProps.set(paragraphStyles->getByName("Shadow-removed"), uno::UNO_QUERY_THROW); + aShadow = getProperty<table::ShadowFormat>(xStyleProps, "ParaShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location); + + uno::Reference< container::XNameAccess > characterStyles = getStyles("CharacterStyles"); + xStyleProps.set(characterStyles->getByName("CharShadow"), uno::UNO_QUERY_THROW); + aShadow = getProperty<table::ShadowFormat>(xStyleProps, "CharShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); + + xStyleProps.set(characterStyles->getByName("CharShadow-removed"), uno::UNO_QUERY_THROW); + aShadow = getProperty<table::ShadowFormat>(xStyleProps, "CharShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf130167_spilloverHeaderShape, "testTdf130167_spilloverHeader.docx") +{ + uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xNameAccess( + xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY); + // graphics from discarded headers were being added to the text body. Reduced from 5 to 2 shapes overall. + CPPUNIT_ASSERT(xNameAccess->getCount() < 4); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf125038, "tdf125038.docx") +{ + OUString aActual = getParagraph(1)->getString(); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: phone:... + // - Actual : result1result2phone:... + // i.e. the result if the inner MERGEFIELD fields ended up in the body text. + CPPUNIT_ASSERT_EQUAL(OUString("phone: \t1234567890"), aActual); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf124986, "tdf124986.docx") +{ + // Load a document with SET fields, where the SET fields contain leading/trailing quotation marks and spaces. + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + + while (xFields->hasMoreElements()) + { + uno::Reference<lang::XServiceInfo> xServiceInfo(xFields->nextElement(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xServiceInfo, uno::UNO_QUERY); + OUString aValue; + if (xServiceInfo->supportsService("com.sun.star.text.TextField.SetExpression")) + { + xPropertySet->getPropertyValue("Content") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("demo"), aValue); + } + } +} + +DECLARE_OOXMLIMPORT_TEST(testTdf125038b, "tdf125038b.docx") +{ + // Load a document with an IF field, where the IF field command contains a paragraph break. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParagraphAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParagraphs = xParagraphAccess->createEnumeration(); + CPPUNIT_ASSERT(xParagraphs->hasMoreElements()); + uno::Reference<text::XTextRange> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: phone: 1234 + // - Actual : + // i.e. the first paragraph was empty and the second paragraph had the content. + CPPUNIT_ASSERT_EQUAL(OUString("phone: 1234"), xParagraph->getString()); + CPPUNIT_ASSERT(xParagraphs->hasMoreElements()); + xParagraphs->nextElement(); + + // Without the accompanying fix in place, this test would have failed with: + // - Expression: !xParagraphs->hasMoreElements() + // i.e. the document had 3 paragraphs, while only 2 was expected. + CPPUNIT_ASSERT(!xParagraphs->hasMoreElements()); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf125038c, "tdf125038c.docx") +{ + OUString aActual = getParagraph(1)->getString(); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: email: test@test.test + // - Actual : email: + // I.e. the result of the MERGEFIELD field inside an IF field was lost. + CPPUNIT_ASSERT_EQUAL(OUString("email: test@test.test"), aActual); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx") +{ + // Important: bug case had 4 pages + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + // First paragraph does not have tab before + // (same applies to all paragraphs in doc, but lets assume they are + // behave same way) + OUString sNodeType = parseDump("/root/page[1]/body/txt[1]/Text[1]", "nType"); + CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Text"), sNodeType); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx") +{ + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); + if (!pXmlSettings) + return; + assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", "851"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121658, "tdf121658.docx") +{ + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); + if (!pXmlSettings) + return; + assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps"); +} + +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTableStyleConfNested) +{ + // Create the doc model. + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "table-style-conf-nested.docx"; + loadURL(aURL, nullptr); + + // Export to docx. + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + validate(maTempFile.GetFileName(), test::OOXML); + mbExported = true; + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Without the accompanying fix in place, this test would have failed, as the custom table cell + // border properties were lost, so the outer A2 cell started to have borders, not present in the + // doc model. + assertXPath(pXmlDoc, "//w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders/w:top", "val", "nil"); +} + +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTdf133771) +{ + // Create the doc model. + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf133771.odt"; + loadURL(aURL, nullptr, /*pPassword*/ "test"); + + CPPUNIT_ASSERT_EQUAL(OUString("Password Protected"), getParagraph(1)->getString()); + + // Without the fix in place, this test would have failed with + // "An uncaught exception of type com.sun.star.io.IOException" + // exporting to docx + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + validate(maTempFile.GetFileName(), test::OOXML); + mbExported = true; + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPathContent(pXmlDoc, "//w:body/w:p/w:r/w:t", "Password Protected"); +} + +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testZeroLineSpacing) +{ + // Create the doc model. + loadURL("private:factory/swriter", nullptr); + uno::Reference<beans::XPropertySet> xParagraph(getParagraph(1), uno::UNO_QUERY); + style::LineSpacing aSpacing; + aSpacing.Mode = style::LineSpacingMode::MINIMUM; + aSpacing.Height = 0; + xParagraph->setPropertyValue("ParaLineSpacing", uno::makeAny(aSpacing)); + + // Export to docx. + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + mbExported = true; + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: atLeast + // - Actual : auto + // i.e. the minimal linespacing was lost on export. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing", "lineRule", "atLeast"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing", "line", "0"); +} + +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testSemiTransparentText) +{ + // Create an in-memory empty document. + loadURL("private:factory/swriter", nullptr); + + // Set text to half-transparent and type a character. + uno::Reference<beans::XPropertySet> xParagraph(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xParagraph.is()); + sal_Int16 nTransparence = 75; + xParagraph->setPropertyValue("CharTransparence", uno::makeAny(nTransparence)); + uno::Reference<text::XTextRange> xTextRange(xParagraph, uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextRange.is()); + xTextRange->setString("x"); + + // Export to docx. + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + mbExported = true; + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + OString aXPath + = "/w:document/w:body/w:p/w:r/w:rPr/w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha"; + double fValue = getXPath(pXmlDoc, aXPath, "val").toDouble(); + sal_Int16 nActual = basegfx::fround(fValue / oox::drawingml::PER_PERCENT); + + // Without the accompanying fix in place, this test would have failed, as the w14:textFill + // element was missing. + CPPUNIT_ASSERT_EQUAL(nTransparence, nActual); +} + +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testUserField) +{ + // Create an in-memory empty document with a user field. + loadURL("private:factory/swriter", nullptr); + uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XDependentTextField> xField( + xFactory->createInstance("com.sun.star.text.TextField.User"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xMaster( + xFactory->createInstance("com.sun.star.text.FieldMaster.User"), uno::UNO_QUERY); + xMaster->setPropertyValue("Name", uno::makeAny(OUString("foo"))); + xField->attachTextFieldMaster(xMaster); + xField->getTextFieldMaster()->setPropertyValue("Content", uno::makeAny(OUString("bar"))); + uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> xText = xDocument->getText(); + xText->insertTextContent(xText->createTextCursor(), xField, /*bAbsorb=*/false); + + // Export to docx. + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + validate(maTempFile.GetFileName(), test::OOXML); + mbExported = true; + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the accompanying fix in place, this test would have failed, the user field was + // exported as <w:t>User Field foo = bar</w:t>. + assertXPathContent(pXmlDoc, "//w:p/w:r[2]/w:instrText", " DOCVARIABLE foo "); + assertXPathContent(pXmlDoc, "//w:p/w:r[4]/w:t", "bar"); + + // Make sure that not only the variables, but also their values are written. + pXmlDoc = parseExport("word/settings.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "//w:docVars/w:docVar", "name", "foo"); + assertXPath(pXmlDoc, "//w:docVars/w:docVar", "val", "bar"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132766, "tdf132766.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Ensure that for list=1 and level=0 we wrote correct bullet char and correct font + assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:lvlText", + "val", u"\uF0B7"); + assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts", + "ascii", "Symbol"); + assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts", + "hAnsi", "Symbol"); + assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts", + "cs", "Symbol"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128245, "tdf128245.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "//w:num[@w:numId='1']/w:abstractNumId", "val", "1"); + assertXPath(pXmlDoc, "//w:num[@w:numId='2']/w:abstractNumId", "val", "2"); + assertXPath(pXmlDoc, "//w:num[@w:numId='3']/w:abstractNumId", "val", "3"); + assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:abstractNumId", "val", "1"); + assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride[@w:ilvl='0']", "ilvl", "0"); + assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride/w:startOverride", "val", "1"); + assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride[@w:ilvl='1']", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf124367, "tdf124367.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), + uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + // it was 2761 at the first import, and 2760 at the second import, due to incorrect rounding + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2762), + getProperty<uno::Sequence<text::TableColumnSeparator>>( + xTableRows->getByIndex(2), "TableColumnSeparators")[0] + .Position); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95189, "tdf95189.docx") +{ + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("3"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(7), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("2"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128820, "tdf128820.fodt") +{ + // Import of exported DOCX failed because of wrong namespace used for wsp element + // Now test the exported XML, in case we stop failing opening invalid files + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + // The parent wpg:wgp element has three children: wpg:cNvGrpSpPr, wpg:grpSpPr, and wpg:wsp + // (if we start legitimately exporting additional children, this needs to be adjusted to check + // all those, to make sure we don't export wrong elements). + assertXPathChildren(pXml, + "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/wpg:wgp", + 3); + assertXPath(pXml, + "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/" + "a:graphic/a:graphicData/wpg:wgp/wpg:cNvGrpSpPr"); + assertXPath(pXml, + "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/" + "a:graphic/a:graphicData/wpg:wgp/wpg:grpSpPr"); + // This one was pic:wsp instead of wps:wsp + assertXPath(pXml, + "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/" + "a:graphic/a:graphicData/wpg:wgp/wps:wsp"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128889, "tdf128889.fodt") +{ + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + // There was an w:r (with w:br) as an invalid child of first paragraph's w:pPr + assertXPath(pXml, "/w:document/w:body/w:p[1]/w:pPr/w:r", 0); + assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r", 2); + // Check that the break is in proper - last - position + assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132754, "tdf132754.docx") +{ + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0.0.0."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0.0.1."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0.0.2."), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf129353, "tdf129353.docx") +{ + CPPUNIT_ASSERT_EQUAL(8, getParagraphs()); + getParagraph(1, "(Verne, 1870)"); + getParagraph(2, "Bibliography"); + getParagraph(4, "Christie, A. (1922). The Secret Adversary. "); + CPPUNIT_ASSERT_EQUAL(OUString(), getParagraph(8)->getString()); + + uno::Reference<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexes = xIndexSupplier->getDocumentIndexes(); + uno::Reference<text::XDocumentIndex> xIndex(xIndexes->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange = xIndex->getAnchor(); + uno::Reference<text::XText> xText = xTextRange->getText(); + uno::Reference<text::XTextCursor> xTextCursor = xText->createTextCursor(); + xTextCursor->gotoRange(xTextRange->getStart(), false); + xTextCursor->gotoRange(xTextRange->getEnd(), true); + OUString aIndexString(convertLineEnd(xTextCursor->getString(), LineEnd::LINEEND_LF)); + + // Check that all the pre-rendered entries are correct, including trailing spaces + CPPUNIT_ASSERT_EQUAL(OUString("\n" // starting with an empty paragraph + "Christie, A. (1922). The Secret Adversary. \n" + "\n" + "Verne, J. G. (1870). Twenty Thousand Leagues Under the Sea. \n" + ""), // ending with an empty paragraph + aIndexString); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77796, "tdf77796.docx") +{ + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + // cell paddings from table style + assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:start", "w", "5"); + assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:top", "w", "240"); + assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:bottom", "w", "480"); + // not modified + assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:end", "w", "108"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128290, "tdf128290.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblLayout", "type", "fixed"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf120394, "tdf120394.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1.2.1"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133605, "tdf133605.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(3), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("(a)"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133605_2, "tdf133605_2.docx") +{ + // About the same document as tdf133605.docx, but number definition has level definitions in random order + CPPUNIT_ASSERT_EQUAL(1, getPages()); + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(3), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("(a)"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123757, "tdf123757.docx") +{ + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + assertXPath(pXml, "/w:document/w:body/w:tbl", 2); +} + +DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-footer.docx") +{ + // Load a document with a continuous section break on page 2. + CPPUNIT_ASSERT_EQUAL(OUString("First page header, section 1"), + parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer, section 1"), + parseDump("/root/page[1]/footer/txt/text()")); + // Make sure the header stays like this; if we naively just update the page style name of the + // first para on page 2, then this would be 'Header, section 2', which is incorrect. + CPPUNIT_ASSERT_EQUAL(OUString("First page header, section 2"), + parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer, section 2"), + parseDump("/root/page[2]/footer/txt/text()")); + // This is inherited from page 2. + CPPUNIT_ASSERT_EQUAL(OUString("Header, section 2"), + parseDump("/root/page[3]/header/txt/text()")); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // - xpath should match exactly 1 node + // i.e. the footer had no text (inherited from page 2), while the correct behavior is to provide + // the own footer text. + CPPUNIT_ASSERT_EQUAL(OUString("Footer, section 3"), + parseDump("/root/page[3]/footer/txt/text()")); + + // Without the export fix in place, the import-export-import test would have failed with: + // - Expected: Header, section 2 + // - Actual : First page header, section 2 + // i.e. both the header and the footer on page 3 was wrong. + + // Additional problem: top margin on page 3 was wrong. + if (mbExported) + { + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2200 + // - Actual : 2574 + // i.e. the top margin on page 3 was too large and now matches the value from the input + // document. + assertXPath(pXml, "/w:document/w:body/w:sectPr/w:pgMar", "top", "2200"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Explicitly set hyphenation=auto on document level + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); + CPPUNIT_ASSERT(pXmlSettings); + assertXPath(pXmlSettings, "/w:settings/w:autoHyphenation", "val", "true"); + + // Second paragraph has explicitly enabled hyphenation + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + assertXPath(pXml, "/w:document/w:body/w:p[2]/w:pPr/w:suppressAutoHyphens", "val", "false"); + + // Default paragraph style explicitly disables hyphens + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + CPPUNIT_ASSERT(pXmlStyles); + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/w:suppressAutoHyphens", "val", "true"); +} + +DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupShapeText.docx") +{ + // tdf#131776: Check if strikeout is used in shape group texts + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + if (!pXml) + return; + + // double strike (dstrike) + // no "val" attribute + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"); + assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike", "val"); + // "val" attribute is true, this is used in this test file. However, LO is going to export this element without the "val" attribute + // because if the element appears, but without an attribute its "val" true by default. + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"); + assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike", "val"); + // "val" attribute is false (this was missing, resulting the regression) + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike", "val", "false"); + + // simple strike (strike) + // no "val" attribute + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"); + assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val"); + // "val" attribute is true, this is used in this test file. However, LO is going to export this element without the "val" attribute + // because if the element appears, but without an attribute its "val" true by default. + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"); + assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val"); + // "val" attribute is false + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[6]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val", "false"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131539, "tdf131539.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + //The positions of OLE objects were not exported, check if now it is exported correctly + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(p_XmlDoc); + OUString aXmlVal = getXPath(p_XmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:object/v:shape", "style"); + // This data was missing + CPPUNIT_ASSERT(aXmlVal.indexOf("margin-left:139.95")>-1); +} + +DECLARE_OOXMLEXPORT_TEST(testLineWidthRounding, "tdf126363_LineWidthRounding.docx") +{ + // tdf#126363: check if line with stays the same after export + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + if (!pXml) + return; + // this was 57240 (it differs from the original 57150, losing the preset line width) + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "57150"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108505, "tdf108505.docx") +{ + uno::Reference<text::XTextRange> xParagraph = getParagraph(3); + uno::Reference<text::XTextRange> xText + = getRun(xParagraph, 1, "Wrong font when alone on the line"); + + // Without the fix in place this would have become Times New Roman + CPPUNIT_ASSERT_EQUAL( + OUString("Trebuchet MS"), + getProperty<OUString>(xText, "CharFontName")); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx new file mode 100644 index 000000000..1fd8ad4a7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -0,0 +1,243 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/text/RelOrientation.hpp> + +char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/"; + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase(DATA_DIRECTORY, "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_EXPORTONLY_TEST(testTdf123621, "tdf123621.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/wp:positionV/wp:posOffset", "1080135"); +} + + +DECLARE_OOXMLEXPORT_TEST(testTdf133334_followPgStyle, "tdf133334_followPgStyle.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133370_columnBreak, "tdf133370_columnBreak.odt") +{ + // Since non-DOCX formats ignores column breaks in non-column situtations, don't export to docx. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf131801, "tdf131801.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + xmlDocUniquePtr pDump = parseLayoutDump(); + // "1." is red + CPPUNIT_ASSERT_EQUAL(OUString("1."), getXPath(pDump, "//page[1]/body/txt[1]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[1]/Special/SwFont", "color")); + // "2." is red + CPPUNIT_ASSERT_EQUAL(OUString("2."), getXPath(pDump, "//page[1]/body/txt[2]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[2]/Special/SwFont", "color")); + // "3." is black + CPPUNIT_ASSERT_EQUAL(OUString("3."), getXPath(pDump, "//page[1]/body/txt[3]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[3]/Special/SwFont", "color")); + // "4." is black + CPPUNIT_ASSERT_EQUAL(OUString("4."), getXPath(pDump, "//page[1]/body/txt[4]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[4]/Special/SwFont", "color")); + // "5." is red + CPPUNIT_ASSERT_EQUAL(OUString("5."), getXPath(pDump, "//page[1]/body/txt[5]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[5]/Special/SwFont", "color")); + // "6." is red + CPPUNIT_ASSERT_EQUAL(OUString("6."), getXPath(pDump, "//page[1]/body/txt[6]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[6]/Special/SwFont", "color")); + // "7." is black + CPPUNIT_ASSERT_EQUAL(OUString("7."), getXPath(pDump, "//page[1]/body/txt[7]/Special", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[7]/Special/SwFont", "color")); + // "8." is black + CPPUNIT_ASSERT_EQUAL(OUString("8."), getXPath(pDump, "//page[1]/body/txt[8]/Special[1]", "rText")); + CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[8]/Special[1]/SwFont", "color")); + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:rStyle", + "val", "Emphasis"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rStyle", + "val", "Emphasis"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:rStyle", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:rStyle", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:rStyle", + "val", "Emphasis"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:sz", + "val", "32"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:rStyle", + "val", "Emphasis"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:sz", + "val", "32"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:rStyle", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[8]/w:pPr/w:rPr/w:rStyle", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf135973, "tdf135973.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("2."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("2."), getProperty<OUString>(xPara, "ListLabelString")); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136441_commentInFootnote, "tdf136441_commentInFootnote.odt") +{ + // failed to load without error if footnote contained a comment. + // (MS Word's UI doesn't allow adding comments to a footnote.) +} + +DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + xmlDocUniquePtr pDump = parseLayoutDump(); + + // There are three tabs with default width + CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[1]", "nWidth").toInt32()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[2]", "nWidth").toInt32()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[3]", "nWidth").toInt32()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf135665, "tdf135665.docx") +{ + uno::Reference<beans::XPropertySet> xOLEProps1(getShape(1), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xOLEProps2(getShape(2), uno::UNO_QUERY_THROW); + bool bSurroundContour1 = false; + bool bSurroundContour2 = false; + xOLEProps1->getPropertyValue("SurroundContour") >>= bSurroundContour1; + xOLEProps2->getPropertyValue("SurroundContour") >>= bSurroundContour2; + + CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported correctly", true, bSurroundContour1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported correctly", false, bSurroundContour2); +} + +DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt") +{ + // invalid combination of at-page anchor and horizontal-rel="paragraph" + // caused relativeFrom="column" instead of relativeFrom="page" + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/wp:positionH/wp:posOffset", "-480060"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/wp:positionH", "relativeFrom", "page"); + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/wp:positionV/wp:posOffset", "8147685"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/wp:positionV", "relativeFrom", "page"); + + // same for sw + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor" + "/wp:positionH/wp:posOffset", "720090"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor" + "/wp:positionH", "relativeFrom", "page"); + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor" + "/wp:positionV/wp:posOffset", "1080135"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor" + "/wp:positionV", "relativeFrom", "page"); + + // now test text rotation -> VML writing direction + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/v:textbox", "style", "mso-layout-flow-alt:bottom-to-top"); + // text wrap -> VML + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/w10:wrap", "type", "none"); + // vertical alignment -> VML + OUString const style = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape", "style"); + CPPUNIT_ASSERT(style.indexOf("v-text-anchor:middle") != -1); +} + +DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter, + "tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx") +{ + // TODO: fix export too + if (mbExported) + return; + // tdf#133070 The height was set relative to page print area bottom, + // but this was handled relative to page height. + // Note: page print area bottom = margin + footer height. + // In this case the footer exists. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + const sal_Int32 nAnchoredHeight + = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1147), nAnchoredHeight); +} + +DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx") +{ + uno::Reference<beans::XPropertySet> xOLEProps(getShape(1), uno::UNO_QUERY_THROW); + sal_Int16 nVRelPos = -1; + sal_Int16 nHRelPos = -1; + xOLEProps->getPropertyValue("VertOrientRelation") >>= nVRelPos; + xOLEProps->getPropertyValue("HoriOrientRelation") >>= nHRelPos; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The OLE is shifted vertically", + text::RelOrientation::PAGE_FRAME , nVRelPos); + CPPUNIT_ASSERT_EQUAL_MESSAGE("The OLE is shifted horizontally", + text::RelOrientation::PAGE_FRAME , nHRelPos); +} + +DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginNoFooter, + "tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx") +{ + // TODO: fix export too + if (mbExported) + return; + // tdf#133070 The height was set relative to page print area bottom, + // but this was handled relative to page height. + // Note: page print area bottom = margin + footer height. + // In this case the footer does not exist, so OpenDocument and OOXML margins are the same. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + const sal_Int32 nAnchoredHeight + = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1147), nAnchoredHeight); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx new file mode 100644 index 000000000..8149a444e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -0,0 +1,1176 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> +#include <com/sun/star/awt/Gradient.hpp> +#include <com/sun/star/style/TabStop.hpp> +#include <com/sun/star/view/XViewSettingsSupplier.hpp> +#include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/text/XTextFramesSupplier.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/style/LineSpacingMode.hpp> +#include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/table/ShadowFormat.hpp> +//#include <com/sun/star/awt/FontWeight.hpp> // keep for testTableStylerPrSz +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> +#include <oox/drawingml/drawingmltypes.hxx> + +#include <string> + +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 { + const char* aBlacklist[] = { + "math-escape.docx", + "math-mso2k7.docx", + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end()); + } + + /** + * Validation handling + */ + bool mustValidate(const char* filename) const override + { + const char* aWhitelist[] = { + "page-graphic-background.odt", + "zoom.docx", + "empty.odt", + "fdo38244.docx", + "comments-nested.odt" + }; + std::vector<const char*> vWhitelist(aWhitelist, aWhitelist + SAL_N_ELEMENTS(aWhitelist)); + + return std::find(vWhitelist.begin(), vWhitelist.end(), filename) != vWhitelist.end(); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testPageGraphicBackground, "page-graphic-background.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // No idea how the graphic background should be exported (seems there is no + // way to do a non-tiling export to OOXML), but at least the background + // color shouldn't be black. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xPageStyle, "BackColor")); +} + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomProperties, "custom-properties.docx") +{ + // tdf#133377 tdf#103987 FILESAVE XLSX: Make sure the custom/core/application + // file properties are stored correctly after roundtrip to .docx + + // Extended file properties - specific to Office package, + // eg. docx - Number of Pages, pptx - Number of Slides + xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs", "1"); + //assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Lines", "1"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Pages", "1"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Words", "3"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Characters", "22"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:CharactersWithSpaces", "24"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "hhhhkompany"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Manager", "ffffmenadzer;iiiiisecondmanager"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:HyperlinkBase", "gggghiperlink"); + //assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:DocSecurity", "2"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:AppVersion", "15.0000"); + + // Custom file properties - defined by user + xmlDocUniquePtr pCustomXml = parseExport("docProps/custom.xml"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property", 9); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]", + "name", "testDateProperty"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]/vt:filetime", + "1982-04-19T10:00:00Z"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[3]", + "name", "testNegativeNumberProperty"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[3]/vt:r8", + "-100"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[4]", + "name", "testNumberProperty"); + //assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[4]/vt:i4", + // "256"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]", + "name", "testRealNumberProperty"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]/vt:r8", + "-128.1"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]", + "name", "testScientificNumber"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]/vt:r8", + "1.23456789E+023"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]", + "name", "testTextProperty"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]/vt:lpwstr", + "testPropertyValue"); + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]", + "name", "testYesNoProperty"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]/vt:bool", + "1"); + // Hidden Custom File Property. With Final set, MS Office notifies recipients that the document is final, and sets the document to read-only. + assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]", + "name", "_MarkAsFinal"); + assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]/vt:bool", + "1"); + + // Core file properties - common for all packages (eg. creation date, modify date) + pXmlDoc = parseExport("docProps/core.xml"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:creator", "Bartosz Kosiorek;secondauthor"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:description", "cccckomentarzglowny"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:lastPrinted", "2020-10-15T07:42:00Z"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/dcterms:created", "2020-10-14T16:23:00Z"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:category", "eeeetokategoria"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:version", "xxxxversion"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:contentStatus", "ddddstatusnieznany"); + assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:identifier", "zzzzidentifier"); +} + +DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx") +{ + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<view::XViewSettingsSupplier> xViewSettingsSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xViewSettingsSupplier->getViewSettings()); + sal_Int16 nValue = 0; + xPropertySet->getPropertyValue("ZoomValue") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue); + + // Validation test: order of elements were wrong. + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + if (!pXmlDoc) + return; + // Order was: rsid, next. + int nNext = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "next"); + int nRsid = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "rsid"); + CPPUNIT_ASSERT(nNext < nRsid); + + pXmlDoc = parseExport("docProps/app.xml"); + // One paragraph in the document. + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs", "1"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "Example Ltd"); +} + +DECLARE_OOXMLEXPORT_TEST(defaultTabStopNotInStyles, "empty.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); +// The default tab stop was mistakenly exported to a style. +// xray ThisComponent.StyleFamilies(1)(0).ParaTabStop + uno::Reference< container::XNameAccess > paragraphStyles = getStyles( "ParagraphStyles" ); + uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence< style::TabStop > >( + paragraphStyles->getByName( "Standard" ), "ParaTabStops" ); +// There actually be one tab stop, but it will be the default. + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(1), stops.getLength()); + CPPUNIT_ASSERT_EQUAL( style::TabAlign_DEFAULT, stops[ 0 ].Alignment ); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo38244, "fdo38244.docx") +{ + /* + * Comments attached to a range was imported without the range, check for the annotation mark start/end positions. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * oRun = oRuns.nextElement 'Annotation + * oRun = oRuns.nextElement + * oRun = oRuns.nextElement 'AnnotationEnd + * xray oRun.TextPortionType + */ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + xRunEnum->nextElement(); + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty<OUString>(xPropertySet, "TextPortionType")); + xRunEnum->nextElement(); + xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty<OUString>(xPropertySet, "TextPortionType")); + + /* + * Initials were not imported. + * + * oFields = ThisComponent.TextFields.createEnumeration + * oField = oFields.nextElement + * xray oField.Initials + */ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials")); + + /* + * There was a fake empty paragraph at the end of the comment text. + * + * oFields = ThisComponent.TextFields.createEnumeration + * oField = oFields.nextElement + * oParas = oField.TextRange.createEnumeration + * oPara = oParas.nextElement + * oPara = oParas.nextElement + */ + + xParaEnumAccess = getProperty< uno::Reference<container::XEnumerationAccess> >(xPropertySet, "TextRange"); + xParaEnum = xParaEnumAccess->createEnumeration(); + xParaEnum->nextElement(); + bool bCaught = false; + try + { + xParaEnum->nextElement(); + } + catch (container::NoSuchElementException&) + { + bCaught = true; + } + CPPUNIT_ASSERT_EQUAL(true, bCaught); +} + +DECLARE_OOXMLEXPORT_TEST(testCommentsNested, "comments-nested.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<beans::XPropertySet> xOuter = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 2), "TextField"); + CPPUNIT_ASSERT_EQUAL(OUString("Outer"), getProperty<OUString>(xOuter, "Content")); + + uno::Reference<beans::XPropertySet> xInner = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 4), "TextField"); + CPPUNIT_ASSERT_EQUAL(OUString("Inner"), getProperty<OUString>(xInner, "Content")); +} + +DECLARE_OOXMLEXPORT_TEST(testMathEscape, "math-escape.docx") +{ + CPPUNIT_ASSERT_EQUAL(OUString("\\{ left [ right ] left ( right ) \\}"), getFormula(getRun(getParagraph(1), 1))); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo51034, "fdo51034.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // The problem was that the 'l' param of the HYPERLINK field was parsed with = "#", not += "#". + CPPUNIT_ASSERT_EQUAL(OUString("http://Www.google.com/#a"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + +// Remove all spaces, as LO export/import may change that. +// Replace symbol - (i.e. U+2212) with ASCII - , LO does this change and it shouldn't matter. +static void CHECK_FORMULA(OUString const & expected, OUString const & actual) { + CPPUNIT_ASSERT_EQUAL( + expected.replaceAll( " ", "" ).replaceAll( OUString(u"\u2212"), "-" ), + actual.replaceAll( " ", "" ).replaceAll( OUString(u"\u2212"), "-" )); +} + +DECLARE_OOXMLEXPORT_TEST(testMathAccents, "math-accents.docx") +{ + CHECK_FORMULA( + "acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a}" + " widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}", + getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathD, "math-d.docx") +{ + CHECK_FORMULA( "left (x mline y mline z right )", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( "left (1 right )", getFormula( getRun( getParagraph( 1 ), 2 ))); + CHECK_FORMULA( "left [2 right ]", getFormula( getRun( getParagraph( 1 ), 3 ))); + CHECK_FORMULA( "left ldbracket 3 right rdbracket", getFormula( getRun( getParagraph( 1 ), 4 ))); + CHECK_FORMULA( "left lline 4 right rline", getFormula( getRun( getParagraph( 1 ), 5 ))); + CHECK_FORMULA( "left ldline 5 right rdline", getFormula( getRun( getParagraph( 1 ), 6 ))); + CHECK_FORMULA( "left langle 6 right rangle", getFormula( getRun( getParagraph( 1 ), 7 ))); + CHECK_FORMULA( "left langle a mline b right rangle", getFormula( getRun( getParagraph( 1 ), 8 ))); + CHECK_FORMULA( "left ({x} over {y} right )", getFormula( getRun( getParagraph( 1 ), 9 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathEscaping, "math-escaping.docx") +{ + CHECK_FORMULA( u"\u2212 \u221E < x < \u221E", getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathLim, "math-lim.docx") +{ + CHECK_FORMULA( u"lim from {x \u2192 1} {x}", getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathMatrix, "math-matrix.docx") +{ + CHECK_FORMULA( "left [matrix {1 # 2 ## 3 # 4} right ]", getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathMso2k7, "math-mso2k7.docx") +{ + CHECK_FORMULA( u"A = \u03C0 {r} ^ {2}", getFormula( getRun( getParagraph( 1 ), 1 ))); +// TODO check the stack/binom difference +// CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (binom {n} {k} right ) {x} ^ {k} {a} ^ {n-k}}", + CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (stack {n # k} right ) {x} ^ {k} {a} ^ {n-k}}", + getFormula( getRun( getParagraph( 2 ), 1 ))); + CHECK_FORMULA( u"{left (1+x right )} ^ {n} =1+ {nx} over {1!} + {n left (n-1 right ) {x} ^ {2}} over {2!} +\u2026", + getFormula( getRun( getParagraph( 3 ), 1 ))); +// TODO check (cos/sin miss {}) +// CHECK_FORMULA( "f left (x right ) = {a} rsub {0} + sum from {n=1} to {\xe2\x88\x9e} {left ({a} rsub {n} cos {{n\xcf\x80x} over {L}} + {b} rsub {n} sin {{n\xcf\x80x} over {L}} right )}", + CHECK_FORMULA( u"f left (x right ) = {a} rsub {0} + sum from {n=1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} over {L} right )}", + getFormula( getRun( getParagraph( 4 ), 1 ))); + CHECK_FORMULA( "{a} ^ {2} + {b} ^ {2} = {c} ^ {2}", getFormula( getRun( getParagraph( 5 ), 1 ))); + CHECK_FORMULA( u"x = {- b \u00B1 sqrt {{b} ^ {2} -4 ac}} over {2 a}", + getFormula( getRun( getParagraph( 6 ), 1 ))); + CHECK_FORMULA( + u"{e} ^ {x} =1+ {x} over {1!} + {{x} ^ {2}} over {2!} + {{x} ^ {3}} over {3!} +\u2026, -\u221E<x<\u221E", + getFormula( getRun( getParagraph( 7 ), 1 ))); + CHECK_FORMULA( +// "sin {\xce\xb1} \xc2\xb1 sin {\xce\xb2} =2 sin {{1} over {2} left (\xce\xb1\xc2\xb1\xce\xb2 right )} cos {{1} over {2} left (\xce\xb1\xe2\x88\x93\xce\xb2 right )}", +// TODO check (cos/in miss {}) + u"sin \u03B1 \u00B1 sin \u03B2 =2 sin {1} over {2} left (\u03B1\u00B1\u03B2 right ) cos {1} over {2} left (\u03B1\u2213\u03B2 right )", + getFormula( getRun( getParagraph( 8 ), 1 ))); + CHECK_FORMULA( +// "cos {\xce\xb1} + cos {\xce\xb2} =2 cos {{1} over {2} left (\xce\xb1+\xce\xb2 right )} cos {{1} over {2} left (\xce\xb1-\xce\xb2 right )}", +// TODO check (cos/sin miss {}) + u"cos \u03B1 + cos \u03B2 =2 cos {1} over {2} left (\u03B1+\u03B2 right ) cos {1} over {2} left (\u03B1-\u03B2 right )", + getFormula( getRun( getParagraph( 9 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathNary, "math-nary.docx") +{ + CHECK_FORMULA( "lllint from {1} to {2} {x + 1}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( "prod from {a} {b}", getFormula( getRun( getParagraph( 1 ), 2 ))); + CHECK_FORMULA( "sum to {2} {x}", getFormula( getRun( getParagraph( 1 ), 3 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathOverbraceUnderbrace, "math-overbrace_underbrace.docx") +{ + CHECK_FORMULA( "{abcd} overbrace {4}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( "{xyz} underbrace {3}", getFormula( getRun( getParagraph( 2 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathOverstrike, "math-overstrike.docx") +{ + CHECK_FORMULA( "overstrike {abc}", getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathPlaceholders, "math-placeholders.docx") +{ + CHECK_FORMULA( "sum from <?> to <?> <?>", getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathRad, "math-rad.docx") +{ + CHECK_FORMULA( "sqrt {4}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( "nroot {3} {x + 1}", getFormula( getRun( getParagraph( 1 ), 2 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathSubscripts, "math-subscripts.docx") +{ + CHECK_FORMULA( "{x} ^ {y} + {e} ^ {x}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( "{x} ^ {b}", getFormula( getRun( getParagraph( 1 ), 2 ))); + CHECK_FORMULA( "{x} rsub {b}", getFormula( getRun( getParagraph( 1 ), 3 ))); + CHECK_FORMULA( "{a} rsub {c} rsup {b}", getFormula( getRun( getParagraph( 1 ), 4 ))); + CHECK_FORMULA( "{x} lsub {2} lsup {1}", getFormula( getRun( getParagraph( 1 ), 5 ))); + CHECK_FORMULA( "{{x csup {6} csub {3}} lsub {4} lsup {5}} rsub {2} rsup {1}", + getFormula( getRun( getParagraph( 1 ), 6 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testMathVerticalStacks, "math-vertical_stacks.docx") +{ + CHECK_FORMULA( "{a} over {b}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( "{a} / {b}", getFormula( getRun( getParagraph( 2 ), 1 ))); +// TODO check these +// CHECK_FORMULA( "binom {a} {b}", getFormula( getRun( getParagraph( 3 ), 1 ))); +// CHECK_FORMULA( "binom {a} {binom {b} {c}}", getFormula( getRun( getParagraph( 4 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testTable, "table.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Make sure we write qFormat for well-known style names. + xmlDocUniquePtr pXmlDocCT = parseExport("word/styles.xml"); + CPPUNIT_ASSERT(pXmlDocCT); + assertXPath(pXmlDocCT, "//w:style[@w:styleId='Normal']/w:qFormat", 1); +} + +namespace { + +struct SingleLineBorders { + sal_Int16 top, bottom, left, right; + SingleLineBorders(int t=0, int b=0, int l=0, int r=0) + : top(t), bottom(b), left(l), right(r) {} + sal_Int16 getBorder(int i) const + { + switch (i) { + case 0: return top; + case 1: return bottom; + case 2: return left; + case 3: return right; + default: assert(false); return 0; + } + } +}; + +} + +DECLARE_OOXMLEXPORT_TEST(testTableBorders, "table-borders.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + uno::Reference<text::XTextTable> xTextTable (xTables->getByIndex(0), uno::UNO_QUERY); + + std::map<OUString, SingleLineBorders> cellBorders; + cellBorders[OUString("A1")] = SingleLineBorders(106, 106, 106, 106); + cellBorders[OUString("B1")] = SingleLineBorders(106, 0, 106, 35); + cellBorders[OUString("C1")] = SingleLineBorders(106, 106, 35, 106); + cellBorders[OUString("A2")] = SingleLineBorders(106, 35, 106, 0); + cellBorders[OUString("B2")] = SingleLineBorders(0, 0, 0, 0); + cellBorders[OUString("C2")] = SingleLineBorders(106, 106, 0, 106); + cellBorders[OUString("A3")] = SingleLineBorders(35, 35, 106, 106); + cellBorders[OUString("B3")] = SingleLineBorders(0, 106, 106, 106); + cellBorders[OUString("C3")] = SingleLineBorders(106, 106, 106, 106); + cellBorders[OUString("A4")] = SingleLineBorders(35, 106, 106, 35); + cellBorders[OUString("B4")] = SingleLineBorders(106, 106, 35, 106); + cellBorders[OUString("C4")] = SingleLineBorders(106, 106, 106, 106); + + const OUString borderNames[] = { + OUString("TopBorder"), + OUString("BottomBorder"), + OUString("LeftBorder"), + OUString("RightBorder"), + }; + + uno::Sequence<OUString> const cells = xTextTable->getCellNames(); + sal_Int32 nLength = cells.getLength(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(cellBorders.size()), nLength); + + for (sal_Int32 i = 0; i < nLength; ++i) + { + uno::Reference<table::XCell> xCell = xTextTable->getCellByName(cells[i]); + uno::Reference< beans::XPropertySet > xPropSet(xCell, uno::UNO_QUERY_THROW); + const SingleLineBorders& borders = cellBorders[cells[i]]; + + for (sal_Int32 j = 0; j < 4; ++j) + { + uno::Any aBorder = xPropSet->getPropertyValue(borderNames[j]); + table::BorderLine aBorderLine; + if (aBorder >>= aBorderLine) + { + std::stringstream message; + message << cells[i] << "'s " << borderNames[j] << " is incorrect"; + CPPUNIT_ASSERT_EQUAL_MESSAGE(message.str(), + borders.getBorder(j), aBorderLine.OuterLineWidth); + } + } + } +} + +DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // The problem was that we lacked the fallback to export the replacement + // graphic for OLE objects. But we can actually export the OLE itself now, + // so check that instead. + uno::Reference<text::XTextEmbeddedObjectsSupplier> xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xEmbeddedObjects->getCount()); + + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); + + if (!pXmlDocCT) + return; // initial import + + assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xlsx']", "ContentType", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p/w:r/w:object/o:OLEObject", + "ProgID", + "Excel.Sheet.12"); +} + +DECLARE_OOXMLEXPORT_TEST(test1Table1Page, "1-table-1-page.docx") +{ + // 2 problem for this document after export: + // - invalid sectPr inserted at the beginning of the page + // - font of empty cell is not preserved, leading to change in rows height + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTextFrames, "textframes.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // The frames were simply missing, so let's check if all 3 frames were imported back. + CPPUNIT_ASSERT_EQUAL(3, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + if (xIndexAccess->getCount()) + { + // After import, a TextFrame is created by the VML import. + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xFrame, "BackColor")); + + table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aBorder.Color); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), aBorder.LineWidth); + + table::ShadowFormat aShadowFormat = getProperty<table::ShadowFormat>(xFrame, "ShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadowFormat.Location); + CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); + } + else + { + // After export and import, the result is a shape. + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xShape, "FillColor")); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), getProperty<sal_Int32>(xShape, "LineColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(35), getProperty<sal_Int32>(xShape, "LineWidth")); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(48), getProperty<sal_Int32>(xShape, "ShadowXDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(48), getProperty<sal_Int32>(xShape, "ShadowYDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), getProperty<sal_Int32>(xShape, "ShadowColor")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") +{ + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); + awt::Gradient aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aGradient.StartColor); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); + + xFrame.set(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); + aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aGradient.StartColor); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x666666), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); + + // Left / right margin was incorrect: the attribute was missing and we + // didn't have the right default (had 0 instead of the below one). + CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty<sal_Int32>(xFrame, "LeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty<sal_Int32>(xFrame, "RightMargin")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCellBtlr, "cell-btlr.docx") +{ + /* + * The problem was that the exporter didn't mirror the workaround of the + * importer, regarding the btLr text direction: the <w:textDirection + * w:val="btLr"/> token was completely missing in the output. + */ + + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:textDirection", "val", "btLr"); +} + +DECLARE_OOXMLEXPORT_TEST(testTableStylerPrSz, "table-style-rPr-sz.docx") +{ + // Verify that font size inside the table is 20pt, despite the sz attribute in the table size. + // Also check that other rPr attribute are used: italic, bold, underline + // Office has the same behavior + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); +// disabled temporarily, next commit enables it again +#if 0 + CPPUNIT_ASSERT_EQUAL(20.f, getProperty<float>(getRun(xPara, 1), "CharHeight")); +#endif +// CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<short>(getRun(xPara, 1), "CharUnderline")); +// CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xPara, 1), "CharWeight")); +// CPPUNIT_ASSERT_EQUAL(awt::FontSlant_ITALIC, getProperty<awt::FontSlant>(getRun(xPara, 1), "CharPosture")); +} + +DECLARE_OOXMLEXPORT_TEST(testMathLiteral, "math-literal.docx") +{ + CHECK_FORMULA( u"iiint from {V} to <?> {\"div\" \"F\"} dV= llint from {S} to <?> {\"F\" \u2219 \"n \" dS}", + getFormula( getRun( getParagraph( 1 ), 1 ))); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo48557, "fdo48557.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Inner margins of the textframe wasn't exported. + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextLeftDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextRightDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextUpperDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextLowerDistance")); +} + +DECLARE_OOXMLEXPORT_TEST(testI120928, "i120928.docx") +{ + // w:numPicBullet was ignored, leading to missing graphic bullet in numbering. + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + uno::Reference<awt::XBitmap> xBitmap; + sal_Int16 nNumberingType = -1; + + for (beans::PropertyValue const & rProp : std::as_const(aProps)) + { + if (rProp.Name == "NumberingType") + nNumberingType = rProp.Value.get<sal_Int16>(); + else if (rProp.Name == "GraphicBitmap") + xBitmap = rProp.Value.get<uno::Reference<awt::XBitmap>>(); + } + CPPUNIT_ASSERT_EQUAL(style::NumberingType::BITMAP, nNumberingType); + CPPUNIT_ASSERT(xBitmap.is()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo64826, "fdo64826.docx") +{ + // 'Track-Changes' (Track Revisions) wasn't exported. + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(mxComponent, "RecordChanges")); + // 'Show-Changes' should not be exported - default is true. + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:revisionView", 0); + } +} + +DECLARE_OOXMLEXPORT_TEST(testPageBackground, "page-background.docx") +{ + // 'Document Background' wasn't exported. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo65265, "fdo65265.docx") +{ + // Redline (tracked changes) of text formatting were not exported + uno::Reference<text::XTextRange> xParagraph1 = getParagraph(1); + uno::Reference<text::XTextRange> xParagraph2 = getParagraph(2); + + CPPUNIT_ASSERT_EQUAL(OUString("Format"), getProperty<OUString>(getRun(xParagraph1, 3), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Format"), getProperty<OUString>(getRun(xParagraph2, 2), "RedlineType")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo65655, "fdo65655.docx") +{ + // The problem was that the DOCX had a non-blank odd footer and a blank even footer + // The 'Different Odd & Even Pages' was turned on + // However - LO assumed that because the 'even' footer is blank - it should ignore the 'Different Odd & Even Pages' flag + // So it did not import it and did not export it + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + bool bValue = false; + xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue; + CPPUNIT_ASSERT_EQUAL(false, bValue); + xPropertySet->getPropertyValue("FooterIsShared") >>= bValue; + CPPUNIT_ASSERT_EQUAL(false, bValue); +} + +DECLARE_OOXMLEXPORT_TEST(testFDO63053, "fdo63053.docx") +{ + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); + CPPUNIT_ASSERT_EQUAL(OUString("test1&test2"), xDocumentProperties->getTitle()); + CPPUNIT_ASSERT_EQUAL(OUString("test1&test2"), xDocumentProperties->getSubject()); +} + +DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + // 1st problem: last character was missing + CPPUNIT_ASSERT_EQUAL(OUString("SAMPLE"), xShape->getString()); + + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"); + bool bFound = false; + for (beans::PropertyValue const & prop : aProps) + if (prop.Name == "TextPath") + bFound = true; + // 2nd problem: v:textpath wasn't imported + CPPUNIT_ASSERT_EQUAL(true, bFound); + + // 3rd problem: rotation angle was 315, not 45. + CPPUNIT_ASSERT_EQUAL(sal_Int32(45 * 100), getProperty<sal_Int32>(xShape, "RotateAngle")); + + // 4th problem: mso-position-vertical-relative:margin was ignored, VertOrientRelation was text::RelOrientation::FRAME. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, getProperty<sal_Int16>(xShape, "VertOrientRelation")); + + // These problems were in the exporter + // The textpath wasn't semi-transparent. + CPPUNIT_ASSERT_EQUAL(sal_Int16(50), getProperty<sal_Int16>(xShape, "FillTransparence")); + // The textpath had a stroke. + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_NONE, getProperty<drawing::LineStyle>(xShape, "LineStyle")); +} + +DECLARE_OOXMLEXPORT_TEST(testWatermarkFont, "watermark-font.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("TestFont"), xShape->getString()); + + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + OUString aFont; + float nFontSize; + + // Check font family + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharFontName") >>= aFont); + CPPUNIT_ASSERT_EQUAL(OUString("DejaVu Serif"), aFont); + + // Check font size + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharHeight") >>= nFontSize); + CPPUNIT_ASSERT_EQUAL(float(72), nFontSize); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo43093, "fdo43093.docx") +{ + // The problem was that the alignment are not exchange when the paragraph are RTL. + uno::Reference<uno::XInterface> xParaRtlLeft(getParagraph( 1, "RTL Left")); + sal_Int32 nRtlLeft = getProperty< sal_Int32 >( xParaRtlLeft, "ParaAdjust" ); + // test the text Direction value for the pragraph + sal_Int16 nRLDir = getProperty< sal_Int32 >( xParaRtlLeft, "WritingMode" ); + + uno::Reference<uno::XInterface> xParaRtlRight(getParagraph( 3, "RTL Right")); + sal_Int32 nRtlRight = getProperty< sal_Int32 >( xParaRtlRight, "ParaAdjust" ); + sal_Int16 nRRDir = getProperty< sal_Int32 >( xParaRtlRight, "WritingMode" ); + + uno::Reference<uno::XInterface> xParaLtrLeft(getParagraph( 5, "LTR Left")); + sal_Int32 nLtrLeft = getProperty< sal_Int32 >( xParaLtrLeft, "ParaAdjust" ); + sal_Int16 nLLDir = getProperty< sal_Int32 >( xParaLtrLeft, "WritingMode" ); + + uno::Reference<uno::XInterface> xParaLtrRight(getParagraph( 7, "LTR Right")); + sal_Int32 nLtrRight = getProperty< sal_Int32 >( xParaLtrRight, "ParaAdjust" ); + sal_Int16 nLRDir = getProperty< sal_Int32 >( xParaLtrRight, "WritingMode" ); + + // this will test the both the text direction and alignment for each paragraph + 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), nRtlRight); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, nRRDir); + + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), nLtrLeft); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLLDir); + + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), nLtrRight); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLRDir); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo64238_a, "fdo64238_a.docx") +{ + // The problem was that when 'Show Only Odd Footer' was marked in Word and the Even footer *was filled* + // then LO would still import the Even footer and concatenate it to the odd footer. + // This case specifically is for : + // 'Blank Odd Footer' with 'Non-Blank Even Footer' when 'Show Only Odd Footer' is marked in Word + // In this case the imported footer in LO was supposed to be blank, but instead was the 'even' footer + uno::Reference<text::XText> xFooterText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "FooterText"); + uno::Reference< text::XTextRange > xFooterParagraph = getParagraphOfText( 1, xFooterText ); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xFooterParagraph, uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + sal_Int32 numOfRuns = 0; + while (xRunEnum->hasMoreElements()) + { + xRunEnum->nextElement(); + numOfRuns++; + } + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), numOfRuns); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo64238_b, "fdo64238_b.docx") +{ + // The problem was that when 'Show Only Odd Footer' was marked in Word and the Even footer *was filled* + // then LO would still import the Even footer and concatenate it to the odd footer. + // This case specifically is for : + // 'Non-Blank Odd Footer' with 'Non-Blank Even Footer' when 'Show Only Odd Footer' is marked in Word + // In this case the imported footer in LO was supposed to be just the odd footer, but instead was the 'odd' and 'even' footers concatenated + uno::Reference<text::XText> xFooterText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "FooterText"); + uno::Reference< text::XTextRange > xFooterParagraph = getParagraphOfText( 1, xFooterText ); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xFooterParagraph, uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + sal_Int32 numOfRuns = 0; + while (xRunEnum->hasMoreElements()) + { + xRunEnum->nextElement(); + numOfRuns++; + } + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), numOfRuns); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo56679, "fdo56679.docx") +{ + // The problem was that the DOCX importer and exporter did not handle the 'color' of an underline + // (not the color of the text, the color of the underline itself) + uno::Reference< text::XTextRange > xParagraph = getParagraph( 1 ); + uno::Reference< text::XTextRange > xText = getRun( xParagraph, 2, "This is a simple sentence."); + + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xText, "CharUnderlineHasColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), getProperty<sal_Int32>(xText, "CharUnderlineColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo65400, "fdo65400.docx") +{ + // The problem was that if in Word you choose 'Character Shading' - then the text portion + // is marked with 'w:shd val=pct15'. LO did not store this value and so when importing and exporting + // this value was lost (and so Word did not show 'Character Shading' was on) + uno::Reference< text::XTextRange > paragraph1 = getParagraph( 1 ); + uno::Reference< text::XTextRange > shaded = getRun( paragraph1, 2, "normal" ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0x0026 ), getProperty< sal_Int32 >( shaded, "CharShadingValue" )); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xd8d8d8 ), getProperty< sal_Int32 >( shaded, "CharBackColor" )); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66543, "fdo66543.docx") +{ + // The problem was that when importing DOCX with 'line numbers' - the 'start value' was imported + // but nothing was done with it. + + uno::Reference< text::XTextRange > paragraph1 = getParagraph( 1 ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), + getProperty<sal_Int32>(paragraph1, "ParaLineNumberStartValue")); +} + +DECLARE_OOXMLEXPORT_TEST(testN822175, "n822175.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + // Was text::WrapTextMode_THROUGH, due to missing Surround handling in the exporter. + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(xFrame, "Surround")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx") +{ + // The problem was that TextFrame imported and exported the wrong value for transparency + // (was stored as 'FillTransparence' instead of 'BackColorTransparency' + uno::Reference<beans::XPropertySet> xFrame(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 80 ), getProperty< sal_Int32 >( xFrame, "FillTransparence" ) ); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66773, "fdo66773.docx") +{ + // The problem was the line spacing was interpreted by Word as 'Multiple 1.08' if no default settings were written. + // Now after the 'docDefaults' section is written in <styles.xml> - there is no more problem. + // (Word does not try to calculate some arbitrary value for line spacing). + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + CPPUNIT_ASSERT(xParaEnum->hasMoreElements()); + + style::LineSpacing alineSpacing = getProperty<style::LineSpacing>(xParaEnum->nextElement(), "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::PROP, alineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(100), static_cast<sal_Int32>(alineSpacing.Height)); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo58577, "fdo58577.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // The second frame was simply missing, so let's check if both frames were imported back. + CPPUNIT_ASSERT_EQUAL(2, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc581614, "bnc581614.doc") +{ + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66929, "fdo66929.docx") +{ + // The problem was that the default 'inset' attribute of the 'textbox' node was exported incorrectly. + // A node like '<v:textbox inset="0">' was exported back as '<v:textbox inset="0pt,0pt,0pt,0pt">' + // This is wrong because the original node denotes a specific 'left' inset, and a default 'top','right','bottom' inset + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + if (xIndexAccess->getCount()) + { + // VML import -> TextFrame + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ) , getProperty< sal_Int32 >( xFrame, "LeftBorderDistance" ) ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 127 ), getProperty< sal_Int32 >( xFrame, "TopBorderDistance" ) ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 254 ), getProperty< sal_Int32 >( xFrame, "RightBorderDistance" ) ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 127 ), getProperty< sal_Int32 >( xFrame, "BottomBorderDistance" ) ); + } + else + { + // drawingML import -> shape with TextBox + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "TextLeftDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(127), getProperty<sal_Int32>(xShape, "TextUpperDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(254), getProperty<sal_Int32>(xShape, "TextRightDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(127), getProperty<sal_Int32>(xShape, "TextLowerDistance")); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBorderSpacingExportCase2, "page-borders-export-case-2.docx") +{ + // The problem was that the exporter didn't mirror the workaround of the + // importer, regarding the page border's spacing : the <w:pgBorders w:offsetFrom="page"> + // and the inner nodes like <w:top w:space="24" ... /> + // + // The exporter ALWAYS exported 'w:offsetFrom="text"' even when the spacing values where too large + // for Word to handle (larger than 31 points) + + xmlDocUniquePtr pXmlDoc = parseExport(); + + // Assert the XPath expression - page borders + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders", "offsetFrom", "page"); + + // Assert the XPath expression - 'left' border + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:left", "space", "24"); + + // Assert the XPath expression - 'right' border + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:right", "space", "24"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66145, "fdo66145.docx") +{ + // The Writer ignored the 'First Is Shared' flag + CPPUNIT_ASSERT_EQUAL(OUString("This is the FIRST page header."), + parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL( + OUString("This is the header for the REST OF THE FILE."), + parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL( + OUString("This is the header for the REST OF THE FILE."), + parseDump("/root/page[3]/header/txt/text()")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGrabBag, "grabbag.docx") +{ + // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx") +{ + // The problem was that bullets with level=0 were shown in LO as normal bullets, + // and when saved back to DOCX were saved with level=1 (so hidden bullets became visible) + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + for (beans::PropertyValue const & rProp : std::as_const(aProps)) + { + if (rProp.Name == "BulletChar") + { + CPPUNIT_ASSERT_EQUAL(OUString("\x0", 1, RTL_TEXTENCODING_ASCII_US), rProp.Value.get<OUString>()); + return; + } + } + + // Shouldn't reach here + CPPUNIT_FAIL("Did not find bullet with level 0"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // The shape had no background, no paragraph adjust and no font color. + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "FillColor")); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText); + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo65718, "fdo65718.docx") +{ + // The problem was that the exporter always exported values of "0" for an images distance from text. + // the actual attributes where 'distT', 'distB', 'distL', 'distR' + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(0), getProperty<sal_Int32>(xPropertySet, "TopMargin") ); + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(0), getProperty<sal_Int32>(xPropertySet, "BottomMargin") ); + + // 'getProperty' return 318 (instead of 317.5) + // I think this is because it returns an integer, instead of a float. + // The actual exporting to DOCX exports the correct value (114300 = 317.5 * 360) + // The exporting to DOCX uses the 'SvxLRSpacing' that stores the value in TWIPS (180 TWIPS) + // However, the 'LeftMargin' property is an integer property that holds that value in 'MM100' (should hold 317.5, but it is 318) + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(114300), getProperty<sal_Int32>(xPropertySet, "LeftMargin") ); + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(114300), getProperty<sal_Int32>(xPropertySet, "RightMargin") ); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo64350, "fdo64350.docx") +{ + // The problem was that page border shadows were not exported + table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getStyles("PageStyles")->getByName("Standard"), "ShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo67013, "fdo67013.docx") +{ + /* + * The problem was that borders inside headers \ footers were not exported + * This was checked in xray using these commands: + * + * xHeaderText = ThisComponent.getStyleFamilies().getByName("PageStyles").getByName("Standard").HeaderText + * xHeaderEnum = xHeaderText.createEnumeration() + * xHeaderFirstParagraph = xHeaderEnum.nextElement() + * xHeaderBottomBorder = xHeaderFirstParagraph.BottomBorder + * + * xFooterText = ThisComponent.getStyleFamilies().getByName("PageStyles").getByName("Standard").FooterText + * xFooterEnum = xFooterText.createEnumeration() + * xFooterFirstParagraph = xFooterEnum.nextElement() + * xFooterTopBorder = xFooterFirstParagraph.TopBorder + */ + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + uno::Reference< text::XTextRange > xHeaderParagraph = getParagraphOfText( 1, xHeaderText ); + table::BorderLine2 aHeaderBottomBorder = getProperty<table::BorderLine2>(xHeaderParagraph, "BottomBorder"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aHeaderBottomBorder.Color); + CPPUNIT_ASSERT_EQUAL(sal_Int16(106), aHeaderBottomBorder.InnerLineWidth); + CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aHeaderBottomBorder.LineDistance); + CPPUNIT_ASSERT_EQUAL(sal_Int16(7), aHeaderBottomBorder.LineStyle); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(159), aHeaderBottomBorder.LineWidth); + CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aHeaderBottomBorder.OuterLineWidth); + + uno::Reference<text::XText> xFooterText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "FooterText"); + uno::Reference< text::XTextRange > xFooterParagraph = getParagraphOfText( 1, xFooterText ); + table::BorderLine2 aFooterTopBorder = getProperty<table::BorderLine2>(xFooterParagraph, "TopBorder"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aFooterTopBorder.Color); + CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aFooterTopBorder.InnerLineWidth); + CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aFooterTopBorder.LineDistance); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4), aFooterTopBorder.LineStyle); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(159), aFooterTopBorder.LineWidth); + CPPUNIT_ASSERT_EQUAL(sal_Int16(106), aFooterTopBorder.OuterLineWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testParaShadow, "para-shadow.docx") +{ + // The problem was that in w:pBdr, child elements had a w:shadow attribute, but that was ignored. + table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat"); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(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(24/8*20)), aShadow.ShadowWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testTableFloating, "table-floating.docx") +{ + // Both the size and the position of the table was incorrect. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // Second table was too wide: 16249, i.e. as wide as the first table. + CPPUNIT_ASSERT_EQUAL(sal_Int32(11248), getProperty<sal_Int32>(xTables->getByIndex(1), "Width")); + + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + if (xIndexAccess->getCount()) + { + // After import, table is inside a TextFrame. + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // This was 0, should be the opposite of (left margin + half of the border width). + CPPUNIT_ASSERT_EQUAL(sal_Int32(-199), getProperty<sal_Int32>(xFrame, "HoriOrientPosition")); + // Was 0 as well, should be the right margin. + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xFrame, "RightMargin")); + } + else + { + // After import, table is inside a TextFrame. + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + // This was 0, should be the opposite of (left margin + half of the border width). + CPPUNIT_ASSERT_EQUAL(sal_Int32(-199), getProperty<sal_Int32>(xShape, "HoriOrientPosition")); + // Was 0 as well, should be the right margin. + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xShape, "RightMargin")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_0, "fdo44689_start_page_0.docx") +{ + // The problem was that the import & export process did not analyze the 'start from page' attribute of a section + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xPara, "PageNumberOffset")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_7, "fdo44689_start_page_7.docx") +{ + // The problem was that the import & export process did not analyze the 'start from page' attribute of a section + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(7), getProperty<sal_Int16>(xPara, "PageNumberOffset")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo67737, "fdo67737.docx") +{ + // The problem was that imported shapes did not import and render the 'flip:x' and 'flip:y' attributes + uno::Reference<drawing::XShape> xArrow = getShape(1); + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xArrow, "CustomShapeGeometry"); + for (beans::PropertyValue const & rProp : aProps) + { + if (rProp.Name == "MirroredY") + { + CPPUNIT_ASSERT_EQUAL( true, rProp.Value.get<bool>() ); + return; + } + } + + // Shouldn't reach here + CPPUNIT_FAIL("Did not find MirroredY=true property"); +} + +DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") +{ + uno::Reference<drawing::XShape> xPicture = getShape(1); + sal_Int32 nShadowColor = getProperty<sal_Int32>(xPicture, "ShadowColor"); + sal_Int16 nShadowTransparence = getProperty<sal_Int16>(xPicture, "ShadowTransparence"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x808080), nShadowColor); + CPPUNIT_ASSERT_EQUAL(sal_Int16(50), nShadowTransparence); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(NoFillAttrInImagedata, "NoFillAttrInImagedata.docx") +{ + //problem was that type and color2 which are v:fill attributes were written in 'v:imagedata' + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:imagedata", "type"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:imagedata", "color2"); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc837302, "bnc837302.docx") +{ + // The problem was that text with empty author was not inserted as a redline + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + + // previously 'AAA' was not an own run + getRun(xParagraph, 3, "AAA"); + // interestingly the 'Insert' is set on the _previous_ run + CPPUNIT_ASSERT_EQUAL(OUString("Insert"), getProperty<OUString>(getRun(xParagraph, 2), "RedlineType")); + + // make sure we don't introduce a redlined delete in the 2nd paragraph + xParagraph = getParagraph(2); + CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(xParagraph, 1), "RedlineType")); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx new file mode 100644 index 000000000..a7fa86d47 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -0,0 +1,1195 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/awt/Gradient.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/style/CaseMap.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/table/ShadowFormat.hpp> +#include <com/sun/star/text/GraphicCrop.hpp> +#include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/xml/dom/XDocument.hpp> +#include <com/sun/star/style/BreakType.hpp> +#include <ftninfo.hxx> + +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 { + const char* aBlacklist[] = { + "math-escape.docx", + "math-mso2k7.docx" + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end()); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testFdo68418, "fdo68418.docx") +{ + // The problem was that in 'MSWordExportBase::SectionProperties' function in 'wrt8sty.cxx' + // it checked if it 'IsPlausableSingleWordSection'. + // The 'IsPlausableSingleWordSection' compared different aspects of 2 'SwFrameFormat' objects. + // One of the checks was 'do both formats have the same distance from the top and bottom ?' + // This check is correct if both have headers or both don't have headers. + // However - if one has a header, and the other one has an empty header (no header) - it is not correct to compare + // between them (same goes for 'footer'). + uno::Reference<text::XText> xFooterText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "FooterText"); + uno::Reference< text::XTextRange > xFooterParagraph = getParagraphOfText( 1, xFooterText ); + + // First page footer is empty, second page footer is 'aaaa' + CPPUNIT_ASSERT_EQUAL(OUString("aaaa"), xFooterParagraph->getString()); // I get an error that it expects '' +} + +DECLARE_OOXMLEXPORT_TEST(testA4AndBorders, "a4andborders.docx") +{ + /* + * The problem was that in case of a document with borders, the pgSz attribute + * was exported as a child of pgBorders, thus being ignored on reload. + * We assert dimension against A4 size in mm (to avoid minor rounding errors) + */ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect Page Width (mm)", sal_Int32(210), getProperty<sal_Int32>(xPageStyle, "Width") / 100); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect Page Height (mm)", sal_Int32(297), getProperty<sal_Int32>(xPageStyle, "Height") / 100); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo68787, "fdo68787.docx") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + // This was 25, the 'lack of w:separator' <-> '0 line width' mapping was missing. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92470_footnoteRestart, "tdf92470_footnoteRestart.docx") +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT( pTextDoc ); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT( pDoc ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote doesn't restart every Page", FTNNUM_PAGE, pDoc->GetFootnoteInfo().m_eNum ); + + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth")); +} + +DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1),1), uno::UNO_QUERY); + // OOXML has just one border attribute (<w:bdr>) for text border so all side has + // the same border with the same padding + // Border + { + const table::BorderLine2 aTopBorder = getProperty<table::BorderLine2>(xRun,"CharTopBorder"); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0xFF6600,0,318,0,0,318), aTopBorder); + CPPUNIT_ASSERT_BORDER_EQUAL(aTopBorder, getProperty<table::BorderLine2>(xRun,"CharLeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(aTopBorder, getProperty<table::BorderLine2>(xRun,"CharBottomBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(aTopBorder, getProperty<table::BorderLine2>(xRun,"CharRightBorder")); + } + + // Padding (w:space) + { + const sal_Int32 nTopPadding = getProperty<sal_Int32>(xRun,"CharTopBorderDistance"); + // In the original ODT the padding is 150, but the unit conversion round it down. + CPPUNIT_ASSERT_EQUAL(sal_Int32(141), nTopPadding); + CPPUNIT_ASSERT_EQUAL(nTopPadding, getProperty<sal_Int32>(xRun,"CharLeftBorderDistance")); + CPPUNIT_ASSERT_EQUAL(nTopPadding, getProperty<sal_Int32>(xRun,"CharBottomBorderDistance")); + CPPUNIT_ASSERT_EQUAL(nTopPadding, getProperty<sal_Int32>(xRun,"CharRightBorderDistance")); + } + + // Shadow (w:shadow) + /* OOXML use just one bool value for shadow so the next conversions + are made during an export-import round + color: any -> black + location: any -> bottom-right + width: any -> border width */ + { + const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); + CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); + } + + // Also check shadow when it is in middle of the paragraph + // (problem can be during export with SwWW8AttrIter::HasTextItem()) + { + uno::Reference<beans::XPropertySet> xMiddleRun(getRun(getParagraph(2),2), uno::UNO_QUERY); + const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xMiddleRun, "CharShadowFormat"); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); + CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); + } + + if (xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml")) + { + // Make sure we write qFormat for custom style names. + assertXPath(pXmlStyles, "//w:style[@w:styleId='Heading']/w:qFormat", 1); + } +} + +DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") +{ + // Check that now styleId's are more like what MSO produces + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + // the 1st style always must be Normal + assertXPath(pXmlStyles, "/w:styles/w:style[1]", "styleId", "Normal"); + // some random style later + assertXPath(pXmlStyles, "/w:styles/w:style[4]", "styleId", "Heading3"); + + // Check that we do _not_ export w:next for styles that point to themselves. + assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:next", 0); + + // Check that we roundtrip <w:next> correctly - on XML level + assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:next", "val", "Normal"); + // And to be REALLY sure, check it on the API level too ;-) + uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles"); + uno::Reference< beans::XPropertySet > properties(paragraphStyles->getByName("Heading 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty<OUString>(properties, "FollowStyle")); + + // This was 0, as export of w:outlineLvl was missing. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(properties, "OutlineLevel")); + + properties.set(paragraphStyles->getByName("Heading 11"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty<OUString>(properties, "FollowStyle")); + + // Make sure style #2 is Heading 1. + assertXPath(pXmlStyles, "/w:styles/w:style[2]", "styleId", "Heading1"); + // w:ind was copied from the parent (Normal) style without a good reason. + assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:pPr/w:ind", 0); + + // We output exactly 2 properties in rPrDefault, nothing else was + // introduced as an additional default + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 2); + // Check that we output real content of rPrDefault + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "ascii", "Times New Roman"); + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:lang", "bidi", "ar-SA"); + // pPrDefault contains only one hyphenation property + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/*", 1); + + // Check latent styles + uno::Sequence<beans::PropertyValue> aGrabBag = getProperty< uno::Sequence<beans::PropertyValue> >(mxComponent, "InteropGrabBag"); + uno::Sequence<beans::PropertyValue> aLatentStyles; + for (beans::PropertyValue const & prop : std::as_const(aGrabBag)) + if (prop.Name == "latentStyles") + prop.Value >>= aLatentStyles; + CPPUNIT_ASSERT(aLatentStyles.getLength()); // document should have latent styles + + // Check latent style default attributes + OUString aCount; + uno::Sequence<beans::PropertyValue> aLatentStyleExceptions; + for (beans::PropertyValue const & prop : std::as_const(aLatentStyles)) + { + if (prop.Name == "count") + aCount = prop.Value.get<OUString>(); + else if (prop.Name == "lsdExceptions") + prop.Value >>= aLatentStyleExceptions; + } + CPPUNIT_ASSERT_EQUAL(OUString("371"), aCount); // This check the "count" attribute. + + // Check exceptions to the latent style defaults. + uno::Sequence<beans::PropertyValue> aLatentStyleException; + aLatentStyleExceptions[0].Value >>= aLatentStyleException; + OUString aName; + for (beans::PropertyValue const & prop : std::as_const(aLatentStyleException)) + if (prop.Name == "name") + aName = prop.Value.get<OUString>(); + CPPUNIT_ASSERT_EQUAL(OUString("Normal"), aName); // This checks the "name" attribute of the first exception. + + // This numbering style wasn't roundtripped. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']/w:name", "val", "No List"); + + // Table style wasn't roundtripped. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:tblPr/w:tblCellMar/w:left", "w", "108"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:semiHidden", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:unhideWhenUsed", 1); + + // Additional para style properties should be also roundtripped. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='ListParagraph']/w:uiPriority", "val", "34"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:qFormat", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rsid", "val", "00780346"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']", "default", "1"); + + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:link", "val", "Heading1Char"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:locked", 1); + + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']", "customStyle", "1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']/w:autoRedefine", 1); + + // Additional char style properties should be also roundtripped. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='DefaultParagraphFont']", "default", "1"); + + // Finally check the same for numbering styles. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']", "default", "1"); + + // This was 1, the default style had <w:suppressAutoHyphens w:val="true"/> even for a default style having no RES_PARATR_HYPHENZONE set. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:pPr/w:suppressAutoHyphens", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx") +{ + // Document has a non-trivial table style, test the roundtrip of it. + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:basedOn", "val", "TableNormal"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rsid", "val", "00903003"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblPr/w:tblStyleColBandSize", "val", "1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tcPr/w:shd", "val", "clear"); + + // Table style lost its paragraph / run properties. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:pPr/w:spacing", "lineRule", "auto"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rPr/w:lang", "eastAsia", "ja-JP"); + + // Table style lost its conditional table formatting properties. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:pPr/w:wordWrap", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:rFonts", "hAnsiTheme", "minorHAnsi"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tblPr", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:vAlign", "val", "bottom"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='lastRow']/w:tcPr/w:tcBorders/w:tr2bl", "val", "nil"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcBorders/w:top", "themeColor", "text1"); + + // w:tblLook element and its attributes were missing. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "firstRow", "1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "lastRow", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "lastColumn", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "firstColumn", "1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "noHBand", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "noVBand", "1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "val", "04a0"); +} + +DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx") +{ + // Problem was that CharCaseMap was style::CaseMap::NONE. + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharCaseMap")); + // Font size in the second row was 11. + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight")); + // Font size in the third row was 11 as well. + xCell.set(xTable->getCellByName("B3"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(14.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight")); + + // This paragraph property was missing in table style. + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:pPr/w:jc", "val", "center"); + + // These run properties were missing + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang", "val", "en-US"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang", "bidi", "ar-SA"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:caps", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:smallCaps", "val", "0"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeColor", "accent1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:spacing", "val", "20"); + + // Table borders were also missing + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV", "themeTint", "99"); +} + +DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx") +{ + // TableStyle:firstRow (for header rows 1 and 2) color and size overrides document rPrDefault + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5B9BD5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),1), "CharHeight")); + // direct formatting in A1 + uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell2->getText()), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(20.f, getProperty<float>(getRun(getParagraphOfText(1, xCell2->getText()),1), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testCalendar4, "calendar4.docx") +{ + // TableStyle:fontsize - overrides DocDefaults, but not Style. + // In this case the style does not define anything (but does copy-inherit the DocDefaults size 36) + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A3"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(14.f, getProperty<float>(getRun(xCell,1), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testCalendar5, "calendar5.docx") +{ + // check text portions with and without direct formatting + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // text portions with direct formatting + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 2), "CharColor")); + // default paragraph text color + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5B9BD5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 3), "CharColor")); + // text portions with direct formatting + CPPUNIT_ASSERT_EQUAL(20.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),2), "CharHeight")); + // default paragraph text size + CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),3), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx") +{ + //fdo#76635 : Table borders are not getting preserved. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:val = 'single']",1); + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:sz = 4]", 1); + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:space = 0]", 1); + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:color = 808080]", 1); + + uno::Reference<beans::XPropertySet> xStyle( + getStyles("CharacterStyles")->getByName("Code Featured Element"), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", float(150), getProperty<float>(xStyle, "CharWeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testQuicktables, "quicktables.docx") +{ + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + + // These were missing in the Calendar3 table style. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:rFonts", "cstheme", "majorBidi"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:color", "themeTint", "80"); + CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeShade").equalsIgnoreAsciiCase("BF")); + + // Calendar4. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:pPr/w:snapToGrid", "val", "0"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:rPr/w:bCs", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd", "themeFill", "accent1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd", "themeFillShade", "80"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind", "rightChars", "0"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind", "right", "144"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcMar/w:bottom", "w", "86"); + + // LightList. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='LightList']/w:tblStylePr[@w:type='firstRow']/w:pPr/w:spacing", "before", "0"); + + // MediumList2-Accent1. + CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumList2-Accent1']/w:tblStylePr[@w:type='band1Vert']/w:tcPr/w:shd", "themeFillTint").equalsIgnoreAsciiCase("3F")); + + // MediumShading2-Accent5. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumShading2-Accent5']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:tcBorders/w:top", "color", "auto"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo71302, "fdo71302.docx") +{ + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + + // This got renamed to "Strong Emphasis" without a good reason. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Strong']", 1); +} + + +DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGrabBag(0); + xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty + + bool bTheme = false; + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) + { + if (prop.Name == "OOXTheme") + { + bTheme = true; + uno::Reference<xml::dom::XDocument> aThemeDom; + CPPUNIT_ASSERT(prop.Value >>= aThemeDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aThemeDom.get()); // Reference not empty + } + } + CPPUNIT_ASSERT(bTheme); // Grab Bag has all the expected elements + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); // One groupshape in the doc + + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xGroup->getCount()); // 1 rendered bitmap from the original shapes + + uno::Reference<beans::XPropertySet> xGroupPropertySet(getShape(1), uno::UNO_QUERY); + xGroupPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty + + bool bData = false, bLayout = false, bQStyle = false, bColor = false, bDrawing = false; + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) + { + if (prop.Name == "OOXData") + { + bData = true; + uno::Reference<xml::dom::XDocument> aDataDom; + CPPUNIT_ASSERT(prop.Value >>= aDataDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aDataDom.get()); // Reference not empty + } + else if (prop.Name == "OOXLayout") + { + bLayout = true; + uno::Reference<xml::dom::XDocument> aLayoutDom; + CPPUNIT_ASSERT(prop.Value >>= aLayoutDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aLayoutDom.get()); // Reference not empty + } + else if (prop.Name == "OOXStyle") + { + bQStyle = true; + uno::Reference<xml::dom::XDocument> aStyleDom; + CPPUNIT_ASSERT(prop.Value >>= aStyleDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aStyleDom.get()); // Reference not empty + } + else if (prop.Name == "OOXColor") + { + bColor = true; + uno::Reference<xml::dom::XDocument> aColorDom; + CPPUNIT_ASSERT(prop.Value >>= aColorDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aColorDom.get()); // Reference not empty + } + else if (prop.Name == "OOXDrawing") + { + bDrawing = true; + uno::Sequence< uno::Any > diagramDrawing; + uno::Reference<xml::dom::XDocument> aDrawingDom; + CPPUNIT_ASSERT(prop.Value >>= diagramDrawing); + CPPUNIT_ASSERT(diagramDrawing[0] >>= aDrawingDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aDrawingDom.get()); // Reference not empty + } + } + CPPUNIT_ASSERT(bData && bLayout && bQStyle && bColor && bDrawing); // Grab Bag has all the expected elements + + uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(0), uno::UNO_QUERY); + OUString nValue; + xPropertySet->getPropertyValue("Name") >>= nValue; + CPPUNIT_ASSERT_EQUAL(OUString("RenderedShapes"), nValue); // Rendered bitmap has the proper name +} + +DECLARE_OOXMLEXPORT_TEST(testFontNameIsEmpty, "font-name-is-empty.docx") +{ + // Check no empty font name is exported + // This test does not fail, if the document contains a font with empty name. + + xmlDocUniquePtr pXmlFontTable = parseExport("word/fontTable.xml"); + if (!pXmlFontTable) + return; + xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlFontTable, "/w:fonts/w:font"); + xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; + sal_Int32 length = xmlXPathNodeSetGetLength(pXmlNodes); + for(sal_Int32 index = 0; index < length; index++){ + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[index]; + OUString attrVal = OUString::createFromAscii(reinterpret_cast<char*>(xmlGetProp(pXmlNode, BAD_CAST("name")))); + if (attrVal.isEmpty()){ + CPPUNIT_FAIL("Font name is empty."); + } + } + xmlXPathFreeObject(pXmlObj); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMultiColumnLineSeparator, "multi-column-line-separator-SAVED.docx") +{ + // Check for the Column Separator value.It should be FALSE as the document does not contain separator line. + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols","sep","false"); +} + +DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx") +{ + // The problem was that item[n].xml and itemProps[n].xml and .rels files for item[n].xml + // files were missing from docx file after saving file. + // This test case tests whether customxml files grabbagged properly in correct object. + + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGrabBag(0); + xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty + bool CustomXml = false; + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) + { + if (prop.Name == "OOXCustomXml" || prop.Name == "OOXCustomXmlProps") + { + CustomXml = true; + uno::Reference<xml::dom::XDocument> aCustomXmlDom; + uno::Sequence<uno::Reference<xml::dom::XDocument> > aCustomXmlDomList; + CPPUNIT_ASSERT(prop.Value >>= aCustomXmlDomList); // PropertyValue of proper type + sal_Int32 length = aCustomXmlDomList.getLength(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), length); + aCustomXmlDom = aCustomXmlDomList[0]; + CPPUNIT_ASSERT(aCustomXmlDom.get()); // Reference not empty + } + } + CPPUNIT_ASSERT(CustomXml); // Grab Bag has all the expected elements +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomXmlRelationships, "customxml.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("customXml/_rels/item1.xml.rels"); + + // Check there is a relation to itemProps1.xml. + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship", 1); + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "itemProps1.xml"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69644, "fdo69644.docx") +{ + // The problem was that the exporter exported the table definition + // with only 3 columns, instead of 5 columns. + // Check that the table grid is exported with 5 columns + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx") +{ + // Import just crashed. + getParagraph(1, "Sample pages document."); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPgMargin, "testPgMargin.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", "1440"); +} + +DECLARE_OOXMLEXPORT_TEST(testImageCrop, "ImageCrop.docx") +{ + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); + css::text::GraphicCrop aGraphicCropStruct; + + imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct; + + CPPUNIT_ASSERT_EQUAL( sal_Int32( 2955 ), aGraphicCropStruct.Left ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 5477 ), aGraphicCropStruct.Right ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 2856 ), aGraphicCropStruct.Top ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 2291 ), aGraphicCropStruct.Bottom ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106974_int32Crop, "tdf106974_int32Crop.docx") +{ + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); + css::text::GraphicCrop aGraphicCropStruct; + + imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct; + + // The crop is constructed in GraphicProperties::pushToPropMap, where + // GraphicHelper::getOriginalSize tries to get graphic size in mm, then falls back to pixels, + // which are then converted to mm taking screen DPI scaling into account. Thus, the resulting + // values are DPI-dependent. + const double fXScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIX(); + + CPPUNIT_ASSERT_MESSAGE( + OString::number(aGraphicCropStruct.Right).getStr(), + 40470 * fXScaleFactor < aGraphicCropStruct.Right); +} + +DECLARE_OOXMLEXPORT_TEST(testLineSpacingexport, "test_line_spacing.docx") +{ + // The Problem was that the w:line attribute value in w:spacing tag was incorrect + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + CPPUNIT_ASSERT(xParaEnum->hasMoreElements()); + + // FIXME The test passes on most machines (including Linux x86_64 with gcc-4.7), but fails on various configs: + // Linux arm, Linux x86_64 with gcc-4.8 and Mac. Need to figure out what goes wrong and fix that. +#if 0 + style::LineSpacing alineSpacing = getProperty<style::LineSpacing>(xParaEnum->nextElement(), "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(13200), static_cast<sal_Int16>(alineSpacing.Height)); + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "line", "31680"); +#endif +} + +DECLARE_OOXMLEXPORT_TEST(testTextBoxGradientAngle, "fdo65295.docx") +{ + CPPUNIT_ASSERT_EQUAL(8, getShapes()); + + // Angle of frame#1 is 135 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame1(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame1, "FillStyle")); + awt::Gradient aGradient1 = getProperty<awt::Gradient>(xFrame1, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(135 * 10), aGradient1.Angle); + + // Angle of frame#2 is 180 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame2(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame2, "FillStyle")); + awt::Gradient aGradient2 = getProperty<awt::Gradient>(xFrame2, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(180 * 10), aGradient2.Angle); + + // Angle of frame#3 is 90 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame3(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame3, "FillStyle")); + awt::Gradient aGradient3 = getProperty<awt::Gradient>(xFrame3, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16( 90 * 10), aGradient3.Angle); + + // Angle of frame#4 is 225 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame4(getShape(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame4, "FillStyle")); + awt::Gradient aGradient4 = getProperty<awt::Gradient>(xFrame4, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(225 * 10), aGradient4.Angle); + + // Angle of frame#5 is 270 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame5(getShape(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame5, "FillStyle")); + awt::Gradient aGradient5 = getProperty<awt::Gradient>(xFrame5, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(270 * 10), aGradient5.Angle); + + // Angle of frame#6 is 315 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame6(getShape(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame6, "FillStyle")); + awt::Gradient aGradient6 = getProperty<awt::Gradient>(xFrame6, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(315 * 10), aGradient6.Angle); + + // Angle of frame#7 is 0 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame7(getShape(7), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame7, "FillStyle")); + awt::Gradient aGradient7 = getProperty<awt::Gradient>(xFrame7, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16( 0 * 10), aGradient7.Angle); + + // Angle of frame#8 is 45 degrees, but 'aGradient.Angle' holds value in 1/10 of a degree + uno::Reference<beans::XPropertySet> xFrame8(getShape(8), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame8, "FillStyle")); + awt::Gradient aGradient8 = getProperty<awt::Gradient>(xFrame8, "FillGradient"); + CPPUNIT_ASSERT_EQUAL(sal_Int16( 45 * 10), aGradient8.Angle); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCellGridSpan, "cell-grid-span.docx") +{ + // The problem was during export gridSpan value for 1st & 2nd cells for test document + // used to get set wrongly to 5 and 65532 respectively which was the reason for crash during save operation + // Verifying gridSpan element is not present in RoundTripped Document (As it's Default value is 1). + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:gridSpan",0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:gridSpan",0); +} +DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx") +{ + // The problem was after save file created by MS the direction changed to RTL. + uno::Reference<uno::XInterface> xParaLTRLeft(getParagraph( 1, "LTR LEFT")); + sal_Int32 nLTRLeft = getProperty< sal_Int32 >( xParaLTRLeft, "ParaAdjust" ); + // test the text Direction value for the pragraph + sal_Int16 nLRDir = getProperty< sal_Int32 >( xParaLTRLeft, "WritingMode" ); + + // this will test the both the text direction and alignment for paragraph + CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_LEFT), nLTRLeft); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLRDir); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParaAutoSpacing, "para-auto-spacing.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing","1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "afterAutospacing","1"); + + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", + "beforeAutospacing"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", + "afterAutospacing"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "before","400"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "after","400"); +} + +DECLARE_OOXMLEXPORT_TEST(testGIFImageCrop, "test_GIF_ImageCrop.docx") +{ + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); + css::text::GraphicCrop aGraphicCropStruct; + + imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct; + + // The crop is constructed in GraphicProperties::pushToPropMap, where + // GraphicHelper::getOriginalSize tries to get graphic size in mm, then falls back to pixels, + // which are then converted to mm taking screen DPI scaling into account. Thus, the resulting + // values are DPI-dependent. + const double fXScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIX(); + const double fYScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIY(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(1085 * fXScaleFactor, aGraphicCropStruct.Left, 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL(3651 * fXScaleFactor, aGraphicCropStruct.Right, 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL(953 * fYScaleFactor, aGraphicCropStruct.Top, 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1244 * fYScaleFactor, aGraphicCropStruct.Bottom, 1); +} + +DECLARE_OOXMLEXPORT_TEST(testPNGImageCrop, "test_PNG_ImageCrop.docx") +{ + /* The problem was image cropping information was not getting saved + * after roundtrip. + * Check for presence of cropping parameters in exported file. + */ + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); + css::text::GraphicCrop aGraphicCropStruct; + + imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct; + + // The crop is constructed in GraphicProperties::pushToPropMap, where + // GraphicHelper::getOriginalSize tries to get graphic size in mm, then falls back to pixels, + // which are then converted to mm taking screen DPI scaling into account. Thus, the resulting + // values are DPI-dependent. + const double fXScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIX(); + const double fYScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIY(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(1058 * fXScaleFactor, aGraphicCropStruct.Left, 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1111 * fXScaleFactor, aGraphicCropStruct.Right, 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1164 * fYScaleFactor, aGraphicCropStruct.Top, 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL(635 * fYScaleFactor, aGraphicCropStruct.Bottom, 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt") +{ + CPPUNIT_ASSERT_EQUAL(3, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // borderlessImage - image WITHOUT BORDERS : simulate padding with -crop + text::GraphicCrop crop = getProperty<text::GraphicCrop>(getShape(2), "GraphicCrop"); + CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 ); + CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right); + + // borderedImage - image WITH BORDERS : simulate padding with -crop + crop = getProperty<text::GraphicCrop>(getShape(3), "GraphicCrop"); + CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 ); + CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right); +} + +DECLARE_OOXMLEXPORT_TEST(testFootnoteParagraphTag, "testFootnote.docx") +{ + /* In footnotes.xml, the paragraph tag inside <w:footnote w:id="2"> was getting written into document.xml. + * Check for, paragraph tag is correctly written into footnotes.xml. + */ + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); + if (!pXmlFootnotes) + return; + assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]","id","2"); + assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r/w:footnoteRef", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSpacingLineRule,"table_lineRule.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "lineRule", "auto"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableLineSpacing, "table_atleast.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:spacing", "line", "320"); +} + +DECLARE_OOXMLEXPORT_TEST(testOoxmlTriangle, "ooxml-triangle.docx") +{ + // The problem was that ooxml-triangle shape type wasn't handled by VML + // export (only isosceles-triangle), leading to a missing shape. + getShape(1); +} + +DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") +{ + // The shape is red in Word2007, green in Word2010. Check that our import follows the later. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(getShape(1), "FillColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") +{ + // check default font theme values have been preserved + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi"); + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "cstheme", "minorBidi"); + + // check the font theme values in style definitions + assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia"); + + // check the color theme values in style definitions + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeColor", "accent1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeTint", "99"); + + // check direct format font theme values have been preserved + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "hAnsiTheme", "majorHAnsi"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "asciiTheme", "majorHAnsi"); + + // check theme font color value has been preserved + assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color", "themeColor", "accent3"); + OUString sThemeShade = getXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color", "themeShade"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xbf), sThemeShade.toInt32(16)); + + // check the themeFontLang values in settings file + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); + if (!pXmlSettings) + return; + assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "val", "en-US"); + assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "eastAsia", "zh-CN"); + assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "bidi", "he-IL"); + + // check fonts have been applied properly + sal_Unicode fontName[2]; //represents the string "宋体" + fontName[0] = 0x5b8b; + fontName[1] = 0x4f53; + CPPUNIT_ASSERT_EQUAL(OUString(fontName, 2), getProperty<OUString>(getParagraph(1), "CharFontNameAsian")); + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), + getProperty<OUString>(getParagraph(2), "CharFontNameComplex")); + CPPUNIT_ASSERT_EQUAL(OUString("Trebuchet MS"), + getProperty<OUString>(getParagraph(3, "Default style theme font"), "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString("Arial Black"), + getProperty<OUString>(getRun(getParagraph(4, "Direct format font"), 1), "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString("Trebuchet MS"), + getProperty<OUString>(getParagraph(5, "Major theme font"), "CharFontName")); + + // check the paragraph background pattern has been preserved including theme colors + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "val", "thinHorzStripe"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeFill", "text2"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeFillTint", "33"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeColor", "accent1"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeShade", "80"); +} + +DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // check cell theme colors have been preserved + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd", "themeFill", "accent6"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd", + "themeFillShade"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd", "themeFillTint", "33"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd", "themeFill", "accent6"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd", + "themeFillShade"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd", + "themeFillTint"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeFill", "accent6"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeFillShade", "80"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", + "themeFillTint"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "val", "horzStripe"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeColor", "accent3"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeTint", "33"); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "color", "E7EEEE"); + + // check table style has been preserved + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tblPr/w:tblStyle", "val", "Sombreadoclaro-nfasis1"); + // check table style is not overwritten by other properties + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:tcBorders/*", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[3]/w:tcPr/w:tcBorders/*", 0); + // check that one cell attribute present in the original document has been preserved + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/*", 1); + + // Check that w:cnfStyle row, cell and paragraph property is preserved. + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "val", "100000000000"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "firstRow", "1"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "lastRow", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "firstColumn", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "lastColumn", "0"); + + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "val", "001000000000"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "oddVBand", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "evenVBand", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "oddHBand", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "evenHBand", "0"); + + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "val", "100000000000"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "firstRowFirstColumn", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "firstRowLastColumn", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "lastRowFirstColumn", "0"); + assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "lastRowLastColumn", "0"); + +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcantSplit, "2_table_doc.docx") +{ + // if Split table value is true for a table then during export do not write <w:cantSplit w:val="false"/> + // in table row property,As default row prop is allow row to break across page. + // writing <w:cantSplit w:val="false"/> during export was causing problem that all the cell data used to come on same page + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:cantSplit",0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit","val","true"); +} + +DECLARE_OOXMLEXPORT_TEST(testDontSplitTable, "tdf101589_dontSplitTable.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + //single row tables need to prevent split by setting row to no split + CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]") ); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable (xTables->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xTable, "Split")); + + uno::Reference<table::XTableRows> xTableRows = xTable->getRows(); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xTableRows->getByIndex(0), "IsSplitAllowed")); +} + +DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx") +{ + // There was a problem for some documents during export.Invalid sectPr getting added + // because of faulty calculation of PageDesc value + // This was the reason for increasing number of pages after RT + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + // tdf126544 Styles were being added before their base/parent/inherited-from style existed, and so were using default settings. + uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles")); + uno::Reference<style::XStyle> xStyle(xParaStyles->getByName("Heading 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString("Heading Base"), xStyle->getParentStyle() ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcolumnbreak, "columnbreak.docx") +{ + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(5, "This is first line after col brk."), "BreakType")); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[1]/w:br", "type", "column"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGlossary, "testGlossary.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/glossary/document.xml"); + assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", "w14 wp14"); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx") +{ + // crashtest +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCrashWhileSave, "testCrashWhileSave.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle", "val").match("Normal")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.docx") +{ + // Docx containing Floating table with formula was giving "General input/output error" while opening in LibreOffice + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal"); + + // let's also assert that the formula was exported properly + assertXPathContent(pXmlDoc, "//w:tbl/w:tr/w:tc[2]/w:p/m:oMathPara/m:oMath/m:sSubSup/m:e/m:r/m:t", u"\u03C3"); +} + +DECLARE_OOXMLEXPORT_TEST(testSingleCellTableBorders, "tdf124399_SingleCellTableBorders.docx") +{ + // tdf#124399: Extra borders on single cell tables fixed. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top [@w:val = 'nil']", 1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testInsideBorders, "tdf129242_InsideBorders.docx") +{ + // tdf#129242: Don't remove inside borders if the table has more than one cells. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // If this is not 0, then inside borders are removed. + assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testRightBorder, "tdf129442_RightBorder.docx") +{ + // tdf#129442: Right border of a one column table was missing. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // If the right border is missing like in the bug, then there is a <w:right w:val="nil" /> tag in tcBorders. + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:tcPr/w:tcBorders/w:end [@w:val = 'nil']", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testBottomBorder, "tdf129450_BottomBorder.docx") +{ + // tdf#129450: Missing bottom border in one row table. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // If there is no bottom border, it is shown in tcBorders. + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testBottomBorders, "tdf129452_BottomBorders.docx") +{ + // tdf#129452: Do not omit bottom borders when a column in a table is vertically merged and + // the inside borders are turned off. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testFontTypes, "tdf120344_FontTypes.docx") +{ + // tdf#120344: Font type of numbering symbols can be different than the font type of the text. + + // Check the font type of the text, should be Consolas. + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/w:rPr/w:rFonts [@w:ascii='Consolas']", 1); + + // Now the font type of the numbering symbols, should be Arial Black. + xmlDocUniquePtr qXmlDocument = parseExport("word/numbering.xml"); + if (!qXmlDocument) + return; + assertXPath(qXmlDocument, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:rPr/w:rFonts [@w:ascii='Arial Black']", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testNumberingLevels, "tdf95495.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // tdf#95495: set list level of the custom style based on the setting of the parent style + // [this assertXPath is not a very good test, since the numbering definition is not set on the paragraph itself, + // but in a style. This just tests the current copy-to-paragraph implementation. But leaving it for now, + // since this example is very much a corner case, so anyone trespassing here should double-check everything...] + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:numPr/w:ilvl [@w:val = '1']", 1); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "//body/txt[5]/LineBreak", "Line", "A.2.1 .DESCRIPTION"); +} + +DECLARE_OOXMLEXPORT_TEST(testVerticalBorders, "calendar3.docx") +{ + // tdf#130799: Inside vertical borders of a table should not be missing. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + // Left and right borders. + assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2); +} + +DECLARE_OOXMLEXPORT_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx") +{ + // tdf#100751: Both x and y flip should happen. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + OUString arrowStyle = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group/v:shape[2]", "style"); + CPPUNIT_ASSERT(arrowStyle.indexOf(u"flip:xy") != sal_Int32(-1)); +} + +DECLARE_OOXMLEXPORT_TEST(testArrowPosition, "tdf104565_ArrowPosition.docx") +{ + // tdf#104565: Test correct position. + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // This is the correct Y coordinate, the incorrect was 817880. + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/wp:positionV/wp:posOffset", "516255"); +} + +DECLARE_OOXMLEXPORT_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx") +{ + // tdf#123346: Check arrow marker. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", "arrow"); +} + +DECLARE_OOXMLEXPORT_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth.odt") +{ + // tdf#92526: Make sure that line with stays 0. + xmlDocUniquePtr pXml = parseExport("word/document.xml"); + if (!pXml) + return; + + // "w" attribute was not exported. + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing" + "/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "0"); +} + +DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromLeftMargin, "tdf132976_testRelativeAnchorWidthFromLeftMargin.docx") +{ + // TODO: Fix export. + if (mbExported) + return; + + // tdf#132976 The size of the width of this shape should come from the size of the left margin. + // It was set to the size of the width of the entire page before. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + const sal_Int32 nAnchoredWidth + = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1133), nAnchoredWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromInsideOutsideMargin, "tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx") +{ + // TODO: Fix export. + if (mbExported) + return; + + // tdf#133863 tdf#133864 The sizes of the width of these shapes depend on the sizes of the inside and outside margins. + // The open book: outside --text-- inside | inside --text-- outside + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // Outside + sal_Int32 nAnchoredWidth = getXPath(pXmlDoc, "(//SwAnchoredDrawObject)[1]/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2552), nAnchoredWidth); + // Inside + nAnchoredWidth = getXPath(pXmlDoc, "(//SwAnchoredDrawObject)[2]/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1440), nAnchoredWidth); + // Inside + nAnchoredWidth = getXPath(pXmlDoc, "(//SwAnchoredDrawObject)[3]/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1440), nAnchoredWidth); + // Outside + nAnchoredWidth = getXPath(pXmlDoc, "(//SwAnchoredDrawObject)[4]/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2552), nAnchoredWidth); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx new file mode 100644 index 000000000..c6cb3c351 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -0,0 +1,1302 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/XTextField.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/text/XTextColumns.hpp> +#include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/util/Date.hpp> +#include <unotools/tempfile.hxx> +#include <config_features.h> +#include <comphelper/configuration.hxx> +#include <officecfg/Office/Writer.hxx> + + +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 { + const char* aBlacklist[] = { + "math-escape.docx", + "math-mso2k7.docx", + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end()); + } + + virtual std::unique_ptr<Resetter> preTest(const char* filename) override + { + if (OString(filename) == "combobox-control.docx" ) + { + std::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(true, batch); + batch->commit(); + } + return nullptr; + } + + void verifyComboBoxExport(bool aComboBoxAsDropDown); +}; + +DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + // This was text::RelOrientation::FRAME, when handling relativeFrom=page, align=right + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "HoriOrientRelation")); + + uno::Reference<drawing::XShapes> xGroup(xShape, uno::UNO_QUERY); + // This resulted in lang::IndexOutOfBoundsException, as nested groupshapes weren't handled. + uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); + + // Right after import we get a rounding error: 8662 vs 8664. + if (mbExported) + { + uno::Reference<drawing::XShape> xYear(xGroup->getByIndex(1), uno::UNO_QUERY); + // This was 2, due to incorrect handling of parent transformations inside DML groupshapes. + CPPUNIT_ASSERT_EQUAL(sal_Int32(8664), xYear->getSize().Width); + } +} + +DECLARE_OOXMLEXPORT_TEST(testBezier, "bezier.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Check that no shape got lost: a bezier, a line and a text shape. + CPPUNIT_ASSERT_EQUAL(3, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeTextbox, "groupshape-textbox.docx") +{ + uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY); + // The VML export lost text on textboxes inside groupshapes. + // The DML export does not, make sure it stays that way. + CPPUNIT_ASSERT_EQUAL(OUString("first"), xShape->getString()); + // This was 16, i.e. inheriting doc default char height didn't work. + CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(xShape, "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapePicture, "groupshape-picture.docx") +{ + // Picture in the groupshape got lost, groupshape had only one child. + uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GraphicObjectShape"), xShapeDescriptor->getShapeType()); +} + +DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx") +{ + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "TextAutoGrowHeight")); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(2), "TextAutoGrowHeight")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedParagraphMark, "testTrackChangesInsertedParagraphMark.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedTableRow, "testTrackChangesDeletedTableRow.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:del"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedTableRow, "testTrackChangesInsertedTableRow.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedTableCell, "testTrackChangesDeletedTableCell.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellDel"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedTableCell, "testTrackChangesInsertedTableCell.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellIns"); +} + +DECLARE_OOXMLEXPORT_TEST(testTextBoxPictureFill, "textbox_picturefill.docx") +{ + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); + auto xBitmap = getProperty<uno::Reference<awt::XBitmap>>(xFrame, "FillBitmap"); + CPPUNIT_ASSERT(xBitmap.is()); + uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY); + CPPUNIT_ASSERT(xGraphic.is()); + Graphic aGraphic(xGraphic); + CPPUNIT_ASSERT(!aGraphic.IsNone()); + CPPUNIT_ASSERT(aGraphic.GetSizeBytes() > 0L); + CPPUNIT_ASSERT_EQUAL(447L, aGraphic.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(528L, aGraphic.GetSizePixel().Height()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO73034, "FDO73034.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:u", "val").match("single")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO71834, "fdo71834.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesParagraphProperties, "testTrackChangesParagraphProperties.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx") +{ + if (!mbExported) + return; + + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xGroup->getByIndex(0), "CustomShapeGeometry"); + OUString aType; + for (beans::PropertyValue const & prop : aProps) + if (prop.Name == "Type") + aType = prop.Value.get<OUString>(); + // This was exported as borderCallout90, which is an invalid drawingML preset shape string. + CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + // This was wrap="none". + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts"); +} + +DECLARE_OOXMLEXPORT_TEST(testPageRelSize, "pagerelsize.docx") +{ + // First shape: width is relative from page, but not height. + uno::Reference<drawing::XShape> xShape = getShape(1); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeWidthRelation")); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation")); + + // Second shape: height is relative from page, but not height. + xShape = getShape(2); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation")); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xShape, "RelativeWidthRelation")); +} + +DECLARE_OOXMLEXPORT_TEST(testRelSizeRound, "rel-size-round.docx") +{ + // This was 9: 9.8 was imported as 9 instead of being rounded to 10. + CPPUNIT_ASSERT_EQUAL(sal_Int16(10), getProperty<sal_Int16>(getShape(1), "RelativeHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testTestTitlePage, "testTitlePage.docx") +{ + // this has 2 pages in Word + CPPUNIT_ASSERT_EQUAL(OUString("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), parseDump("/root/page[2]/footer/txt/text()")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableRowDataDisplayedTwice,"table-row-data-displayed-twice.docx") +{ + // fdo#73534: There was a problem for some documents during export.Invalid sectPr getting added + // because of wrong condition in code. + // This was the reason for increasing number of pages after RT + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73556,"fdo73556.docx") +{ + /* + * The file contains a table with 3 columns + * the gridcols are as follows: {1210, 1331, 1210} + * whereas the individual cells have {1210, 400, 1210} + * The table column separators were taken from the Grid, while + * the table width was calculated as 2820 from cells instead + * of 3751 from the Grid. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 3); + sal_Int32 tableWidth = 0; + tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[1]", "w").toInt32(); + tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32(); + tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[3]", "w").toInt32(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3751), tableWidth); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx") +{ + // fdo#74499 + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32()); + + // tdf#106572 - preventative test matching danger conditions, but imported OK anyway + CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo69656, "Table_cell_auto_width_fdo69656.docx") +{ + // Changed the UT to check "dxa" instead of "auto" + // For this particular issue file few cells have width type "auto" + // LO supports VARIABLE and FIXED width type. + // If type is VARIABLE LO calculates width as percent of PageSize + // Else if the width is fixed it uses the width value. + // After changes for fdo76741 the fixed width is exported as "dxa" for DOCX + + // Check for the width type of table and its cells. + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW","type","dxa"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76741, "fdo76741.docx") +{ + + // There are two issue related to table in the saved(exported) file + // - the table alignment in saved file is "left" instead of "center" + // - the table width type in properties is "auto" instead of "dxa" + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "//w:jc", "val", "center"); + assertXPath(pXmlDoc, "//w:tblW", "w", "10081"); + assertXPath(pXmlDoc, "//w:tblW", "type", "dxa"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73541,"fdo73541.docx") +{ + // fdo#73541: The mirrored margins were not imported and mapped correctly in Page Layout + // Hence <w:mirrorMargins /> tag was not exported back in settings.xml + xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); + assertXPath(pXmlDoc, "/w:settings/w:mirrorMargins"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo106029,"fdo106029.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO74106, "FDO74106.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val","hebrew1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO74215, "FDO74215.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + // tdf#106849 NumPicBullet xShape should not be resized. + + // This is dependent on the running system: see MSWordExportBase::BulletDefinitions + // FIXME: the size of a bullet is defined by GraphicSize property + // (stored in SvxNumberFormat::aGraphicSize) so use that for the size + // (properly convert from 100mm to pt (1 inch is 72 pt, 1 pt is 20 twips). + + // On 96 DPI "width:11.25pt;height:11.25pt"; on 120 DPI "width:9pt;height:9pt" + const OUString sStyle + = getXPath(pXmlDoc, "/w:numbering/w:numPicBullet[2]/w:pict/v:shape", "style"); + { + const OUString sWidth = sStyle.getToken(0, ';'); + CPPUNIT_ASSERT(sWidth.startsWith("width:")); + CPPUNIT_ASSERT(sWidth.endsWith("pt")); + const double fWidth = sWidth.copy(6, sWidth.getLength() - 8).toDouble(); + const double fXScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIX(); + // note: used to fail on Mac with 14.7945205479452 vs. 14.8 + // note: used to fail on another Mac with 12.1348314606742 vs 12.15 + CPPUNIT_ASSERT_DOUBLES_EQUAL(11.25 * fXScaleFactor, fWidth, 0.1); + } + { + const OUString sHeight = sStyle.getToken(1, ';'); + CPPUNIT_ASSERT(sHeight.startsWith("height:")); + CPPUNIT_ASSERT(sHeight.endsWith("pt")); + const double fHeight = sHeight.copy(7, sHeight.getLength() - 9).toDouble(); + const double fYScaleFactor = 96.0 / Application::GetDefaultDevice()->GetDPIY(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(11.25 * fYScaleFactor, fHeight, 0.1); + } +} + +DECLARE_OOXMLEXPORT_TEST(testColumnBreak_ColumnCountIsZero,"fdo74153.docx") +{ + /* fdo73545: Column Break with Column_count = 0 was not getting preserved. + * The <w:br w:type="column" /> was missing after roundtrip + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + if (pXmlDoc) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br","type","column"); + + //tdf76349 match Word's behavior of treating breaks in single columns as page breaks. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90697_complexBreaksHeaders,"tdf90697_complexBreaksHeaders.docx") +{ +// This is a complex document using many types of section breaks and re-defined headers. +// Paragraphs 44-47 were in two columns + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(45), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + +// after that, the section break should switch things back to one column. + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(50), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testIndentation, "test_indentation.docx") +{ + // fdo#74141 :There was a problem that in style.xml and document.xml in <w:ind> tag "right" & "left" margin + // attributes gets added(w:right=0 & w:left=0) if these attributes are not set in original document. + // This test is to verify <w:ind> does not contain w:right attribute. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:ind", "end"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, "chart-in-footer.docx") +{ + // fdo#73872: document contains chart in footer. + // The problem was that footer1.xml.rels files for footer1.xml + // files were missing from docx file after roundtrip. + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/footer1.xml.rels"); + + // Check footer1.xml.rels contains in doc after roundtrip. + // Check Id = rId1 in footer1.xml.rels + assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship","Id","rId1"); + assertXPath(pXmlDoc, + "/rels:Relationships/rels:Relationship[@Id='rId1']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"); + + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); + assertXPath(pXmlDocCT, + "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']", + "ContentType", + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"); + + // check the content too + xmlDocUniquePtr pXmlDocFooter1 = parseExport("word/footer1.xml"); + assertXPath(pXmlDocFooter1, + "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData", + "uri", + "http://schemas.openxmlformats.org/drawingml/2006/chart"); + assertXPath(pXmlDocFooter1, + "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/c:chart", + "id", + "rId1"); + + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); +} + +DECLARE_OOXMLEXPORT_TEST(testNestedTextFrames, "nested-text-frames.odt") +{ + CPPUNIT_ASSERT_EQUAL(3, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // First problem was LO crashed during export (crash test) + + // Second problem was LO made file corruption, writing out nested text boxes, which can't be handled by Word. + // Test that all three exported text boxes are anchored to the same paragraph and not each other. + uno::Reference<text::XTextContent> xTextContent(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xRange = xTextContent->getAnchor(); + uno::Reference<text::XText> xText = xRange->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); + + xTextContent.set(getShape(2), uno::UNO_QUERY); + xRange = xTextContent->getAnchor(); + xText = xRange->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); + + xTextContent.set(getShape(3), uno::UNO_QUERY); + xRange = xTextContent->getAnchor(); + xText = xRange->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testFloatingTablePosition, "floating-table-position.docx") +{ + // Position of shape was wrong, because some conversion was missing. + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + // This was 3295. + CPPUNIT_ASSERT_EQUAL(sal_Int32(5964), getProperty<sal_Int32>(xShape, "HoriOrientPosition")); + // This was 4611. + CPPUNIT_ASSERT_EQUAL(sal_Int32(8133), getProperty<sal_Int32>(xShape, "VertOrientPosition")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbi11739, "abi11739.docx") +{ + // Validation test: order of elements were wrong. + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + // Order was: uiPriority, link, basedOn. + CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "basedOn") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "link")); + CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "link") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "uiPriority")); + // Order was: qFormat, unhideWhenUsed. + CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[11]", "unhideWhenUsed") < getXPathPosition(pXmlDoc, "/w:styles/w:style[11]", "qFormat")); +} + +DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx") +{ + // check there are two objects and they are FrameShapes + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), getShape(1)->getShapeType()); + CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), getShape(2)->getShapeType()); + + // check the objects are present in the exported document.xml + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:object", 2); + + // finally check the embedded files are present in the zipped document + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + const uno::Sequence<OUString> names = xNameAccess->getElementNames(); + int nSheetFiles = 0; + int nImageFiles = 0; + for (OUString const & n : names) + { + if(n.startsWith("word/embeddings/oleObject")) + nSheetFiles++; + if(n.startsWith("word/media/image")) + nImageFiles++; + } + CPPUNIT_ASSERT_EQUAL(2, nSheetFiles); + CPPUNIT_ASSERT_EQUAL(2, nImageFiles); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedLists_StartingWithZero, "FDO74105.docx") +{ + /* Issue : Numbered lists Starting with value '0' is not preserved after RT. + * In numbering.xml, an XML tag <w:start> is optional. If not mentioned, + * the Numbered list should start from 0. + * Problem was LO was writing <w:start> for all levels 0-8 with default value "1". + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + + // Check that we do _not_ export w:start for <w:lvl w:ilvl="0">. + assertXPath(pXmlDoc, "w:numbering/w:abstractNum[1]/w:lvl[1]/w:start", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreak,"fdo74566.docx") +{ + /* Break to next page was written into wrong paragraph as <w:pageBreakBefore />. + * LO was not preserving Page Break as <w:br w:type="page" />. + * Now after fix , LO writes Page Break as the new paragraph and also + * preserves the xml tag <w:br>. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + uno::Reference<text::XTextRange> xParagraph2 = getParagraph(2); + uno::Reference<text::XTextRange> xParagraph4 = getParagraph(4); + + getRun(xParagraph2, 1, "First Page Second Line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:br","type","page"); + getRun(xParagraph4, 1, "Second Page First line after Page Break"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleObject, "test_ole_object.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata", + "o:title"); + assertXPath(pXmlDoc, + "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject", + "DrawAspect", + "Content"); + // TODO: ProgID="Package" - what is this? Zip with 10k extra header? + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.bin']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + // check the media type too + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); + assertXPath(pXmlDocCT, + "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']", + "ContentType", + "application/vnd.openxmlformats-officedocument.oleObject"); + +} + +DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx") +{ + /* + * fdo#74792 : The images associated with smart-art data[i].xml + * were not preserved on exporting to DOCX format + * Added support to grabbag the rels, with associated images. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/diagrams/_rels/data1.xml.rels"); + if(!pXmlDoc) + return; + assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship", 4); + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL( + comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + + //check that images are also saved + OUString const sImageFile( "word/media/OOXDiagramDataRels1_0.jpeg" ); //added anchor id to form a unique name + uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName( sImageFile ), uno::UNO_QUERY); + CPPUNIT_ASSERT( xInputStream.is() ); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx") +{ + //in case of multiple smart arts the names for images were getting + //repeated and thereby causing a data loss as the binary stream was + //getting over written. This test case ensures that unique names are + //given for images in different smart arts. + xmlDocUniquePtr pXmlDataRels1 = parseExport("word/diagrams/_rels/data1.xml.rels"); + if( !pXmlDataRels1 ) + return; + + xmlDocUniquePtr pXmlDataRels2 = parseExport("word/diagrams/_rels/data2.xml.rels"); + if( !pXmlDataRels2 ) + return; + + //ensure that the rels file is present. + assertXPath(pXmlDataRels1,"/rels:Relationships/rels:Relationship", 4); + assertXPath(pXmlDataRels2,"/rels:Relationships/rels:Relationship", 4); + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL( + comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + + //check that images are also saved + OUString const sImageFile1( "word/media/OOXDiagramDataRels1_0.jpeg" ); //added anchor id to form a unique name + uno::Reference<io::XInputStream> xInputStream1(xNameAccess->getByName( sImageFile1 ), uno::UNO_QUERY); + CPPUNIT_ASSERT( xInputStream1.is() ); + + //check that images are saved for other smart-arts as well. + OUString const sImageFile2( "word/media/OOXDiagramDataRels2_0.jpeg" ); //added anchor id to form a unique name + uno::Reference<io::XInputStream> xInputStream2(xNameAccess->getByName( sImageFile2 ), uno::UNO_QUERY); + CPPUNIT_ASSERT( xInputStream2.is() ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCurruption, "tableCurrupt.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); + CPPUNIT_ASSERT(pXmlDoc) ; + assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]",1); + + // tdf#116549: header paragraph should not have a bottom border. + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("First Page"), "HeaderText"); + table::BorderLine2 aHeaderBottomBorder = getProperty<table::BorderLine2>( getParagraphOfText( 1, xHeaderText ), "BottomBorder"); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aHeaderBottomBorder.LineWidth); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDateControl, "date-control.docx") +{ + // check XML + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", "2014-03-05T00:00:00Z"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "dddd, dd' de 'MMMM' de 'yyyy"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid", "val", "es-ES"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u"mi\u00E9rcoles, 05 de marzo de 2014"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf115030, "tdf115030.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + sal_Unicode aDot = {0x02D9}; + sal_Unicode aDobleDot = {0x00A8}; + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:acc/m:accPr/m:chr", "val", OUString(aDot)); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[2]/m:acc/m:accPr/m:chr", "val", OUString(aDobleDot)); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/m:oMathPara/m:oMath[1]/m:acc/m:accPr/m:chr", "val", OUString(aDot)); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_OpeningBrace, "2120112713_OpenBrace.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Checking for OpeningBrace tag + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[1]/m:dPr[1]/m:begChr[1]","val",""); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf132305, "tdf132305.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:bar/m:barPr/m:pos","val","top"); +} + +// Checks that all runs of the field have text properties. +// Old behaviour: only first run has text properties of the field +// +// There are several runs are used in fields: +// <w:r> +// <w:rPr> +// <!-- properties written with DocxAttributeOutput::StartRunProperties() / DocxAttributeOutput::EndRunProperties(). +// </w:rPr> +// <w:fldChar w:fldCharType="begin" /> +// </w:r> +// <w:r> +// <w:rPr> +// <!-- properties written with DocxAttributeOutput::DoWriteFieldRunProperties() +// </w:rPr> +// <w:instrText>TIME \@"HH:mm:ss"</w:instrText> +// </w:r> +// <w:r> +// <w:rPr> +// <!-- properties written with DocxAttributeOutput::DoWriteFieldRunProperties() +// </w:rPr> +// <w:fldChar w:fldCharType="separate" /> +// </w:r> +// <w:r> +// <w:rPr> +// <!-- properties written with DocxAttributeOutput::DoWriteFieldRunProperties() +// </w:rPr> +// <w:t>14:01:13</w:t> +// </w:r> +// <w:r> +// <w:rPr> +// <!-- properties written with DocxAttributeOutput::DoWriteFieldRunProperties() +// </w:rPr> +// <w:fldChar w:fldCharType="end" /> +// </w:r> +// See, tdf#38778 +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf38778, "tdf38778_properties_in_run_for_field.doc") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + const OUString psz("20"); + const OUString pszCs("20"); + + // w:fldCharType="begin" + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz", "val", psz); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:szCs", "val", pszCs); + + // PAGE + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:rPr/w:sz", "val", psz); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:rPr/w:szCs", "val", pszCs); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:instrText", " PAGE "); + + // w:fldCharType="separate" + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr/w:sz", "val", psz); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr/w:szCs", "val", pszCs); + + // field result: 1 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:rPr/w:sz", "val", psz); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:rPr/w:szCs", "val", pszCs); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:t", "1"); // field result + + // w:fldCharType="end" + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:sz", "val", psz); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:szCs", "val", pszCs); + + // tdf#127862: page fill color (in this case white) was lost + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT(drawing::FillStyle_NONE != getProperty<drawing::FillStyle>(xStyle, "FillStyle")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76312, "FDO76312.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]"); +} + +void Test::verifyComboBoxExport(bool aComboBoxAsDropDown) +{ + if (aComboBoxAsDropDown) + { + // ComboBox was imported as DropDown text field + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + uno::Any aField = xFields->nextElement(); + uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown")); + + uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(aField, "Items"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aItems.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]); + CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), aItems[2]); + } + else + { + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + uno::Reference<drawing::XControlShape> xControl(xShape, uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), getProperty<OUString>(xControl->getControl(), "Text")); + + uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(xControl->getControl(), "StringItemList"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]); + CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, "combobox-control.docx") +{ + // check XML + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", "manolo"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", "pepito"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "Manolo"); + + // check imported control + verifyComboBoxExport(getShapes() == 0); +} + +CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_true) +{ + std::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(true, batch); + batch->commit(); + + load(mpTestDocumentPath, "combobox-control.docx"); + verifyComboBoxExport(true); +} + +CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_false) +{ + std::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(false, batch); + batch->commit(); + + load(mpTestDocumentPath, "combobox-control.docx"); + verifyComboBoxExport(false); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCheckBoxControl, "checkbox-control.docx") +{ + // check XML + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", "val", "2612"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", "val", "2610"); + + // TODO: import control and add a check here +} + +DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, "paragraphWithComments.docx") +{ + /* Comment id's were getting overwritten for annotation mark(s), + which was causing a mismatch in the relationship for comment id's + in document.xml and comment.xml + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml"); + if(!pXmlDoc) + return; + + sal_Int32 idInDocXml = getXPath(pXmlDoc,"/w:document/w:body/w:p[3]/w:commentRangeEnd[1]","id").toInt32(); + sal_Int32 idInCommentXml = getXPath(pXmlComm,"/w:comments/w:comment[1]","id").toInt32(); + CPPUNIT_ASSERT_EQUAL( idInDocXml, idInCommentXml ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104707_urlComment, "tdf104707_urlComment.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + auto aField1 = xFields->nextElement(); + // the comment/annotation/postit text + auto xText = getProperty< uno::Reference<text::XText> >(aField1, "TextRange"); + // the hyperlink within the comment text + auto xURLField = getProperty< uno::Reference<text::XTextField> >(xText, "TextField"); + auto aURL = getProperty< OUString >(xURLField, "URL"); + CPPUNIT_ASSERT_EQUAL(OUString("https://bugs.documentfoundation.org/show_bug.cgi?id=104707"), aURL); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") +{ + // fdo#76015 : Document contains oleobject in header xml. + // Problem was relationship entry for oleobject from header was + // exported into document.xml.rels file because of this rels file + // for headers were missing from document/word/rels. + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/header1.xml.rels"); + + assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship[1]","Id","rId1"); + + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); + + // check the media type too + assertXPath(pXmlDocCT, + "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']", + "ContentType", + "application/vnd.openxmlformats-officedocument.oleObject"); + + // check the content too + xmlDocUniquePtr pXmlDocHeader1 = parseExport("word/header1.xml"); + assertXPath(pXmlDocHeader1, + "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Word.Picture.8"); + xmlDocUniquePtr pXmlDocHeader2 = parseExport("word/header2.xml"); + assertXPath(pXmlDocHeader2, + "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Word.Picture.8"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_ClosingBrace, "2120112713.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Checking for ClosingBrace tag + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[2]/m:dPr[1]/m:endChr[1]","val",""); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testlvlPicBulletId, "lvlPicBulletId.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtContent, "SdtContent.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + assertXPath(pXmlDoc, "/w:hdr[1]/w:sdt[1]/w:sdtContent[1]/w:p[1]/w:del[1]"); +} + +#if 0 +// Currently LibreOffice exports custom geometry for this up arrow, not preset shape. +// When LibreOffice can export preset shape with correct modifiers, then this test can be re-enabled. + +DECLARE_OOXMLEXPORT_TEST(testFdo76016, "fdo76016.docx") +{ + // check XML + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "//a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1"); + assertXPath(pXmlDoc, "//a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", "adj2"); +} +#endif + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileWithInvalidImageLink, "FileWithInvalidImageLink.docx") +{ + /* In case if the original file has an image whose link is + invalid, then the RT file used to result in corruption + since the exported image would be an empty image. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathNoAttribute(pXmlDoc, + "/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/" + "a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", + "embed"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeDOCX, "fdo80410.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.docx']", + "ContentType", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docx']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[6]/w:r/w:object/o:OLEObject", + "ProgID", + "Word.Document.12"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeXLSM, "fdo76098.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "ContentType", "application/vnd.ms-excel.sheet.macroEnabled.12"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocChart1 = parseExport("word/charts/chart1.xml"); + assertXPath(pXmlDocChart1, + "/c:chartSpace/c:externalData", + "id", + "rId1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76108, "test76108.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + //docx file after RT is getting corrupted. + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]", "fldCharType", "begin"); +} + +DECLARE_OOXMLEXPORT_TEST(testTCTagMisMatch, "TCTagMisMatch.docx") +{ + // TCTagMisMatch.docx : This document contains an empty table with borders. + // there was a TC tag mismatch which resulted into a crash. + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + if(!pXmlDoc) + return; + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]",0); + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78292, "FDO78292.docx") +{ + //text node is a leaf node, it should not have any children + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSimpleSdts, "simple-sdts.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:id", 3); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:picture", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:group", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:citation", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xls']", + "ContentType", + "application/vnd.ms-excel"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xls']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p/w:r/w:object/o:OLEObject", + "ProgID", + "Excel.Chart.8"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf83227, "tdf83227.docx") +{ + // Bug document contains a rotated image, which is handled as a draw shape (not as a Writer image) on export. + if (!mbExported) + return; + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.png"))); + // This was also true, image was written twice. + CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/image2.png"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103001, "tdf103001.docx") +{ + // The same image is featured in the header and in the body text, make sure + // the header relation is still written, even when caching is enabled. + if (!mbExported) + return; + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + // This failed: header reused the RelId of the body text, even if RelIds + // are local to their stream. + CPPUNIT_ASSERT(xNameAccess->hasByName("word/_rels/header1.xml.rels")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + // There should be a section break that's in the middle of the document: right after the table. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx") +{ + // the problem was: file is truncated: the first page is missing. + // More precisely, the table in the first page was clipped. + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nFlyPrtHeight = getXPath(pXmlDoc, "(/root/page[1]//fly)[1]/infos/prtBounds", "height").toInt32(); + sal_Int32 nTableHeight = getXPath(pXmlDoc, "(/root/page[1]//fly)[1]/tab/infos/bounds", "height").toInt32(); + CPPUNIT_ASSERT_MESSAGE("The table is clipped in a fly frame.", nFlyPrtHeight >= nTableHeight); + } + + // check how much pages we have: it should match the Word layout result + CPPUNIT_ASSERT_EQUAL(11, getPages()); + + // check content of the first page + { + uno::Reference<beans::XPropertySet> xFrame(getShapeByName("Marco1"), uno::UNO_QUERY); + + // no border + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xFrame, "LineWidth")); + } + + // Make sure we have 19 tables created + { + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(19), xTables->getCount( )); + + // check the text inside first cell of the first table + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + + const OUString aMustHaveText = "Requerimientos del Cliente"; + const OUString aActualText = xCell->getString(); + + CPPUNIT_ASSERT(aActualText.indexOf(aMustHaveText) > 0); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf99090_pgbrkAfterTable, "tdf99090_pgbrkAfterTable.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + // There should be a regular page break that's in the middle of the document: right after the table. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf96750_landscapeFollow, "tdf96750_landscapeFollow.docx") +{ + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle, "IsLandscape")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf86926_A3, "tdf86926_A3.docx") +{ + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(42000), getProperty<sal_Int32>(xStyle, "Height")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(29700), getProperty<sal_Int32>(xStyle, "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf64372_continuousBreaks,"tdf64372_continuousBreaks.docx") +{ + //There are no page breaks, so everything should be on the first page. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92724_continuousBreaksComplex,"tdf92724_continuousBreaksComplex.docx") +{ + //There are 2 page breaks, so there should be 3 pages. + CPPUNIT_ASSERT_EQUAL(3, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90697_continuousBreaksComplex2,"tdf92724_continuousBreaksComplex2.docx") +{ +// Continuous section breaks with new headers/footers should not immediately switch to a new page style. + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + + sal_Int16 nPages = xCursor->getPage(); + while( nPages > 0 ) + { + OUString sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); +// Specific case to avoid. Testing separately (even though redundant). +// The first header (defined on page 3) ONLY is shown IF the section happens to start on a new page (which it doesn't in this document). + CPPUNIT_ASSERT( xHeaderText->getString() != "Third section - First page header. No follow defined" ); +// Same test stated differently: Pages 4 and 5 OUGHT to use "Second section header", but currently don't. Page 6 does. + if( nPages <= 3 ) + CPPUNIT_ASSERT_EQUAL( OUString("First section header"), xHeaderText->getString() ); + else + CPPUNIT_ASSERT( xHeaderText->getString() == "First section header" || xHeaderText->getString() == "Second section header" ); + + xCursor->jumpToPage( --nPages ); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95367_inheritFollowStyle, "tdf95367_inheritFollowStyle.docx") +{ + CPPUNIT_ASSERT_EQUAL(OUString("header"), parseDump("/root/page[2]/header/txt/text()")); +} + +DECLARE_OOXMLEXPORT_TEST(testInheritFirstHeader,"inheritFirstHeader.docx") +{ +// First page headers always link to last used first header, never to a follow header + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + + xCursor->jumpToLastPage(); + OUString sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); + CPPUNIT_ASSERT_EQUAL( OUString("Last Header"), xHeaderText->getString() ); + + xCursor->jumpToPreviousPage(); + sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); + xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); + CPPUNIT_ASSERT_EQUAL( OUString("First Header"), xHeaderText->getString() ); + + xCursor->jumpToPreviousPage(); + sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); + xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); + CPPUNIT_ASSERT_EQUAL( OUString("Follow Header"), xHeaderText->getString() ); +} + +#if HAVE_MORE_FONTS +DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original,"tdf81345.docx") +{ + //Header wasn't replaced and columns were missing because no new style was created. + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + + xCursor->jumpToLastPage(); + OUString pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + CPPUNIT_ASSERT(pageStyleName != "Standard"); + + // tdf89297 Styles were being added before their base/parent/inherited-from style existed, and so were using default settings. + uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles")); + uno::Reference<beans::XPropertySet> xStyle(xParaStyles->getByName("Pull quote"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6736947), getProperty<sal_Int32>(xStyle, "CharColor")); +} +#endif + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocxTablePosition, "floating-table-position.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // the exported positions were wrong due to some missing shifting in the export code + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpX", "3494"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "4611"); +} + +DECLARE_OOXMLEXPORT_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupSapeText.docx") +{ + // tdf#123351: Check if correct underline is used. + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "single"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "double"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "thick"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dotted"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dottedHeavy"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dash"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dashedHeavy"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r[1]/w:rPr/w:u", "val", "dashLongHeavy"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dotDash"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dashDotHeavy"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dotDotDash"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "dashDotDotHeavy"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "wave"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "wavyHeavy"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "wavyDouble"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[32]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "none"); + + // TODO: Import of "words". + // This must fail when import of "words" is implemented. This is a temporary solution, we read "words" as "single". + assertXPath(pXmlDocument, "/w:document/w:body/w:p[32]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "single"); +} + +DECLARE_OOXMLEXPORT_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineColorGroupedShapes.docx") +{ + // tdf#132491 : Check if correct color is used for underline. + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "FF0000"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "00B050"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color"); +} + +DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromRightMargin, "tdf133670_testRelativeAnchorWidthFromRightMargin.docx") +{ + // TODO: Fix export. + if (mbExported) + return; + + // tdf#133670 The width was set relative from right margin, but this was handled relative from page width. + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + const sal_Int32 nAnchoredWidth + = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2408), nAnchoredWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testAutoFitForLegacyShapes, "tdf112312_AutoFitForLegacyShapes.odt") +{ + // tdf#112312: check if noAutoFit is used instead of spAutoFit even if the TextAutoGrowHeight is set + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:noAutofit"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "a:spAutofit"); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx new file mode 100644 index 000000000..e6645a0e8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -0,0 +1,1363 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/text/XDocumentIndex.hpp> +#include <com/sun/star/text/XDocumentIndexesSupplier.hpp> +#include <com/sun/star/text/XFootnote.hpp> +#include <com/sun/star/text/XTextField.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/style/LineSpacingMode.hpp> +#include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/rdf/URI.hpp> +#include <com/sun/star/rdf/Statement.hpp> +#include <o3tl/cppunittraitshelper.hxx> + +#include <ndindex.hxx> +#include <pam.hxx> + +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 { + const char* aBlacklist[] = { + "math-escape.docx", + "math-mso2k7.docx", + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + + // If the testcase is stored in some other format, it's pointless to test. + return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end()); + } +}; + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76248, "FDO76248.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // In two cases the a:graphicData elements had no children, which is invalid. + assertXPath(pXmlDoc, "//a:graphicData[not(*)]", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTscp, "tscp.docx") +{ + uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext()); + uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, "urn:bails"); + uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(mxComponent, uno::UNO_QUERY); + uno::Sequence< uno::Reference<rdf::XURI> > aGraphNames = xDocumentMetadataAccess->getMetadataGraphsWithType(xType); + // This failed, no graphs had the urn:bails type. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aGraphNames.getLength()); + uno::Reference<rdf::XURI> xGraphName = aGraphNames[0]; + uno::Reference<rdf::XNamedGraph> xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName); + + // No RDF statement on the first paragraph. + uno::Reference<rdf::XResource> xParagraph(getParagraph(1), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xStatements = xGraph->getStatements(xParagraph, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>()); + CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(xStatements->hasMoreElements())); + + // 3 RDF statements on the second paragraph. + xParagraph.set(getParagraph(2), uno::UNO_QUERY); + std::map<OUString, OUString> aExpectedStatements = + { + {"urn:bails:ExportControl:BusinessAuthorization:Identifier", "urn:example:tscp:1"}, + {"urn:bails:ExportControl:BusinessAuthorizationCategory:Identifier", "urn:example:tscp:1:confidential"}, + {"urn:bails:ExportControl:Authorization:StartValidity", "2015-11-27"} + }; + std::map<OUString, OUString> aActualStatements; + xStatements = xGraph->getStatements(xParagraph, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>()); + while (xStatements->hasMoreElements()) + { + rdf::Statement aStatement = xStatements->nextElement().get<rdf::Statement>(); + aActualStatements[aStatement.Predicate->getNamespace() + aStatement.Predicate->getLocalName()] = aStatement.Object->getStringValue(); + } + CPPUNIT_ASSERT(bool(aExpectedStatements == aActualStatements)); + + // No RDF statement on the third paragraph. + xParagraph.set(getParagraph(3), uno::UNO_QUERY); + xStatements = xGraph->getStatements(xParagraph, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>()); + CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(xStatements->hasMoreElements())); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76589 , "fdo76589.docx") +{ + /* Numbered list was not preserve after RT. + * In numbering.xml, when NumberingType is "decimal" and level is zero, + * w:val of w:lvlText was empty. + * It should be <w:lvlText w:val="%1" /> + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + + assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" ); +} + +DECLARE_OOXMLEXPORT_TEST(testDecimalNumberingNoLeveltext, "decimal-numbering-no-leveltext.docx") +{ + // This was "%1", not empty: we turned a kind-of-none numbering into a decimal one. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml")) + assertXPath (pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val", ""); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNoDuplicateAttributeExport, "duplicate-east-asia.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // File asserting while saving in LO. + parseExport("word/document.xml"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79008, "fdo79008.docx") +{ + /* File crashing while saving in LO. + * Check if document.xml file is created after fix + */ + parseExport("word/document.xml"); + + // Read-only is set, but it is not enforced, so it should be off... + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT(!pTextDoc->GetDocShell()->IsSecurityOptOpenReadOnly()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyProtection, "tdf120852_readOnlyProtection.docx") +{ + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly"); + } + + // Read-only is set, so Enforcement must enable it. + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT(pTextDoc->GetDocShell()->IsSecurityOptOpenReadOnly()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyUnProtected, "tdf120852_readOnlyUnProtected.docx") +{ + // Readonly is not enforced, just a suggestion, + // so when a section is protected, the document should enable forms protection. + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT(!pTextDoc->GetDocShell()->IsSecurityOptOpenReadOnly()); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY_THROW); + const sal_Int32 nLastSection = xSections->getCount() - 1; + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(nLastSection), uno::UNO_QUERY_THROW); + if ( !mbExported ) + { + CPPUNIT_ASSERT_MESSAGE("Section is not protected", !getProperty<bool>(xSect, "IsProtected")); + // Enable section protection. The round-trip should have forms protection enabled. + xSect->setPropertyValue("IsProtected", uno::makeAny(true)); + } + else + { + CPPUNIT_ASSERT_MESSAGE("Section is protected", getProperty<bool>(xSect, "IsProtected")); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAuthorPropertySdt, "author-property.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"); + // FIXME: the next property doesn't match, though it's correct in theory. A bug in assertXPath? + // assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "prefixMappings", + // "xmlns:ns0='http://purl.org/dc/elements/1.1/' xmlns:ns1='http://schemas.openxmlformats.org/package/2006/metadata/core-properties'"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76586, "fdo76586.docx") +{ + /* + * In the test file gridCol had only one value for entire table width + * while there are two cells in a table row. + * So the table was not imported with the correct cell widths + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // there is only one table in the test file + assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[1]", "w", "1601"); + assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[2]", "w", "7843"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76587 , "fdo76587.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "line", "240"); + assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "lineRule", "auto"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77890 , "fdo77890.docx") +{ + /* + Ensure that the page break is preserved i.e it should not be converted to a section break, in case + if the different first page is set for the pages in the document. + For additional comments please refer to https://www.libreoffice.org/bugzilla/show_bug.cgi?id=77890#c2 + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br", "type", "page"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedList,"NumberedList.docx") +{ + //fdo74150:In document.xml, for pStyle = "NumberedList1", iLvl and numId was not preserved + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:pStyle", "val", "NumberedList1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:ilvl","val", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:numId","val", "0"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:pStyle","val", "NumberedList1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:ilvl","val", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:numId","val", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx") +{ + // keep width of fixed size cells in the nested table + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // These were 4030 and 4249. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[1]", "w", "3841"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]", "w", "4049"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131959, "NumberedList.docx") +{ + // import tblInd from table style + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // These were 0. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblInd", "w", "360"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd", "w", "360"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76597, "fdo76597.docx") +{ + // check XML + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "96"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "120"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeTIF, "fdo77476.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tiff']", "PartName", "/word/media/image1.tif"); +} + +DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx") +{ + uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY); + // This checks textbox textrun size of font which is in group shape. + CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(xShape, "CharHeight")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFloatingTable, "fdo77887.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "horzAnchor", "margin"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "leftFromText", "141"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "rightFromText", "141"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpXSpec", "center"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpY", "2266"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "vertAnchor", "page"); + + //make sure not to write empty attributes which requires enumeration + assertXPathNoAttribute(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpYSpec"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:vMerge", "val", "restart"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeleft, "tdf90681-2.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:vMerge", "val", "restart"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt") +{ + parseExport("word/document.xml"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlinkContainingPlaceholderField, "hyperlink-field.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + parseExport("word/document.xml"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTablePreferredWidth, "tablePreferredWidth.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Problem :If the table preferred width is in percent, then after RT it changes to 0 & width type changes + // to 'auto' instead of 'pct'. + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]", "w", "3000"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]", "type","pct"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO75431, "fdo75431.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "//w:tbl", 2); + assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type", "val", "nextPage"); +} + +DECLARE_OOXMLEXPORT_TEST(testFDO77725, "fdo77725.docx") +{ + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); + if (!pXmlFootnotes) + return; + + assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]", 0); + assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[2]", 0); + assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[3]", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testFieldRotation, "field-rotated.fodt") +{ + uno::Reference<text::XTextRange> const xRun(getRun(uno::Reference<text::XTextRange>(getParagraphOrTable(1), uno::UNO_QUERY), 1)); + uno::Reference<text::XTextField> const xField(getProperty<uno::Reference<text::XTextField>>(xRun, "TextField")); + CPPUNIT_ASSERT(xField.is()); + CPPUNIT_ASSERT_EQUAL(OUString("DocInformation:Title"), xField->getPresentation(true)); + CPPUNIT_ASSERT_EQUAL(OUString("Rotationeering"), xField->getPresentation(false)); + // problem was that the rotation wasn't applied to all runs of the field + CPPUNIT_ASSERT_EQUAL(sal_Int16(900), getProperty<sal_Int16>(xRun, "CharRotation")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteSeparator, "footnotesep.fodt") +{ + // footnote separator definitions - taken from default page style + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "id", "0"); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "type", "separator"); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:r[1]/w:separator", 0); + // use paragraph font size to simulate height + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz", "val", "12"); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]", "id", "1"); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]", "type", "continuationSeparator"); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:r[1]/w:continuationSeparator", 0); + assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz", "val", "12"); + + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); + assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[1]", "id", "0"); + assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[2]", "id", "1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121441, "tdf121441.docx") +{ + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); + assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[1]/w:rPr/w:rStyle", 1); + assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rStyle", 0); + assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rFonts", 0); + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "eastAsia", "Symbol"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "cs", "Symbol"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "ascii", "Symbol"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "hAnsi", "Symbol"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77812, "fdo77812.docx") +{ + /* Additional sectPr was getting inserted and hence Column properties + * were getting added into this additional sectPr instead of Default setPr. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Check no additional section break is inserted. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:sectPr", 0); + + // Check w:cols comes under Default sectPr + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols", "num", "2"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']", + "PartName", + "/word/embeddings/oleObject1.xlsx"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Excel.Sheet.12"); +} + +DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx") +{ + xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml"); + + if (!pXmlHeader) + return; + + xmlDocUniquePtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels"); + if(!pXmlHeaderRels) + return; + + assertXPath(pXmlHeaderRels,"/rels:Relationships/rels:Relationship[1]","Id","rId1"); +} + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreakInFirstPara,"fdo77727.docx") +{ + /* Break to next page was not exported if it is in first paragraph of the section. + * Now after fix , LO writes Next Page Break and also preserves <w:br> tag. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br","type","page"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78284, "fdo78284.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Override[@PartName='/word/media/OOXDiagramDataRels1_0.png']", + "ContentType", + "image/png"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78384,"fdo78384.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78469, "fdo78469.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + // make sure dataBinding & text tags not present in sdtcontent + assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:dataBinding[1]",0); + assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:text[1]",0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887, "fdo78887.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1]", 1); + assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]", "Lyrics: "); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[2]", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887b, "missing_newline.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/w:br[1]", 1); + assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]", "Tab and line break"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[5]/w:br[1]", 1); + assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[6]/w:t[1]", "New line"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78651, "fdo78651.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // ensure that there are only two tables + assertXPath(pXmlDoc, "//w:tbl", 2); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78882, "fdo78882.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Ensure that Section Break is getting written inside second paragraph + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:pPr[1]/w:sectPr[1]",1); + + // Ensure that no dummy paragraph gets created inside second paragraph for Section Break + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:p[1]/w:pPr[1]/w:sectPr[1]",0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76934, "fdo76934.docx") +{ + /* Issue was, AutoSpacing property if present inside styles.xml, LO was not able to + * preserve it. + */ + + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + + // Ensure that after fix LO is preserving AutoSpacing property in styles.xml + assertXPath ( pXmlDoc, "/w:styles[1]/w:style[@w:styleId='Title']/w:pPr[1]/w:spacing[1]", "beforeAutospacing", "1" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79540, "fdo79540.docx") +{ + /* Issue was, <w:drawing> was getting written inside <w:drawing>. + * So postpone the writing of Inner Drawing tag. + * MS Office does not allow nesting of drawing tags. + */ + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Ensure that two separate w:drawing tags are written and they are not nested. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testFDO79062, "fdo79062.docx") +{ + xmlDocUniquePtr pXmlFootNotes = parseExport("word/footnotes.xml"); + if (!pXmlFootNotes) + return; + assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14"); + + xmlDocUniquePtr pXmlEndNotes = parseExport("word/endnotes.xml"); + if (!pXmlEndNotes) + return; + assertXPath(pXmlEndNotes, "/w:endnotes", "Ignorable", "w14 wp14"); + + //tdf#93121 don't add fake tabs in front of extra footnote paragraphs + uno::Reference<text::XFootnotesSupplier> xFootnoteSupp(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnoteIdxAcc = xFootnoteSupp->getFootnotes(); + uno::Reference<text::XFootnote> xFootnote(xFootnoteIdxAcc->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XText> xFootnoteText(xFootnote, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess>xParaEnumAccess(xFootnoteText->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration>xParaEnum = xParaEnumAccess->createEnumeration(); + + uno::Reference<text::XTextRange> xTextRange; + xParaEnum->nextElement(); + xParaEnum->nextElement() >>= xTextRange; + OUString sFootnotePara = xTextRange->getString(); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Paragraph starts with W(87), not tab(9)", u'W', sFootnotePara[0] ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf123262_textFootnoteSeparators, "tdf123262_textFootnoteSeparators.docx") +{ + //Everything easily fits on one page + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 1, getPages() ); + + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XText> xFootnoteText(xFootnotes->getByIndex(0), uno::UNO_QUERY); + + // The text in the separator footnote should not be added to the footnotes + OUString sText = " Microsoft Office."; + CPPUNIT_ASSERT_EQUAL(sText, xFootnoteText->getString()); + + // Ensure that paragraph markers are not lost. + xFootnoteText.set(xFootnotes->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of paragraphs in second footnote", 2, getParagraphs(xFootnoteText) ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79668,"fdo79668.docx") +{ + // fdo#79668: Document was Crashing on DebugUtil build while Saving + // because of repeated attribute value in same element. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // w:pPr's w:shd attributes were getting added to w:pPrChange/w:pPr's w:shd hence checking + // w:fill for both shd elements + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:shd", "fill", "FFFFFF" ); + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pPrChange/w:pPr/w:shd", "fill", "FFFFFF" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78907,"fdo78907.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page" ); + + xmlDocUniquePtr pXmlDoc1 = parseExport("word/footer1.xml"); + if (!pXmlDoc1) + return; + assertXPath ( pXmlDoc1, "/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl", 0 ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf118702,"tdf118702.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:type", "val", "nextPage" ); + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz", "orient", "landscape" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79822, "fdo79822.docx") +{ + /* File getting crash while saving in LO. + * The Docx contain smartart and the file was created in ms word 2007 + */ + parseExport("word/document.xml"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79915, "fdo79915.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[10]/w:t", "How much buoyancy does the water provide?"); +} + +DECLARE_OOXMLEXPORT_TEST(testfdo79817, "fdo79817.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID", "{9222E47B-A68B-4AEB-9855-21C912B9D3D2}"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]"); + } +} + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79968_sldx, "fdo79968.docx") +{ + // This UT for DOCX embedded with powerpoint slide + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']", + "PartName", + "/word/embeddings/oleObject1.sldx"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldx']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "PowerPoint.Slide.12"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx") +{ + // This UT for DOCX embedded with binary excel work sheet. + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.binary.macroEnabled.12']", + "PartName", + "/word/embeddings/oleObject1.xlsb"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsb']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Excel.SheetBinaryMacroEnabled.12"); +} + +DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx") +{ + //fdo#76635 : Table borders are not getting preserved. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + //Table Cell Borders + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'single']",1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:sz = 4]", 1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:space = 0]", 1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:color = '000000']", 1); + + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'single']",1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:sz = 4]", 1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:space = 0]", 1); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:color = '000000']", 1); + + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH",0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV",0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95033, "tdf95033.docx") +{ + //tdf#95033 : Table borders defined by row-level tblPrEx are not getting preserved. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + //Not disabled table cell borders + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[2]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133455, "tdf133455.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + //Not disabled table cell borders + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']", 0); + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138612, "tdf138612.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + + // Row 5 Col 1 - vertically merged cell + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:vMerge", "val", "restart"); + // Row 5 Col 2 - split cell + // This was w:vMerge="restart" + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[2]/w:tcPr/w:vMerge", 0); + + // Row 6 Col 1 - merged with cell in Row 5 Col 1 + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue"); + // Row 6 Col 2 - split cell + // This was w:vMerge="continue" (merged with cell in Row 5 Col 2) + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[2]/w:tcPr/w:vMerge", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx") +{ + // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:pPr/w:rPr/w:vanish", 1); + if (!mbExported) + // originally no <w:vanish> (the same as <w:vanish val="false">) + assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish", 0); + else + // This was hidden (<w:vanish/>) + assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish", "val", "false"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119800, "tdf119800.docx") +{ + // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. + // (tdf#128646 solved the same only for table paragraphs) + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:vanish", 1); + if (!mbExported) + // originally no <w:vanish> (the same as <w:vanish val="false">) + assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish", 0); + else + // This was hidden (<w:vanish/>) + assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish", "val", "false"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo77129, "fdo77129.docx") +{ + // The problem was that text after TOC field was missing if footer reference comes in field. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Data was lost from this paragraph. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:t", "Abstract"); +} + +// Test the same testdoc used for testFdo77129. +DECLARE_OOXMLEXPORT_TEST(testTdf129402, "fdo77129.docx") +{ + // tdf#129402: ToC title must be "Contents", not "Content"; the index field must include + // pre-rendered element. + + // Currently export drops empty paragraph after ToC, so skip getParagraphs test for now +// CPPUNIT_ASSERT_EQUAL(5, getParagraphs()); + CPPUNIT_ASSERT_EQUAL(OUString("owners."), getParagraph(1)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("Contents"), getParagraph(2)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("How\t2"), getParagraph(3)->getString()); +// CPPUNIT_ASSERT_EQUAL(OUString(), getParagraph(4)->getString()); + + uno::Reference<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexes = xIndexSupplier->getDocumentIndexes(); + uno::Reference<text::XDocumentIndex> xIndex(xIndexes->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange = xIndex->getAnchor(); + uno::Reference<text::XText> xText = xTextRange->getText(); + uno::Reference<text::XTextCursor> xTextCursor = xText->createTextCursor(); + xTextCursor->gotoRange(xTextRange->getStart(), false); + xTextCursor->gotoRange(xTextRange->getEnd(), true); + OUString aTocString(xTextCursor->getString()); + + // Check that the pre-rendered entry is inside the index + CPPUNIT_ASSERT_EQUAL(OUString("How\t2"), aTocString); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx") +{ + // This UT for DOCX embedded with excel work sheet. + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.macroEnabled.12']", + "PartName", + "/word/embeddings/oleObject1.xlsm"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsm']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Excel.SheetMacroEnabled.12"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80522,"fdo80522.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-word.document.macroEnabled.12']", + "PartName", + "/word/embeddings/oleObject1.docm"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docm']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Word.DocumentMacroEnabled.12"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_pptm,"fdo80523_pptm.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.presentation.macroEnabled.12']", + "PartName", + "/word/embeddings/oleObject1.pptm"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.pptm']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "PowerPoint.ShowMacroEnabled.12"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_sldm,"fdo80523_sldm.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.slide.macroEnabled.12']", + "PartName", + "/word/embeddings/oleObject1.sldm"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldm']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "PowerPoint.SlideMacroEnabled.12"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80898, "fdo80898.docx") +{ + // This UT for DOCX embedded with binary excel work sheet. + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/msword']", + "PartName", + "/word/embeddings/oleObject1.doc"); + + // check the rels too + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + assertXPath(pXmlDocRels, + "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.doc']", + "Type", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + // check the content too + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); + assertXPath(pXmlDocContent, + "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", + "ProgID", + "Word.Document.8"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleIconDrawAspect, "tdf131537.odt") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject", + "DrawAspect", "Icon"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCellWithDirectFormatting, "fdo80800.docx") +{ + // Issue was Direct Formatting for non-first Table cells was not getting preserved. + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Ensure that for Third Table cell Direct Formatting is preserved. + // In file, Direct Formatting used for Third Table cell is Line Spacing="1.5 lines" + // For Line Spacing "1.5 lines" w:line equals 360 + assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc[3]/w:p/w:pPr/w:spacing","line","360"); + +} + +DECLARE_OOXMLEXPORT_TEST(testFdo80800b_tableStyle, "fdo80800b_tableStyle.docx") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Cell1 1.5lines"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell A1 1.5 line spacing", sal_Int16(150), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); + + xCell.set(xTable->getCellByName("B1"), uno::UNO_QUERY); + xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + xParaEnum = xParaEnumAccess->createEnumeration(); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Cell2 Implicit (Single)"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 single line spacing", sal_Int16(100), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); + + xCell.set(xTable->getCellByName("C1"), uno::UNO_QUERY); + xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + xParaEnum = xParaEnumAccess->createEnumeration(); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Cell3 Implicit (Single)"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("C1 paragraph1 single line spacing", sal_Int16(100), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("C1 paragraph3 line spacing", sal_Int16(212), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf117297_tableStyle, "tdf117297_tableStyle.docx") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<text::XText> xText = xPara->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("Green text, default size (9), 1.5 spaced"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph1 green font", sal_Int32(0x70AD47), getProperty<sal_Int32>(getRun(xPara, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph1 1.5 line spacing", sal_Int16(150), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xText = xPara->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("TableGrid color (blue), TableGrid size (9), double spacing"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 blue font", sal_Int32(0x00B0F0), getProperty<sal_Int32>(getRun(xPara, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 double spacing", sal_Int16(200), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82175_noStyleInheritance, "tdf82175_noStyleInheritance.docx") +{ + // The document's "Default" paragraph style is 1 inch fixed line spacing, and that is what should not be inherited. + style::LineSpacing aSpacing = getProperty<style::LineSpacing>(getParagraph(1), "ParaLineSpacing"); + // MSWord uses 115% line spacing, but LO follows the documentation and sets single spacing. + CPPUNIT_ASSERT_MESSAGE("Text Body style 115% line spacing", sal_Int16(120) > aSpacing.Height); + CPPUNIT_ASSERT_MESSAGE("THANKS for *FIXING* line spacing", sal_Int16(115) != aSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aSpacing.Mode); +} + +DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") +{ + // Header was lost on export when the document had multiple columns. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPageStyle, "HeaderIsOn")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo83048, "fdo83048.docx") +{ + // Issue was wrong SDT properties were getting exported for Date SDT + xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); + + // Make sure Date is inside SDT tag. + // This will happen only if right SDT properties are exported. + assertXPathContent(pXmlDoc, "/w:ftr/w:sdt/w:sdtContent/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:t", + "1/2/2013"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdt2Run, "sdt-2-run.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + + // The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[1]/w:t", "first"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[2]/w:t", "second"); + // Make sure the third portion is still outside <w:sdt>. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/w:t", "third"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFD083057, "fdo83057.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + + // A fly frame was attached to a para which started with a hint (run) containing an SDT. + // This SDT was handled while exporting the FLYFRAME and also the text of the run. + // So, even though the original file had only one sdt in the header, the RT file had two; + // one for a separate run as expected, and one incorrectly exported in the alternateContent (FLYFRAME) + + // Assert that the file has only one sdt, in a separate run + assertXPath(pXmlDoc, "//w:sdt", 1); + assertXPath(pXmlDoc, "//mc:AlternateContent//w:sdt", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testHeaderBorder, "header-border.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // This was 0, as header margin was lost during import. + assertXPath(pXmlDoc, "//w:pgMar", "header", "720"); + // This was 33: 33 points -> 660 twips. We counted 900 - 240 (distance + // of page and body frame) instead of 720 - 240 (distance of page and + // header frame). + assertXPath(pXmlDoc, "//w:pgBorders/w:top", "space", "24"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTablepprShape, "tblppr-shape.docx") +{ + // Unhandled exception due to unexpected w:tblpPr resulted in not importing page size, either. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + // This was 2000, page width wasn't large enough. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2540), getProperty<sal_Int32>(xPageStyle, "LeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testImageNoborder, "image-noborder.docx") +{ + // This was 26; we exported border for an image that had no border. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf89774, "tdf89774.fodt") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml")) + // This was 65, as unit was seconds instead of minutes. + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:TotalTime", "1"); +} + +DECLARE_OOXMLEXPORT_TEST(testSectionProtection, "sectionprot.odt") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr/w:formProt", "val", "true"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:formProt", "val", "false"); + } + + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms"); + } + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("TextSection is protected", true, getProperty<bool>(xSect, "IsProtected")); + xSect.set(xSections->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Section1 is protected", false, getProperty<bool>(xSect, "IsProtected")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSectionProtection2, "sectionprot2.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms"); + } + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("TextSection is protected", true, getProperty<bool>(xSect, "IsProtected")); +} + +DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") +{ + // check document permission settings for the whole document + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptProviderType", "rsaAES"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptAlgorithmClass","hash"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptAlgorithmType", "typeAny"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptAlgorithmSid", "14"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptSpinCount", "100000"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "hash", "A0/Xy6KcXljJlZjP0TwJMPJuW2rc46UwXqn2ctxckc2nCECE5i89M85z2Noh3ZEA5NBQ9RJ5ycxiUH6nzmJaKw=="); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "salt", "B8k6wb1pkjUs4Nv/8QBk/w=="); + } + + // get bookmark interface + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks(); + + // check: we have 2 bookmarks + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xBookmarksByIdx->getCount()); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("_GoBack")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("permission-for-group:267014232:everyone")); +} + +DECLARE_OOXMLEXPORT_TEST(tdf106843, "tdf106843.fodt") +{ + // check Track Changes permission set in Writer/OpenDocument (password: "test", encoded by default encoding of Writer) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "trackedChanges"); + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1"); + + // LO intends to export a .docx format that is natively compatible with 2013 + // but this document has an implicitly added setting AddExternalLeading = false + assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode"); + assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "val", "14"); // compatible with 2010 + } +} + +DECLARE_OOXMLEXPORT_TEST(tdf89991_revisionView, "tdf89991.docx") +{ + // check revisionView (Show Changes) import and export + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) + { + assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", "0"); + assertXPath(pXmlSettings, "/w:settings/w:revisionView", "formatting", "0"); + + // There was no compatibilityMode defined. + // 12: Use word processing features specified in ECMA-376. This is the default. + assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode"); + assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "val", "12"); + } +} + +DECLARE_OOXMLEXPORT_TEST(tdf122201_editUnprotectedText, "tdf122201_editUnprotectedText.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // get the document + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT(pDoc); + + // get two different nodes + SwNodeIndex aDocEnd(pDoc->GetNodes().GetEndOfContent()); + SwNodeIndex aDocStart(*aDocEnd.GetNode().StartOfSectionNode(), 3); + + // check protected area + SwPaM aPaMPortected(aDocStart); + CPPUNIT_ASSERT(aPaMPortected.HasReadonlySel(false)); + + // check unprotected area + SwPaM aPaMUnprotected(aDocEnd); + CPPUNIT_ASSERT(!aPaMUnprotected.HasReadonlySel(false)); +} + +DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // this test must not be zero + assertXPath(pXmlDoc, "//w:headerReference", 2); + } +} + +DECLARE_OOXMLEXPORT_TEST(testOO47778_1, "ooo47778-3.odt") +{ + CPPUNIT_ASSERT_EQUAL(5, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPathContent(pXmlDoc, "(//w:t)[3]", "c"); +} + +DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPathContent(pXmlDoc, "(//w:t)[4]", "c"); + + // tdf116436: The problem was that the table background was undefined, not white. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xCell, "BackColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPathContent(pXmlDoc, "(//w:t)[2]", "B"); +} + +DECLARE_OOXMLEXPORT_TEST(testKDE302504, "kde302504-1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPath(pXmlDoc, "//v:shape", "ID", "KoPathShape"); +} + +DECLARE_OOXMLEXPORT_TEST(testKDE216114, "kde216114-1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPath(pXmlDoc, "//w:pict", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testOO72950, "ooo72950-1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPath(pXmlDoc, "//w:tbl", 1); +} + +//There are two tables to export in this doc the second of which is inside a +//frame anchored to first cell of the first table. They must not be +//considered the same table +DECLARE_OOXMLEXPORT_TEST(fdo60957, "fdo60957-2.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPath(pXmlDoc, "//w:tbl", 2); +} + +//This has more cells than msword supports, we must balance the +//number of cell start and ends +DECLARE_OOXMLEXPORT_TEST(testOO106020, "ooo106020-1.odt") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + assertXPath(pXmlDoc, "//w:tbl", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx") +{ + sal_uInt32 nCh = 0x24b62; + OUString aExpected( &nCh, 1); + // Assert that UTF8 encoded non-BMP Unicode character is correct + uno::Reference<text::XTextRange> xTextRange1 = getRun(getParagraph(1), 1); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange1->getString()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSpacingGroupShapeText, "tdf131775_SpacingGroupShapeText.docx") +{ + // tdf#131775: Check if correct spacing. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:spacing", "val", "71"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf100581, "tdf100581.odt") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:pPr/w:pStyle", "val", "FrameContents"); + + // w:sectPr is not exported + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:pPr/w:sectPr", 0); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect" + "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:pStyle", "val", "FrameContents"); + + // w:sectPr is not exported + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect" + "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:sectPr", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf112287, "tdf112287.docx") +{ + // tdf#131775: Check if correct spacing. + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr","vAnchor","margin"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testZOrderInHeader, "tdf120760_ZOrderInHeader.docx") +{ + // tdf#120760 Check that the Z-Order of the background is smaller than the front shape's. + xmlDocUniquePtr pXml = parseExport("word/header1.xml"); + if (!pXml) + return; + + // Get the Z-Order of the background image and of the shape in front of it. + sal_Int32 nBackground = getXPath(pXml, "/w:hdr/w:p[1]/w:r[1]/w:drawing/wp:anchor", "relativeHeight").toInt32(); + sal_Int32 nFrontShape = getXPath(pXml, "/w:hdr/w:p[1]/w:r[1]/mc:AlternateContent[2]" + "/mc:Choice/w:drawing/wp:anchor", "relativeHeight").toInt32(); + + // Assert that background is in the back. + CPPUNIT_ASSERT(nBackground < nFrontShape); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx new file mode 100644 index 000000000..d3099505a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -0,0 +1,1018 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + + + +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/Hatch.hpp> +#include <com/sun/star/drawing/LineJoint.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/style/LineSpacingMode.hpp> +#include <com/sun/star/text/GraphicCrop.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> + +#include <comphelper/sequenceashashmap.hxx> + +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_EXPORTONLY_TEST(testTdf133701, "tdf133701.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "hSpace", "567"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "vSpace", "284"); +} + +DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx") +{ + CPPUNIT_ASSERT_EQUAL(OUString("Title"), getProperty<OUString>(getShape(1), "Title")); + CPPUNIT_ASSERT_EQUAL(OUString("Description"), getProperty<OUString>(getShape(1), "Description")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlZorder, "dml-zorder.odt") +{ + CPPUNIT_ASSERT_EQUAL(3, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // This was "0": causing that in Word, the second shape was on top, while in the original odt the first shape is on top. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "relativeHeight", "2"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlShapeRelsize, "dml-shape-relsize.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Relative size wasn't exported all, then relativeFrom was "page", not "margin". + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin"); +} + +DECLARE_OOXMLEXPORT_TEST(testDmlPictureInTextframe, "dml-picture-in-textframe.docx") +{ + if (!mbExported) + return; + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.gif"))); + // This was also true, image was written twice. + CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/image2.gif"))); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlGroupshapeRelsize, "dml-groupshape-relsize.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Relative size wasn't imported. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin"); +} + +DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx") +{ + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::VertOrientation::TOP, getProperty<sal_Int16>(xGroup, "VertOrient")); + uno::Reference<drawing::XShape> xShape(xGroup->getByIndex(1), uno::UNO_QUERY); + // This was drawing::FillStyle_NONE. + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape, "FillStyle")); + // This was drawing::LineStyle_NONE. + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty<drawing::LineStyle>(xShape, "LineStyle")); + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + // This was wrap="none". + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:bodyPr", "wrap", "square"); + + xShape.set(xGroup->getByIndex(3), uno::UNO_QUERY); + OUString aType = comphelper::SequenceAsHashMap(getProperty<beans::PropertyValues>(xShape, "CustomShapeGeometry"))["Type"].get<OUString>(); + CPPUNIT_ASSERT_EQUAL(OUString("ooxml-bentConnector3"), aType); + // Connector was incorrectly shifted towards the top left corner, X was 552, Y was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(4018), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-4487), xShape->getPosition().Y); + + xShape.set(xGroup->getByIndex(5), uno::UNO_QUERY); + // This was incorrectly shifted towards the top of the page, Y was 106. + CPPUNIT_ASSERT_EQUAL(sal_Int32(-4727), xShape->getPosition().Y); +} + +DECLARE_OOXMLEXPORT_TEST(testDmlTextshapeB, "dml-textshapeB.docx") +{ + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + uno::Reference<drawing::XShape> xShape(xGroup->getByIndex(3), uno::UNO_QUERY); + // Connector was incorrectly shifted towards the top left corner, X was 192, Y was -5743. + CPPUNIT_ASSERT_EQUAL(sal_Int32(3778), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-5064), xShape->getPosition().Y); + + xShape.set(xGroup->getByIndex(5), uno::UNO_QUERY); + // This was incorrectly shifted towards the top of the page, Y was -5011. + CPPUNIT_ASSERT_EQUAL(sal_Int32(-4713), xShape->getPosition().Y); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLSolidfillAlpha, "dml-solidfill-alpha.docx") +{ + // Problem was that the transparency was not exported (a:alpha). + // RGB color (a:srgbClr) + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(70), getProperty<sal_Int16>(xShape, "FillTransparence")); + + // Theme color (a:schemeClr) + xShape.set(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(20), getProperty<sal_Int16>(xShape, "FillTransparence")); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLTextFrameNoFill, "frame.fodt") +{ + // Problem is that default text frame background is white in Writer and transparent in Word + uno::Reference<beans::XPropertySet> xShape1(getShape(1), uno::UNO_QUERY); +// it is re-imported as solid +// CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xShape1, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape1, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xShape1, "FillTransparence")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape1, "FillColor")); + + uno::Reference<beans::XPropertySet> xShape2(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape2, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xShape2, "FillTransparence")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xE8F2A1), getProperty<sal_Int32>(xShape2, "FillColor")); + + uno::Reference<beans::XPropertySet> xShape3(getShape(3), uno::UNO_QUERY); +// it is re-imported as solid +// CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xShape3, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape3, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape3, "FillColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xShape3, "FillTransparence")); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLCustomGeometry, "dml-customgeometry-cubicbezier.docx") +{ + + // The problem was that a custom shape was not exported. + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(getShape(1), "CustomShapeGeometry"); + uno::Sequence<beans::PropertyValue> aPathProps; + for (beans::PropertyValue const & rProp : aProps) + { + if (rProp.Name == "Path") + rProp.Value >>= aPathProps; + } + uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aPairs; + uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments; + for (beans::PropertyValue const & rProp : std::as_const(aPathProps)) + { + if (rProp.Name == "Coordinates") + rProp.Value >>= aPairs; + else if (rProp.Name == "Segments") + rProp.Value >>= aSegments; + } + + // (a:moveTo) + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), aSegments[0].Count); + CPPUNIT_ASSERT_EQUAL(sal_Int16(drawing::EnhancedCustomShapeSegmentCommand::MOVETO), aSegments[0].Command ); + + // (a:cubicBezTo) + CPPUNIT_ASSERT_EQUAL(sal_Int16(5), aSegments[1].Count); + CPPUNIT_ASSERT_EQUAL(sal_Int16(drawing::EnhancedCustomShapeSegmentCommand::CURVETO), aSegments[1].Command ); + + // Coordinates + sal_Int32 nLength = 16; + CPPUNIT_ASSERT_EQUAL(nLength, aPairs.getLength()); + std::pair<sal_Int32,sal_Int32> aCoordinates[] = + { + std::pair<sal_Int32,sal_Int32>(9084, 0), + std::pair<sal_Int32,sal_Int32>(6734, 689), + std::pair<sal_Int32,sal_Int32>(4489, 893), + std::pair<sal_Int32,sal_Int32>(2633, 893), + std::pair<sal_Int32,sal_Int32>(1631, 893), + std::pair<sal_Int32,sal_Int32>(733, 830), + std::pair<sal_Int32,sal_Int32>(0, 752), + std::pair<sal_Int32,sal_Int32>(987, 908), + std::pair<sal_Int32,sal_Int32>(2274, 1034), + std::pair<sal_Int32,sal_Int32>(3756, 1034), + std::pair<sal_Int32,sal_Int32>(5357, 1034), + std::pair<sal_Int32,sal_Int32>(7183, 877), + std::pair<sal_Int32,sal_Int32>(9084, 423), + std::pair<sal_Int32,sal_Int32>(9084, 0), + std::pair<sal_Int32,sal_Int32>(9084, 0), + std::pair<sal_Int32,sal_Int32>(9084, 0) + }; + + for( int i = 0; i < nLength; ++i ) + { + CPPUNIT_ASSERT(abs(aCoordinates[i].first - aPairs[i].First.Value.get<sal_Int32>()) < 20); + CPPUNIT_ASSERT(abs(aCoordinates[i].second - aPairs[i].Second.Value.get<sal_Int32>()) < 20); + } +} + +DECLARE_OOXMLEXPORT_TEST(testDmlRectangleRelsize, "dml-rectangle-relsize.docx") +{ + // This was around 19560, as we did not read wp14:pctHeight for + // drawinglayer shapes and the fallback data was invalid. + OString aMessage("Height is only " + OString::number(getShape(1)->getSize().Height)); + CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), getShape(1)->getSize().Height >= 20967); + + // This was around 0: relative size of 0% was imported as 0, not "fall back to absolute size". + CPPUNIT_ASSERT(getShape(2)->getSize().Height > 300); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLTextFrameVertAdjust, "dml-textframe-vertadjust.docx") +{ + // DOCX textboxes with text are imported as text frames but in Writer text frames did not have + // TextVerticalAdjust attribute so far. + + // 1st frame's context is adjusted to the top + uno::Reference<beans::XPropertySet> xFrame(getShapeByName("Rectangle 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust")); + // 2nd frame's context is adjusted to the center + xFrame.set(getShapeByName("Rectangle 2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_CENTER, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust")); + // 3rd frame's context is adjusted to the bottom + xFrame.set(getShapeByName("Rectangle 3"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillBitmapCrop, "dml-shape-fillbitmapcrop.docx") +{ + // Test the new GraphicCrop property which is introduced to define + // cropping of shapes filled with a picture in stretch mode. + + // 1st shape has some cropping + text::GraphicCrop aGraphicCropStruct = getProperty<text::GraphicCrop>(getShape(1), "GraphicCrop"); + CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? 454 : 455 ), aGraphicCropStruct.Left ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? 367 : 368 ), aGraphicCropStruct.Right ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? -454 : -455 ), aGraphicCropStruct.Top ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? -367 : -368 ), aGraphicCropStruct.Bottom ); + + // 2nd shape has no cropping + aGraphicCropStruct = getProperty<text::GraphicCrop>(getShape(2), "GraphicCrop"); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Left ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Right ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Top ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), aGraphicCropStruct.Bottom ); + +} + +DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillPattern, "dml-shape-fillpattern.docx") +{ + // Hatching was ignored by the export. + + // 1st shape: light horizontal pattern (ltHorz) + drawing::Hatch aHatch = getProperty<drawing::Hatch>(getShape(1), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x99FF66), aHatch.Color); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 2nd shape: horizontal pattern (horz) + aHatch = getProperty<drawing::Hatch>(getShape(2), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 3rd shape: light vertical pattern (ltVert) + aHatch = getProperty<drawing::Hatch>(getShape(3), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(900), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 4th shape: vertical pattern (vert) + aHatch = getProperty<drawing::Hatch>(getShape(4), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(900), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 5th shape: light upward diagonal pattern (ltUpDiag) + aHatch = getProperty<drawing::Hatch>(getShape(5), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(450), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 6th shape: wide upward diagonal pattern (wdUpDiag) + aHatch = getProperty<drawing::Hatch>(getShape(6), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(450), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 7th shape: light downward diagonal pattern (ltDnDiag) + aHatch = getProperty<drawing::Hatch>(getShape(7), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1350), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 8th shape: wide downward diagonal pattern (wdDnDiag) + aHatch = getProperty<drawing::Hatch>(getShape(8), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1350), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); + + // 9th shape: small grid pattern (smGrid) + aHatch = getProperty<drawing::Hatch>(getShape(9), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_DOUBLE, aHatch.Style); + + // 10th shape: large grid pattern (lgGrid) + aHatch = getProperty<drawing::Hatch>(getShape(10), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_DOUBLE, aHatch.Style); + + // 11th shape: small checker board pattern (smCheck) + aHatch = getProperty<drawing::Hatch>(getShape(11), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(450), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_DOUBLE, aHatch.Style); + + // 12th shape: outlined diamond pattern (openDmnd) + aHatch = getProperty<drawing::Hatch>(getShape(12), "FillHatch"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(450), aHatch.Angle); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aHatch.Distance); + CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_DOUBLE, aHatch.Style); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeChildPosition, "dml-groupshape-childposition.docx") +{ + // Problem was parent transformation was ignored fully, but translate component + // which specify the position must be also applied for children of the group. + + uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xChildGroup(xGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? -2120 : -2122), xChildGroup->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11336 : 11333), xChildGroup->getPosition().Y); + + xGroup.set(xChildGroup, uno::UNO_QUERY); + xChildGroup.set(xGroup->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? -1856 : -1858), xChildGroup->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11336 : 11333), xChildGroup->getPosition().Y); + + xChildGroup.set(xGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? -2120 : -2122), xChildGroup->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 14026 : 14023), xChildGroup->getPosition().Y); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDMLGradientFillTheme, "dml-gradientfill-theme.docx") +{ + // Problem was when a fill gradient was imported from a theme, (fillRef in ooxml) + // not just the theme was written out but the explicit values too + // Besides the duplication of values it causes problems with writing out + // <a:schemeClr val="phClr"> into document.xml, while phClr can be used just for theme definitions. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // check no explicit gradFill has been exported + assertXPath(pXmlDoc, + "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill", + 0); + + // check shape style has been exported + assertXPath(pXmlDoc, + "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef", + "idx", "2"); + assertXPath(pXmlDoc, + "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr", + "val", "accent1"); +} + +DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeParaSpacing, "dml-groupshape-paraspacing.docx") +{ + // Paragraph spacing (top/bottom margin and line spacing) inside a group shape was not imported + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText(); + + // 1st paragraph has 1.5x line spacing but it has no spacing before/after. + uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1); + style::LineSpacing aLineSpacing = getProperty<style::LineSpacing>(xRun, "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(150), aLineSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); + + // 2nd paragraph has double line spacing but it has no spacing before/after. + xRun.set(getRun(getParagraphOfText(2, xText),1)); + aLineSpacing = getProperty<style::LineSpacing>(xRun, "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(200), aLineSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); + + // 3rd paragraph has 24 pt line spacing but it has no spacing before/after. + xRun.set(getRun(getParagraphOfText(3, xText),1)); + aLineSpacing = getProperty<style::LineSpacing>(xRun, "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::MINIMUM), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(847), aLineSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); + + // 4th paragraph has 1.75x line spacing but it has no spacing before/after. + xRun.set(getRun(getParagraphOfText(4, xText),1)); + aLineSpacing = getProperty<style::LineSpacing>(xRun, "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(175), aLineSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); + + // 5th paragraph has margins which are defined by w:beforeLines and w:afterLines. + xRun.set(getRun(getParagraphOfText(5, xText),1)); + aLineSpacing = getProperty<style::LineSpacing>(xRun, "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), aLineSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(635), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(741), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); + + // 6th paragraph has margins which are defined by w:before and w:after. + xRun.set(getRun(getParagraphOfText(6, xText),1)); + aLineSpacing = getProperty<style::LineSpacing>(xRun, "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), aLineSpacing.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(423), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(635), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); + + // 7th paragraph has auto paragraph margins a:afterAutospacing and a:beforeAutospacing, which means margins must be ignored. + xRun.set(getRun(getParagraphOfText(7, xText),1)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableFloatingMargins, "table-floating-margins.docx") +{ + // In case the table had custom left cell margin, the horizontal position was still incorrect (too small, -199). + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + sal_Int32 nHoriOrientPosition = getProperty<sal_Int32>(xFrame, "HoriOrientPosition"); + CPPUNIT_ASSERT(nHoriOrientPosition < sal_Int32(-495)); + // These were 0 as well, due to lack of import. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xFrame, "TopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), getProperty<sal_Int32>(xFrame, "BottomMargin")); + + if (!mbExported) + return; + // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table. + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127814, "tdf127814.docx") +{ + // Paragraph top margin was 0 in a table started on a new page + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "before", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128752, "tdf128752.docx") +{ + // Paragraph bottom margin was 200, docDefault instead of table style setting + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119054, "tdf119054.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + // Don't overwrite before and after spacing of Heading2 by table style. + // Heading2 overrides table style's values from DocDefaults. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", "360"); + // Use table style based single line spacing instead of the docDefaults' 254 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "line", "240"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131258, "tdf131258.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + // Use table style based bottom margin instead of the docDefaults in empty tables, too + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132514, "tdf132514.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + // Keep table style setting, when the footer also contain a table + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "after", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69636, "fdo69636.docx") +{ + /* + * The problem was that the exporter didn't mirror the workaround of the + * importer, regarding the btLr text frame direction: the + * mso-layout-flow-alt property was completely missing in the output. + */ + xmlDocUniquePtr pXmlDoc = parseExport(); + // VML + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox", "style").match("mso-layout-flow-alt:bottom-to-top")); + // drawingML + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "vert", "vert270"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVMLData, "TestVMLData.docx") +{ + // The problem was exporter was exporting vml data for shape in w:rPr element. + // vml data should not come under w:rPr element. + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "stroked").match("f")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testImageData, "image_data.docx") +{ + // The problem was exporter was exporting v:imagedata data for shape in w:pict as v:fill w element. + + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape/v:imagedata", "detectmouseclick").match("t")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx") +{ + // The problem was that VMLExport::Commit didn't save the correct width and height, + // and ImplEESdrWriter::ImplFlipBoundingBox made a mistake calculating the position + + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // Check DML document + + sal_Int32 aXPos[4], aYPos[4]; + aXPos[0] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32(); + aXPos[1] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32(); + aXPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32(); + aXPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32(); + + aYPos[0] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32(); + aYPos[1] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32(); + aYPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32(); + aYPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32(); + + // certain degree of error is tolerated due to rounding in unit conversions + CPPUNIT_ASSERT(abs(1239520 - aXPos[0]) < 1000); + CPPUNIT_ASSERT(abs(1239520 - aXPos[1]) < 1000); + CPPUNIT_ASSERT(abs(1238250 - aXPos[2]) < 1000); + CPPUNIT_ASSERT(abs(1238885 - aXPos[3]) < 1000); + + CPPUNIT_ASSERT(abs(2095500 - aYPos[0]) < 1000); + CPPUNIT_ASSERT(abs(2094865 - aYPos[1]) < 1000); + CPPUNIT_ASSERT(abs(2094230 - aYPos[2]) < 1000); + CPPUNIT_ASSERT(abs(2094865 - aYPos[3]) < 1000); + + sal_Int32 aHSize[4], aVSize[4]; + aHSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32(); + aHSize[1] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32(); + aHSize[2] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32(); + aHSize[3] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32(); + + aVSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32(); + aVSize[1] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32(); + aVSize[2] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32(); + aVSize[3] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32(); + + // certain degree of error is tolerated due to rounding in unit conversions + CPPUNIT_ASSERT(abs(3599280 - aHSize[0]) < 1000); + CPPUNIT_ASSERT(abs(3599280 - aHSize[1]) < 1000); + CPPUNIT_ASSERT(abs(3599280 - aHSize[2]) < 1000); + CPPUNIT_ASSERT(abs(3599280 - aHSize[3]) < 1000); + + CPPUNIT_ASSERT(abs(1799640 - aVSize[0]) < 1000); + CPPUNIT_ASSERT(abs(1799640 - aVSize[1]) < 1000); + CPPUNIT_ASSERT(abs(1799640 - aVSize[2]) < 1000); + CPPUNIT_ASSERT(abs(1799640 - aVSize[3]) < 1000); + + // Check VML document + + // get styles of the four shapes + OUString aStyles[4]; + aStyles[0] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:rect", "style"); + // original is: "position:absolute;margin-left:97.6pt;margin-top:165pt;width:283.4pt;height:141.7pt;rotation:285" + aStyles[1] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect", "style"); + // original is: "position:absolute;margin-left:97.6pt;margin-top:164.95pt;width:283.4pt;height:141.7pt;rotation:255" + aStyles[2] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Fallback/w:pict/v:rect", "style"); + // original is: "position:absolute;margin-left:97.5pt;margin-top:164.9pt;width:283.4pt;height:141.7pt;rotation:105" + aStyles[3] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Fallback/w:pict/v:rect", "style"); + // original is: "position:absolute;margin-left:97.55pt;margin-top:164.95pt;width:283.4pt;height:141.7pt;rotation:75" + + //check the size and position of each of the shapes + for( int i = 0; i < 4; ++i ) + { + CPPUNIT_ASSERT(!aStyles[i].isEmpty()); + + sal_Int32 nextTokenPos = 0; + do + { + OUString aStyleCommand = aStyles[i].getToken( 0, ';', nextTokenPos ); + CPPUNIT_ASSERT(!aStyleCommand.isEmpty()); + + OUString aStyleCommandName = aStyleCommand.getToken( 0, ':' ); + OUString aStyleCommandValue = aStyleCommand.getToken( 1, ':' ); + + if( aStyleCommandName == "margin-left" ) + { + float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(97.6, fValue, 0.1); + } + else if( aStyleCommandName == "margin-top" ) + { + float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(165.0, fValue, 0.2); + } + else if( aStyleCommandName == "width" ) + { + float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(283.4, fValue, 0.1); + } + else if( aStyleCommandName == "height" ) + { + float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(141.7, fValue, 0.1); + } + + } while( nextTokenPos != -1 ); + } + + // Check shape objects + + awt::Point aPos[4]; + aPos[0] = getShape(1)->getPosition(); + aPos[1] = getShape(2)->getPosition(); + aPos[2] = getShape(3)->getPosition(); + aPos[3] = getShape(4)->getPosition(); + + // certain degree of error is tolerated due to rounding in unit conversions + CPPUNIT_ASSERT(abs(4734 - aPos[0].X) < 10); + CPPUNIT_ASSERT(abs(4734 - aPos[1].X) < 10); + CPPUNIT_ASSERT(abs(4731 - aPos[2].X) < 10); + CPPUNIT_ASSERT(abs(4733 - aPos[3].X) < 10); + + CPPUNIT_ASSERT(abs(2845 - aPos[0].Y) < 10); + CPPUNIT_ASSERT(abs(2843 - aPos[1].Y) < 10); + CPPUNIT_ASSERT(abs(2842 - aPos[2].Y) < 10); + CPPUNIT_ASSERT(abs(2843 - aPos[3].Y) < 10); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73215, "fdo73215.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // 'rect' was 'pictureFrame', which isn't valid. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:prstGeom", + "prst", "rect"); + // 'adj1' was 'adj', which is not valid for bentConnector3. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[9]/wps:spPr/a:prstGeom/a:avLst/a:gd", + "name", "adj1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBehinddoc, "behinddoc.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // This was "0", shape was in the foreground. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "behindDoc", "1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSmartArtAnchoredInline, "fdo73227.docx") +{ + /* Given file contains 3 DrawingML objects as 1Picture,1SmartArt and 1Shape. + * Check for SmartArt. + * SmartArt should get written as "Floating Object" i.e. inside <wp:anchor> tag. + * Also check for value of attribute "id" of <wp:docPr>. It should be unique for + * all 3 DrawingML objects in a document. + */ + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr","id","1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr","name","Diagram1"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr","id","2"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr","name","10-Point Star 3"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[2]/wp:anchor/wp:docPr","id","3"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[2]/wp:anchor/wp:docPr","name","Picture 1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo65833, "fdo65833.docx") +{ + // The "editas" attribute for vml group shape was not preserved. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group", "editas", "canvas"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73247, "fdo73247.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm", + "rot", "1969200"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo70942, "fdo70942.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom", + "prst", "ellipse"); +} + +DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx") +{ + // The problem was that the position of the picture was incorrect, it was shifted towards the bottom right corner. + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + OString aXPath("/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:xfrm/a:off"); + // This was 720. + assertXPath(pXmlDocument, aXPath, "x", "0"); + // This was 1828800. + assertXPath(pXmlDocument, aXPath, "y", "0"); +} + +DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // check shape style has been preserved + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef", + "idx", "1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr", + "val", "accent1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef", + "idx", "1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr", + "val", "accent1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef", + "idx", "1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr", + "val", "accent1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef", + "idx", "2"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef/a:schemeClr", + "val", "accent1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef/a:schemeClr/a:shade", + "val", "50000"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:effectRef", + "idx", "0"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:effectRef/a:schemeClr", + "val", "accent1"); + + // check shape style hasn't been overwritten + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill", + 1); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill", + 1); + + // check direct theme assignments have been preserved + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr", + "val", "accent6"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:schemeClr", + "val", "accent3"); + + // check color transformations applied to theme colors have been preserved + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumMod", + "val", "40000"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumOff", + "val", "60000"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:schemeClr/a:lumMod", + "val", "50000"); + + // check direct color assignments have been preserved + OUString sFillColor = getXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:srgbClr", + "val"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), sFillColor.toInt32(16)); + sal_Int32 nLineColor = getXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr", + "val").toInt32(16); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), nLineColor); + + // check direct line type assignments have been preserved + sal_Int32 nLineWidth = getXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", + "w").toInt32(); + CPPUNIT_ASSERT(abs(63500 - nLineWidth) < 1000); //some rounding errors in the conversion ooxml -> libo -> ooxml are tolerated + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:miter", + 1); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", + 1); + + uno::Reference<drawing::XShape> xShape1 = getShape(1); + uno::Reference<drawing::XShape> xShape2 = getShape(2); + uno::Reference<drawing::XShape> xShape3 = getShape(3); + + // check colors are properly applied to shapes on import + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape1, "FillColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfcd5b5), getProperty<sal_Int32>(xShape2, "FillColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), getProperty<sal_Int32>(xShape3, "FillColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x3a5f8b), getProperty<sal_Int32>(xShape1, "LineColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f6228), getProperty<sal_Int32>(xShape2, "LineColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(xShape3, "LineColor")); + + // check line properties are properly applied to shapes on import + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty<drawing::LineStyle>(xShape1, "LineStyle")); + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty<drawing::LineStyle>(xShape2, "LineStyle")); + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_DASH, getProperty<drawing::LineStyle>(xShape3, "LineStyle")); + CPPUNIT_ASSERT_EQUAL(drawing::LineJoint_ROUND, getProperty<drawing::LineJoint>(xShape1, "LineJoint")); + CPPUNIT_ASSERT_EQUAL(drawing::LineJoint_ROUND, getProperty<drawing::LineJoint>(xShape2, "LineJoint")); + CPPUNIT_ASSERT_EQUAL(drawing::LineJoint_MITER, getProperty<drawing::LineJoint>(xShape3, "LineJoint")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO73546, "FDO73546.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + assertXPath(pXmlDoc, "/w:hdr/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "distL","0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69616, "fdo69616.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + // VML + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[1]/mc:AlternateContent/mc:Fallback/w:pict/v:group", "coordorigin").match("696,725")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlignForShape,"Shape.docx") +{ + //fdo73545:Shape Horizontal and vertical orientation is wrong + //The wp:align tag is missing after roundtrip + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/wp:positionH/wp:align"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineStyle_DashType, "LineStyle_DashType.docx") +{ + /* DOCX contatining Shape with LineStyle as Dash Type should get preserved inside + * an XML tag <a:prstDash> with value "dash", "sysDot", "lgDot", etc. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDotDot"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDot"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dashDot"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDot"); +} + +DECLARE_OOXMLEXPORT_TEST(testGradientFillPreservation, "gradient-fill-preservation.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // check rgb colors for every step in the gradient of the first shape + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", + "val", "ffff00"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", + "val", "ffff33"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[3]/a:srgbClr", + "val", "ff0000"); + + // check theme colors for every step in the gradient of the second shape + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='0']/a:schemeClr", + "val", "accent5"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr", + "val", "accent1"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='100000']/a:schemeClr", + "val", "accent1"); + + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:srgbClr/a:alpha", + "val", "20000"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:tint", + "val", "44500"); + assertXPath(pXmlDocument, + "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:satMod", + "val", "160000"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineStyle_DashType_VML, "LineStyle_DashType_VML.docx") +{ + /* DOCX contatining "Shape with text inside" having Line Style as "Dash Type" should get + * preserved inside an XML tag <v:stroke> with attribute dashstyle having value "dash". + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:stroke", "dashstyle", "dash"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo74110,"fdo74110.docx") +{ + /* + The File contains word art which is being exported as shape and the mapping is defaulted to + shape type rect since the actual shape type(s) is/are commented out for some reason. + The actual shape type(s) has/have adjustment value(s) where as rect does not have adjustment value. + Hence the following test case. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]", + "prst", "rect"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]",0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOuterShdw,"testOuterShdw.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "//mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:effectLst[1]/a:outerShdw[1]", "dist", "1041400"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExtentValue, "fdo74605.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + sal_Int32 nX = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent", "cx").toInt32(); + // This was negative. + CPPUNIT_ASSERT(nX >= 0); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); +} + +// part of tdf#93676, word gives the frame in the exported .docx a huge height, +// because it's exported with 255% height percentage from a 255 HeightPercent +// settings, but 255 is a special flag that the value is synced to the +// other dimension. +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSyncedRelativePercent, "tdf93676-1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // check no explicit pctHeight has been exported, all we care + // about at this point is that it's not 255000 + assertXPath(pXmlDoc, "//wp14:pctHeight", 0); +} + +DECLARE_OOXMLIMPORT_TEST(testTdf107119, "tdf107119.docx") +{ + uno::Reference<beans::XPropertySet> XPropsWrap(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(XPropsWrap, "Surround")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf133457, "tdf133457.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:framePr", "vAnchor", "text"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133924, "tdf133924.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "wrap", "around"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr", "wrap", "notBeside"); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx new file mode 100644 index 000000000..71696adeb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -0,0 +1,1118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + + +#include <com/sun/star/drawing/Hatch.hpp> +#include <com/sun/star/drawing/PointSequenceSequence.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#include <pagedesc.hxx> + +#include <comphelper/sequenceashashmap.hxx> + +#include <config_features.h> + +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"); + } + + // We import OOXML's EMUs into integral mm100 internal representation, then export back into + // EMUs. This results in inaccuracies. + void assertXPathHasApproxEMU(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, + const OString& rAttribute, sal_Int64 nAttributeVal) + { + OUString val = getXPath(pXmlDoc, rXPath, rAttribute); + // Use precision of 1/2 of 100th of mm, which is 180 EMU + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( + OString("XPath: " + rXPath + "\nAttribute: " + rAttribute).getStr(), nAttributeVal, + val.toInt64(), 180); + } +}; + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST( testChildNodesOfCubicBezierTo, "FDO74774.docx") +{ + /* Number of children required by cubicBexTo is 3 of type "pt". + While exporting, sometimes the child nodes are less than 3. + The test case ensures that there are 3 child nodes of type "pt" + for cubicBexTo + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath( pXmlDoc, + "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[3]/wps:spPr[1]/a:custGeom[1]/a:pathLst[1]/a:path[1]/a:cubicBezTo[2]/a:pt[3]"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMSwordHang,"test_msword_hang.docx") +{ + // fdo#74771: + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r[2]/w:drawing/wp:inline", "distT", "0"); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeThemeFont, "groupshape-theme-font.docx") +{ + // Font was specified using a theme reference, which wasn't handled. + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1); + // This was Calibri. + CPPUNIT_ASSERT_EQUAL(OUString("Cambria"), getProperty<OUString>(xRun, "CharFontName")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAnchorIdForWP14AndW14, "AnchorId.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline", "anchorId", "78735EFD"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "anchorId", "78735EFD"); + + +} + +DECLARE_OOXMLEXPORT_TEST(testDkVert, "dkvert.docx") +{ + // <a:pattFill prst="dkVert"> was exported as ltVert. + uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xShape(xGroup->getByIndex(0), uno::UNO_QUERY); + // This was 50. + CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<drawing::Hatch>(xShape, "FillHatch").Distance); +} + +DECLARE_OOXMLEXPORT_TEST(testTextWatermark, "textWatermark.docx") +{ + //The problem was that the watermark ID was not preserved, + //and Word uses the object ID to identify if it is a watermark. + //It has to have the 'PowerPlusWaterMarkObject' string in it + xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml"); + if (!pXmlHeader1) + return; + + assertXPath(pXmlHeader1, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]","id","PowerPlusWaterMarkObject93701316"); + + //The second problem was that Word uses also "o:spid" + const OUString& sSpid = getXPath(pXmlHeader1, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]","spid"); + CPPUNIT_ASSERT(!sSpid.isEmpty()); +} + +DECLARE_OOXMLEXPORT_TEST(testPictureWatermark, "pictureWatermark.docx") +{ + //The problem was that the watermark ID was not preserved, + //and Word uses the object ID to identify if it is a watermark. + //It has to have the 'WordPictureWaterMarkObject' string in it + + xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml"); + if (!pXmlHeader1) + return; + + // Check the watermark ID + assertXPath(pXmlHeader1, "/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:shape[1]","id","WordPictureWatermark11962361"); +} + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76249, "fdo76249.docx") +{ + /* + * The Locked Canvas is imported correctly, but while exporting + * the drawing element is exported inside a textbox. However the drawing has to exported + * as a Locked Canvas inside a text-box for the RT file to work in MS Word, as drawing elements + * are not allowed inside the textboxes. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76979, "fdo76979.docx") +{ + // The problem was that black was exported as "auto" fill color, resulting in well-formed, but invalid XML. + xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); + // This was "auto", not "FFFFFF". + assertXPath(pXmlDoc, "//wps:spPr/a:solidFill/a:srgbClr", "val", "FFFFFF"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104539, "tdf104539.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "dir", "13500000"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeEffectPreservation, "shape-effect-preservation.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // first shape with outer shadow, rgb color + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "algn", "tl"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "blurRad", "50800"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "dir", "2700000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "dist", "37674"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "rotWithShape", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr", + "val", "000000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha", + "val", "40000"); + + // second shape with outer shadow, scheme color + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "algn", "tl"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "blurRad", "114300"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "dir", "2700000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "dist", "203137"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", + "rotWithShape", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr", + "val", "accent1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:lumMod", + "val", "40000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:lumOff", + "val", "60000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:alpha", + "val", "40000"); + + // third shape with inner shadow, rgb color + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw", + "blurRad", "63500"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw", + "dir", "16200000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw", + "dist", "50800"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr", + "val", "ffff00"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha", + "val", "50000"); + + // 4th shape with soft edge + assertXPathHasApproxEMU( + pXmlDoc, + "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:softEdge", + "rad", 127000); // actually, it returns 127080 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:softEdge/*", + 0 ); // should not be present + + // 5th shape with glow effect, scheme color + assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr", + "val", "eb2722"); + + // 6th shape with reflection + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection", + "blurRad", "6350"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection", + "stA", "50000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection", + "endA", "300"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection", + "endPos", "55500"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection/*", + 0 ); // should not be present + + // 7th shape with several effects: glow, inner shadow and reflection + assertXPathHasApproxEMU(pXmlDoc, + "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow", + "rad", 63500); // actually, it returns 63360 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr", + "val", "eb2722"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw", + "blurRad", "63500"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw", + "dir", "2700000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr", + "val", "000000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha", + "val", "50000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection", + "blurRad", "6350"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection", + "stA", "52000"); + +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShape3DEffectPreservation, "shape-3d-effect-preservation.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // first shape: extrusion and shift on z, rotated camera with zoom, rotated light rig + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera", + "prst", "perspectiveRelaxedModerately"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera", + "zoom", "150000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot", + "lat", "19490639"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot", + "lon", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot", + "rev", "12900001"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig", + "rig", "threePt"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig", + "dir", "t"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot", + "lat", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot", + "lon", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot", + "rev", "4800000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "extrusionH", "63500"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "z", "488950"); + + // second shape: extrusion with theme color, no camera or light rotation, metal material + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera", + "prst", "isometricLeftDown"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot", + 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig", + "rig", "threePt"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig", + "dir", "t"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot", + 0); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "extrusionH", "25400"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "prstMaterial", "metal"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr", + "val", "accent5"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr/a:lumMod", + "val", "40000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr/a:lumOff", + "val", "60000"); + + // third shape: colored contour and top and bottom bevel, plastic material + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "contourW", "50800"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "prstMaterial", "plastic"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT", + "w", "139700"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT", + "h", "88900"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT", + "prst", "cross"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelB", + "h", "88900"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelB", + "prst", "relaxedInset"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:contourClr/a:srgbClr", + "val", "3333ff"); + + // fourth shape: wireframe + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d", + "prstMaterial", "legacyWireframe"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureEffectPreservation, "picture-effects-preservation.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // first picture: glow effect with theme color and transformations, 3d rotation and extrusion + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow", + "rad", "228600"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow/a:srgbClr", + "val", "267de6"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow/a:srgbClr/a:alpha", + "val", "40000"); + + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:camera", + "prst", "isometricRightUp"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:lightRig", + "rig", "threePt"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:sp3d", + "extrusionH", "76200"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:sp3d/a:extrusionClr/a:srgbClr", + "val", "92d050"); + + // second picture: shadow and reflection effects + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw", + "dir", "8076614"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr", + "val", "000000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha", + "val", "40000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:reflection", + "dir", "5400000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:reflection/*", + 0 ); // should not be present + + // third picture: soft edge effect + assertXPathHasApproxEMU( + pXmlDoc, + "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:softEdge", + "rad", 63500); // actually, it returns 63360 +} + +DECLARE_OOXMLEXPORT_TEST(testPictureArtisticEffectPreservation, "picture-artistic-effects-preservation.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pRelsDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc || !pRelsDoc) + return; + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL( + comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + + // 1st picture: marker effect + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticMarker", + "trans", "14000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticMarker", + "size", "80"); + + OUString sEmbedId1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer", + "embed"); + OUString sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId1 + "']"; + OUString sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target"); + CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/" + sFile))); + + // 2nd picture: pencil grayscale + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticPencilGrayscale", + "trans", "15000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticPencilGrayscale", + "pencilSize", "66"); + + OUString sEmbedId2 = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer", + "embed"); + CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId2); + + // 3rd picture: pencil sketch + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticPencilSketch", + "trans", "7000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticPencilSketch", + "pressure", "17"); + + OUString sEmbedId3 = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer", + "embed"); + CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId3); + + // 4th picture: light screen + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticLightScreen", + "trans", "13000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticLightScreen", + "gridSize", "1"); + + OUString sEmbedId4 = getXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer", + "embed"); + sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId4 + "']"; + sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target"); + CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/" + sFile))); + + // 5th picture: watercolor sponge + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticWatercolorSponge", + "brushSize", "4"); + + OUString sEmbedId5 = getXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer", + "embed"); + CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId5); + + // 6th picture: photocopy (no attributes) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/" + "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/" + "a14:artisticPhotocopy", 1); + + OUString sEmbedId6 = getXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer", + "embed"); + CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId6); + + // no redundant wdp files saved + CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/hdphoto3.wdp"))); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo77719, "fdo77719.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:custGeom[1]", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNestedAlternateContent, "nestedAlternateContent.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // We check alternateContent could not contains alternateContent (i.e. nested alternateContent) + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[2]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]",0); +} + +#if 0 +// Currently LibreOffice exports custom geometry for this hexagon, not preset shape. +// When LibreOffice can export preset shapes with correct modifiers, then this test can be re-enabled. + +DECLARE_OOXMLEXPORT_TEST(test76317, "test76317.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) return; + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]", "prst", "hexagon"); +} + +#endif + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo76591, "fdo76591.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "relativeHeight", "3"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76317_2K10, "test76317_2K10.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]", "name", "adj"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77122, "LinkedTextBoxes.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + //ensure that the text box links are preserved. + assertXPath(pXmlDoc, "//wps:txbx[1]", "id", "1"); + assertXPath(pXmlDoc, "//wps:linkedTxbx[1]", "id", "1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76734_2K7, "test76734_2K7.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", "wps"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test77219, "test77219.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", "1"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf77219_backgroundShape, "tdf77219_backgroundShape.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", false, getProperty<bool>(getShape(1), "Opaque")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf77219_foregroundShape, "tdf77219_foregroundShape.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", true, getProperty<bool>(getShape(1), "Opaque")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf108973_backgroundTextbox, "tdf108973_backgroundTextbox.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", false, getProperty<bool>(getShape(1), "Opaque")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf108973_foregroundTextbox, "tdf108973_foregroundTextbox.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", true, getProperty<bool>(getShape(1), "Opaque")); +} + +DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") +{ + // Document contains a flowChartMultidocument preset shape, our date for that shape wasn't correct. + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"]); + uno::Sequence<awt::Size> aSubViewSize((aPath["SubViewSize"]).get<uno::Sequence<awt::Size> >() ); + + // This was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), aSubViewSize[0].Height); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76101, "fdo76101.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:styles/w:style"); + xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; + CPPUNIT_ASSERT(4091 >= xmlXPathNodeSetGetLength(pXmlNodes)); + xmlXPathFreeObject(pXmlObj); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAndShapeOverlapping,"ShapeOverlappingWithSdt.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]/w:t[1]"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLockedCanvas, "fdo78658.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Checking for lockedCanvas tag + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/lc:lockedCanvas", 1); +} + +DECLARE_OOXMLEXPORT_TEST(fdo78474, "fdo78474.docx") +{ + xmlDocUniquePtr pXmlDoc1 = parseExport("word/document.xml"); + if (!pXmlDoc1) return; + //docx file after RT is getting corrupted. + assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", "rId2"); + + xmlDocUniquePtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc2) return; + assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbsolutePositionOffsetValue,"fdo78432.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + xmlXPathObjectPtr pXmlObjs[6]; + pXmlObjs[0] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"); + pXmlObjs[1] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]"); + + pXmlObjs[2] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[2]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"); + pXmlObjs[3] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[2]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]"); + + pXmlObjs[4] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[3]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"); + pXmlObjs[5] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[3]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]"); + + for(sal_Int32 index = 0; index<6; ++index) + { + CPPUNIT_ASSERT(pXmlObjs[index]->nodesetval != nullptr); + xmlNodePtr pXmlNode = pXmlObjs[index]->nodesetval->nodeTab[0]; + OUString contents = OUString::createFromAscii(reinterpret_cast<const char*>((pXmlNode->children[0]).content)); + CPPUNIT_ASSERT( contents.toInt64() <= SAL_MAX_INT32 ); + xmlXPathFreeObject(pXmlObjs[index]); + } +} + +DECLARE_OOXMLEXPORT_TEST(testRubyHyperlink, "rubyhyperlink.fodt") +{ + // test that export doesn't assert with overlapping ruby / hyperlink attr +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78300,"fdo78300.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, + "/w:document/w:body/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r[1]/w:drawing[1]", + 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWordArtWithinDraingtool, "testWordArtWithinDraingtool.docx") +{ +/* * Within a file, there is a 2007 wordArt enclosed in a drawing tool + * LO was exporting it as below: + * Sample XML as in Original file: + * <p> <r> <ac> <drawing> <txbx> <txbxContent> .. <pict> </pict> </txbxContent></txbx> </drawing> </ac> </r> </p> + * After RT : + * <p> <r> <ac> <drawing> <txbx> <txbxContent> .. <drawing> <txbx> <txbxContent> .. </txbxContent></txbx> </drawing> .. </txbxContent></txbx> </drawing> </ac> </r> </p> + * Expected : as there is nesting of a 2007 Word Art within a drawing tool, then can be separated in two different runs. + * */ + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent",1); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape",1); + // Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict. + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict",1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78663, "fdo78663.docx") +{ +/* * A 2007 word art tool is enclosed in a 2010 drawing toolWithin a file, + * Originally the file has the following xml tag hierarchy. + * + * <p> <r> <ac> <drawing> <txbx> <txbxContent> <pict><shapetype> <shape> ...</shape></shapetype> </pict> </txbxContent></txbx> </drawing> </ac> </r> </p> + * After RT : + * <p> <r> <ac> <drawing> <txbx> <txbxContent> <pict><shapetype> <shape> <textbox><txbxContent> ... </txbxContent></textbox></shape></shapetype> </pict> </txbxContent></txbx> </drawing> </ac> </r> </p> + * MSO doesn't allow nesting of txbxContent tags. + * As the text of the wordart tool is written in the tag <v:textpath string="Welcome to... "History is fun and informative"/> + * We shouldn't repeat it again in <shapetype><shape> <textbox><txbxContent> + * */ + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1); + // Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict. + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict",1); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo78957, "fdo78957.docx") +{ + xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml"); + + if(!pXmlHeader) + return; + + const sal_Int64 IntMax = SAL_MAX_INT32; + sal_Int64 cx = 0, cy = 0; + cx = getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]","cx").toInt64(); + cy = getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]","cy").toInt64(); + // Here we check the values of extent width & height + CPPUNIT_ASSERT(cx <= IntMax ); + CPPUNIT_ASSERT(cy >= 0 ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79256, "fdo79256.docx") +{ + /* corruption issue also solved by fixing tdf#108064: + * since that LO keeps MSO preset dash styles during OOXML export + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln/a:prstDash", "val", "lgDash"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDash1000thOfPercent, "dashed_line_custdash_1000th_of_percent.docx") +{ + /* Make sure that preset line is exported correctly as "1000th of a percent". + * This test-file has a CUSTOM dash-line that is defined as '1000th of a percent'. + * This should be imported by LO as-is, and exported back with the same values. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "d" , "100000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "sp", "300000"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "d" , "100000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDashPercentage, "dashed_line_custdash_percentage.docx") +{ + /* Make sure that preset line is exported correctly as "1000th of a percent". + * This test-file has a CUSTOM dash-line that is defined as percentages. + * This should be imported by LO as '1000th of a percent', and exported back + * as '1000th of a percent'. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "d" , "100000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "sp", "300000"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "d" , "100000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCommentInitials, "comment_initials.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/comments.xml"); + + assertXPath(pXmlDoc,"/w:comments/w:comment[1]", "initials", "initials"); +} + +DECLARE_OOXMLEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + comphelper::SequenceAsHashMap aCustomShapeGeometry(getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry")); + + // Test that the shape is a rounded rectangle. + CPPUNIT_ASSERT_EQUAL(OUString("ooxml-roundRect"), aCustomShapeGeometry["Type"].get<OUString>()); + + // The shape text should start with a table, with "a" in its A1 cell. + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1, xText), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79591, "fdo79591.docx") +{ + /* Values set for docPr name and shape ID attributes + * in RT file were not valid as per UTF-8 encoding format + * and hence was showing RT document as corrupt with error + * message "invalid character" + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr", "name", ""); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", ""); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") +{ + // The problem was that the shape in the header wasn't in the background. + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(1), "Opaque")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80894, "TextFrameRotation.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Rotation value was not roundtripped for textframe. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm", + "rot","16200000"); + + // w:enforcement defaults to off if not explicitly specified, so DocProtect forms should not be enabled. + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("No protected sections", sal_Int32(0), xSections->getCount()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80895, "fdo80895.docx") +{ + // DML shapes in header and footer were not getting rendered in LO and the same were not preserved after RT. + // In actual there was a shape but because of fetching wrong theme for header.xml or footer.xml + // resultant shape was with <a:noFill/> prop in <wps:spPr> hence was not visible. + // Checking there is a shape in header without <a:noFill/> element. + + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:noFill",0); + assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:noFill",0); + + // Check for fallback (required for MSO-2007) + assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "fillcolor", "#4f81bd"); + assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:fill", "type", "solid"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118242, "tdf118242.odt") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:pStyle", "val", "HeaderRight"); + + // w:sectPr is not exported + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:sectPr", 0); + + // and drawing is no longer in the document + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[3]", 0); + + //but it's in the header + pXmlDocument = parseExport("word/header1.xml"); + + assertXPath(pXmlDocument, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData" + "/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r/w:drawing", 1); + +} + +DECLARE_OOXMLEXPORT_TEST(testWrapTightThrough, "wrap-tight-through.docx") +{ + // These were wrapSquare without a wrap polygon before. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // The first shape should be wrapThrough with a wrap polygon (was wrapSquare). + assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapThrough/wp:wrapPolygon/wp:start", "x", "-1104"); + // The second shape should be wrapTight with a wrap polygon (was wrapSquare). + assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapTight/wp:wrapPolygon/wp:start", "y", "792"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.docx") +{ + // The problem was that the wrap polygon was ignored during export. + drawing::PointSequenceSequence aSeqSeq = getProperty<drawing::PointSequenceSequence>(getShape(1), "ContourPolyPolygon"); + // This was 0: the polygon list was empty. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength()); + + drawing::PointSequence aSeq = aSeqSeq[0]; + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeGrayscale, "picture_colormode_grayscale.docx") +{ + // The problem was that the grayscale was not exported + xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:grayscl", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeBlackWhite, "picture_colormode_black_white.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:biLevel", "thresh", "50000"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeWatermark, "picture_colormode_watermark.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "bright", "70000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "contrast", "-70000"); +} + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportShadow, "bnc637947.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dist" , "109865"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dir" , "634411"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr", "val" , "000000"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha", "val" , "38000"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportAdjustmentValue, "tdf91429.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd", "fmla", "val 50000"); +} + +DECLARE_OOXMLEXPORT_TEST(testTextVerticalAdjustment, "tdf36117_verticalAdjustment.docx") +{ + //Preserve the page vertical alignment setting for .docx + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT(pDoc); + + SwPageDesc* pDesc = &pDoc->GetPageDesc( 0 ); + drawing::TextVerticalAdjust nVA = pDesc->GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_CENTER, nVA ); + + pDesc = &pDoc->GetPageDesc( 1 ); + nVA = pDesc->GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_TOP, nVA ); + + pDesc = &pDoc->GetPageDesc( 2 ); + nVA = pDesc->GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_BOTTOM, nVA ); + + pDesc = &pDoc->GetPageDesc( 3 ); + nVA = pDesc->GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_BLOCK, nVA ); +} + +#if HAVE_MORE_FONTS +DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx") +{ + int followCount=0; + int precedeCount=0; + if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt","precede").isEmpty() ) + precedeCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt","follow").isEmpty() ) + followCount++; + if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt","precede").isEmpty() ) + precedeCount++; + //there should be 4 chains/13 linked textboxes (set of 5, set of 3, set of 3, set of 2) + //that means 9 NEXT links and 9 PREV links. + //however, the current implementation adds leftover shapes, so can't go on exact numbers + // (unknown number of flys, unknown order of leftovers) + CPPUNIT_ASSERT ( (followCount >= 6) && (precedeCount >= 6) ); +} +#endif + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTDF93675, "no-numlevel-but-indented.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "//w:ind", "start", "1418"); +} + + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // there should be no flipH and flipV attributes in this case + assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipH"); + assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipV"); + // check rotation angle + assertXPath(pXmlDoc, "//a:xfrm", "rot", "13500000"); + // check the first few coordinates of the polygon + CPPUNIT_ASSERT_DOUBLES_EQUAL( + 2351, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x").toInt32(), 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( + 3171, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y").toInt32(), 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( + 1695, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "x").toInt32(), 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( + 3171, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "y").toInt32(), 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( + 1695, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "x").toInt32(), 1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( + 1701, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y").toInt32(), 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92335, "tdf92335.docx") +{ + // Don't export redundant ListLabel character styles + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + + assertXPath(pXmlStyles, "//w:style[@w:styleId='ListLabel1']", 0); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx new file mode 100644 index 000000000..5b09147a0 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -0,0 +1,1199 @@ +/* -*- 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 <memory> + +#ifdef MACOSX +#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#include <premac.h> +#include <AppKit/AppKit.h> +#include <postmac.h> +#endif + +#include <swmodeltestbase.hxx> + +#include <IDocumentSettingAccess.hxx> +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/TableColumnSeparator.hpp> +#include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/text/XTextFramesSupplier.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/style/BreakType.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/table/ShadowFormat.hpp> +#include <com/sun/star/view/XFormLayerAccess.hpp> +#include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/table/TableBorder2.hpp> +#include <unotools/fltrcfg.hxx> +#include <comphelper/sequenceashashmap.hxx> +#include <oox/drawingml/drawingmltypes.hxx> +#include <xmloff/odffields.hxx> +#include <IDocumentMarkAccess.hxx> +#include <IMark.hxx> + +#include <bordertest.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} + + virtual std::unique_ptr<Resetter> preTest(const char* filename) override + { + if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx" ) + { + std::unique_ptr<Resetter> 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"); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testN751054, "n751054.docx") +{ + text::TextContentAnchorType eValue = getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"); + CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf48569, "tdf48569.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // File crashing while saving in LO + text::TextContentAnchorType eValue = getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, eValue); +} + +DECLARE_OOXMLEXPORT_TEST(testN750935, "n750935.docx") +{ + // Some page break types were ignores, resulting in less pages. + CPPUNIT_ASSERT_EQUAL(5, getPages()); + + /* + * The problem was that the header and footer was not shared. + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.FooterIsShared + */ + uno::Reference<beans::XPropertySet> 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<beans::XPropertySet> 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<drawing::XShape> xShape(xPropertySet, uno::UNO_QUERY); + awt::Size aActualSize(xShape->getSize()); + CPPUNIT_ASSERT(aActualSize.Width > 0); + + // The second shape should be a line + uno::Reference<lang::XServiceInfo> xServiceInfo(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo49940, "fdo49940.docx") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<beans::XPropertySet> 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<text::XTextRange > paragraph = getParagraph(3); + CPPUNIT_ASSERT_EQUAL(OUString("09/02/14"), paragraph->getString()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo81486, "fdo81486.docx") +{ + uno::Reference<text::XTextRange > paragraph = getParagraph(1); + CPPUNIT_ASSERT_EQUAL(OUString("CustomTitle"), paragraph->getString()); +} + +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<container::XNameContainer> xStyles; + xStyleFamilies->getByName("ParagraphStyles") >>= xStyles; + uno::Reference<beans::XPropertySet> xPropertySetHeader( xStyles->getByName("Header"), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(false, xPropertySetHeader->getPropertyValue("ParaLineNumberCount").get<bool>()); + uno::Reference<beans::XPropertySet> xPropertySetFooter( xStyles->getByName("Footer"), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(false, xPropertySetFooter->getPropertyValue("ParaLineNumberCount").get<bool>()); +} + +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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + uno::Reference<drawing::XShapes> shapes(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShape> image; + shapes->getByIndex(0) >>= image; + uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); + uno::Reference<graphic::XGraphic> graphic; + imageProperties->getPropertyValue( "Graphic" ) >>= graphic; + uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(120), bitmap->getSize().Width ); + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(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") +{ +/* +<v:shapetype> must be global, reachable even from <v:shape> inside another <w:pict> +image = ThisComponent.DrawPage.getByIndex(0) +xray image.FillColor +*/ + uno::Reference<drawing::XShape> image = getShape(1); + uno::Reference<beans::XPropertySet> 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<drawing::XShape> image1 = getShape(1), image2 = getShape(2), image3 = getShape(3); + sal_Int32 zOrder1, zOrder2, zOrder3; + OUString descr1, descr2, descr3; + uno::Reference<beans::XPropertySet> imageProperties1(image1, uno::UNO_QUERY); + imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1; + imageProperties1->getPropertyValue( "Description" ) >>= descr1; + uno::Reference<beans::XPropertySet> imageProperties2(image2, uno::UNO_QUERY); + imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2; + imageProperties2->getPropertyValue( "Description" ) >>= descr2; + uno::Reference<beans::XPropertySet> 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<uno::XInterface> paragraph1(getParagraph( 2, "text1" )); + uno::Reference<uno::XInterface> 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<beans::XPropertySet> 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, 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> 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 ' 11, was larger + * oPara = oParas.nextElement + * xray oPara.ParaFirstLineIndent ' -635, was 0 + */ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration()); + + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration()); + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + float fValue = 0; + xPropertySet->getPropertyValue("CharHeight") >>= fValue; + CPPUNIT_ASSERT_EQUAL(11.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<beans::XPropertySet> 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") +{ +/* <w:numPr> in the paragraph itself was overridden by <w:numpr> introduced by the paragraph's <w:pStyle> +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< text::XTextRange > paragraph(getParagraph( 1, "Text1." )); + OUString numberingStyleName = getProperty< OUString >( paragraph, "NumberingStyleName" ); + uno::Reference<text::XNumberingRulesSupplier> xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> numberingRules = xNumberingRulesSupplier->getNumberingRules(); + uno::Reference<container::XIndexAccess> 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<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1905), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf59699, "tdf59699.docx") +{ + uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY); + auto xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(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<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty<sal_Int32>(xPropertySet, "TopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty<sal_Int32>(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<sal_Int32>(getParagraph(1), "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3810), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty<sal_Int32>(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. + */ + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106724, "tdf106724.docx") +{ + // This document simply crashed the importer. +} + +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(testTdf66496, "tdf66496.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 + */ + { // Check first shape + uno::Reference<beans::XPropertySet> xShapeProperties( getShape(1), uno::UNO_QUERY ); + uno::Reference<drawing::XShapeDescriptor> 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); + } + + { // Check second shape + uno::Reference<beans::XPropertySet> xShapeProperties( getShape(2), uno::UNO_QUERY ); + uno::Reference<drawing::XShapeDescriptor> 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<text::XTextRange> xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xFrame->getString().startsWith( "Lorem ipsum" ) ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3454), getProperty<sal_Int32>(xFrame, "Height")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo74357, "fdo74357.docx") +{ + // Floating table wasn't converted to a textframe. + // This was 0. + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + // Bottom margin of the first paragraph was too large, causing a layout problem. + // This was 494. + CPPUNIT_ASSERT_EQUAL(sal_Int32(86), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo55187, "fdo55187.docx") +{ + // 0x010d was imported as a newline. + getParagraph(1, OUString(u"lup\u010Dka")); +} + +DECLARE_OOXMLEXPORT_TEST(testN780563, "n780563.docx") +{ + /* + * Make sure we have the table in the fly frame created + */ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> 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<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + //tdf#102619 - I would have expected this to be "Standard", but MSO 2013/2010/2003 all give FollowStyle==Date + uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Date"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Date"), getProperty<OUString>(properties, "FollowStyle")); +} + +DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx") +{ + uno::Reference< text::XTextRange > xPara = getParagraph(1); + OUString aStyleName = getProperty<OUString>(xPara, "PageStyleName"); + // what happens on export here is that the "Default Style" isn't actually + // used on page 2, because of the hard page break with style "Converted2" + // and therefore SwPageDesc::IsFollowNextPageOfNode() returns false and + // "w:titlepg" element is not written + // (the export result is wrong with or without w:titlepg, because the footer + // on the 2nd page should be the text "shown footer") + if (mbExported) + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), aStyleName); + else + CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aStyleName); + + + //tdf64372 this document should only have one page break (2 pages, not 3) + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +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<OUString>(xPara, "PageStyleName"); + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(aStyleName), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xFooterText = getProperty< uno::Reference<text::XTextRange> >(xPageStyle, "FooterText"); + CPPUNIT_ASSERT_EQUAL( OUString("hidden footer"), xFooterText->getString() ); + + CPPUNIT_ASSERT_EQUAL( 7, getParagraphs() ); +} + +DECLARE_OOXMLEXPORT_TEST(testShadow, "imgshadow.docx") +{ + /* + * The problem was that drop shadows on inline images were not being + * imported and applied. + */ + uno::Reference<beans::XPropertySet> xPropertySet(getShape(2), uno::UNO_QUERY); + + bool bShadow = getProperty<bool>(xPropertySet, "Shadow"); + CPPUNIT_ASSERT(bShadow); + + sal_Int32 nShadowXDistance = getProperty<sal_Int32>(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<style::BreakType>(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<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> 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<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "LeftMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo52208, "fdo52208.docx") +{ + // The problem was that the document had 2 pages instead of 1. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_OOXMLEXPORT_TEST(testN785767, "n785767.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + // 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<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position); + CPPUNIT_ASSERT_MESSAGE("B1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence<text::TableColumnSeparator> >(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<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); + table::TableBorder2 aBorder; + xTableProperties->getPropertyValue("TableBorder2") >>= aBorder; + CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::FINE_DASHED, aBorder.RightLine.LineStyle); +} + +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 + */ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroupShape->getCount()); + + uno::Reference<drawing::XShapes> xInnerGroupShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xInnerGroupShape->getCount()); + + uno::Reference<drawing::XShape> 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<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> 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<float>(xShape->getText(), "CharHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testN793262, "n793262.docx") +{ + uno::Reference<container::XEnumerationAccess> xHeaderText = getProperty< uno::Reference<container::XEnumerationAccess> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + uno::Reference<container::XEnumeration> 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<float>(xHeaderParagraphs->nextElement(), "CharHeight")); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Cell margins as direct formatting were ignored, this was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(76), getProperty<sal_Int32>(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 const 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<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + + // First problem: check that we have 2 tables, nesting caused the + // creation of outer one to fail + uno::Reference<container::XIndexAccess> 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<text::XTextTable> xTextTable(xTextTablesSupplier->getTextTables()->getByName("Table2"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xAnchor(xTextTable->getAnchor(), uno::UNO_QUERY); + uno::Any aFrame = xAnchor->getPropertyValue("TextFrame"); + uno::Reference<beans::XPropertySet> xFrame; + aFrame >>= xFrame; + sal_Int16 nValue; + xFrame->getPropertyValue("VertOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", text::VertOrientation::BOTTOM, nValue); + xFrame->getPropertyValue("VertOrientRelation") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation relation", text::RelOrientation::PAGE_PRINT_AREA, nValue); + + // tdf#106572 - perhaps not the best test to hijack since this file + // produces an error in Word, but it nicely matches danger points, + // and has a different first footer, so nice visual confirmation. + CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName")); +} + +DECLARE_OOXMLEXPORT_TEST(testTbLrHeight, "tblr-height.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("B1"); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, getProperty<sal_Int16>(xCell, "WritingMode")); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc865381, "bnc865381.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTextTable->getCellByName("A2"); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, getProperty<sal_Int16>(xCell, "WritingMode")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo53985, "fdo53985.docx") +{ + // Unhandled exception prevented import of the rest of the document. + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xTables->getCount()); // Only 4 tables were imported. + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT_MESSAGE("Compatibility: Protect form", pDoc->getIDocumentSettingAccess().get( DocumentSettingId::PROTECT_FORM ) ); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xSections->getCount()); // The first paragraph wasn't counted as a section. + + uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("TextSection is protected", true, getProperty<bool>(xSect, "IsProtected")); + xSect.set(xSections->getByIndex(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Section3 is protected", false, getProperty<bool>(xSect, "IsProtected")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo59638, "fdo59638.docx") +{ + // The problem was that w:lvlOverride inside w:num was ignores by dmapper. + + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + for (beans::PropertyValue const & rProp : std::as_const(aProps)) + { + if (rProp.Name == "BulletChar") + { + // Was '*', should be 'o'. + CPPUNIT_ASSERT_EQUAL(OUString(u"\uF0B7"), rProp.Value.get<OUString>()); + 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. + CPPUNIT_ASSERT_EQUAL(1, getShapes()); +} + +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<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + if (xIndexAccess->getCount()) + { + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(0), getProperty<sal_Int32>(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<sal_Int32>(getRun(getParagraph(1), 1), "CharEscapementHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo59273, "fdo59273.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> 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(12963), getProperty<sal_Int32>(xTextTable, "Width")); + + uno::Reference<table::XTableRows> xTableRows = xTextTable->getRows(); + // Was 9997, so the 4th column had ~zero width + CPPUNIT_ASSERT_LESSEQUAL(2, (sal_Int16(7500) + - getProperty<uno::Sequence<text::TableColumnSeparator>>( + xTableRows->getByIndex(0), "TableColumnSeparators")[2] + .Position)); +} + +DECLARE_OOXMLEXPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbllook.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Background was -1. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x7F7F7F), getProperty<sal_Int32>(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<sal_Int32>(getShape(1), "TopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testN592908_Frame, "n592908-frame.docx") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + text::WrapTextMode eValue; + xPropertySet->getPropertyValue("Surround") >>= eValue; + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, eValue); +} + +DECLARE_OOXMLEXPORT_TEST(testN592908_Picture, "n592908-picture.docx") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + text::WrapTextMode eValue; + xPropertySet->getPropertyValue("Surround") >>= eValue; + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, eValue); +} + +DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx") +{ + // A combo box is imported + if (getShapes() > 0) + { + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(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<OUString>(xPropertySet, "DefaultText")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength()); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPropertySet, "Dropdown")); + } + else + { + // ComboBox was imported as DropDown text field + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + uno::Any aField = xFields->nextElement(); + uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown")); + + uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(aField, "Items"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aItems.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Yes"), aItems[0]); + CPPUNIT_ASSERT_EQUAL(OUString("No"), aItems[1]); + CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), aItems[2]); + } +} + +DECLARE_OOXMLEXPORT_TEST(testIndentation, "indentation.docx") +{ + uno::Reference<uno::XInterface> xParaLTRTitle(getParagraph( 1, "Title aligned")); + uno::Reference<uno::XInterface> xParaLTRNormal(getParagraph( 2, "")); + + // this will test the text direction for paragraphs + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>( xParaLTRTitle, "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>( 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<table::ShadowFormat>(getStyles("PageStyles")->getByName("Standard"), "ShadowFormat"); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(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 <w:tbl> without any paragraph in between, but with different tblpPr. In this + // case we need to have 2 different tables instead of 1 + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testN820509, "n820509.docx") +{ + // M.d.yyyy date format was unhandled. + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); + + ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*pMarkAccess->getAllMarksBegin()); + + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); + + const sw::mark::IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); + OUString sDateFormat; + auto pResult = pParameters->find(ODF_FORMDATE_DATEFORMAT); + if (pResult != pParameters->end()) + { + pResult->second >>= sDateFormat; + } + CPPUNIT_ASSERT_EQUAL(OUString("M.d.yyyy"), sDateFormat); +} + +DECLARE_OOXMLEXPORT_TEST(testN830205, "n830205.docx") +{ + // Previously import just crashed (due to infinite recursion). + getParagraph(1, "XXX"); +} + +DECLARE_OOXMLEXPORT_TEST(tdf123705, "tdf123705.docx") +{ +} + +DECLARE_OOXMLEXPORT_TEST(testTableAutoColumnFixedSize, "table-auto-column-fixed-size.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> 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<sal_Int32>(xTextTable, "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testTableAutoColumnFixedSize2, "table-auto-column-fixed-size2.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> 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<sal_Int32>(xTextTable, "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo46361, "fdo46361.docx") +{ + uno::Reference<container::XIndexAccess> xGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); + // This was CENTER. + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty<drawing::TextVerticalAdjust>(xShape, "TextVerticalAdjust")); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText(); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText); + // This was LEFT. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); + // This was black, not green. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x008000), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); + // \n char was missing due to unhandled w:br. + uno::Reference<text::XText> xShapeText(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("text\ntext"), xShapeText->getString()); + // \n chars were missing, due to unhandled multiple w:p tags. + xShapeText.set(xGroupShape->getByIndex(2), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("text\ntext\n"), xShapeText->getString()); + + // tdf#128153 The first and second lines are directly specified as centered. Make sure that doesn't change. + xParagraph.set(getParagraphOfText(2, xShapeText->getText(), "text")); + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); + // The last paragraph should be left aligned. + xParagraph.set(getParagraphOfText(3, xShapeText->getText(), "")); + CPPUNIT_ASSERT_MESSAGE("You FIXED me!", style::ParagraphAdjust_LEFT != static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); +} + +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<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XText> xText(xFootnotes->getByIndex(0), uno::UNO_QUERY); + //uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(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<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(10492), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); +} + +DECLARE_OOXMLEXPORT_TEST(testGroupshapeRotation, "groupshape-rotation.docx") +{ + // Rotation on groupshapes wasn't handled at all by the VML importer. + // Note: the shapes are still shifting on the page, so the rotation drifts after multiple round-trips. + CPPUNIT_ASSERT_DOUBLES_EQUAL(31500.0, getProperty<double>(getShape(1), "RotateAngle"), 100); +} + +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. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +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<sal_Int32>(getParagraph(1), "ParaBottomMargin")); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> 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<sal_Int32>(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<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> 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<sal_Int32>(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<style::BreakType>(getParagraphOrTable(2), "BreakType")); + + // This one is outside the table: should not be ignored. + CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty<style::BreakType>(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<drawing::XShapes> xOuterGroupShape(getShape(1), uno::UNO_QUERY); + uno::Reference<drawing::XShapes> xInnerGroupShape(xOuterGroupShape->getByIndex(0), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape(xInnerGroupShape->getByIndex(0), uno::UNO_QUERY); + // Was CENTER. + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty<drawing::TextVerticalAdjust>(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<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-270), aCustomShapeGeometry["TextPreRotateAngle"].get<sal_Int32>()); +} + +DECLARE_OOXMLEXPORT_TEST(testChartProp, "chart-prop.docx") +{ + // The problem was that chart was not getting parsed in writer module. + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(15240), getProperty<sal_Int32>(xPropertySet, "Width")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8890), getProperty<sal_Int32>(xPropertySet, "Height")); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo43093, "fdo43093b.docx") +{ + // The problem was that the direction and alignment are not correct for RTL paragraphs. + uno::Reference<uno::XInterface> 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<uno::XInterface> 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<uno::XInterface> 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<uno::XInterface> 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); +} + +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 000000000..ae47d4f28 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -0,0 +1,1546 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <config_features.h> + +#include <com/sun/star/awt/Size.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/text/XFootnote.hpp> +#include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/text/XTextColumns.hpp> +#include <com/sun/star/text/XTextFramesSupplier.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/style/BreakType.hpp> +#include <com/sun/star/style/PageStyleLayout.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> +#include <com/sun/star/view/XFormLayerAccess.hpp> +#include <com/sun/star/view/XViewSettingsSupplier.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <com/sun/star/style/LineSpacing.hpp> +#include <com/sun/star/style/LineSpacingMode.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/text/TextContentAnchorType.hpp> + +#include <ftninfo.hxx> +#include <sfx2/docfile.hxx> +#include <sfx2/docfilt.hxx> + +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"); + } +}; + +class DocmTest : public SwModelTestBase +{ +public: + DocmTest() + : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "MS Word 2007 XML VBA") + { + } +}; + +DECLARE_OOXMLEXPORT_TEST(testFdo55381, "fdo55381.docx") +{ + CPPUNIT_ASSERT_EQUAL(4, getPages()); + //TODO: frames not located on the correct pages +} + +DECLARE_OOXMLEXPORT_TEST(testDocm, "hello.docm") +{ + // Make sure that we check the name of the export filter. + // This was application/vnd.ms-word.document.macroEnabled.main+xml when the + // name of the import filter was checked. + if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml")) + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", + "ContentType", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"); +} + +DECLARE_OOXMLEXPORT_TEST(testDefaultContentTypes, "fdo55381.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml")) + { + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Default[@Extension='xml']", + "ContentType", + "application/xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Default[@Extension='rels']", + "ContentType", + "application/vnd.openxmlformats-package.relationships+xml"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Default[@Extension='png']", + "ContentType", + "image/png"); + + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Default[@Extension='jpeg']", + "ContentType", + "image/jpeg"); + } +} + +DECLARE_SW_ROUNDTRIP_TEST(testDocmSave, "hello.docm", nullptr, DocmTest) +{ + // This was + // application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, + // we used the wrong content type for .docm files. + if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml")) + assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", + "ContentType", + "application/vnd.ms-word.document.macroEnabled.main+xml"); +} + +DECLARE_SW_ROUNDTRIP_TEST(testBadDocm, "bad.docm", nullptr, DocmTest) +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + // This was 'MS Word 2007 XML', broken docm files were not recognized. + CPPUNIT_ASSERT_EQUAL(OUString("MS Word 2007 XML VBA"), pTextDoc->GetDocShell()->GetMedium()->GetFilter()->GetName()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf109063, "tdf109063.docx") +{ + // This was 1, near-page-width table was imported as a TextFrame. + CPPUNIT_ASSERT_EQUAL(0, getShapes()); +} + +DECLARE_SW_ROUNDTRIP_TEST(testTdf108269, "tdf108269.docm", nullptr, DocmTest) +{ + if (!mbExported) + return; + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); + // This failed: VBA streams were not roundtripped via the doc-level + // grab-bag. + CPPUNIT_ASSERT(xNameAccess->hasByName("word/vbaProject.bin")); + CPPUNIT_ASSERT(xNameAccess->hasByName("word/vbaData.xml")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf92045, "tdf92045.docx") +{ + // This was true, <w:effect w:val="none"/> resulted in setting the blinking font effect. + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getRun(getParagraph(1), 1), "CharFlash")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf95031, "tdf95031.docx") +{ + // This was 494, in-numbering paragraph's automating spacing was handled as visible spacing, while it should not. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106690, "tdf106690.docx") +{ + // This was 0, numbering rules with automatic spacing meant 0 + // before/autospacing for all text nodes, even for ones at the start/end of + // a numbered text node block. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(2), "ParaTopMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106690Cell, "tdf106690-cell.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 0, bottom margin of the second paragraph in the A1 table cell + // had a reduced auto-space, just because of a next paragraph in the A2 + // cell. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf122342, "tdf122342.docx") +{ + // These were 494, style based numbering rules with automatic spacing meant 0 + // before/autospacing for all text nodes, even for ones at the start/end of + // a numbered text node block. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); + // last list item + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(3), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132802, "tdf132802.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "after", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "after", "0"); + // This was 0 (list auto spacing is not zero before tables) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing", "after", "280"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "0"); + // This was 0 (list auto spacing is not zero at the end of table cells) + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "after", "280"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "280"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "280"); + // This was 0 (list auto spacing is not zero at list end) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "280"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132807, "tdf132807.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "before", "280"); + // This was 240 (list auto spacing is zero in lists) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "0"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0"); + // This was 240 (list auto spacing is zero in lists) + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "before", "0"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing", "before", "280"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:spacing", "before", "280"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133052, "tdf133052.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // These were 240 (top auto spacing of list subitems are zero) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:spacing", "before", "0"); + // in tables, too + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[3]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[4]/w:pPr/w:spacing", "before", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[5]/w:pPr/w:spacing", "before", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134648, "tdf134648.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // list item with direct top auto spacing + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "after", "240"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing", "1"); + + // This was spacing w:after=200, but bottom auto spacing of first list subitem is zero + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf129575_directBefore, "tdf129575-directBefore.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // direct paragraph formatting + // This was 212 twips from the table style, but always direct paragraph formatting wins, in the case of the default 0 margin, too + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + // default margin + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf129575_directAfter, "tdf129575-directAfter.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // from table style + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(212), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + // direct paragraph formatting + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf129575_styleAfter, "tdf129575-styleAfter.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // direct paragraph formatting + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + // from table style + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(212), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf129575_docDefault, "tdf129575-docDefault.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // docDefault defines both bottom margin and line spacing, but + // applied bottom margin values are based on non-docDefault paragraph styles, line spacing is based on table style + + // docDefault: <w:spacing w:after="160" w:line="320" w:lineRule="auto"/> + // table style: <w:spacing w:after="0" w:line="240" w:lineRule="auto"/> (single line space, overwriting bigger docDefault) + + // Paragraph style Normal: <w:spacing w:after="160"/> (same as docDefault), + // table style based single line spacing + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(282), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); + style::LineSpacing aLineSpacing = getProperty<style::LineSpacing>(getParagraphOfText(1, xCell->getText()), "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), aLineSpacing.Height); + // Heading 2: <w:spacing w:after="360"/> (different from docDefault), + // table style based single line spacing + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(635), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaBottomMargin")); + aLineSpacing = getProperty<style::LineSpacing>(getParagraphOfText(1, xCell->getText()), "ParaLineSpacing"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aLineSpacing.Mode); + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), aLineSpacing.Height); + +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118812, "tdf118812_tableStyles-comprehensive.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // cell A1 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "before", "480"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "after", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "CharSubStyleDefaults"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16"); + // cell A2 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "before", "480"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "after", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "ParaSubStyleDefaultsChar"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:rStyle", "val", "CharSubStyleNormal"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:sz", "val", "16"); + // cell A3 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:pStyle", "val", "ParaSubStyleNormal"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "before", "480"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "after", "280"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[1]/w:rPr/w:sz", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "CharSubStyleNormal"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:sz", 0); + // cell A4 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:pStyle", "val", "ParaSubStyleDefaults"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "before", "480"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "after", "200"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[1]/w:rPr/w:sz", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "CharSubStyleDefaults"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:sz", 0); + // cell A5 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "line"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:rPr", "color"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:rPr", "sz"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "before", "480"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "after", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:color", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:color", "val", "AAAA00"); // all text in color + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16"); + // cell A6 + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "line"); + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:rPr", "color"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:rPr/w:sz", "val", "16"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "before", "480"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "after", "20"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:color", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:color", "val", "AAAA00"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107626, "tdf107626.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // This was 2 (missing trailing cell in merged cell range) + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc", 3); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx") +{ + // The second paragraph (first numbered one) had 0 bottom margin: + // autospacing was even collapsed between different numbering styles. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(3), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(4), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4318), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); + + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + if (!pXmlDoc) + return; + // Validation test: order of elements was wrong. Order was: insideH, end, insideV. + int nEnd = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "end"); + int nInsideH = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "insideH"); + int nInsideV = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "insideV"); + CPPUNIT_ASSERT(nEnd < nInsideH); + CPPUNIT_ASSERT(nInsideH < nInsideV); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf109306, "tdf109306.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // Both types of relative width specification (pct): simple integers (in fiftieths of percent) + // and floats with "%" unit specification must be treated correctly + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(9), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); + + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(1), "IsWidthRelative")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(80), getProperty<sal_Int16>(xTables->getByIndex(1), "RelativeWidth")); +} + +DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx") +{ + CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(1), 1), "CharAutoKerning")); + // This failed: kerning was also enabled for the second paragraph. + CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(2), 1), "CharAutoKerning")); + + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Default Paragraph Style"), uno::UNO_QUERY); + //tdf107801: kerning normally isn't enabled by default for .docx + CPPUNIT_ASSERT_EQUAL_MESSAGE("AutoKern should be false", false, getProperty<bool>(xStyle, "CharAutoKerning")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.docx") +{ + // the paragraph style should set table's text-flow break-before-page + CPPUNIT_ASSERT_EQUAL( 3, getPages() ); + + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Default Paragraph Style"), uno::UNO_QUERY); + //tdf107801: kerning info wasn't exported previously. + CPPUNIT_ASSERT_EQUAL_MESSAGE("AutoKern should be true", true, getProperty<bool>(xStyle, "CharAutoKerning")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104420, "tdf104420_lostParagraph.docx") +{ + // the add/remove dummy paragraph was losing an entire header and paragraph + CPPUNIT_ASSERT_EQUAL( 2, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPadding.odt") +{ + // the page style's borderless padding should force this to 3 pages, not 1 + CPPUNIT_ASSERT_EQUAL( 3, getPages() ); +} + +#if HAVE_MORE_FONTS +DECLARE_OOXMLEXPORT_TEST(tdf105490_negativeMargins, "tdf105490_negativeMargins.docx") +{ + // negative margins should change to minimal margins, not default margins. + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} +#endif + +DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth,"tdf97648_relativeWidth.docx") +{ + CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(7616), getShape(1)->getSize().Width, 10); + CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(8001), getShape(2)->getSize().Width, 10); + CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(4001), getShape(3)->getSize().Width, 10); + CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_LEFT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(6), "ParaAdjust")) ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(1600), getShape(4)->getSize().Width, 10); + CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_RIGHT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(8), "ParaAdjust")) ); + + + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), getProperty<sal_Int32>(getShape(1), "LeftMargin") ); + if (!mbExported) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text should wrap above/below the line", text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(getShape(1), "Surround")); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(2), "HoriOrient")); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::RIGHT, getProperty<sal_Int16>(getShape(3), "HoriOrient")); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT, getProperty<sal_Int16>(getShape(4), "HoriOrient")); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx") +{ + CPPUNIT_ASSERT_MESSAGE("There should be two or three pages", getPages() <= 3 ); + + //tdf#95114 - follow style is Text Body - DOCX test + uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("annotation subject"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("annotation text"), getProperty<OUString>(properties, "FollowStyle")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, "tdf46940_dontEquallyDistributeColumns.docx") +{ + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns")); + // This was false, columns before a section-page-break were balanced. + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(2), "DontBalanceTextColumns")); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(3), "DontBalanceTextColumns")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf98700_keepWithNext, "tdf98700_keepWithNext.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading style keeps with next", true, getProperty<bool>(getParagraph(1), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default style doesn't keep with next", false, getProperty<bool>(getParagraph(2), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 1 style inherits keeps with next", true, getProperty<bool>(getParagraph(3), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 2 style disabled keep with next", false, getProperty<bool>(getParagraph(4), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text Body style toggled off keep with next", false, getProperty<bool>(getParagraph(5), "ParaKeepTogether")); + + //tdf#95114 - follow style is Text Body - ODT test + uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Text body"), getProperty<OUString>(properties, "FollowStyle")); +} + +// base class to supply a helper method for testHFLinkToPrev +class testHFBase : public Test +{ +protected: + OUString + getHFText(const uno::Reference<style::XStyle>& xPageStyle, + const OUString &sPropName) + { + auto xTextRange = getProperty< uno::Reference<text::XTextRange> >( + xPageStyle, sPropName); + return xTextRange->getString(); + } +}; + +DECLARE_SW_EXPORT_TEST(testHFLinkToPrev, "headerfooter-link-to-prev.docx", nullptr, testHFBase) +{ + uno::Reference<container::XNameAccess> xPageStyles = getStyles("PageStyles"); + + // get a page cursor + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier( + xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor( + xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + + // get LO page style for page 1, corresponding to docx section 1 first page + xCursor->jumpToFirstPage(); + OUString pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + uno::Reference<style::XStyle> xPageStyle( + xPageStyles->getByName(pageStyleName), uno::UNO_QUERY); + // check page 1 header & footer text + CPPUNIT_ASSERT_EQUAL(OUString("First page header for all sections"), + getHFText(xPageStyle, "HeaderText")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer for section 1 only"), + getHFText(xPageStyle, "FooterText")); + + // get LO page style for page 2, corresponding to docx section 1 + xCursor->jumpToPage(2); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); + // check header & footer text + CPPUNIT_ASSERT_EQUAL(OUString("Even page header for section 1 only"), + getHFText(xPageStyle, "HeaderTextLeft")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer for all sections"), + getHFText(xPageStyle, "FooterTextLeft")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header for all sections"), + getHFText(xPageStyle, "HeaderText")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer for section 1 only"), + getHFText(xPageStyle, "FooterText")); + + // get LO page style for page 4, corresponding to docx section 2 first page + xCursor->jumpToPage(4); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); + // check header & footer text + CPPUNIT_ASSERT_EQUAL(OUString("First page header for all sections"), + getHFText(xPageStyle, "HeaderText")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer for sections 2 and 3 only"), + getHFText(xPageStyle, "FooterText")); + + // get LO page style for page 5, corresponding to docx section 2 + xCursor->jumpToPage(5); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); + // check header & footer text + CPPUNIT_ASSERT_EQUAL(OUString("Even page header for sections 2 and 3 only"), + getHFText(xPageStyle, "HeaderTextLeft")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer for all sections"), + getHFText(xPageStyle, "FooterTextLeft")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header for all sections"), + getHFText(xPageStyle, "HeaderText")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer for sections 2 and 3 only"), + getHFText(xPageStyle, "FooterText")); + + // get LO page style for page 7, corresponding to docx section 3 first page + xCursor->jumpToPage(7); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); + // check header & footer text + CPPUNIT_ASSERT_EQUAL(OUString("First page header for all sections"), + getHFText(xPageStyle, "HeaderText")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer for sections 2 and 3 only"), + getHFText(xPageStyle, "FooterText")); + + // get LO page style for page 8, corresponding to docx section 3 + xCursor->jumpToPage(8); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); + // check header & footer text + CPPUNIT_ASSERT_EQUAL(OUString("Even page header for sections 2 and 3 only"), + getHFText(xPageStyle, "HeaderTextLeft")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer for all sections"), + getHFText(xPageStyle, "FooterTextLeft")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header for all sections"), + getHFText(xPageStyle, "HeaderText")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer for sections 2 and 3 only"), + getHFText(xPageStyle, "FooterText")); +} + +DECLARE_OOXMLEXPORT_TEST(testRhbz988516, "rhbz988516.docx") +{ + // The problem was that the list properties of the footer leaked into body + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(1), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString("Enclosure 3"), getParagraph(2)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(2), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(3), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(4), "NumberingStyleName")); + + // tdf#103975 The problem was that an empty paragraph with page break info was removed. + CPPUNIT_ASSERT_EQUAL( 2, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakB, "tdf103975_notPageBreakB.docx") +{ + // turn on View Formatting Marks to see these documents. + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(4), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); + CPPUNIT_ASSERT_EQUAL( 4, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakC, "tdf103975_notPageBreakC.docx") +{ + // turn on View Formatting Marks to see these documents. + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(4), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); + CPPUNIT_ASSERT_EQUAL( 4, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakD, "tdf103975_notPageBreakD.docx") +{ + // The problem was that the column break was moving outside of the columns, making a page break. + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakE, "tdf103975_notPageBreakE.docx") +{ + // The problem was that the column break was getting lost. + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, "tdf112352_nextPageColumns.docx") +{ + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf109310_endnoteStyleForMSO, "tdf109310_endnoteStyleForMSO.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/endnotes.xml"); + // Check w:rStyle element has w:val attribute - note that w: is not specified for attribute + assertXPath(pXmlDoc, "/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "val", + "EndnoteCharacters"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103389, "tdf103389.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // No geometry was exported for the second canvas + // Check both canvases' geometry + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf84678, "tdf84678.docx") +{ + // This was 0, left margin inside a shape+text wasn't imported from DOCX. + // 360000 EMU, but layout uses twips. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(567), parseDump("/root/page/body/txt/anchored/fly/infos/prtBounds", "left").toInt32()); + +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103544, "tdf103544.docx") +{ + // We have two shapes: a frame and an image + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + + // Image was lost because of the frame export + uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY); + auto xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic"); + CPPUNIT_ASSERT(xGraphic.is()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103573, "tdf103573.docx") +{ + // Relative positions to the left or right margin (MS Word naming) was not handled. + uno::Reference<beans::XPropertySet> xShapeProperties( getShape(1), uno::UNO_QUERY ); + sal_Int16 nValue; + xShapeProperties->getPropertyValue("HoriOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally", text::HoriOrientation::CENTER, nValue); + xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally relatively to left page border", text::RelOrientation::PAGE_LEFT, nValue); + + xShapeProperties.set( getShape(2), uno::UNO_QUERY ); + xShapeProperties->getPropertyValue("HoriOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally", text::HoriOrientation::CENTER, nValue); + xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally relatively to right page border", text::RelOrientation::PAGE_RIGHT, nValue); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106132, "tdf106132.docx") +{ + uno::Reference<beans::XPropertySet> xShape(getShapeByName("Frame1"), uno::UNO_QUERY); + // This was 250, <wps:bodyPr ... rIns="0" ...> was ignored for an outer shape. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xShape, "TextRightDistance")); +} + +DECLARE_OOXMLEXPORT_TEST(testBnc519228OddBreaks, "bnc519228_odd-breaksB.docx") +{ + // Check that all the normal styles are not set as right-only, those should be only those used after odd page breaks. + uno::Reference<beans::XPropertySet> defaultStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), defaultStyle->getPropertyValue("PageStyleLayout")); + uno::Reference<beans::XPropertySet> firstPage( getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), firstPage->getPropertyValue("PageStyleLayout")); + + OUString page1StyleName = getProperty<OUString>( getParagraph( 1, "This is the first page." ), "PageDescName"); + uno::Reference<beans::XPropertySet> page1Style(getStyles("PageStyles")->getByName(page1StyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_RIGHT), page1Style->getPropertyValue("PageStyleLayout")); + getParagraphOfText( 1, getProperty< uno::Reference<text::XText> >(page1Style, "HeaderText"), "This is the header for odd pages"); + + // Page2 comes from follow of style for page 1 and should be a normal page. Also check the two page style have the same properties, + // since page style for page1 was created from page style for page 2. + OUString page2StyleName = getProperty<OUString>( page1Style, "FollowStyle" ); + uno::Reference<beans::XPropertySet> page2Style(getStyles("PageStyles")->getByName(page2StyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), page2Style->getPropertyValue("PageStyleLayout")); + getParagraphOfText( 1, getProperty< uno::Reference<text::XText> >(page2Style, "HeaderTextLeft"), "This is the even header"); + getParagraphOfText( 1, getProperty< uno::Reference<text::XText> >(page2Style, "HeaderTextRight"), "This is the header for odd pages"); + CPPUNIT_ASSERT_EQUAL(getProperty<sal_Int32>(page1Style, "TopMargin"), getProperty<sal_Int32>(page2Style, "TopMargin")); + + OUString page5StyleName = getProperty<OUString>( getParagraph( 4, "Then an odd break after an odd page, should lead us to page #5." ), "PageDescName"); + uno::Reference<beans::XPropertySet> page5Style(getStyles("PageStyles")->getByName(page5StyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_RIGHT), page5Style->getPropertyValue("PageStyleLayout")); + getParagraphOfText( 1, getProperty< uno::Reference<text::XText> >(page5Style, "HeaderText"), "This is the header for odd pages"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf79329, "tdf79329.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // This was 1: only the inner, not the outer table was created. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xTables->getCount()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103982, "tdf103982.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor", "distB").toInt32(); + // This was -260350, which is not a valid value for an unsigned type. + CPPUNIT_ASSERT(nDistB >= 0); + + // tdf#115670 the shadow should not be enabled (no on="t") + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(!getProperty<bool>(xPropertySet, "Shadow")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104115, "tdf104115.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // This found 0 nodes: the custom geometry was not written for the Bezier + // curve -> Word refused to open the document. + assertXPath(pXmlDoc, "//a:custGeom", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103651, "tdf103651.docx") +{ + uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 1), "TextField"); + OUString sContent; + xTextField->getPropertyValue("Content") >>= sContent; + // Comment in the first paragraph should not have smiley ( 0xf04a ). + CPPUNIT_ASSERT_EQUAL( sal_Int32( -1 ) , sContent.indexOf( u'\xf04a' )); + + // this document has a w:kern setting in the DocDefault character properties. Ensure it applies. + CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(1), 1), "CharAutoKerning")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99227, "tdf99227.docx") +{ + // A drawing anchored as character to a footnote caused write past end of document.xml at export to docx. + // After that, importing after export failed with + // SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word / document.xml', + // and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing was silently lost. + xmlDocUniquePtr pXmlDoc = parseExport("word/footnotes.xml"); + + assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.docx") +{ + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty<text::WrapTextMode>(getShape(1), "Surround")); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::VertOrientation::BOTTOM, getProperty<sal_Int16>(xTable->getCellByName("A1"), "VertOrient")); + + //For MSO compatibility, the textbox should be at the top of the cell, not at the bottom - despite VertOrientation::BOTTOM + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds", "top").toInt32(); + CPPUNIT_ASSERT_MESSAGE("FlyTop should be 2865, not 5649", nFlyTop < sal_Int32(3000)); + sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32(); + CPPUNIT_ASSERT_MESSAGE("TextTop should be 3856", nTextTop > 3000); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf112446_frameStyle, "tdf112446_frameStyle.docx") +{ + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::NONE, getProperty<sal_Int16>(getShape(1), "HoriOrient")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.docx") +{ + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + + uno::Reference<text::XText> xFootnoteText; + xFootnotes->getByIndex(0) >>= xFootnoteText; + // This was footnote text, which didn't match with newly created footnotes + CPPUNIT_ASSERT_EQUAL(OUString("Footnote"), getProperty<OUString>(getParagraphOfText(1, xFootnoteText), "ParaStyleName")); + + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Footnote Characters"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0x00FF00), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + + xPageStyle.set(getStyles("CharacterStyles")->getByName("Footnote anchor"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0x00FF00), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + + //tdf#118361 - in RTL locales, the footnote separator should still be left aligned. + uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote separator LTR", sal_Int16(0), getProperty<sal_Int16>(aPageStyle, "FootnoteLineAdjust")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx") +{ + uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEndnotes = xEndnotesSupplier->getEndnotes(); + uno::Reference<text::XFootnote> xEndnote; + xEndnotes->getByIndex(0) >>= xEndnote; + // character properties were previously not assigned to the footnote/endnote in-text anchor. + CPPUNIT_ASSERT_EQUAL( 24.0f, getProperty< float >(xEndnote->getAnchor(), "CharHeight") ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF0000), getProperty< sal_Int32 >(xEndnote->getAnchor(), "CharColor") ); + + uno::Reference<text::XText> xEndnoteText; + xEndnotes->getByIndex(0) >>= xEndnoteText; + // This was Endnote Symbol + CPPUNIT_ASSERT_EQUAL(OUString("Endnote"), getProperty<OUString>(getParagraphOfText(1, xEndnoteText), "ParaStyleName")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x993300), getProperty<sal_Int32>(getParagraphOfText(1, xEndnoteText), "CharColor")); + + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Endnote Characters"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF00FF), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + + xPageStyle.set(getStyles("CharacterStyles")->getByName("Endnote anchor"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF00FF), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf55427_footnote2endnote, "tdf55427_footnote2endnote.odt") +{ + CPPUNIT_ASSERT_EQUAL(4, getPages()); + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("ParagraphStyles")->getByName("Footnote"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", sal_Int32(0xFF007F), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + xPageStyle.set(getStyles("ParagraphStyles")->getByName("Endnote"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", sal_Int32(0x2BD0D2), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + // The footnote numbering type of ARABIC will not transfer over when those footnotes are converted to endnotes. + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote numbering type", SVX_NUM_ARABIC, pDoc->GetFootnoteInfo().m_aFormat.GetNumberingType() ); + // The original document has a real endnote using ROMAN_LOWER numbering, so that setting MUST remain unchanged. + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote numbering type", SVX_NUM_ROMAN_LOWER, pDoc->GetEndNoteInfo().m_aFormat.GetNumberingType() ); + + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + + uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xEndnotes = xEndnotesSupplier->getEndnotes(); + uno::Reference<text::XFootnote> xEndnote; + xEndnotes->getByIndex(0) >>= xEndnote; + uno::Reference<text::XText> xEndnoteText; + xEndnotes->getByIndex(0) >>= xEndnoteText; + + // ODT footnote-at-document-end's closest DOCX match is an endnote, so the two imports will not exactly match by design. + if (!mbExported) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote count", sal_Int32(5), xFootnotes->getCount() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote count", sal_Int32(1), xEndnotes->getCount() ); + + uno::Reference<text::XFootnote> xFootnote; + xFootnotes->getByIndex(0) >>= xFootnote; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote's number", OUString("1"), xFootnote->getAnchor()->getString() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote's number", OUString("i"), xEndnote->getAnchor()->getString() ); + + uno::Reference<text::XText> xFootnoteText; + xFootnotes->getByIndex(0) >>= xFootnoteText; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote style", OUString("Footnote"), getProperty<OUString>(getParagraphOfText(1, xFootnoteText), "ParaStyleName") ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", OUString("Endnote"), getProperty<OUString>(getParagraphOfText(1, xEndnoteText), "ParaStyleName") ); + } + else + { + // These asserted items are major differences in the conversion from footnote to endnote, NOT necessary conditions for a proper functioning document. + CPPUNIT_ASSERT_EQUAL_MESSAGE( "At-Document-End footnotes were converted into endnotes", sal_Int32(0), xFootnotes->getCount() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "At-Document-End footnotes became endnotes", sal_Int32(6), xEndnotes->getCount() ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "converted footnote's number", OUString("i"), xEndnote->getAnchor()->getString() ); + xEndnotes->getByIndex(4) >>= xEndnote; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote's new number", OUString("v"), xEndnote->getAnchor()->getString() ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "retained footnote style", OUString("Footnote"), getProperty<OUString>(getParagraphOfText(1, xEndnoteText), "ParaStyleName") ); + xEndnotes->getByIndex(4) >>= xEndnoteText; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", OUString("Endnote"), getProperty<OUString>(getParagraphOfText(1, xEndnoteText), "ParaStyleName") ); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104162, "tdf104162.docx") +{ + // This crashed: the comment field contained a table with a <w:hideMark/>. + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XElementAccess> xTextFields(xTextFieldsSupplier->getTextFields()); + CPPUNIT_ASSERT(xTextFields->hasElements()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104150, "tdf104150.docx") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + // This was 0xff0000, i.e. red: background shape wasn't ignored. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xPageStyle, "BackColor")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103976, "tdf103976.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 0, table style inheritance went wrong and w:afterLines had priority over w:after. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(60)), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); + + // tdf#116549: heading 2 style should not have a bottom border. + uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Heading 2"), uno::UNO_QUERY); + table::BorderLine2 aBottomBorder = getProperty<table::BorderLine2>(xStyle, "BottomBorder"); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aBottomBorder.LineWidth); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001.docx") +{ + // This was 0 (1 on UI), while Word treats outliers as 100 (outlier = not in [1..600]) + CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int16>( 100 ), getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharScaleWidth" )); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf106001_2, "tdf106001-2.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // In test ODT CharScaleWidth = 900, this was not changed upon OOXML export to stay in [1..600], now it's clamped to 600 + // Note: we disregard what's set in pPr / rPr and only care about r / rPr + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:w","val","600"); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf99074, "tdf99074.docx") +{ + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<view::XViewSettingsSupplier> const xController( + xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> const xViewSettings( + xController->getViewSettings()); + + // The behavior changed - Word 2013 and 2016 ignore this setting on + // import, and instead honor the user's setting. + // Let's ignore the <w:view w:val="web"/> too. + CPPUNIT_ASSERT(!getProperty<bool>(xViewSettings, "ShowOnlineLayout")); +} + +DECLARE_OOXMLEXPORT_TEST(testDefaultSectBreakCols, "default-sect-break-cols.docx") +{ + // First problem: the first two paragraphs did not have their own text section, so the whole document had two columns. + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1, "First."), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + // Second problem: the page style had two columns, while it shouldn't have any. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xPageStyle, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + // Check for the Column Separator value.It should be FALSE as the document does not contain separator line. + bool bValue = getProperty< bool >(xTextColumns, "SeparatorLineIsOn"); + CPPUNIT_ASSERT(!bValue) ; +} + +DECLARE_OOXMLEXPORT_TEST(testMultiColumnSeparator, "multi-column-separator-with-line.docx") +{ + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1, "First data."), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + // Check for the Column Separator value.It should be TRUE as the document contains separator line. + bool bValue = getProperty< bool >(xTextColumns, "SeparatorLineIsOn"); + CPPUNIT_ASSERT(bValue); +} + +DECLARE_OOXMLEXPORT_TEST(testUnbalancedColumns, "unbalanced-columns.docx") +{ + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + // This was false, last section was balanced, but it's unbalanced in Word. + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(2), "DontBalanceTextColumns")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf121670_columnsInSectionsOnly, "tdf121670_columnsInSectionsOnly.docx") +{ + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("DontBalanceTextColumns?", true, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns")); + + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("# of columns", sal_Int16(3), xTextColumns->getColumnCount()); + + xTextSection.set( getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection") ); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns.set( getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns") ); + CPPUNIT_ASSERT_EQUAL_MESSAGE("# of columns", sal_Int16(0), xTextColumns->getColumnCount()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106492, "tdf106492.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + // This was 4: an additional sectPr was added to the document. + assertXPath(pXmlDoc, "//w:sectPr", 3); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf107104, "tdf107104.docx") +{ + CPPUNIT_ASSERT(getShape(1)->getSize().Width > 0); + // This failed: the second arrow was invisible because it had zero width. + CPPUNIT_ASSERT(getShape(2)->getSize().Width > 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf107033, "tdf107033.docx") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + // This was 0: footnote separator was disabled even in case the document + // had no footnotes. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth")); +} + +#if HAVE_MORE_FONTS +DECLARE_OOXMLEXPORT_TEST(testTdf107889, "tdf107889.docx") +{ + // This was 1, multi-page table was imported as a floating one. + CPPUNIT_ASSERT_EQUAL(0, getShapes()); +} +#endif + +DECLARE_OOXMLEXPORT_TEST(testTdf107837, "tdf107837.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + // This was true, a balanced section from ODF turned into a non-balanced one after OOXML roundtrip. + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf107684, "tdf107684.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml")) + // This was 1, <w:outlineLvl> was duplicated for Heading1. + assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf107618, "tdf107618.doc") +{ + // This was false, header was lost on export. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPageStyle, "HeaderIsOn")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf108682, "tdf108682.docx") +{ + auto aLineSpacing = getProperty<style::LineSpacing>(getParagraph(1), "ParaLineSpacing"); + // This was style::LineSpacingMode::PROP. + CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::FIX, aLineSpacing.Mode); + // 260 twips in mm100, this was a negative value. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(459), aLineSpacing.Height); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf100075, "tdf100075.docx") +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + + // There are two frames in document + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xIndexAccess->getCount()); + + uno::Reference<beans::XPropertySet> xFrame1(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFrame2(xIndexAccess->getByIndex(1), uno::UNO_QUERY); + + // Ensure that frame#1 height is more that frame#2: if no hRul attribute + // defined, MS Word will use hRul=auto if height is not defined, + // and hRul=atLeast if height is provided. So frame#1 should be higher + CPPUNIT_ASSERT(getProperty<sal_Int32>(xFrame1, "Height") > getProperty<sal_Int32>(xFrame2, "Height")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf105095, "tdf105095.docx") +{ + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); + // This failed, tab between the footnote number and the footnote content + // was lost on import. + CPPUNIT_ASSERT_EQUAL( OUString("\tfootnote"), xTextRange->getString() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf106062_nonHangingFootnote, "tdf106062_nonHangingFootnote.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); + // This failed, tab between the footnote number and the footnote content was lost on import. + CPPUNIT_ASSERT_MESSAGE( "Footnote starts with a tab", xTextRange->getString().startsWith("\t") ); +} + +DECLARE_OOXMLEXPORT_TEST( testActiveXTextfield, "activex_textbox.docx" ) +{ + uno::Reference<drawing::XControlShape> xControlShape( getShape(1), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xControlShape.is() ); + + // Check control type + uno::Reference<beans::XPropertySet> xPropertySet( xControlShape->getControl(), uno::UNO_QUERY ); + uno::Reference<lang::XServiceInfo> xServiceInfo( xPropertySet, uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL( true, bool( xServiceInfo->supportsService ( "com.sun.star.form.component.TextField" ) ) ); + + // Check textfield is multi-line + CPPUNIT_ASSERT_EQUAL( true, getProperty<bool>(xPropertySet, "MultiLine") ); + + uno::Reference<drawing::XControlShape> xControlShape2( getShape(2), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xControlShape2.is() ); + + // Check control type + uno::Reference<beans::XPropertySet> xPropertySet2( xControlShape2->getControl(), uno::UNO_QUERY ); + uno::Reference<lang::XServiceInfo> xServiceInfo2( xPropertySet2, uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL( true, bool( xServiceInfo2->supportsService ( "com.sun.star.form.component.TextField" ) ) ); + + // Check textfield is single-line + CPPUNIT_ASSERT_EQUAL( false, getProperty<bool>(xPropertySet2, "MultiLine") ); + + // Don't open in design mode when form controls exist + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<view::XFormLayerAccess> xFormLayerAccess(xModel->getCurrentController(), uno::UNO_QUERY); + CPPUNIT_ASSERT( !xFormLayerAccess->isFormDesignMode() ); +} + +DECLARE_OOXMLEXPORT_TEST( testActiveXCheckbox, "activex_checkbox.docx" ) +{ + uno::Reference<drawing::XControlShape> xControlShape( getShape(1), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xControlShape.is() ); + + // Check control type + uno::Reference<beans::XPropertySet> xPropertySet( xControlShape->getControl(), uno::UNO_QUERY ); + uno::Reference<lang::XServiceInfo> xServiceInfo( xPropertySet, uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL( true, bool( xServiceInfo->supportsService( "com.sun.star.form.component.CheckBox" ) ) ); + + // Check custom label + CPPUNIT_ASSERT_EQUAL( OUString( "Custom Caption" ), getProperty<OUString>(xPropertySet, "Label") ); + + // Check background color (highlight system color) + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0x316AC5 ), getProperty<sal_Int32>(xPropertySet, "BackgroundColor") ); + + // Check Text color (active border system color) + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD4D0C8), getProperty<sal_Int32>(xPropertySet, "TextColor")); + + // Check state of the checkbox + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(xPropertySet, "State")); + + // Check anchor type + uno::Reference<beans::XPropertySet> xPropertySet2(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType")); +} + +DECLARE_OOXMLEXPORT_TEST(testActiveXControlAlign, "activex_control_align.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // First check box aligned as a floating object + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xControlShape.is()); + + // Check whether we have the right control + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService( "com.sun.star.form.component.CheckBox"))); + CPPUNIT_ASSERT_EQUAL(OUString("Floating Check Box"), getProperty<OUString>(xPropertySet, "Label")); + + // Check anchor type + uno::Reference<beans::XPropertySet> xPropertySet2(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType")); + + // Also check position and size + uno::Reference<drawing::XShape> xShape(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape.is()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4470), xShape->getSize().Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1427), xShape->getSize().Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5126), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2341), xShape->getPosition().Y); + + // Second check box aligned inline / as character + xControlShape.set(getShape(2), uno::UNO_QUERY); + + // Check whether we have the right control + 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.CheckBox"))); + CPPUNIT_ASSERT_EQUAL(OUString("Inline Check Box"), getProperty<OUString>(xPropertySet, "Label")); + + // Check anchor type + xPropertySet2.set(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(text::VertOrientation::TOP),getProperty<sal_Int32>(xPropertySet2,"VertOrient")); + + // Also check position and size + xShape.set(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape.is()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4410), xShape->getSize().Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1083), xShape->getSize().Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1085), xShape->getPosition().Y); + + // Also check the specific OOXML elements + xmlDocUniquePtr pXmlDoc = parseExport(); + CPPUNIT_ASSERT(pXmlDoc); + // For inline controls use w:object as parent element and pictureFrame shapetype + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object/v:shapetype", "spt", "75"); + // For floating controls use w:pict as parent element and hostControl shapetype + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shapetype", "spt", "201"); + + // Have different shape ids + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape", "id") != + getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shape", "id")); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + // Before table background color was white, should be transparent (auto). + uno::Reference<text::XTextRange> xCell1(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xCell1, "BackColor")); + + // Cell with auto color but with 15% fill, shouldn't be transparent. + uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("B1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xd8d8d8), getProperty<sal_Int32>(xCell2, "BackColor")); + + // Cell with color defined (red). + uno::Reference<text::XTextRange> xCell3(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xff0000), getProperty<sal_Int32>(xCell3, "BackColor")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf111964, "tdf111964.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Unicode spaces that are not XML whitespace must not be trimmed + const sal_Unicode sWSReference [] { 0x2002, 0x2002, 0x2002, 0x2002, 0x2002, 0 }; + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:t", sWSReference); +} + +DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark-shapetype.docx") +{ + uno::Reference<drawing::XShape> xShape1(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape1.is()); + uno::Reference<beans::XPropertySet> xPropertySet1(xShape1, uno::UNO_QUERY); + + uno::Reference<drawing::XShape> xShape2(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape2.is()); + uno::Reference<beans::XPropertySet> xPropertySet2(xShape2, uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(xPropertySet1->getPropertyValue("TextAutoGrowHeight"), xPropertySet2->getPropertyValue("TextAutoGrowHeight")); +} + +DECLARE_OOXMLEXPORT_TEST(testActiveXControlAtRunEnd, "activex_control_at_run_end.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Two issues were here: + // 1) second shape was not export (it is anchored to the end of the run) + // 2) inline property was inherited to the second shape by mistake + + // First checkbox is the inlined one + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xControlShape.is()); + + // Check whether we have the right control + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService( "com.sun.star.form.component.CheckBox"))); + CPPUNIT_ASSERT_EQUAL(OUString("Inline Checkbox"), getProperty<OUString>(xPropertySet, "Label")); + + // Check anchor type + uno::Reference<beans::XPropertySet> xPropertySet2(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType")); + + // Second check box anchored to character + xControlShape.set(getShape(2), uno::UNO_QUERY); + + // Check whether we have the right control + 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.CheckBox"))); + CPPUNIT_ASSERT_EQUAL(OUString("Floating Checkbox"), getProperty<OUString>(xPropertySet, "Label")); + + // Check anchor type + xPropertySet2.set(xControlShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType")); +} + +DECLARE_OOXMLEXPORT_TEST(testActiveXOptionButtonGroup, "activex_option_button_group.docx") +{ + // Optionbutton groups were not handled + // The two optionbutton should have the same group name + const OUString sGroupName = "GroupX"; + + uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xControlShape.is()); + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sGroupName, getProperty<OUString>(xPropertySet, "GroupName")); + + xControlShape.set(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xControlShape.is()); + xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sGroupName, getProperty<OUString>(xPropertySet, "GroupName")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf112169, "tdf112169.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(6, getPages()); + // LO crashed while export because of character background color handling + + //tdf76683 - Cannot be negative number - use firstLine instead of hanging + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); + assertXPathNoAttribute(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "hanging"); + assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "firstLine","360"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103090, "tdf103090.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Get bookmark name + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:bookmarkStart", "name"); + + // Ensure that name has no spaces + CPPUNIT_ASSERT(bookmarkName.indexOf(" ") < 0); + + // Get PAGEREF field + OUString fieldName = getXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"); + + // Ensure that PAGEREF field refers exactly our bookmark + OUString expectedFieldName = " PAGEREF " + bookmarkName + " \\h "; + CPPUNIT_ASSERT_EQUAL(expectedFieldName, fieldName); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107111, "tdf107111.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Ensure that hyperlink and its properties are in place. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr", 1); + + // Ensure that hyperlink properties do not contain <w:webHidden/>. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr/w:webHidden", 0); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90789, "tdf90789.docx") +{ + uno::Reference<text::XTextContent> xShape(getShape(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xShape->getAnchor() != nullptr); + + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference<view::XSelectionSupplier> xCtrl(xModel->getCurrentController(), uno::UNO_QUERY_THROW); + xCtrl->select(uno::makeAny(xShape->getAnchor())); + + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xCtrl, uno::UNO_QUERY_THROW); + uno::Reference<text::XTextViewCursor> xTextCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_SET_THROW); + uno::Reference<text::XPageCursor> xPageCursor(xTextCursor, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), xPageCursor->getPage()); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf90789_2, "tdf90789-2.docx") +{ + // Section break before frame and shape was ignored + CPPUNIT_ASSERT_EQUAL( 3, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + + // top margin of the first paragraph and bottom margin of the last paragraph + // is zero, when auto spacing is used. + + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaBottomMargin")); + + // top margin is not auto spacing + uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(847), getProperty<sal_Int32>(getParagraphOfText(1, xCell2->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell2->getText()), "ParaBottomMargin")); + + // bottom margin is not auto spacing + uno::Reference<text::XTextRange> xCell3(xTable->getCellByName("A3"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell3->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(847), getProperty<sal_Int32>(getParagraphOfText(1, xCell3->getText()), "ParaBottomMargin")); + + // auto spacing, if the paragraph contains footnotes + uno::Reference<text::XTextRange> xCell4(xTable->getCellByName("A4"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell4->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell4->getText()), "ParaBottomMargin")); + + // auto spacing is explicitly disabled, and no margins are defined. + xCell.set(xTable->getCellByName("A5"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaBottomMargin")); + + // auto spacing on a paragraph + uno::Reference<text::XTextTable> xTable2(xTables->getByIndex(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell5(xTable2->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell5->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell5->getText()), "ParaBottomMargin")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf137593, "tdf137593.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // zero auto spacing, if the first paragraph contains text boxes + // This was 280. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115557, "tdf115557.docx") +{ + // A chart anchored to a footnote multiplied during import + xmlDocUniquePtr pXmlDoc = parseExport("word/footnotes.xml"); + + assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx new file mode 100644 index 000000000..a6a5b37af --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() + : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "MS Word 2007 XML Template") + { + } + +protected: + bool mustTestImportOf(const char* filename) const override + { + return OString(filename).endsWith(".dotx"); + } +}; + +DECLARE_OOXMLEXPORT_TEST(testSaveAsDotX, "sample.dotx") +{ + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); + + if (!pXmlDocCT) + return; + + // Ensure that document has correct content type + assertXPath(pXmlDocCT, + "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", + "ContentType", + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml"); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx new file mode 100644 index 000000000..df4ac56ec --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -0,0 +1,682 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> +#include <xmloff/odffields.hxx> +#include <IDocumentMarkAccess.hxx> +#include <IMark.hxx> + +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(testFdo47669, "fdo47669.docx") +{ + /* + * Problem: we created imbalance </w:hyperlink> which shouldn't be there, + * resulting in loading error: missing last character of hyperlink text + * and content after it wasn't loaded. + */ + getParagraph(1, "This is a hyperlink with anchor. Also, this sentence should be seen."); + getRun(getParagraph(1), 2, "hyperlink with anchor"); + CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/#a"), getProperty<OUString>(getRun(getParagraph(1), 2), "HyperLinkURL")); +} + +DECLARE_OOXMLEXPORT_TEST(testN789482, "n789482.docx") +{ + // The problem was that w:del was exported before w:hyperlink, resulting in an invalid XML. + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + getRun(xParagraph, 1, "Before. "); + + CPPUNIT_ASSERT_EQUAL(OUString("Delete"), getProperty<OUString>(getRun(xParagraph, 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getRun(xParagraph, 2), "IsStart")); + + getRun(xParagraph, 3, "www.test.com"); + CPPUNIT_ASSERT_EQUAL(OUString("http://www.test.com/"), getProperty<OUString>(getRun(xParagraph, 3), "HyperLinkURL")); + + CPPUNIT_ASSERT_EQUAL(OUString("Delete"), getProperty<OUString>(getRun(xParagraph, 4), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getRun(xParagraph, 4), "IsStart")); + + getRun(xParagraph, 5, " After."); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBnc834035, "bnc834035.odt") +{ + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + CPPUNIT_ASSERT_EQUAL(3, getPages()); + // Illustration index had wrong hyperlinks: anchor was using Writer's + // <seqname>!<index>|sequence syntax, not a bookmark name. + xmlDocUniquePtr pXmlDoc = parseExport(); + // This was Figure!1|sequence. + assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:hyperlink", "anchor", "_Toc363553908"); +} + +DECLARE_OOXMLEXPORT_TEST(testCp1000015, "cp1000015.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // Redline and hyperlink end got exported in an incorrect order. + getParagraph(1, "Hello."); + getParagraph(2, "http://www.google.com/"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlineIsEnd, "hyperlink.docx") +{ + // Check that the document.xml contents all the tag properly closed. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // If document.xml miss any ending tag then parseExport() returns NULL which fail the test case. + CPPUNIT_ASSERT(pXmlDoc) ; + // Check hyperlink is properly open. + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:hyperlink",1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69649, "fdo69649.docx") +{ + // The DOCX containing the Table of Contents was not exported with correct page nos + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[21]/w:hyperlink/w:r[5]/w:t", "15"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFieldFlagO,"TOC_field_f.docx") +{ + // This test case is to verify \o flag should come once. + xmlDocUniquePtr pXmlDoc = parseExport(); + + // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed + // not to insert an empty paragraph before TOC. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\f \\o \"1-3\" \\u \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTOCFlag_f, "toc_doc.docx") +{ + // Export logic for all TOC field flags was enclosed inside + // if( SwTOXElement::Mark & pTOX->GetCreateType() ) in ww8atr.cxx which gets true for \f, + // this was the reason if there is \f flag present in original doc then only other flags like + // \o \h \n used to come after RoundTrip. + // This test case is to verify even if there is no \f flag in original doc, \h flag is getting + // preserved after RT. + xmlDocUniquePtr pXmlDoc = parseExport(); + + // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed + // not to insert an empty paragraph before TOC. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\o \"1-3\" \\u \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveZfield,"preserve_Z_field_TOC.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\f \\o \"1-3\" \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveWfieldTOC, "PreserveWfieldTOC.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\w \\f \\o \"1-3\" \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFieldFlagB,"TOC_field_b.docx") +{ + // This test case is to verify \b flag. + xmlDocUniquePtr pXmlDoc = parseExport(); + + // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed + // not to insert an empty paragraph before TOC. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\b \"bookmark111\" \\o \"1-9\" \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveXfieldTOC, "PreserveXfieldTOC.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\x \\f \\o \"1-3\" \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77715,"FDO77715.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText[1]", " TOC \\c "); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTOCFlag_u,"testTOCFlag_u.docx") +{ + // DOCX containing TOC should preserve code field '\u'. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed + // not to insert an empty paragraph before TOC. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\o \"1-9\" \\u \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo73596_RunInStyle,"fdo73596_RunInStyle.docx") +{ + // INDEX should be preserved. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]", " INDEX \\e \""); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo73596_AlphaSeparator,"fdo73596_AlphaSeparator.docx") +{ + // INDEX flag \h "A" should be preserved. + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]", " INDEX \\h \"A\" \\e \""); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption1, "EquationAsScientificNumbering.docx") +{ + // fdo#74431 : This test case is to verify the Captions are coming properly + // earlier it was coming as "SEQ "scientific"\*ROMAN now it is SEQ scientific\* ROMAN" + + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " SEQ scientific \\* ROMAN "); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption2, "EquationWithAboveAndBelowCaption.docx") +{ + // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip + // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[3]/w:instrText", " SEQ Equation \\* ARABIC "); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption3, "FigureAsLabelPicture.docx") +{ + // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip + // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText", " SEQ picture \\* ARABIC "); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption4, "TableWithAboveCaptions.docx") +{ + // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip + // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " SEQ Table \\* ARABIC "); +} + +DECLARE_OOXMLEXPORT_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.docx") +{ + // Problem is that footer1.xml.rels contains the empty + // Target due to which the file get corrupted + // in MS Office 2007. + // Check for footer1.xml.rels file. + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/footer1.xml.rels"); + if (!pXmlRels) + return; + // Check the value of Target which is http://www.google.com/. + assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship","Target","http://www.google.com/"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlphabeticalIndex_MultipleColumns,"alphabeticalIndex_MultipleColumns.docx") +{ + // Bug :: fdo#73596 + /* + * Index with multiple columns was not imported correctly and + * hence not exported correctly... + * The column count is given by the \c switch. + * If the column count is explicitly specified, + * MS Office adds section breaks before and after the Index. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText", " INDEX \\c \"4\"\\e \""); + + // check for section breaks after and before the Index Section + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type","val","continuous"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:type","val","continuous"); + // check for "w:space" attribute for the columns in Section Properties + assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:cols/w:col[1]","space","720"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageref, "testPageref.docx") +{ + // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip + // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink/w:r[3]/w:instrText", "PAGEREF _Toc355095261 \\h"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlphabeticalIndex_AutoColumn,"alphabeticalIndex_AutoColumn.docx") +{ + // Bug :: fdo#73596 + /* + * When the columns in Index are 0; i.e not specified by the + * "\c" switch, don't write back '\c "0"' or the section breaks + * before and after the Index Context + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText", " INDEX \\e \""); + + // check for section break doesn't appear for any paragraph + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testIndexFieldFlagF,"IndexFieldFlagF.docx") +{ + // This test case is to verify the Index field flag '\f' with some + // Specific Entry Type (ex. "Syn" in our case). + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // We check the Index field flag '\f'. + assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[4]/w:r[2]/w:instrText[1]", " INDEX \\c \"2\"\\f \"Syn\" \" \\e \""); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBibliography,"FDO75133.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " BIBLIOGRAPHY "); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery", "val", "Bibliographies"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGenericTextField, "Unsupportedtextfields.docx") +{ + // fdo#75158 : This test case is to verify the unsupported textfields are exported properly. + + xmlDocUniquePtr pXmlDoc = parseExport(); + xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[2]/w:instrText"); + xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + OUString contents = OUString::createFromAscii(reinterpret_cast<char*>((pXmlNode->children[0]).content)); + CPPUNIT_ASSERT(contents.match("PRINTDATE \\* MERGEFORMAT")); + xmlXPathFreeObject(pXmlObj); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_FieldType, "99_Fields.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Checking for three field types (BIBLIOGRAPHY, BIDIOUTLINE, CITATION) in sequence + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtContent/w:r[2]/w:instrText"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCitation,"FDO74775.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:instrText", " CITATION Kra06 \\l 1033 "); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[4]/w:t", "(Kramer & Chen, 2006)"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperLinkTagEnded, "fdo76316.docx") +{ + /* XML tag <w:hyperlink> was not getting closed when its inside another + * <w:hyperlink> tag. + */ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[2]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[7]/w:tc[1]/w:tbl[1]/w:tr[2]/w:tc[6]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:hyperlink[1]",1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76163 , "fdo76163.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + //docx file after RT is getting corrupted. + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[10]/w:fldChar", "fldCharType", "end" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78659, "fdo78659.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78654 , "fdo78654.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // In case of two "Hyperlink" tags in one paragraph and one of them + // contains "PAGEREF" field then field end tag was missing from hyperlink. + assertXPath ( pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink[3]/w:r[5]/w:fldChar", "fldCharType", "end" ); +} + + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78599,"fdo78599.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + //docx file after RT is getting corrupted. + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar", "fldCharType", "end" ); + + // Check for automatic hyphenation + if (xmlDocUniquePtr pSettingsXml = parseExport("word/settings.xml")) + // This failed as w:settings had no w:autoHyphenation child. + assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78886, "fdo78886.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78910, "fdo78910.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // This is to ensure that the fld starts and ends inside a hyperlink... + assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[1]/w:fldChar", "fldCharType", "begin" ); + assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[5]/w:fldChar", "fldCharType", "end" ); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78590, "FDO78590.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // This is to ensure that the fld starts and ends inside a hyperlink... + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "w", "9851" ); + assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "h", "1669" ); +} + +DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx") +{ + // The problem was that the SDT was around the whole paragraph, not only around the citation field. + if (xmlDocUniquePtr pXmlDoc = parseExport()) + { + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t", "Before sdt."); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:instrText", " CITATION BBC11 \\l 1033 "); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:t", "After sdt."); + } +} + +DECLARE_OOXMLEXPORT_TEST(testParagraphSdt, "paragraph-sdt.docx") +{ + // The problem was that the SDT was around the run only, not the whole paragraph. + if (xmlDocUniquePtr pXmlDoc = parseExport()) + { + // The path to w:sdt contained a w:p. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:sdt"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-para.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + { + // The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t", "first"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r/w:t", "second"); + // Make sure the third paragraph is still outside <w:sdt>. + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r/w:t", "third"); + } +} + +DECLARE_OOXMLEXPORT_TEST(test2Id, "2-id.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + { + // This was 2, but only one w:id is allowed. + assertXPath(pXmlDoc, "//w:sdtPr/w:id", 1); + } +} + +DECLARE_OOXMLEXPORT_TEST(testTableStart2Sdt, "table-start-2-sdt.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + { + // w:docPartGallery should be a child of <w:docPartObj>, make sure it's not a child of w:text. + assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery", 0); + } +} + +DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + { + // Single <w:sdt> was exported as 2 <w:sdt> elements. + assertXPath(pXmlDoc, "//w:sdt", 1); + } + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); + + ::sw::mark::IDateFieldmark* pFieldmark + = dynamic_cast<::sw::mark::IDateFieldmark*>(*pMarkAccess->getAllMarksBegin()); + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); + CPPUNIT_ASSERT_EQUAL(OUString("4/26/2012"), pFieldmark->GetContent()); +} + +DECLARE_OOXMLEXPORT_TEST(testFdo81492, "fdo81492.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport()) + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:instrText", "ADDIN EN.CITE.DATA"); +} + +DECLARE_OOXMLEXPORT_TEST(testEditTime, "fdo81341.docx") +{ + /* Issue was LO was not able to Import and Export EditTime in seconds format. + * It was supporting Time in "HH:MM" format. But if DOCX contains Time in seconds, + * then LO was not able to display time in "HH:MM:SS" format. + * While exporting LO was writing plain text instead of field entry. + */ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + //Ensure that EditTime is written inside w:fldChar in "HH:MM:SS" format. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar", "fldCharType", "begin"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:fldChar", "fldCharType", "separate"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:t", "00:05"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:fldChar", "fldCharType", "end"); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo81945, "fdo81945.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "//w:sdt//w:sdt", 0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo82123, "fdo82123.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // make sure there is only one run inside first SDT after RT as in the Original file. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:sdt[1]/w:sdtContent/w:r",1); +} + +DECLARE_OOXMLEXPORT_TEST(testSdtBeforeField, "sdt-before-field.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // Make sure the field doesn't sneak inside the SDT: the SDT should contain only a single run (there were 6 ones). + assertXPath(pXmlDoc, "//w:sdt/w:sdtContent/w:r", 1); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo81946, "fdo81946.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); + // make sure AlternateContent should not present in sdt + assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:r[2]/mc:AlternateContent[1]",0); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo82492, "fdo82492.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // make sure there is only one run inside first SDT after RT as in the Original file. + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent/w:r",1); +} + +DECLARE_OOXMLEXPORT_TEST(testSdtHeader, "sdt-header.docx") +{ + // Problem was that w:sdt elements in headers were lost on import. + if (xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml")) + // This was 0, w:sdt (and then w:date) was missing. + assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testSdtCompanyMultipara, "sdt-company-multipara.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // This was 3, but multiple paragraphs inside "Company" SDT is now allowed. + assertXPath(pXmlDoc, "//w:sdtContent/w:p", 1); + } +} + +DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, "fixed-date-field.docx") +{ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + uno::Reference<beans::XPropertySet> xField(xFields->nextElement(), uno::UNO_QUERY); + + // Check fixed property was imported and date value was parsed correctly + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xField, "IsFixed")); + css::util::DateTime date = getProperty<css::util::DateTime>(xField, "DateTimeValue"); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(24), date.Day); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(7), date.Month); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2014), date.Year); + + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + // Previously, fixed fields were exported as static text ("Date (fixed)") + // Check they are now exported correctly as fldChar with fldLock attribute + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar", "fldLock", "true"); + } +} + +DECLARE_OOXMLEXPORT_TEST(testToxmarkHyperlink, "toxmarkhyperlink.fodt") +{ + // test that export doesn't assert with overlapping fields / hyperlink attr +} + +DECLARE_OOXMLEXPORT_TEST(testOO34469, "ooo34469-1.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport()) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating_New_files|outline"); +} + +DECLARE_OOXMLEXPORT_TEST(testOO39845, "ooo39845-7.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + if (xmlDocUniquePtr pXmlDoc = parseExport()) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "Figure4|graphic"); +} + +DECLARE_OOXMLEXPORT_TEST( testTdf85161, "tdf85161.docx" ) +{ + CPPUNIT_ASSERT_EQUAL(OUString("Symbol"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName")); + CPPUNIT_ASSERT_EQUAL(OUString(u'\x5e'),getParagraph(1)->getString()); +} + +DECLARE_OOXMLEXPORT_TEST( testTdf66401, "tdf66401.docx") +{ + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) + { + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", "ascii", "Arial Black"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz", "val", "24"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:rFonts", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:rFonts", "ascii", "Arial Black"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:sz", "val", "24"); + } +} + +DECLARE_OOXMLEXPORT_TEST( testDateFieldInShape, "date_field_in_shape.docx" ) +{ + // This was crashed on export. + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); + + ::sw::mark::IDateFieldmark* pFieldmark + = dynamic_cast<::sw::mark::IDateFieldmark*>(*pMarkAccess->getAllMarksBegin()); + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); + CPPUNIT_ASSERT_EQUAL(OUString("Click here to enter a date."), pFieldmark->GetContent()); +} + +DECLARE_OOXMLEXPORT_TEST( testDateFieldAtEndOfParagraph, "date_field_at_end_of_paragraph.docx" ) +{ + // Additional line end was added by import and it was crashed on export + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); + + ::sw::mark::IDateFieldmark* pFieldmark + = dynamic_cast<::sw::mark::IDateFieldmark*>(*pMarkAccess->getAllMarksBegin()); + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); + CPPUNIT_ASSERT_EQUAL(OUString("Click here to enter a date."), pFieldmark->GetContent()); +} + +DECLARE_OOXMLEXPORT_TEST(testDropDownFieldEntryLimit, "tdf126792.odt" ) +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + // In MSO, there is a limit of 25 for the items in a drop-down form field. + // So we truncate the list of items to not exceed this limit. + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); + + ::sw::mark::IFieldmark* pFieldmark + = dynamic_cast<::sw::mark::IFieldmark*>(*pMarkAccess->getAllMarksBegin()); + CPPUNIT_ASSERT(pFieldmark); + CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDROPDOWN), pFieldmark->GetFieldname()); + + const sw::mark::IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); + auto pListEntries = pParameters->find(ODF_FORMDROPDOWN_LISTENTRY); + CPPUNIT_ASSERT(bool(pListEntries != pParameters->end())); + css::uno::Sequence<OUString> vListEntries; + pListEntries->second >>= vListEntries; + if (!mbExported) + CPPUNIT_ASSERT_EQUAL(sal_Int32(26), vListEntries.getLength()); + else + CPPUNIT_ASSERT_EQUAL(sal_Int32(25), vListEntries.getLength()); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132185, "tdf132185.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); + // Since the default (without xml:space attribute) is to ignore leading and trailing spaces, + // " PAGE \\* roman " will get imported as "PAGE \\* roman". This is also valid, and must be + // treated accordingly. "roman" was ignored before the fix, exporting only " PAGE ". + assertXPathContent(pXmlDoc, "/w:ftr/w:p/w:r[2]/w:instrText", " PAGE \\* roman "); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx new file mode 100644 index 000000000..1ad0df5fb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx @@ -0,0 +1,268 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> +#include <unotools/tempfile.hxx> +#include <tools/urlobj.hxx> +#include <unotools/saveopt.hxx> + +// This file contains tests to check relative/absolute hyperlinks handling + +#define USE_TEMP_DIR true +#define DONT_MODIFY_LINK false + +#define USE_ABSOLUTE true +#define USE_RELATIVE false + +// bAbsolute - decide if output link should be converted to absolute +// bUseTempDir - decide if link should be modified to be placed in temp dir - for testing relative links +#define DECLARE_LINKS_EXPORT_TEST(TestName, FileName, bAbsolute, bUseTempDir) \ + class TestName : public Test \ + { \ + protected: \ + virtual OUString getTestName() override { return #TestName; } \ + virtual void postLoad(const char*) override \ + { \ + if (!bUseTempDir) \ + return; \ + \ + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); \ + /* can be changed only after import */ \ + uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); \ + \ + /* Get original link */ \ + OUString sOriginalFileName = getProperty<OUString>(xText, "HyperLinkURL"); \ + INetURLObject aOriginalURL(sOriginalFileName); \ + CPPUNIT_ASSERT(!aOriginalURL.HasError()); \ + OUString sFileName = aOriginalURL.GetLastName(); \ + CPPUNIT_ASSERT(!sFileName.isEmpty()); \ + \ + /* Get temp path */ \ + OUString sTempDir = utl::TempFile::GetTempNameBaseDirectory(); \ + \ + /* Create & apply new URL */ \ + OUString sOriginalFileInTempDir = sTempDir + sFileName; \ + uno::Reference<beans::XPropertySet> xPropertySet(xText, css::uno::UNO_QUERY); \ + xPropertySet->setPropertyValue("HyperLinkURL", \ + css::uno::makeAny(sOriginalFileInTempDir)); \ + } \ + \ + public: \ + CPPUNIT_TEST_SUITE(TestName); \ + CPPUNIT_TEST(Import_Export_Import); \ + CPPUNIT_TEST_SUITE_END(); \ + void Import_Export_Import() \ + { \ + SvtSaveOptions aOpt; \ + if (bAbsolute) \ + { \ + aOpt.SetSaveRelFSys(false); \ + CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \ + } \ + else \ + { \ + aOpt.SetSaveRelFSys(true); \ + CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \ + } \ + executeLoadReloadVerify(FileName); \ + } \ + void verify() override; \ + }; \ + CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \ + void TestName::verify() + +// bAbsolute - decide if relative link should be converted to absolute on import +#define DECLARE_LINKS_IMPORT_TEST(TestName, FileName, bAbsolute) \ + class TestName : public Test \ + { \ + protected: \ + virtual OUString getTestName() override { return #TestName; } \ + \ + public: \ + CPPUNIT_TEST_SUITE(TestName); \ + CPPUNIT_TEST(Import); \ + CPPUNIT_TEST_SUITE_END(); \ + void Import() \ + { \ + SvtSaveOptions aOpt; \ + if (bAbsolute) \ + { \ + aOpt.SetSaveRelFSys(false); \ + CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \ + } \ + else \ + { \ + aOpt.SetSaveRelFSys(true); \ + CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \ + } \ + executeImportTest(FileName); \ + } \ + void verify() override; \ + }; \ + CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \ + void TestName::verify() + +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"); + } +}; + +/* IMPORT */ + +DECLARE_LINKS_IMPORT_TEST(testRelativeToRelativeImport, "relative-link.docx", USE_RELATIVE) +{ + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); + OUString sTarget = getProperty<OUString>(xText, "HyperLinkURL"); + CPPUNIT_ASSERT(sTarget.startsWith("file:///")); + CPPUNIT_ASSERT(sTarget.endsWith("relative.docx")); +} + +DECLARE_LINKS_IMPORT_TEST(testRelativeToAbsoluteImport, "relative-link.docx", USE_ABSOLUTE) +{ + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); + OUString sTarget = getProperty<OUString>(xText, "HyperLinkURL"); + CPPUNIT_ASSERT(sTarget.startsWith("file:///")); + CPPUNIT_ASSERT(sTarget.endsWith("relative.docx")); +} + +DECLARE_LINKS_IMPORT_TEST(testAbsoluteToAbsoluteImport, "absolute-link.docx", USE_ABSOLUTE) +{ + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); + // # should be encoded + CPPUNIT_ASSERT_EQUAL(OUString("file:///B:/Users/user/Desktop/a%23b/test.docx"), + getProperty<OUString>(xText, "HyperLinkURL")); +} + +DECLARE_LINKS_IMPORT_TEST(testAbsoluteToRelativeImport, "absolute-link.docx", USE_RELATIVE) +{ + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); + // when target file (B:\\...) & document with link (temp dir) are placed on different partitions, absolute path will be loaded + CPPUNIT_ASSERT_EQUAL(OUString("file:///B:/Users/user/Desktop/a%23b/test.docx"), + getProperty<OUString>(xText, "HyperLinkURL")); +} + +DECLARE_LINKS_IMPORT_TEST(testTdf123627_import, "tdf123627.docx", USE_RELATIVE) +{ + uno::Reference<text::XTextRange> xText = getRun(getParagraph(1), 1); + OUString sTarget = getProperty<OUString>(xText, "HyperLinkURL"); + CPPUNIT_ASSERT(sTarget.startsWith("file:///")); + CPPUNIT_ASSERT(sTarget.endsWith("New/test.docx")); +} + +/* EXPORT */ + +DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", USE_RELATIVE, + USE_TEMP_DIR) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", + "relative.docx"); +} + +DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", USE_ABSOLUTE, + DONT_MODIFY_LINK) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + + OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target"); + CPPUNIT_ASSERT(sTarget.startsWith("file:///")); + CPPUNIT_ASSERT(sTarget.endsWith("relative.docx")); +} + +DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", USE_RELATIVE, + USE_TEMP_DIR) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", "test.docx"); +} + +DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", USE_ABSOLUTE, + DONT_MODIFY_LINK) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + + OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target"); + CPPUNIT_ASSERT(sTarget.startsWith("file:///")); + CPPUNIT_ASSERT(sTarget.endsWith("test.docx")); +} + +DECLARE_LINKS_EXPORT_TEST(testTdf123627_export, "tdf123627.docx", USE_RELATIVE, USE_TEMP_DIR) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", + "test.docx"); +} + +DECLARE_LINKS_EXPORT_TEST(testTdf126590_export, "tdf126590.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + // in the original file: Target="file:///C:\TEMP\test.docx" => invalid file URI + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", + "file:///C:/TEMP/test.docx"); +} + +DECLARE_LINKS_EXPORT_TEST(testTdf126768_export, "tdf126768.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + // in the original file: "file:///C:\\TEMP\\test.docx" => invalid file URI + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", + "file:///C:/TEMP/test.docx"); +} + +DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_ABSOLUTE, + DONT_MODIFY_LINK) +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + if (!pXmlDoc) + return; + + OUString sTarget = "file:///C:/TEMP/%C3%A9kezet.docx"; + assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", + INetURLObject::decode( sTarget, INetURLObject::DecodeMechanism::ToIUri, + RTL_TEXTENCODING_UTF8)); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx new file mode 100644 index 000000000..5c2d43698 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx @@ -0,0 +1,638 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/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_EXPORTONLY_TEST(Test_TextEffects_GlowShadowReflection, "TextEffects_Glow_Shadow_Reflection.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow", "rad").match("63500")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr", "val").match("00B0F0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr/w14:alpha", "val").match("60000")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow", "rad").match("228600")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr", "val").match("accent6")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:alpha", "val").match("60000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:satMod", "val").match("175000")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "blurRad").match("63500")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "dist").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "dir").match("1800000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "sx").match("100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "sy").match("-30000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "kx").match("-800400")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "ky").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "algn").match("bl")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr", "val").match("accent3")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:alpha", "val").match("38000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:lumMod", "val").match("75000")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "blurRad").match("190500")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "dist").match("190500")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "dir").match("3000000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "sx").match("100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "sy").match("100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "kx").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "ky").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "algn").match("ctr")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr", "val").match("FF0000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr/w14:alpha", "val").match("10000")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "blurRad").match("6350")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "stA").match("60000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "stPos").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "endA").match("900")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "endPos").match("60000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "dist").match("60007")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "dir").match("5400000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "fadeDir").match("5400000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "sx").match("100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "sy").match("-100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "kx").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "ky").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "algn").match("bl")); + + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "blurRad").match("6350")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "stA").match("55000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "stPos").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "endA").match("300")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "endPos").match("45500")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "dist").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "dir").match("5400000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "fadeDir").match("5400000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "sx").match("100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "sy").match("-100000")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "kx").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "ky").match("0")); + CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "algn").match("bl")); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_TextOutline, "TextEffects_TextOutline.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Paragraph 1 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "w", "50800"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "dbl"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "70000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr", "val", "92D050"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:alpha", "val", "30000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumMod", "val", "75000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumOff", "val", "25000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "30000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:alpha", "val", "55000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "40000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "60000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]/w14:srgbClr", "val", "0070C0"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]", "pos", "100000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]/w14:schemeClr", "val", "accent4"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin", "ang", "3600000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin", "scaled", "0"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "dash"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:miter", "lim", "0"); + + // Paragraph 2 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "w", "9525"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "sng"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:solidFill/w14:srgbClr", "val", "FF0000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "solid"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1); + + // Paragraph 3 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "w", "9525"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "sng"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:noFill", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "solid"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_TextFill, "TextEffects_TextFill.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // Paragraph 1 has no textFill + + // Paragraph 2 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textFill/w14:noFill", 1); + + // Paragraph 3 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:alpha", "val", "5000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "40000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumOff", "val", "60000"); + + // Paragraph 4 + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "5000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "67000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "50000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr", "val", "00B0F0"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:alpha", "val", "10000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:lumMod", "val", "80000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:alpha", "val", "15000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff", "val", "40000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin", "ang", "16200000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin", "scaled", "0"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing, "TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Paragraph 1 - w14:props3d + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "extrusionH", "63500"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "contourW", "25400"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "prstMaterial", "softEdge"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "w", "38100"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "h", "38100"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "prst", "relaxedInset"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "w", "69850"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "h", "38100"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "prst", "cross"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr", "val", "accent2"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr/w14:srgbClr", "val", "92D050"); + + // Paragraph 2 - w14:ligatures + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures", "val", "standard"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures", "val", "standardContextual"); + + // Paragraph 3 - w14:numForm and w14:numSpacing + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm", "val", "lining"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing", "val", "tabular"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm", "val", "oldStyle"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing", "val", "proportional"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_StylisticSets_CntxtAlts, "TextEffects_StylisticSets_CntxtAlts.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + // Paragraph 1 - w14:stylisticSets + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", "id", "4"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet", 1); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet", "id", "2"); + + // Paragraph 1 - w14:cntxtAlts + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:cntxtAlts", 1); + +} + +DECLARE_OOXMLEXPORT_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14"); + + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + + assertXPath(pXmlStyles, "/w:styles", "Ignorable", "w14"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_CompatSettingsForW14, "TextEffects_StylisticSets_CntxtAlts.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); + + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting", 5); + + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "val", "15"); // document was made with Word2013 -> 15 + + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "name", "overrideTableStyleFontSizeAndJustification"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "val", "1"); + + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "name", "enableOpenTypeFeatures"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "val", "1"); + + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "name", "doNotFlipMirrorIndents"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "val", "1"); + + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "name", "differentiateMultirowTableHeaders"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "uri", "http://schemas.microsoft.com/office/word"); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "val", "1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_Groupshapes, "TextEffects_Groupshapes.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + OString sPathToWGP = "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp"; + + assertXPath(pXmlDoc, sPathToWGP + "/wps:wsp", 2); + + OString sPathToShapeRunProperties = sPathToWGP + "/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr"; + + // Glow + OString sPathGlow = sPathToShapeRunProperties + "/w14:glow"; + assertXPath(pXmlDoc, sPathGlow, 1); + assertXPath(pXmlDoc, sPathGlow, "rad", "127000"); + assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr", "val", "00B050"); + assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr/w14:alpha", "val", "60000"); + + // Shadow + OString sPathShadow = sPathToShapeRunProperties + "/w14:shadow"; + assertXPath(pXmlDoc, sPathShadow, 1); + assertXPath(pXmlDoc, sPathShadow, "blurRad", "127000"); + assertXPath(pXmlDoc, sPathShadow, "dist", "787400"); + assertXPath(pXmlDoc, sPathShadow, "dir", "12720000"); + assertXPath(pXmlDoc, sPathShadow, "sx", "70000"); + assertXPath(pXmlDoc, sPathShadow, "sy", "70000"); + assertXPath(pXmlDoc, sPathShadow, "kx", "0"); + assertXPath(pXmlDoc, sPathShadow, "ky", "0"); + assertXPath(pXmlDoc, sPathShadow, "algn", "l"); + assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "92D050"); + assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "40000"); + + // Reflection + OString sPathReflection = sPathToShapeRunProperties + "/w14:reflection"; + assertXPath(pXmlDoc, sPathReflection, 1); + assertXPath(pXmlDoc, sPathReflection, "blurRad", "139700"); + assertXPath(pXmlDoc, sPathReflection, "stA", "47000"); + assertXPath(pXmlDoc, sPathReflection, "stPos", "0"); + assertXPath(pXmlDoc, sPathReflection, "endA", "0"); + assertXPath(pXmlDoc, sPathReflection, "endPos", "85000"); + assertXPath(pXmlDoc, sPathReflection, "dist", "63500"); + assertXPath(pXmlDoc, sPathReflection, "dir", "5400000"); + assertXPath(pXmlDoc, sPathReflection, "fadeDir", "5400000"); + assertXPath(pXmlDoc, sPathReflection, "sx", "100000"); + assertXPath(pXmlDoc, sPathReflection, "sy", "-100000"); + assertXPath(pXmlDoc, sPathReflection, "kx", "0"); + assertXPath(pXmlDoc, sPathReflection, "ky", "0"); + assertXPath(pXmlDoc, sPathReflection, "algn", "bl"); + + // TextOutline + OString sPathTextOutline = sPathToShapeRunProperties + "/w14:textOutline"; + assertXPath(pXmlDoc, sPathTextOutline, 1); + assertXPath(pXmlDoc, sPathTextOutline, "w", "25400"); + assertXPath(pXmlDoc, sPathTextOutline, "cap", "rnd"); + assertXPath(pXmlDoc, sPathTextOutline, "cmpd", "sng"); + assertXPath(pXmlDoc, sPathTextOutline, "algn", "ctr"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val", "accent2"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val", "40000"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "75000"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val", "solid"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:round", 1); + + // TextFill + OString sPathTextFill = sPathToShapeRunProperties + "/w14:textFill"; + assertXPath(pXmlDoc, sPathTextFill, 1); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent4"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "41000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent6"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "60000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "40000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "87000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent5"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff", "val", "40000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:lin", "ang", "5400000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:lin", "scaled", "0"); + + // Props3D + OString sPathProps3D = sPathToShapeRunProperties + "/w14:props3d"; + assertXPath(pXmlDoc, sPathProps3D, 1); + assertXPath(pXmlDoc, sPathProps3D, "extrusionH", "63500"); + assertXPath(pXmlDoc, sPathProps3D, "contourW", "12700"); + assertXPath(pXmlDoc, sPathProps3D, "prstMaterial", "warmMatte"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w", "38100"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h", "38100"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst", "circle"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val", "accent2"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "60000"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "40000"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val", "accent4"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val", "75000"); + + // Ligatures + OString sPathLigatures = sPathToShapeRunProperties + "/w14:ligatures"; + assertXPath(pXmlDoc, sPathLigatures, 1); + assertXPath(pXmlDoc, sPathLigatures, "val", "standard"); + + // NumForm + OString sPathNumForm = sPathToShapeRunProperties + "/w14:numForm"; + assertXPath(pXmlDoc, sPathNumForm, 1); + assertXPath(pXmlDoc, sPathNumForm, "val", "oldStyle"); + + // NumSpacing + OString sPathNumSpacing = sPathToShapeRunProperties + "/w14:numSpacing"; + assertXPath(pXmlDoc, sPathNumSpacing, 1); + assertXPath(pXmlDoc, sPathNumSpacing, "val", "tabular"); + + // StylisticSets + OString sPathStylisticSets = sPathToShapeRunProperties + "/w14:stylisticSets"; + assertXPath(pXmlDoc, sPathStylisticSets, 1); + assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id", "1"); +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_InStyleXml, "TextEffects_InStyle.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); + + OString sPathToCharacterStyle = "/w:styles/w:style[3]"; + + assertXPath(pXmlDoc, sPathToCharacterStyle, "type", "character"); + assertXPath(pXmlDoc, sPathToCharacterStyle, "styleId", "TextEffectsStyleChar"); + assertXPath(pXmlDoc, sPathToCharacterStyle, "customStyle", "1"); + + { + OString sPathToRun = sPathToCharacterStyle + "/w:rPr"; + + // Glow + OString sPathGlow = sPathToRun + "/w14:glow"; + assertXPath(pXmlDoc, sPathGlow, "rad", "63500"); + assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr", "val", "accent2"); + assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:alpha", "val", "60000"); + assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:satMod", "val", "175000"); + + // Shadow + OString sPathShadow = sPathToRun + "/w14:shadow"; + assertXPath(pXmlDoc, sPathShadow, "blurRad", "50800"); + assertXPath(pXmlDoc, sPathShadow, "dist", "38100"); + assertXPath(pXmlDoc, sPathShadow, "dir", "16200000"); + assertXPath(pXmlDoc, sPathShadow, "sx", "100000"); + assertXPath(pXmlDoc, sPathShadow, "sy", "100000"); + assertXPath(pXmlDoc, sPathShadow, "kx", "0"); + assertXPath(pXmlDoc, sPathShadow, "ky", "0"); + assertXPath(pXmlDoc, sPathShadow, "algn", "b"); + assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "000000"); + assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "60000"); + + // Reflection + OString sPathReflection = sPathToRun + "/w14:reflection"; + assertXPath(pXmlDoc, sPathReflection, "blurRad", "6350"); + assertXPath(pXmlDoc, sPathReflection, "stA", "50000"); + assertXPath(pXmlDoc, sPathReflection, "stPos", "0"); + assertXPath(pXmlDoc, sPathReflection, "endA", "300"); + assertXPath(pXmlDoc, sPathReflection, "endPos", "50000"); + assertXPath(pXmlDoc, sPathReflection, "dist", "29997"); + assertXPath(pXmlDoc, sPathReflection, "dir", "5400000"); + assertXPath(pXmlDoc, sPathReflection, "fadeDir", "5400000"); + assertXPath(pXmlDoc, sPathReflection, "sx", "100000"); + assertXPath(pXmlDoc, sPathReflection, "sy", "-100000"); + assertXPath(pXmlDoc, sPathReflection, "kx", "0"); + assertXPath(pXmlDoc, sPathReflection, "ky", "0"); + assertXPath(pXmlDoc, sPathReflection, "algn", "bl"); + + // TextOutline + OString sPathTextOutline = sPathToRun + "/w14:textOutline"; + assertXPath(pXmlDoc, sPathTextOutline, "w", "25400"); + assertXPath(pXmlDoc, sPathTextOutline, "cap", "rnd"); + assertXPath(pXmlDoc, sPathTextOutline, "cmpd", "sng"); + assertXPath(pXmlDoc, sPathTextOutline, "algn", "ctr"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val", "40000"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "75000"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val", "solid"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:bevel", 1); + + // TextFill + OString sPathTextFill = sPathToRun + "/w14:textFill"; + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "10000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "40000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff", "val", "60000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "46000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "95000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "5000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path", "path", "circle"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "b", "-30000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "r", "50000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "t", "130000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "l", "50000"); + + // Props3D + OString sPathProps3D = sPathToRun + "/w14:props3d"; + assertXPath(pXmlDoc, sPathProps3D, "extrusionH", "57150"); + assertXPath(pXmlDoc, sPathProps3D, "contourW", "12700"); + assertXPath(pXmlDoc, sPathProps3D, "prstMaterial", "metal"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w", "38100"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h", "38100"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst", "angle"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "w", "69850"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "h", "69850"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "prst", "divot"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val", "75000"); + + // Ligatures + OString sPathLigatures = sPathToRun + "/w14:ligatures"; + assertXPath(pXmlDoc, sPathLigatures, "val", "standard"); + + // NumForm + OString sPathNumForm = sPathToRun + "/w14:numForm"; + assertXPath(pXmlDoc, sPathNumForm, "val", "lining"); + + // NumSpacing + OString sPathNumSpacing = sPathToRun + "/w14:numSpacing"; + assertXPath(pXmlDoc, sPathNumSpacing, "val", "proportional"); + + // StylisticSets + OString sPathStylisticSets = sPathToRun + "/w14:stylisticSets"; + assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id", "1"); + } + + OString sPathToParagraphStyle = "/w:styles/w:style[9]"; + + assertXPath(pXmlDoc, sPathToParagraphStyle, "type", "paragraph"); + assertXPath(pXmlDoc, sPathToParagraphStyle, "styleId", "TextEffectsStyle"); + assertXPath(pXmlDoc, sPathToParagraphStyle, "customStyle", "1"); + + { + OString sPathToRun = sPathToParagraphStyle + "/w:rPr"; + + // Glow + OString sPathGlow = sPathToRun + "/w14:glow"; + assertXPath(pXmlDoc, sPathGlow, "rad", "63500"); + assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr", "val", "accent2"); + assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:alpha", "val", "60000"); + assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:satMod", "val", "175000"); + + // Shadow + OString sPathShadow = sPathToRun + "/w14:shadow"; + assertXPath(pXmlDoc, sPathShadow, "blurRad", "50800"); + assertXPath(pXmlDoc, sPathShadow, "dist", "38100"); + assertXPath(pXmlDoc, sPathShadow, "dir", "16200000"); + assertXPath(pXmlDoc, sPathShadow, "sx", "100000"); + assertXPath(pXmlDoc, sPathShadow, "sy", "100000"); + assertXPath(pXmlDoc, sPathShadow, "kx", "0"); + assertXPath(pXmlDoc, sPathShadow, "ky", "0"); + assertXPath(pXmlDoc, sPathShadow, "algn", "b"); + assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "000000"); + assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "60000"); + + // Reflection + OString sPathReflection = sPathToRun + "/w14:reflection"; + assertXPath(pXmlDoc, sPathReflection, "blurRad", "6350"); + assertXPath(pXmlDoc, sPathReflection, "stA", "50000"); + assertXPath(pXmlDoc, sPathReflection, "stPos", "0"); + assertXPath(pXmlDoc, sPathReflection, "endA", "300"); + assertXPath(pXmlDoc, sPathReflection, "endPos", "50000"); + assertXPath(pXmlDoc, sPathReflection, "dist", "29997"); + assertXPath(pXmlDoc, sPathReflection, "dir", "5400000"); + assertXPath(pXmlDoc, sPathReflection, "fadeDir", "5400000"); + assertXPath(pXmlDoc, sPathReflection, "sx", "100000"); + assertXPath(pXmlDoc, sPathReflection, "sy", "-100000"); + assertXPath(pXmlDoc, sPathReflection, "kx", "0"); + assertXPath(pXmlDoc, sPathReflection, "ky", "0"); + assertXPath(pXmlDoc, sPathReflection, "algn", "bl"); + + // TextOutline + OString sPathTextOutline = sPathToRun + "/w14:textOutline"; + assertXPath(pXmlDoc, sPathTextOutline, "w", "25400"); + assertXPath(pXmlDoc, sPathTextOutline, "cap", "rnd"); + assertXPath(pXmlDoc, sPathTextOutline, "cmpd", "sng"); + assertXPath(pXmlDoc, sPathTextOutline, "algn", "ctr"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val", "40000"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "75000"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val", "solid"); + assertXPath(pXmlDoc, sPathTextOutline+"/w14:bevel", 1); + + // TextFill + OString sPathTextFill = sPathToRun + "/w14:textFill"; + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "10000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "40000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff", "val", "60000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "46000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "95000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "5000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path", "path", "circle"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "b", "-30000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "r", "50000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "t", "130000"); + assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "l", "50000"); + + // Props3D + OString sPathProps3D = sPathToRun + "/w14:props3d"; + assertXPath(pXmlDoc, sPathProps3D, "extrusionH", "57150"); + assertXPath(pXmlDoc, sPathProps3D, "contourW", "12700"); + assertXPath(pXmlDoc, sPathProps3D, "prstMaterial", "metal"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w", "38100"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h", "38100"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst", "angle"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "w", "69850"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "h", "69850"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "prst", "divot"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val", "accent1"); + assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val", "75000"); + + // Ligatures + OString sPathLigatures = sPathToRun + "/w14:ligatures"; + assertXPath(pXmlDoc, sPathLigatures, "val", "standard"); + + // NumForm + OString sPathNumForm = sPathToRun + "/w14:numForm"; + assertXPath(pXmlDoc, sPathNumForm, "val", "lining"); + + // NumSpacing + OString sPathNumSpacing = sPathToRun + "/w14:numSpacing"; + assertXPath(pXmlDoc, sPathNumSpacing, "val", "proportional"); + + // StylisticSets + OString sPathStylisticSets = sPathToRun + "/w14:stylisticSets"; + assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id", "1"); + } +} + +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_no_tag_if_no_fill, "tdf112103_tablebgnofill.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:shd", 0); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |