[Libreoffice-commits] core.git: sw/qa

Thomas Beck thomas.beck at cib.de
Thu Nov 9 14:09:11 UTC 2017


 sw/qa/extras/rtfimport/data/tdf108947.rtf |  113 ++++++++++++++++++++++++++++++
 sw/qa/extras/rtfimport/rtfimport.cxx      |   18 ++++
 2 files changed, 131 insertions(+)

New commits:
commit 743efc3d4b086d20abd1449bcb73e9bce506c083
Author: Thomas Beck <thomas.beck at cib.de>
Date:   Mon Nov 6 13:35:45 2017 +0100

    tdf#108947 Added Unittest.
    
    Added different branches for Windows/Linux because of differences in
    linebreaks.
    
    Change-Id: I17397155292e173bf698fa2680aaaf2711c064cf
    Reviewed-on: https://gerrit.libreoffice.org/44358
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/qa/extras/rtfimport/data/tdf108947.rtf b/sw/qa/extras/rtfimport/data/tdf108947.rtf
new file mode 100755
index 000000000000..77c2418705d5
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf108947.rtf
@@ -0,0 +1,113 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fonttbl
+{\f0\fnil\fcharset0\fprq0\fttruetype Tahoma;}
+{\f1\fnil\fcharset0\fprq0\fttruetype NULL;}
+{\f2\fnil\fcharset0\fprq0\fttruetype Dingbats;}
+{\f3\fnil\fcharset0\fprq0\fttruetype Symbol;}
+{\f4\fnil\fcharset0\fprq0\fttruetype Arial;}
+{\f5\fnil\fcharset0\fprq0\fttruetype Times New Roman;}
+{\f6\fnil\fcharset0\fprq0\fttruetype Courier New;}}
+{\colortbl
+\red0\green0\blue0;
+\red255\green255\blue255;}
+{\stylesheet
+{\s34\fi-431\li720 Tick List;}
+{\s21\fi-431\li720\sbasedon23 Lower Roman List;}
+{\s25\tx431\sbasedon15\snext23 Numbered Heading 1;}
+{\s26\tx431\sbasedon16\snext23 Numbered Heading 2;}
+{\s7\fi-431\li720 Diamond List;}
+{\*\cs9\sbasedon23 Endnote Text;}
+{\s10\tqc\tx4320\tqc\tx8640\f5\fs24\lang4105\sbasedon23\snext10 Footer;}
+{\s22\f5\fs20\lang0\snext22 No List;}
+{\s27\tx431\sbasedon17\snext23 Numbered Heading 3;}
+{\s28\fi-431\li720 Numbered List;}
+{\*\cs8\fs20\super Endnote Reference;}
+{\s14\tqc\tx4320\tqc\tx8640\f5\fs24\lang4105\sbasedon23\snext14 Header;}
+{\s4\tx1584\sbasedon25\snext23 Chapter Heading;}
+{\*\cs6\f5\fs20\lang0 Default Paragraph Font;}
+{\s31\fi-431\li720 Square List;}
+{\s5\fi-431\li720 Dashed List;}
+{\s37\fi-431\li720\sbasedon28 Upper Roman List;}
+{\s18\fi-431\li720 Heart List;}
+{\s24\sb100\f4\fs20\lang1033\sbasedon23\snext24 Normal (Web);}
+{\s3\fi-431\li720 Bullet List;}
+{\s13\fi-431\li720 Hand List;}
+{\*\cs12\fs20\sbasedon23 Footnote Text;}
+{\s15\sb440\sa60\f4\fs34\b\sbasedon23\snext23 Heading 1;}
+{\s16\sb440\sa60\f4\fs28\b\sbasedon23\snext23 Heading 2;}
+{\s17\sb440\sa60\f4\fs24\b\sbasedon23\snext23 Heading 3;}
+{\s33\f5\fs20\lang0\snext33 Table Normal;}
+{\s23\f5\fs24\lang4105\snext23 Normal;}
+{\s20\fi-431\li720\sbasedon28 Lower Case List;}
+{\s1\li1440\ri1440\sa120\sbasedon23 Block Text;}
+{\s36\fi-431\li720\sbasedon28 Upper Case List;}
+{\*\cs11\fs20\super Footnote Reference;}
+{\s30\tx1584\sbasedon25\snext23 Section Heading;}
+{\s19\fi-431\li720 Implies List;}
+{\s2\fi-431\li720 Box List;}
+{\s32\fi-431\li720 Star List;}
+{\s29\f6\sbasedon23 Plain Text;}
+{\s35\fi-431\li720 Triangle List;}}
+\kerning0\cf0\ftnbj\fet2\ftnstart1\ftnnar\aftnnar\ftnstart1\facingp\titlepg{\info}\deftab720\viewkind1\paperw12240\paperh15840\margl1440\margr1440\widowctl
+{\headerl\pard\plain
+\pard\plain\ltrpar\ql\s14\itap0\tqc\tx4320\tqc\tx8640{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0\par}{\f5\fs24\lang4105{\*\listtag0}}
+\sectd\sbknone\colsx360\marglsxn1800\margrsxn1800\pgncont\ltrsect
+\pard\plain\ltrpar\qc\s23\itap0{\f0\fs24\ul\lang4105{\*\listtag0}\abinodiroverride\ltrch Sublet Agreement}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Between}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\ul\lang4105{\*\listtag0}\abinodiroverride\ltrch Joe Drew}{\f0\fs24\lang4105{\*\listtag0}\line (Hereinafter called the "TENANT" of the first part).\line }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch And}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch \line }{\f0\fs24\ul\lang4105{\*\listtag0}John Horn}{\f0\fs24\lang4105{\*\listtag0} }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch (Hereinafter called the "SUBTENANT" of the second part).\line \line The TENANT hereby agrees to rent to the SUBTENANT and the SUBTENANT agrees to rent from the TENANT the premises being:}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\ul\lang4105{\*\listtag0}\abinodiroverride\ltrch 511 Albert Street, Unit 111, Waterloo ON Canada N2L 5A7}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch (hereinafter referred to as the \uc1\u8220\'93the premises\uc1\u8221\'94) situated in the Municipality of Waterloo, said premises to be used by the SUBTENANT for residential purposes only, upon the following terms and conditions: }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch To have and to hold the  premises for and during the term of }{\f0\fs24\ul\lang4105{\*\listtag0}4 months}{\f0\fs24\lang4105{\*\listtag0} to be computed from the }{\f0\fs24\ul\lang4105{\*\listtag0}15}{\f0\fs24\ul\super\lang4105{\*\listtag0}th}{\f0\fs24\ul\lang4105{\*\listtag0} day of August 2004}{\f0\fs24\lang4105{\*\listtag0} and ending on the }{\f0\fs24\ul\lang4105{\*\listtag0}15}{\f0\fs24\ul\super\lang4105{\*\listtag0}th}{\f0\fs24\ul\lang4105{\*\listtag0} day of December 2004. }{\f0\fs24\lang4105{\*\listtag0}The SUBTENANT agrees to give up vacant possession to the original tenant or landlord at the expiry of the sublease.}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch The SUBTENANT and TENANT agree that all terms and conditions existing in the Tenancy Agreement dated February 2001 shall govern the relationship between the TENANT and the SUBTENANT and the TENANT and SUBTENANT agree that the SUBTENANT shall be bound by all of the terms and conditions in the aforementioned Tenancy Agreement.\~ \line \line Yielding and paying therefore monthly and every month during the said term unto the said TENANT the sum of }{\f0\fs24\ul\lang4105{\*\listtag0}$ 375.00}{\f0\fs24\lang4105{\*\listtag0} of lawful money of Canada, without any deduction, defalcation or abatement whatsoever on the 15}{\f0\fs24\super\lang4105{\*\listtag0}th}{\f0\fs24\lang4105{\*\listtag0} day of each month. }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch The SUBTENANT covenants with the TENANT to pay rent to the tenant and agree to all the terms of the original lease entered into by the original tenant & landlord.}
+\par\pard\plain\ltrpar\ql\sb240\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch The SUBTENANT is to pay water rates and charges for electricity, Internet, cable and phone charges directly to the appropriate utility, with the exception of water which is paid directly to the TENANT.}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}}
+{\headerl\pard\plain
+\par\pard\plain\ltrpar\ql\s14\itap0\tqc\tx4320\tqc\tx8640{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Header Page 2}{\fldrslt {\noproof  ?}}}{\f0\fs24\lang4105{\*\listtag0} }
+\par\pard\plain\ltrpar\ql\s23\itap0\par}{\f5\fs24\lang4105{\*\listtag0}}
+\sect\sectd\sbknone\cols2\marglsxn1800\margrsxn1800\pgncont\ltrsect
+\pard\plain\ltrpar\ql\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________\line Subtenant Name (Print Please)}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Subtenants Permanent Address}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch ________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Subtenants Signature}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch ________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Tenant\uc1\u8217\'92s Name (Print Please)}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Tenant\uc1\u8217\'92s  Permanent Address}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch ________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Tenants Signature}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}}
+{\headerl\pard\plain
+\par\pard\plain\ltrpar\ql\s14\itap0\tqc\tx4320\tqc\tx8640{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Header Page 2}{\fldrslt {\noproof  ?}}}{\f0\fs24\lang4105{\*\listtag0} }
+\par\pard\plain\ltrpar\ql\s23\itap0\par}{\f5\fs24\lang4105{\*\listtag0}}
+\sect\sectd\sbknone\colsx360\marglsxn1800\margrsxn1800\pgncont\ltrsect
+\pard\plain\ltrpar\ql\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Date}}
\ No newline at end of file
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 50c39d5eb1ce..22f6aba651d3 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1175,6 +1175,24 @@ DECLARE_RTFIMPORT_TEST(testImportHeaderFooter, "tdf108055.rtf")
     CPPUNIT_ASSERT_EQUAL(OUString("Footer uneven"), aActual);
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf108947, "tdf108947.rtf")
+{
+    //Check page count
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+    //Check if Headers/Footers contain what they should in this document
+    uno::Reference<text::XText> xHeaderTextRight = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default Style"), "HeaderTextRight");
+    OUString aActual = xHeaderTextRight->getString();
+    CPPUNIT_ASSERT_EQUAL(OUString(""), aActual);
+
+    OUString aExpected = SAL_NEWLINE_STRING;
+    aExpected += SAL_NEWLINE_STRING;
+    aExpected += "Header Page 2 ?";
+    uno::Reference<text::XText> xHeaderTextLeft = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default Style"), "HeaderTextLeft");
+    aActual = xHeaderTextLeft->getString();
+    CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+}
+
 DECLARE_RTFIMPORT_TEST(testWatermark, "watermark.rtf")
 {
     Size aExpectedSize(14965, 7482);


More information about the Libreoffice-commits mailing list