summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-07-22 23:34:40 +0200
committerDavid Tardon <dtardon@redhat.com>2014-07-23 15:25:33 +0000
commit8b674d486ea7f18c02f8a29f4a87529d7daf4491 (patch)
tree5e860c49dbe9cf82aaef6b54ba09dd34976358da
parent7249420f98baa1cd839354fc07923595d0188841 (diff)
fdo#81276: sw: HTML import: fix inverted test in CSS import
(regression from 5089bdb234a93bcb62b597c18b8ab66048246b13) (cherry picked from commit 7dff37c65e08985b80ac79e13f5571819a8e739d) Conflicts: sw/qa/extras/htmlexport/htmlexport.cxx Change-Id: I5b45c4c47ba66385b2b528b5a3039bda37b060d6 Reviewed-on: https://gerrit.libreoffice.org/10476 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit a6a423148d66a9bf68cdd6475ea792263ab80df8) Reviewed-on: https://gerrit.libreoffice.org/10484 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sw/qa/extras/htmlexport/data/fdo81276.html21
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx13
-rw-r--r--sw/source/filter/html/htmlcss1.cxx2
3 files changed, 35 insertions, 1 deletions
diff --git a/sw/qa/extras/htmlexport/data/fdo81276.html b/sw/qa/extras/htmlexport/data/fdo81276.html
new file mode 100644
index 000000000000..653f6b182189
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/fdo81276.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html lang="ru-ru" >
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta charset="utf-8">
+ <style>
+
+ @page { size: 29.7cm 21cm;
+ margin-left: 0.5cm;
+ margin-right: 0.5cm;
+ margin-top: 2cm;
+ margin-bottom: 0.5cm
+ }
+
+ </style>
+</head>
+
+<body>
+
+</body>
+</html>
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index ed264e22e500..78e2959d76f2 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -61,6 +61,19 @@ private:
#define DECLARE_HTMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
+DECLARE_HTMLEXPORT_TEST(testFdo81276, "fdo81276.html")
+{
+ uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles"));
+ uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY);
+ // some rounding going on here?
+ CPPUNIT_ASSERT(abs(sal_Int32(29700) - getProperty<sal_Int32>(xStyle, "Width")) < 10);
+ CPPUNIT_ASSERT(abs(sal_Int32(21006) - getProperty<sal_Int32>(xStyle, "Height")) < 10);
+ CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "LeftMargin")) < 10);
+ CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "RightMargin")) < 10);
+ CPPUNIT_ASSERT(abs(sal_Int32(2000) - getProperty<sal_Int32>(xStyle, "TopMargin")) < 10);
+ CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "BottomMargin")) < 10);
+}
+
DECLARE_HTMLEXPORT_TEST(testFdo62336, "fdo62336.docx")
{
// The problem was essentially a crash during table export as docx/rtf/html
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index 69eddb75d784..a57fe117dc85 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1702,7 +1702,7 @@ void SwHTMLParser::NewStyle()
sType = rOption.GetString();
}
- bIgnoreRawData = !sType.getLength() &&
+ bIgnoreRawData = sType.getLength() &&
!sType.getToken(0,';').equalsAscii(sCSS_mimetype);
}