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

2023-11-19 Thread Stephan Bergmann (via logerrit)
 writerperfect/qa/unit/EPUBExportTest.cxx |  236 ---
 1 file changed, 125 insertions(+), 111 deletions(-)

New commits:
commit e4d8f186d07aa1999e16abff3381e37b8764e964
Author: Stephan Bergmann 
AuthorDate: Sun Nov 19 13:22:12 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 19 15:23:17 2023 +0100

Extended loplugin:ostr: writerperfect

Change-Id: Ib942f7725e224b7c4beaca4cd4d86b83f60cd3f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159664
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index f667213288bf..86e7a4502ed3 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -149,7 +149,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMimetype)
 SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
 SvMemoryStream aMemoryStream;
 aMemoryStream.WriteStream(aFileStream);
-OString aExpected("application/epub+zip");
+OString aExpected("application/epub+zip"_ostr);
 CPPUNIT_ASSERT(aMemoryStream.GetSize() > 
static_cast(aExpected.getLength()) + 38);
 
 OString aActual(static_cast(aMemoryStream.GetData()) + 38, 
aExpected.getLength());
@@ -158,11 +158,11 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMimetype)
 
 xmlDocUniquePtr mpXmlDoc = parseExport("OEBPS/content.opf");
 // Default is EPUB3.
-assertXPath(mpXmlDoc, "/opf:package", "version", "3.0");
+assertXPath(mpXmlDoc, "/opf:package"_ostr, "version"_ostr, "3.0");
 
 // This was just "libepubgen/x.y.z", i.e. the LO version was missing.
-OUString aGenerator
-= getXPath(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@name='generator']", "content");
+OUString aGenerator = getXPath(
+mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@name='generator']"_ostr, "content"_ostr);
 
CPPUNIT_ASSERT(aGenerator.startsWith(utl::DocInfoHelper::GetGeneratorString()));
 
 uno::Reference 
xMSF(mxComponentContext->getServiceManager(),
@@ -186,7 +186,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUB2)
 
 xmlDocUniquePtr mpXmlDoc = parseExport("OEBPS/content.opf");
 // This was 3.0, EPUBVersion filter option was ignored and we always 
emitted EPUB3.
-assertXPath(mpXmlDoc, "/opf:package", "version", "2.0");
+assertXPath(mpXmlDoc, "/opf:package"_ostr, "version"_ostr, "2.0");
 }
 
 CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUBFixedLayout)
@@ -199,7 +199,8 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUBFixedLayout)
 
 xmlDocUniquePtr mpXmlDoc = parseExport("OEBPS/content.opf");
 // This was missing, EPUBLayoutMethod filter option was ignored and we 
always emitted reflowable layout.
-assertXPathContent(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@property='rendition:layout']",
+assertXPathContent(mpXmlDoc,
+   
"/opf:package/opf:metadata/opf:meta[@property='rendition:layout']"_ostr,
"pre-paginated");
 }
 
@@ -211,7 +212,8 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, 
testEPUBFixedLayoutOption)
 
 // This failed, fixed layout was only working via the FilterData map.
 xmlDocUniquePtr mpXmlDoc = parseExport("OEBPS/content.opf");
-assertXPathContent(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@property='rendition:layout']",
+assertXPathContent(mpXmlDoc,
+   
"/opf:package/opf:metadata/opf:meta[@property='rendition:layout']"_ostr,
"pre-paginated");
 }
 
@@ -232,8 +234,8 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, 
testEPUBFixedLayoutImplicitBreak)
 // document.
 xmlDocUniquePtr mpXmlDoc = parseExport("OEBPS/toc.xhtml");
 // This was 'Page 1' instead.
-assertXPathContent(mpXmlDoc, "//xhtml:li[1]/xhtml:a", "First chapter");
-assertXPathContent(mpXmlDoc, "//xhtml:li[2]/xhtml:a", "Second chapter");
+assertXPathContent(mpXmlDoc, "//xhtml:li[1]/xhtml:a"_ostr, "First 
chapter");
+assertXPathContent(mpXmlDoc, "//xhtml:li[2]/xhtml:a"_ostr, "Second 
chapter");
 }
 
 CPPUNIT_TEST_FIXTURE(EPUBExportTest, testPageBreakSplit)
@@ -256,11 +258,11 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testSpanAutostyle)
 createDoc(u"span-autostyle.fodt", {});
 
 xmlDocUniquePtr mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
-assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[1]", "class", "span0");
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[1]"_ostr, "class"_ostr, 
"span0");
 // This failed, it was still span1, i.e. the bold and the italic formatting
 // did not differ.
-assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[2]", "class", "span1");
-assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[3]", "class", "span2");
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[2]"_ostr, "class"_ostr, 
"span1");
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[3]"_ostr, "class"_ostr, 
"span2");
 }
 
 CPPUNIT_TEST_FIXTURE(EPUBExportTest, testParaA

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2021-02-17 Thread Noel (via logerrit)
 writerperfect/qa/unit/DrawingImportTest.cxx |4 ++--
 writerperfect/qa/unit/PresentationImportTest.cxx|4 ++--
 writerperfect/qa/unit/SpreadsheetImportTest.cxx |4 ++--
 writerperfect/qa/unit/TextImportTest.cxx|4 ++--
 writerperfect/qa/unit/wpftimport.cxx|2 +-
 writerperfect/source/writer/EPUBPackage.cxx |3 +--
 writerperfect/source/writer/exp/XMLTextFrameContext.cxx |2 +-
 writerperfect/source/writer/exp/xmlfmt.cxx  |2 +-
 writerperfect/source/writer/exp/xmlimp.cxx  |3 +--
 9 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit 1491b0003a03064a3cec30fc71c35d46eb6970b2
Author: Noel 
AuthorDate: Wed Feb 17 18:23:05 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 18 08:17:57 2021 +0100

loplugin:referencecasting in writerperfect

Change-Id: I2b8dfca7344caa4b9dd503fc3fca383a6cee8f04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111077
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/writerperfect/qa/unit/DrawingImportTest.cxx 
b/writerperfect/qa/unit/DrawingImportTest.cxx
index 6fb1f98ef6b2..8af2ec8d62b7 100644
--- a/writerperfect/qa/unit/DrawingImportTest.cxx
+++ b/writerperfect/qa/unit/DrawingImportTest.cxx
@@ -123,8 +123,8 @@ void DrawingImportTest::test()
 using namespace css;
 
 rtl::Reference xFilter{ new 
DrawingImportFilter(m_xContext) };
-writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(),
-"private:factory/sdraw", 
m_xDesktop, m_xContext);
+writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter, 
"private:factory/sdraw",
+m_xDesktop, m_xContext);
 
 uno::Reference xDoc(aLoader.getDocument(), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
diff --git a/writerperfect/qa/unit/PresentationImportTest.cxx 
b/writerperfect/qa/unit/PresentationImportTest.cxx
index e1414dec5b85..0c29c72695df 100644
--- a/writerperfect/qa/unit/PresentationImportTest.cxx
+++ b/writerperfect/qa/unit/PresentationImportTest.cxx
@@ -123,8 +123,8 @@ void PresentationImportTest::test()
 using namespace css;
 
 rtl::Reference xFilter{ new 
PresentationImportFilter(m_xContext) };
-writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(),
-"private:factory/simpress", 
m_xDesktop, m_xContext);
+writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter, 
"private:factory/simpress",
+m_xDesktop, m_xContext);
 
 uno::Reference xDoc(aLoader.getDocument(), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
diff --git a/writerperfect/qa/unit/SpreadsheetImportTest.cxx 
b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
index caf5d4de94ec..3c5de090ce1c 100644
--- a/writerperfect/qa/unit/SpreadsheetImportTest.cxx
+++ b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
@@ -117,8 +117,8 @@ void SpreadsheetImportTest::test()
 using namespace css;
 
 rtl::Reference xFilter{ new 
SpreadsheetImportFilter(m_xContext) };
-writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(),
-"private:factory/scalc", 
m_xDesktop, m_xContext);
+writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter, 
"private:factory/scalc",
+m_xDesktop, m_xContext);
 
 uno::Reference xDoc(aLoader.getDocument(), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
diff --git a/writerperfect/qa/unit/TextImportTest.cxx 
b/writerperfect/qa/unit/TextImportTest.cxx
index 0b482a75c9a3..c1ff7ad75ff2 100644
--- a/writerperfect/qa/unit/TextImportTest.cxx
+++ b/writerperfect/qa/unit/TextImportTest.cxx
@@ -111,8 +111,8 @@ void TextImportTest::test()
 using namespace css;
 
 rtl::Reference xFilter{ new TextImportFilter(m_xContext) 
};
-writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(),
-"private:factory/swriter", 
m_xDesktop, m_xContext);
+writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter, 
"private:factory/swriter",
+m_xDesktop, m_xContext);
 
 uno::Reference xDoc(aLoader.getDocument(), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT(xDoc.is());
diff --git a/writerperfect/qa/unit/wpftimport.cxx 
b/writerperfect/qa/unit/wpftimport.cxx
index fe3bfa02f9a6..5034f159e704 100644
--- a/writerperfect/qa/unit/wpftimport.cxx
+++ b/writerperfect/qa/unit/wpftimport.cxx
@@ -21,7 +21,7 @@ css::uno::Reference createDummyInput()
 {
 rtl::Reference xDummyInput(
 new comphelper::SequenceInputStream(css::uno::Sequence()));
-return xDummyInput.get();
+return xDummyInput;
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerperfect/source/writer/EPUBPa

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

2020-09-27 Thread David Tardon (via logerrit)
 writerperfect/qa/unit/WpftWriterFilterTest.cxx   |1 +
 writerperfect/qa/unit/data/writer/libwps/pass/PocketWord.psw |binary
 2 files changed, 1 insertion(+)

New commits:
commit 9b9d668d45dce3f318d89d54725a4d6cfc750315
Author: David Tardon 
AuthorDate: Sun Sep 27 15:21:42 2020 +0200
Commit: David Tardon 
CommitDate: Sun Sep 27 19:04:06 2020 +0200

add import test file for Pocket Word

Change-Id: Idbd2ddb113f77a6dc3966110757c4037d993bd4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103515
Tested-by: Jenkins
Reviewed-by: David Tardon 

diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx 
b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index 8bc4c7cadbb3..6f88c694682b 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -48,6 +48,7 @@ void WpftWriterFilterTest::test()
 { "Writer_3.1.sdw", REQUIRE_STAROFFICE_VERSION(0, 0, 2) },
 };
 const writerperfect::test::WpftOptionalMap_t aWpsOptional{
+{ "PocketWord.psw", REQUIRE_WPS_VERSION(0, 4, 12) },
 { "Word_5.0_DOS.doc", REQUIRE_WPS_VERSION(0, 4, 3) },
 { "Write_3.1.wri", REQUIRE_WPS_VERSION(0, 4, 2) },
 };
diff --git a/writerperfect/qa/unit/data/writer/libwps/pass/PocketWord.psw 
b/writerperfect/qa/unit/data/writer/libwps/pass/PocketWord.psw
new file mode 100644
index ..75c0b60f397c
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/libwps/pass/PocketWord.psw differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2020-07-02 Thread Stephan Bergmann (via logerrit)
 writerperfect/qa/unit/DirectoryStreamTest.cxx   |6 +++---
 writerperfect/qa/unit/WPXSvStreamTest.cxx   |6 +++---
 writerperfect/source/common/DocumentHandler.cxx |2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit ec2ee430e78cf768bbe48d4b7e7b32aaa6410b54
Author: Stephan Bergmann 
AuthorDate: Thu Jul 2 13:48:59 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 2 16:13:36 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: writerperfect

Change-Id: I13fcde3b0c847a622be0305c6d2bd21057d3402c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97758
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/writerperfect/qa/unit/DirectoryStreamTest.cxx 
b/writerperfect/qa/unit/DirectoryStreamTest.cxx
index 8d8388dc3c0d..fcf77743c0c5 100644
--- a/writerperfect/qa/unit/DirectoryStreamTest.cxx
+++ b/writerperfect/qa/unit/DirectoryStreamTest.cxx
@@ -56,9 +56,9 @@ private:
 uno::Reference m_xNonexistent;
 };
 
-static const char g_aDirPath[] = "/writerperfect/qa/unit/data/stream/test.dir";
-static const char g_aNondirPath[] = 
"/writerperfect/qa/unit/data/stream/test.dir/mimetype";
-static const char g_aNonexistentPath[] = 
"/writerperfect/qa/unit/data/stream/foo/bar";
+const char g_aDirPath[] = "/writerperfect/qa/unit/data/stream/test.dir";
+const char g_aNondirPath[] = 
"/writerperfect/qa/unit/data/stream/test.dir/mimetype";
+const char g_aNonexistentPath[] = "/writerperfect/qa/unit/data/stream/foo/bar";
 
 DirectoryStreamTest::DirectoryStreamTest()
 {
diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx 
b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index e9680510b43a..21715229e299 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -63,9 +63,9 @@ private:
 void testStructured();
 };
 
-static const char aText[] = "hello world";
-static const char aOLEFile[] = 
"/writerperfect/qa/unit/data/stream/fdo40686-1.doc";
-static const char aZipFile[] = "/writerperfect/qa/unit/data/stream/test.odt";
+const char aText[] = "hello world";
+const char aOLEFile[] = "/writerperfect/qa/unit/data/stream/fdo40686-1.doc";
+const char aZipFile[] = "/writerperfect/qa/unit/data/stream/test.odt";
 
 shared_ptr lcl_createStream()
 {
diff --git a/writerperfect/source/common/DocumentHandler.cxx 
b/writerperfect/source/common/DocumentHandler.cxx
index 35aa49181313..181415033909 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -20,7 +20,7 @@
 
 namespace writerperfect
 {
-static const unsigned char librvng_utf8_skip_data[256]
+const unsigned char librvng_utf8_skip_data[256]
 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2019-05-31 Thread Mark Hung (via logerrit)
 writerperfect/qa/unit/EPUBExportTest.cxx  |7 
 writerperfect/qa/unit/data/writer/epubexport/abi11105.abw |  200 ++
 writerperfect/source/writer/exp/txtparai.cxx  |6 
 writerperfect/source/writer/exp/txtparai.hxx  |5 
 writerperfect/source/writer/exp/xmltbli.cxx   |6 
 writerperfect/source/writer/exp/xmltbli.hxx   |5 
 writerperfect/source/writer/exp/xmltext.cxx   |9 
 writerperfect/source/writer/exp/xmltext.hxx   |3 
 8 files changed, 230 insertions(+), 11 deletions(-)

New commits:
commit 966dc7f2cf500bb529394e1865e2cc6e5b264ab0
Author: Mark Hung 
AuthorDate: Thu May 30 22:59:29 2019 +0800
Commit: Miklos Vajna 
CommitDate: Fri May 31 09:12:23 2019 +0200

EPUB export: fix not properly paired openPageSpan

Fix the test case converting abi11105.abw to EPUB file.
( the attachment at
   )

soffice.bin: .../sax/source/expatwrap/saxwriter.cxx:1184: virtual void
(anonymous namespace)::SAXWriter::endElement(const rtl::OUString &):
Assertion `aName ==
m_pSaxWriterHelper->m_DebugStartedElements.top()' failed.

We used to invoke handlePageSpan when starting a paragraph
or a table element that has master-page-name defined in the referred
style, and invoke closePageSpan when XMLBodyContentContext.

Limit the handling of page span to top-level paragraph or tables
so that it doesn't messed up in the nested ( paragraph that changed
it's page style in a table cell ) case.

Change-Id: Ic8637663aaa7506ced9758bd7ccd7233309e8557
Reviewed-on: https://gerrit.libreoffice.org/73214
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 00f989f15f8b..c004c658b57a 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -877,6 +877,13 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testSimpleRuby)
 assertXPathContent(mpXmlDoc, "//xhtml:body/xhtml:p/xhtml:ruby/xhtml:span", 
"base text");
 assertXPathContent(mpXmlDoc, "//xhtml:body/xhtml:p/xhtml:ruby/xhtml:rt", 
"ruby text");
 }
+
+CPPUNIT_TEST_FIXTURE(EPUBExportTest, testAbi11105)
+{
+// This crashed because the paragraph style "P5" which had a 
master-page-name
+// appeared in a table cell messed up page spans.
+createDoc("abi11105.abw", {});
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerperfect/qa/unit/data/writer/epubexport/abi11105.abw 
b/writerperfect/qa/unit/data/writer/epubexport/abi11105.abw
new file mode 100644
index ..cbb32694022b
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/abi11105.abw
@@ -0,0 +1,200 @@
+
+http://www.abisource.com/awml.dtd";>
+http://www.w3.org/1999/XSL/Format"; 
xmlns:math="http://www.w3.org/1998/Math/MathML"; xid-max="602" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; fileformat="1.0" 
xmlns:svg="http://www.w3.org/2000/svg"; 
xmlns:awml="http://www.abisource.com/awml.dtd"; 
xmlns="http://www.abisource.com/awml.dtd"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; version="0.99.2" 
xml:space="preserve" props="dom-dir:ltr; document-footnote-restart-section:0; 
document-endnote-type:numeric; document-endnote-place-enddoc:1; 
document-endnote-initial:1; lang:en-US; document-endnote-restart-section:0; 
document-footnote-restart-page:0; document-footnote-type:numeric; 
document-footnote-initial:1; document-endnote-place-endsection:0">
+
+
+
+
+
+
+
+
+application/x-abiword
+AbiWord
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Evan Rinehart
+P.O. Box 21456
+Baton Rouge, LA 70894
+(985) 806 4063
+evanrineh...@gmail.com
+
+
+
+
+
+
+
+
+
+Work Experience
+
+
+
+
+
+RageComm
+Aug 2007 - 
+
+
+
+Programmer
+Researching and 
implementing advanced graphics techniques using shaders; providing general 
support.
+
+
+LSU Student Technical 
Application Resource Training
+Aug 2006 - May 2007
+
+
+
+Software Trainer
+Taught classes in MATLAB, Mathematica, web design, and 
Linux system administration.
+
+
+LSU Department of Electrical 
and Computer Engineering
+Jan 2006 - May 2007
+
+
+
+Engineering Tutor
+Tutored engineering students in circuits, digital logic, 
electronics, and software engineering.
+
+
+LSU Department of 
Mathematics
+Aug 2005 - May 2006
+
+
+
+Software Trainer / Math Tutor
+Assisted students enrolled in computer-based college 
algebra program.
+
+
+LSU School of Veterinary 
Medicine
+Jun 2004 - Aug 2005
+
+
+
+Entry-Level Network Technician
+Installed and maintained network hardware throughout 
hospital and research facility.
+
+
+
+
+
+Education
+
+
+Bachelor of Science in 
Electrical Engineering
+Louisiana State 
University, 2007
+
+
+Concentration in Computer 
Engineering
+Minor in Physics
+Minor in Computer 
Science
+Major GPA: 3.24
+
+
+
+Bachelor of Science in 
Mathemat

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

2019-04-24 Thread Luboš Luňák (via logerrit)
 writerperfect/qa/unit/WpftDrawFilterTest.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cfbb223d5666cb803539ac98918ff39b27efc6e7
Author: Luboš Luňák 
AuthorDate: Tue Apr 23 23:32:50 2019 +0200
Commit: Luboš Luňák 
CommitDate: Wed Apr 24 09:52:21 2019 +0200

fix filename of a test file in writerperfect

Was broken in d077b19a3f617f5ef.

Change-Id: I5f0e0ca7c60f0f09381ee7eebd7d49d5533e07af
Reviewed-on: https://gerrit.libreoffice.org/71145
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/writerperfect/qa/unit/WpftDrawFilterTest.cxx 
b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
index 7d96e5a6557f..ddb5be888094 100644
--- a/writerperfect/qa/unit/WpftDrawFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
@@ -32,7 +32,7 @@ void WpftDrawFilterTest::test()
 {
 const writerperfect::test::WpftOptionalMap_t aMWAWOptional{
 { "ClarisDraw.hqx", REQUIRE_MWAW_VERSION(0, 3, 5) },
-{ "CorelPainter_3_win", REQUIRE_MWAW_VERSION(0, 3, 15) },
+{ "CorelPainter_3_win.rif", REQUIRE_MWAW_VERSION(0, 3, 15) },
 { "CorelPainter_10", REQUIRE_MWAW_VERSION(0, 3, 15) },
 { "CricketDraw_1.0.hqx", REQUIRE_MWAW_VERSION(0, 3, 8) },
 { "CricketDraw_1.1.hqx", REQUIRE_MWAW_VERSION(0, 3, 8) },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-01-24 Thread Libreoffice Gerrit user
 writerperfect/qa/unit/EPUBExportTest.cxx |  198 +++
 1 file changed, 49 insertions(+), 149 deletions(-)

New commits:
commit bd1aeecf0bbca1ce0282a98d7c0da144295bc146
Author: Miklos Vajna 
AuthorDate: Wed Jan 23 21:26:35 2019 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 24 09:06:19 2019 +0100

CppunitTest_writerperfect_epubexport: use CPPUNIT_TEST_FIXTURE()

Change-Id: I212301ffbad7dd975c0e16c1c71d471ec064c83f
Reviewed-on: https://gerrit.libreoffice.org/66821
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index be8302dc520e..00f989f15f8b 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -37,6 +37,7 @@ class EPUBExportTest : public test::BootstrapFixture,
public unotest::MacrosTest,
public XmlTestTools
 {
+protected:
 uno::Reference mxComponentContext;
 uno::Reference mxComponent;
 utl::TempFile maTempFile;
@@ -56,105 +57,6 @@ public:
 /// Looks up a key of a class in rCss.
 static OUString getCss(std::map>& rCss, 
const OUString& rClass,
const OUString& rKey);
-void testOutlineLevel();
-void testMimetype();
-void testEPUB2();
-void testEPUBFixedLayout();
-void testEPUBFixedLayoutOption();
-void testEPUBFixedLayoutImplicitBreak();
-void testPageBreakSplit();
-void testSpanAutostyle();
-void testParaAutostyleCharProps();
-void testMeta();
-void testMetaXMP();
-void testMetaAPI();
-void testCoverImage();
-void testParaNamedstyle();
-void testCharNamedstyle();
-void testNamedStyleInheritance();
-void testNestedSpan();
-void testLineBreak();
-void testEscape();
-void testParaCharProps();
-void testSection();
-void testList();
-void testImage();
-void testImageBorder();
-void testImageNospan();
-void testTable();
-void testTableRowSpan();
-void testTableCellBorder();
-void testTableCellWidth();
-void testTableRowHeight();
-void testLink();
-void testLinkInvalid();
-void testLinkCharFormat();
-void testLinkNamedCharFormat();
-void testTableWidth();
-void testTextBox();
-void testFontEmbedding();
-void testImageLink();
-void testFootnote();
-void testPopup();
-void testPopupMedia();
-void testPopupAPI();
-void testPageSize();
-void testSVG();
-void testTdf115623SingleWritingMode();
-void testTdf115623SplitByChapter();
-void testTdf115623ManyPageSpans();
-void testSimpleRuby();
-
-CPPUNIT_TEST_SUITE(EPUBExportTest);
-CPPUNIT_TEST(testOutlineLevel);
-CPPUNIT_TEST(testMimetype);
-CPPUNIT_TEST(testEPUB2);
-CPPUNIT_TEST(testEPUBFixedLayout);
-CPPUNIT_TEST(testEPUBFixedLayoutOption);
-CPPUNIT_TEST(testEPUBFixedLayoutImplicitBreak);
-CPPUNIT_TEST(testPageBreakSplit);
-CPPUNIT_TEST(testSpanAutostyle);
-CPPUNIT_TEST(testParaAutostyleCharProps);
-CPPUNIT_TEST(testMeta);
-CPPUNIT_TEST(testMetaXMP);
-CPPUNIT_TEST(testMetaAPI);
-CPPUNIT_TEST(testCoverImage);
-CPPUNIT_TEST(testParaNamedstyle);
-CPPUNIT_TEST(testCharNamedstyle);
-CPPUNIT_TEST(testNamedStyleInheritance);
-CPPUNIT_TEST(testNestedSpan);
-CPPUNIT_TEST(testLineBreak);
-CPPUNIT_TEST(testEscape);
-CPPUNIT_TEST(testParaCharProps);
-CPPUNIT_TEST(testSection);
-CPPUNIT_TEST(testList);
-CPPUNIT_TEST(testImage);
-CPPUNIT_TEST(testImageBorder);
-CPPUNIT_TEST(testImageNospan);
-CPPUNIT_TEST(testTable);
-CPPUNIT_TEST(testTableRowSpan);
-CPPUNIT_TEST(testTableCellBorder);
-CPPUNIT_TEST(testTableCellWidth);
-CPPUNIT_TEST(testTableRowHeight);
-CPPUNIT_TEST(testLink);
-CPPUNIT_TEST(testLinkInvalid);
-CPPUNIT_TEST(testLinkCharFormat);
-CPPUNIT_TEST(testLinkNamedCharFormat);
-CPPUNIT_TEST(testTableWidth);
-CPPUNIT_TEST(testTextBox);
-CPPUNIT_TEST(testFontEmbedding);
-CPPUNIT_TEST(testImageLink);
-CPPUNIT_TEST(testFootnote);
-CPPUNIT_TEST(testPopup);
-CPPUNIT_TEST(testPopupMedia);
-CPPUNIT_TEST(testPopupAPI);
-CPPUNIT_TEST(testPageSize);
-CPPUNIT_TEST(testSVG);
-CPPUNIT_TEST(testTdf115623SingleWritingMode);
-CPPUNIT_TEST(testTdf115623SplitByChapter);
-CPPUNIT_TEST(testTdf115623ManyPageSpans);
-CPPUNIT_TEST(testSimpleRuby);
-CPPUNIT_TEST_SUITE_END();
 };
 
 void EPUBExportTest::setUp()
@@ -264,7 +166,7 @@ OUString EPUBExportTest::getCss(std::map>& rCss,
 return aRet;
 }
 
-void EPUBExportTest::testOutlineLevel()
+CPPUNIT_TEST_FIXTURE(EPUBExportTest, testOutlineLevel)
 {
 createDoc("outline-level.fodt", {});
 
@@ -275,7 +177,7 @@ void EPUBExportTest::testOutlineLevel()
 CPPUNIT_ASSERT(!mxZipFile->hasByName("OEBPS/sections/section0003.xhtml"));
 }
 
-void EPUBExportTest::testMimetype()

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

2018-10-20 Thread Libreoffice Gerrit user
 writerperfect/qa/unit/EPUBExportTest.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 993d92d5cbb8f63a630ca615112a6abbefdf8a16
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 17:02:50 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 20 19:50:08 2018 +0200

pvs-studio: Possible overflow

Change-Id: Ifa213fd6b719683afae9633615f69db894cd9c18
Reviewed-on: https://gerrit.libreoffice.org/62062
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index ecca84410866..be8302dc520e 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -284,7 +284,7 @@ void EPUBExportTest::testMimetype()
 SvMemoryStream aMemoryStream;
 aMemoryStream.WriteStream(aFileStream);
 OString aExpected("application/epub+zip");
-CPPUNIT_ASSERT(aMemoryStream.GetSize() > static_cast(38 + 
aExpected.getLength()));
+CPPUNIT_ASSERT(aMemoryStream.GetSize() > 
static_cast(aExpected.getLength()) + 38);
 
 OString aActual(static_cast(aMemoryStream.GetData()) + 38, 
aExpected.getLength());
 // This failed: actual data was some garbage, not the uncompressed mime 
type.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-27 Thread David Tardon
 writerperfect/qa/unit/ImportTest.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit bb27318a41e7d8ee20cd23ed2c94d493f4ba0f81
Author: David Tardon 
Date:   Sun May 27 08:13:03 2018 +0200

creation of css::document::XFilter needs filter name

Change-Id: I5d580e2efe6cf34b9855e47190f6242323d7823a
Reviewed-on: https://gerrit.libreoffice.org/54873
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerperfect/qa/unit/ImportTest.cxx 
b/writerperfect/qa/unit/ImportTest.cxx
index 1775f4fc6eeb..3168ac6aade3 100644
--- a/writerperfect/qa/unit/ImportTest.cxx
+++ b/writerperfect/qa/unit/ImportTest.cxx
@@ -95,9 +95,12 @@ WpftLoader ImportTest::createLoader(const rtl::OUString& 
rUrl,
 aDesc[utl::MediaDescriptor::PROP_URL()] <<= rUrl;
 aDesc[utl::MediaDescriptor::PROP_READONLY()] <<= true;
 uno::Sequence 
lDesc(aDesc.getAsConstPropertyValueList());
-const rtl::OUString sType = m_xTypeDetection->queryTypeByDescriptor(lDesc, 
true);
-CPPUNIT_ASSERT(!sType.isEmpty());
-const uno::Reference 
xFilter(m_xFilterFactory->createInstance(sType),
+m_xTypeDetection->queryTypeByDescriptor(lDesc, true);
+aDesc = lDesc;
+rtl::OUString sFilter;
+aDesc[utl::MediaDescriptor::PROP_FILTERNAME()] >>= sFilter;
+CPPUNIT_ASSERT(!sFilter.isEmpty());
+const uno::Reference 
xFilter(m_xFilterFactory->createInstance(sFilter),
 UNO_QUERY);
 CPPUNIT_ASSERT(xFilter.is());
 return WpftLoader(rUrl, xFilter, rFactoryUrl, m_xDesktop, m_xTypeMap, 
m_xContext);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-27 Thread David Tardon
 writerperfect/qa/unit/ImportTest.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 307b26c1bd1f2bd3ca3325a96933c1dc38b5224e
Author: David Tardon 
Date:   Sun May 27 08:27:47 2018 +0200

re-enable test

Change-Id: Id1283afe1ed4429a194a2a2c27eaf5c76387a23a
Reviewed-on: https://gerrit.libreoffice.org/54875
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/writerperfect/qa/unit/ImportTest.cxx 
b/writerperfect/qa/unit/ImportTest.cxx
index dca0808bd432..1775f4fc6eeb 100644
--- a/writerperfect/qa/unit/ImportTest.cxx
+++ b/writerperfect/qa/unit/ImportTest.cxx
@@ -80,9 +80,7 @@ void ImportTest::testWK3WithFM3()
 CPPUNIT_ASSERT(xCellProps.is());
 sal_Int32 nCharColor = 0;
 CPPUNIT_ASSERT(xCellProps->getPropertyValue("CharColor") >>= nCharColor);
-#if 0 // broken by commit 8154953add163554c00935486a1cf5677cef2609
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), nCharColor); // blue text
-#endif
 }
 
 WpftLoader ImportTest::createCalcLoader(const rtl::OUString& rFile) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2018-04-10 Thread Mark Hung
 writerperfect/qa/unit/EPUBExportTest.cxx   
|   55 ++
 writerperfect/qa/unit/data/writer/epubexport/tdf115623-many-pagespans.odt  
|binary
 writerperfect/qa/unit/data/writer/epubexport/tdf115623-single-writing-mode.odt 
|binary
 writerperfect/qa/unit/data/writer/epubexport/tdf115623-split-by-chapter.odt
|binary
 writerperfect/source/writer/exp/txtparai.cxx   
|1 
 writerperfect/source/writer/exp/txtstyli.cxx   
|1 
 writerperfect/source/writer/exp/xmlimp.cxx 
|   32 +
 writerperfect/source/writer/exp/xmlimp.hxx 
|5 
 writerperfect/source/writer/exp/xmltbli.cxx
|3 
 writerperfect/source/writer/exp/xmltext.cxx
|7 +
 writerperfect/source/writer/exp/xmltext.hxx
|1 
 11 files changed, 105 insertions(+)

New commits:
commit c6d3d0642e0f5d24cab402a8a7c6f81406d044cf
Author: Mark Hung 
Date:   Tue Feb 20 18:40:38 2018 +0800

tdf#115623: invoke openPageSpan / closePageSpan

* For paragraphs or tables whose styles specify style:master-page-name,
it indicate starting a new page style and should invoke
openPageSpan / closePageSapn properly.

* closePageSpan at the end of text body is invoked.

Change-Id: Ic85157c9b1a43c94a027b464ad9105e9072afcf7
Reviewed-on: https://gerrit.libreoffice.org/52082
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 81d70591a0da..231c63252efd 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -98,6 +98,9 @@ public:
 void testPopupAPI();
 void testPageSize();
 void testSVG();
+void testTdf115623SingleWritingMode();
+void testTdf115623SplitByChapter();
+void testTdf115623ManyPageSpans();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -144,6 +147,9 @@ public:
 CPPUNIT_TEST(testPopupAPI);
 CPPUNIT_TEST(testPageSize);
 CPPUNIT_TEST(testSVG);
+CPPUNIT_TEST(testTdf115623SingleWritingMode);
+CPPUNIT_TEST(testTdf115623SplitByChapter);
+CPPUNIT_TEST(testTdf115623ManyPageSpans);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -881,6 +887,55 @@ void EPUBExportTest::testSVG()
 assertXPathNSDef(mpXmlDoc, "/svg:svg", "xlink", 
"http://www.w3.org/1999/xlink";);
 }
 
+
+void EPUBExportTest::testTdf115623SingleWritingMode()
+{
+// Simple page that has single writing mode should work.
+createDoc("tdf115623-single-writing-mode.odt", {});
+std::map< OUString, std::vector > aCssDoc = 
parseCss("OEBPS/styles/stylesheet.css");
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+OUString aClass = getXPath(mpXmlDoc, "//xhtml:body", "class");
+CPPUNIT_ASSERT_EQUAL(OUString("vertical-rl"), 
EPUBExportTest::getCss(aCssDoc, aClass, "writing-mode"));
+}
+
+void EPUBExportTest::testTdf115623SplitByChapter()
+{
+createDoc("tdf115623-split-by-chapter.odt", {});
+std::map< OUString, std::vector > aCssDoc = 
parseCss("OEBPS/styles/stylesheet.css");
+{
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+OUString aClass = getXPath(mpXmlDoc, "//xhtml:body", "class");
+CPPUNIT_ASSERT_EQUAL(OUString("vertical-rl"), 
EPUBExportTest::getCss(aCssDoc, aClass, "writing-mode"));
+xmlFreeDoc(mpXmlDoc);
+mpXmlDoc = nullptr;
+}
+// Splitted HTML should keep the same writing-mode.
+{
+mpXmlDoc = parseExport("OEBPS/sections/section0002.xhtml");
+OUString aClass = getXPath(mpXmlDoc, "//xhtml:body", "class");
+CPPUNIT_ASSERT_EQUAL(OUString("vertical-rl"), 
EPUBExportTest::getCss(aCssDoc, aClass, "writing-mode"));
+}
+}
+
+void EPUBExportTest::testTdf115623ManyPageSpans()
+{
+createDoc("tdf115623-many-pagespans.odt", {});
+std::map< OUString, std::vector > aCssDoc = 
parseCss("OEBPS/styles/stylesheet.css");
+// Two pages should have different writing modes.
+{
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+OUString aClass = getXPath(mpXmlDoc, "//xhtml:body", "class");
+CPPUNIT_ASSERT_EQUAL(OUString("vertical-rl"), 
EPUBExportTest::getCss(aCssDoc, aClass, "writing-mode"));
+xmlFreeDoc(mpXmlDoc);
+mpXmlDoc = nullptr;
+}
+{
+mpXmlDoc = parseExport("OEBPS/sections/section0002.xhtml");
+OUString aClass = getXPath(mpXmlDoc, "//xhtml:body", "class");
+CPPUNIT_ASSERT_EQUAL(OUString("horizontal-tb"), 
EPUBExportTest::getCss(aCssDoc, aClass, "writing-mode"));
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git 
a/writerperfect/qa/unit/data/writer/epubexport/tdf115623-many-pagespans.odt 
b/writerperf

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2018-02-12 Thread Miklos Vajna
 writerperfect/source/writer/exp/xmlimp.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 6259dfce9d140368156c5fe8bb577c7589265dd5
Author: Miklos Vajna 
Date:   Mon Feb 12 16:08:41 2018 +0100

EPUB export: pick up XMP metadata from 'metadata.xmp'

This used to be .xmp, but that's inconsistent with how cover
image is not .jpg but cover.jpg (or .png, etc).

Also it was redundant, since these files are in the media directory, for
which the default is the  directory.

Change-Id: Iadfebf2f9c336f443537759b1e58409a93e1c51d
Reviewed-on: https://gerrit.libreoffice.org/49604
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/data/writer/epubexport/meta-xmp/meta-xmp.xmp 
b/writerperfect/qa/unit/data/writer/epubexport/meta-xmp/metadata.xmp
similarity index 100%
rename from writerperfect/qa/unit/data/writer/epubexport/meta-xmp/meta-xmp.xmp
rename to writerperfect/qa/unit/data/writer/epubexport/meta-xmp/metadata.xmp
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 3ef02f69f008..812b27e7b69b 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -183,8 +183,7 @@ void FindXMPMetadata(const 
uno::Reference &xContext, con
 return;
 
 OUString aMediaDir = FindMediaDir(rDocumentBaseURL, rFilterData);
-INetURLObject aDocumentBaseURL(rDocumentBaseURL);
-OUString aURL = aMediaDir + aDocumentBaseURL.GetBase() + ".xmp";
+OUString aURL = aMediaDir + "metadata.xmp";
 SvFileStream aStream(aURL, StreamMode::READ);
 if (!aStream.IsOpen())
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2018-01-19 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |   
14 ++
 writerperfect/qa/unit/data/writer/epubexport/popup-media.odt 
|binary
 writerperfect/qa/unit/data/writer/epubexport/popup-media/libreoffice.png 
|binary
 writerperfect/source/writer/exp/xmlimp.cxx   |   
22 --
 4 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 9035ee7c90ed5ff78864145fd92241491033c074
Author: Miklos Vajna 
Date:   Thu Jan 18 15:53:54 2018 +0100

EPUB export: accept relative links for image popup from default media dir

Previously:

- the user had to copy the linked image to the same dir as the doc
- set a relative link on the image (in ODF, it resulted in "../foo.png")
- copy the image to the media dir ("test" by default for "test.odt")
- export to EPUB to have the image popup

Now, additionally:

- relative link may point to the default media dir (in ODF, it results
  in "../test/foo.png")
- no need to copy the image
- export to EPUB creates the popup

So one less step is necessary. The downside is that this way the
relative URL contain the base name of the document, so renaming the
document breaks these relative links.

Change-Id: I93894a28393d36a33dcec7bfe7c4a54fd83768da

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 5a1c21c0e48f..176324b0dff7 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -94,6 +94,7 @@ public:
 void testImageLink();
 void testFootnote();
 void testPopup();
+void testPopupMedia();
 void testPopupAPI();
 void testPageSize();
 void testSVG();
@@ -139,6 +140,7 @@ public:
 CPPUNIT_TEST(testImageLink);
 CPPUNIT_TEST(testFootnote);
 CPPUNIT_TEST(testPopup);
+CPPUNIT_TEST(testPopupMedia);
 CPPUNIT_TEST(testPopupAPI);
 CPPUNIT_TEST(testPageSize);
 CPPUNIT_TEST(testSVG);
@@ -791,6 +793,18 @@ void EPUBExportTest::testPopup()
 assertXPath(mpXmlDoc, "//xhtml:body/xhtml:aside[2]/xhtml:img", 1);
 }
 
+void EPUBExportTest::testPopupMedia()
+{
+// This is the same as testPopup(), but the links point to images in the
+// default media directory, not in the document directory.
+createDoc("popup-media.odt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// Test image popup anchor. This failed, number of XPath nodes was 0.
+assertXPath(mpXmlDoc, "//xhtml:body/xhtml:p[1]/xhtml:a", "type", 
"noteref");
+assertXPath(mpXmlDoc, "//xhtml:body/xhtml:p[1]/xhtml:a/xhtml:img", 1);
+}
+
 void EPUBExportTest::testPopupAPI()
 {
 // Make sure that the popup works with data from a media directory.
diff --git a/writerperfect/qa/unit/data/writer/epubexport/popup-media.odt 
b/writerperfect/qa/unit/data/writer/epubexport/popup-media.odt
new file mode 100644
index ..5f45e7ce8aef
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/epubexport/popup-media.odt differ
diff --git 
a/writerperfect/qa/unit/data/writer/epubexport/popup-media/libreoffice.png 
b/writerperfect/qa/unit/data/writer/epubexport/popup-media/libreoffice.png
new file mode 100644
index ..cc74f136fbdf
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/epubexport/popup-media/libreoffice.png 
differ
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index f600840be1d7..f001bd667e5a 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -367,6 +367,16 @@ const librevenge::RVNGPropertyList 
&XMLImport::GetMetaData()
 return maMetaData;
 }
 
+namespace
+{
+/// Finds out if a file URL exists.
+bool FileURLExists(const OUString& rURL)
+{
+SvFileStream aStream(rURL, StreamMode::READ);
+return aStream.IsOpen();
+}
+}
+
 PopupState XMLImport::FillPopupData(const OUString &rURL, 
librevenge::RVNGPropertyList &rPropList)
 {
 uno::Reference xUriRef;
@@ -384,16 +394,20 @@ PopupState XMLImport::FillPopupData(const OUString &rURL, 
librevenge::RVNGProper
 if (bAbsolute)
 return PopupState::NotConsumed;
 
+// Default case: relative URL, popup data was in the same directory as the
+// document at insertion time.
 OUString aAbs = maMediaDir + rURL;
-if (aAbs.isEmpty())
-return PopupState::NotConsumed;
+if (!FileURLExists(aAbs))
+// Fallback case: relative URL, popup data was in the default media
+// directory at insertion time.
+aAbs = maMediaDir + "../" + rURL;
 
-SvFileStream aStream(aAbs, StreamMode::READ);
-if (!aStream.IsOpen())
+if (!FileURLExists(aAbs))
 // Relative link, but points to non-existing file: don't emit that to
 // librevenge, since it will be invalid anyway.
 return PopupState::Ignore;
 
+SvFileStream aStream(aAbs,

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2018-01-19 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx  |   11 ++
 writerperfect/qa/unit/data/writer/epubexport/image-link.fodt  |2 
 writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt |binary
 writerperfect/source/writer/exp/txtparai.cxx  |   30 +--
 writerperfect/source/writer/exp/xmlimp.cxx|   39 +-
 writerperfect/source/writer/exp/xmlimp.hxx|   15 +++
 6 files changed, 68 insertions(+), 29 deletions(-)

New commits:
commit 5c4d5021000584ac541e4d0323586c4ff926173f
Author: Miklos Vajna 
Date:   Thu Jan 18 11:49:45 2018 +0100

EPUB export: fix validation error on invalid relative links

It's valid to have a relative link that points nowhere in ODF, but the
same is not true for EPUB.

Change-Id: I7884032e277a0c53d0c513cea70dd2ee29ccd85c

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index f52667a9b6ce..5a1c21c0e48f 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -85,6 +85,7 @@ public:
 void testTableCellWidth();
 void testTableRowHeight();
 void testLink();
+void testLinkInvalid();
 void testLinkCharFormat();
 void testLinkNamedCharFormat();
 void testTableWidth();
@@ -129,6 +130,7 @@ public:
 CPPUNIT_TEST(testTableCellWidth);
 CPPUNIT_TEST(testTableRowHeight);
 CPPUNIT_TEST(testLink);
+CPPUNIT_TEST(testLinkInvalid);
 CPPUNIT_TEST(testLinkCharFormat);
 CPPUNIT_TEST(testLinkNamedCharFormat);
 CPPUNIT_TEST(testTableWidth);
@@ -662,6 +664,15 @@ void EPUBExportTest::testLink()
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"https://libreoffice.org/";);
 }
 
+void EPUBExportTest::testLinkInvalid()
+{
+createDoc("link-invalid.odt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// This was 1, invalid relative link was not filtered out.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", 0);
+}
+
 void EPUBExportTest::testLinkCharFormat()
 {
 createDoc("link-charformat.fodt", {});
diff --git a/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
index 9414e36fd723..0796cea3e4b1 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
+++ b/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
@@ -16,7 +16,7 @@
   
   
 
-  iVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
+  http://libreoffice.org/";>iVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
 
UkdCAK7OHOkgY0hSTQAAeiYAAICEAAD6gOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
 
AAJiS0dEAACqjSMyCW9GRnMGAAAMc1XTCXBIWXMAAA3XAAAN1wFCKJt4
 
CXZwQWcAAABMQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
diff --git a/writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt 
b/writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt
new file mode 100644
index ..3bbbdeb921e3
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/epubexport/link-invalid.odt differ
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 309f80ce607a..904c865bf90d 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -237,6 +237,7 @@ public:
 
 private:
 librevenge::RVNGPropertyList m_aPropertyList;
+PopupState m_ePopupState = PopupState::NONE;
 };
 
 XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext(XMLImport &rImport, 
const librevenge::RVNGPropertyList &rPropertyList)
@@ -265,8 +266,12 @@ void XMLTextFrameHyperlinkContext::startElement(const 
OUString &/*rName*/, const
 FillStyles(rAttributeValue, mrImport.GetAutomaticTextStyles(), 
mrImport.GetTextStyles(), m_aPropertyList);
 else
 {
-if (rAttributeName == "xlink:href" && 
mrImport.FillPopupData(rAttributeValue, aPropertyList))
-continue;
+if (rAttributeName == "xlink:href")
+{
+m_ePopupState = mrImport.FillPopupData(rAttributeValue, 
aPropertyList);
+if (m_ePopupState != PopupState::NotConsumed)
+continue;
+}
 
 // This affects the link's properties.
 OString sName = OUStringToOString(rAttributeName, 
RTL_TEXTENCODING_UTF8);
@@ -275,12 +280,14 @@ void XMLTextFrameHyperlinkContext::startElement(const 
OUString &/*rName*/, const
 }
 }
 
-mrImport.GetGenerator().openLink(aPropertyList);
+if (m_ePopupState != PopupState::Ignore)
+mrImport.GetGenerator().openLink(aPropertyList);
 }
 
 void XMLTextFrameHyperlinkContext::endElement(const OUString &/*rName*/)
 {
-mrImport.GetGenerator().closeLink();
+if (m_ePopupState != PopupState::Ignore)
+mrImport.GetGenerator()

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-12-19 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |7 +++
 writerperfect/source/writer/EPUBExportFilter.cxx |   20 ++--
 2 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit fadd9d449719a97dc8d99d96b0ee663ae92759f8
Author: Miklos Vajna 
Date:   Mon Dec 18 17:28:53 2017 +0100

EPUB export, fixed layout: fix mm size of SVG pages

The preferred map unit was pixel, but SVGExport::writeMtf() expects the
map unit is always a logical one, given that it calls
OutputDevice::LogicToLogic() for it.

Change-Id: Id1f311eb14423a76a82886ca848c90ab48c6eb49
Reviewed-on: https://gerrit.libreoffice.org/46733
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 178041d9c0da..1cdd80040d2c 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -171,6 +171,7 @@ void EPUBExportTest::registerNamespaces(xmlXPathContextPtr 
&pXmlXpathCtx)
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dc"), 
BAD_CAST("http://purl.org/dc/elements/1.1/";));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("opf"), 
BAD_CAST("http://www.idpf.org/2007/opf";));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xhtml"), 
BAD_CAST("http://www.w3.org/1999/xhtml";));
+xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("svg"), 
BAD_CAST("http://www.w3.org/2000/svg";));
 }
 
 void EPUBExportTest::createDoc(const OUString &rFile, const 
uno::Sequence &rFilterData)
@@ -813,6 +814,12 @@ void EPUBExportTest::testPageSize()
 mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
 // 21,59cm x 27.94cm (letter).
 assertXPath(mpXmlDoc, 
"/xhtml:html/xhtml:head/xhtml:meta[@name='viewport']", "content", "width=816, 
height=1056");
+
+xmlFreeDoc(mpXmlDoc);
+mpXmlDoc = parseExport("OEBPS/images/image0001.svg");
+// This was 288mm, logic->logic conversion input was a pixel value.
+assertXPath(mpXmlDoc, "/svg:svg", "width", "216mm");
+assertXPath(mpXmlDoc, "/svg:svg", "height", "279mm");
 }
 
 void EPUBExportTest::testSVG()
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index eb65c0ee5098..42652719684f 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -140,15 +140,23 @@ void 
EPUBExportFilter::CreateMetafiles(std::vector(rGDIMetaFile).Write(aMemoryStream);
-uno::Sequence aSequence(static_cast(aMemoryStream.GetData()), aMemoryStream.Tell());
-
 Size aLogic = aRenderer.getDocumentSizeIn100mm(nPage);
 // Get the CSS pixel size of the page (mm100 -> pixel using 96 DPI, 
independent from system DPI).
 Size aCss(static_cast(aLogic.getWidth()) / 26.4583, 
static_cast(aLogic.getHeight()) / 26.4583);
+Graphic aGraphic = aRenderer.renderToGraphic(nPage, 
aDocumentSizePixel, aCss, COL_WHITE);
+GDIMetaFile &rGDIMetaFile = const_cast(aGraphic.GetGDIMetaFile());
+
+// Set preferred map unit and size on the metafile, so the SVG size
+// will be correct in MM.
+MapMode aMapMode;
+aMapMode.SetMapUnit(MapUnit::Map100thMM);
+rGDIMetaFile.SetPrefMapMode(aMapMode);
+rGDIMetaFile.SetPrefSize(aLogic);
+
+SvMemoryStream aMemoryStream;
+rGDIMetaFile.Write(aMemoryStream);
+uno::Sequence aSequence(static_cast(aMemoryStream.GetData()), aMemoryStream.Tell());
+
 rPageMetafiles.emplace_back(aSequence, aCss);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-12-01 Thread Miklos Vajna
 writerperfect/source/writer/exp/xmlimp.cxx |   88 +++--
 1 file changed, 35 insertions(+), 53 deletions(-)

New commits:
commit 1a0a026a5770ca2e8ca66e1e8daed101301c7e30
Author: Miklos Vajna 
Date:   Thu Nov 30 16:36:03 2017 +0100

EPUB export: handle custom media dir in cover image / XMP metadata

By changing the default to /cover. and /.xmp.

Change-Id: I736aefafba5aa5208917d9ed40119ca7721cdde3
Reviewed-on: https://gerrit.libreoffice.org/45604
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/data/writer/epubexport/meta-xmp.xmp 
b/writerperfect/qa/unit/data/writer/epubexport/meta-xmp/meta-xmp.xmp
similarity index 100%
rename from writerperfect/qa/unit/data/writer/epubexport/meta-xmp.xmp
rename to writerperfect/qa/unit/data/writer/epubexport/meta-xmp/meta-xmp.xmp
diff --git a/writerperfect/qa/unit/data/writer/epubexport/meta.cover-image.png 
b/writerperfect/qa/unit/data/writer/epubexport/meta/cover.png
similarity index 100%
rename from writerperfect/qa/unit/data/writer/epubexport/meta.cover-image.png
rename to writerperfect/qa/unit/data/writer/epubexport/meta/cover.png
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index f933487a59b8..ad4928f17a65 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -49,6 +49,37 @@ OUString GetMimeType(const OUString &rExtension)
 return it == vMimeTypes.end() ? OUString() : it->second;
 }
 
+/// Determines the base directory for cover images, XMP metadata, popup images.
+OUString FindMediaDir(const OUString &rDocumentBaseURL, const 
uno::Sequence &rFilterData)
+{
+OUString aMediaDir;
+
+// See if filter data contains a media directory explicitly.
+for (sal_Int32 i = 0; i < rFilterData.getLength(); ++i)
+{
+if (rFilterData[i].Name == "RVNGMediaDir")
+{
+rFilterData[i].Value >>= aMediaDir;
+break;
+}
+}
+
+if (!aMediaDir.isEmpty())
+return aMediaDir + "/";
+
+// Not set explicitly, try to pick it up from the base directory.
+INetURLObject aURL(rDocumentBaseURL);
+try
+{
+aMediaDir = rtl::Uri::convertRelToAbs(rDocumentBaseURL, 
aURL.GetBase()) + "/";
+}
+catch (const rtl::MalformedUriException &rException)
+{
+SAL_WARN("writerperfect", "FindMediaDir: convertRelToAbs() failed:" << 
rException.getMessage());
+}
+return aMediaDir;
+}
+
 /// Picks up a cover image from the base directory.
 OUString FindCoverImage(const OUString &rDocumentBaseURL, OUString &rMimeType, 
const uno::Sequence &rFilterData)
 {
@@ -75,8 +106,6 @@ OUString FindCoverImage(const OUString &rDocumentBaseURL, 
OUString &rMimeType, c
 if (rDocumentBaseURL.isEmpty())
 return aRet;
 
-INetURLObject aDocumentBaseURL(rDocumentBaseURL);
-
 static const std::initializer_list vExtensions =
 {
 "gif",
@@ -85,17 +114,10 @@ OUString FindCoverImage(const OUString &rDocumentBaseURL, 
OUString &rMimeType, c
 "svg"
 };
 
+OUString aMediaDir = FindMediaDir(rDocumentBaseURL, rFilterData);
 for (const auto &rExtension : vExtensions)
 {
-try
-{
-aRet = rtl::Uri::convertRelToAbs(rDocumentBaseURL, 
aDocumentBaseURL.GetBase() + ".cover-image." + rExtension);
-}
-catch (const rtl::MalformedUriException &rException)
-{
-SAL_WARN("writerperfect", "FindCoverImage: convertRelToAbs() 
failed:" << rException.getMessage());
-}
-
+aRet = aMediaDir + "cover." + rExtension;
 if (!aRet.isEmpty())
 {
 SvFileStream aStream(aRet, StreamMode::READ);
@@ -113,37 +135,6 @@ OUString FindCoverImage(const OUString &rDocumentBaseURL, 
OUString &rMimeType, c
 return aRet;
 }
 
-/// Determines the base directory for cover images, XMP metadata, popup images.
-OUString FindMediaDir(const OUString &rDocumentBaseURL, const 
uno::Sequence &rFilterData)
-{
-OUString aMediaDir;
-
-// See if filter data contains a media directory explicitly.
-for (sal_Int32 i = 0; i < rFilterData.getLength(); ++i)
-{
-if (rFilterData[i].Name == "RVNGMediaDir")
-{
-rFilterData[i].Value >>= aMediaDir;
-break;
-}
-}
-
-if (!aMediaDir.isEmpty())
-return aMediaDir + "/";
-
-// Not set explicitly, try to pick it up from the base directory.
-INetURLObject aURL(rDocumentBaseURL);
-try
-{
-aMediaDir = rtl::Uri::convertRelToAbs(rDocumentBaseURL, 
aURL.GetBase()) + "/";
-}
-catch (const rtl::MalformedUriException &rException)
-{
-SAL_WARN("writerperfect", "FindMediaDir: convertRelToAbs() failed:" << 
rException.getMessage());
-}
-return aMediaDir;
-}
-
 /// Picks up XMP metadata from the base directory.
 void FindXMPMetadata(const uno::Reference &xContext, 
const OU

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-12-01 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |   11 +
 writerperfect/qa/unit/data/writer/epubexport/image-link.fodt |   37 +
 writerperfect/source/writer/exp/txtparai.cxx |   68 +++
 3 files changed, 116 insertions(+)

New commits:
commit 8f0f8f80c1712fdc2ebb178cb88c5bd43db50fb7
Author: Miklos Vajna 
Date:   Thu Nov 30 16:31:18 2017 +0100

EPUB export: don't loose images with links

And actually handle the link around the image.

Change-Id: Ic9b7b9497becf677dbf550c67074c5c588ef8922

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 1760caa05096..d04c2eeeaaa3 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -87,6 +87,7 @@ public:
 void testTableWidth();
 void testTextBox();
 void testFontEmbedding();
+void testImageLink();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -122,6 +123,7 @@ public:
 CPPUNIT_TEST(testTableWidth);
 CPPUNIT_TEST(testTextBox);
 CPPUNIT_TEST(testFontEmbedding);
+CPPUNIT_TEST(testImageLink);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -679,6 +681,15 @@ void EPUBExportTest::testFontEmbedding()
 #endif
 }
 
+void EPUBExportTest::testImageLink()
+{
+createDoc("image-link.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// This failed, image was missing.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a/xhtml:img", 1);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
new file mode 100644
index ..9414e36fd723
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/image-link.fodt
@@ -0,0 +1,37 @@
+
+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:oas
 is: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">
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+  
+
+  
+  
+
+  iVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
+
UkdCAK7OHOkgY0hSTQAAeiYAAICEAAD6gOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+
AAJiS0dEAACqjSMyCW9GRnMGAAAMc1XTCXBIWXMAAA3XAAAN1wFCKJt4
+
CXZwQWcAAABMQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+
BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+
cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+
/878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+
QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+
YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+
2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+
cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+
AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+
hOCNQr34oD4ldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+
5RscJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+AABJRU5ErkJggg==
+   
+
+  
+
diff --git a/writ

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-30 Thread Miklos Vajna
 writerperfect/qa/uitest/epubexport/epubexport.py   |4 
 writerperfect/qa/unit/EPUBExportTest.cxx   |   25 +-
 writerperfect/qa/unit/data/writer/epubexport/meta-xmp.fodt |8 +
 writerperfect/source/writer/EPUBExportDialog.cxx   |2 
 writerperfect/source/writer/exp/xmlimp.cxx |   54 +
 writerperfect/source/writer/exp/xmlmetai.cxx   |   28 +-
 writerperfect/source/writer/exp/xmlmetai.hxx   |   14 +--
 7 files changed, 104 insertions(+), 31 deletions(-)

New commits:
commit 98770243f7f5387aae06e83ed4de0d68e02abb02
Author: Miklos Vajna 
Date:   Thu Nov 30 08:49:10 2017 +0100

EPUB export: allow setting custom metadata explicitly

If not set, fall back to the existing auto-find. The testcase now
asserts that the priority is:

- api
- if that is not set, then xmp
- if that is not set, then doc

(And at the end libepubgen itself has some defaults as well.)

Change-Id: Ie8fc646b81c4a287690fd2eeed43f4786b7938bf
Reviewed-on: https://gerrit.libreoffice.org/45552
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py 
b/writerperfect/qa/uitest/epubexport/epubexport.py
index aaac6759adac..8db15c5bf891 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -79,8 +79,8 @@ class EPUBExportTest(UITestCase):
 self.ui_test.execute_blocking_action(action=uiComponent.execute, 
dialog_handler=handleDialog)
 propertyValues = uiComponent.getPropertyValues()
 filterData = [i.Value for i in propertyValues if i.Name == 
"FilterData"][0]
-# The EPUBCoverImage key was missing, EPUBExportDialog::OKClickHdl() 
did not set it.
-coverImage = [i.Value for i in filterData if i.Name == 
"EPUBCoverImage"][0]
+# The RVNGCoverImage key was missing, EPUBExportDialog::OKClickHdl() 
did not set it.
+coverImage = [i.Value for i in filterData if i.Name == 
"RVNGCoverImage"][0]
 self.assertEqual("cover.png", coverImage)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 82452d958152..1760caa05096 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -62,6 +62,7 @@ public:
 void testParaAutostyleCharProps();
 void testMeta();
 void testMetaXMP();
+void testMetaAPI();
 void testCoverImage();
 void testParaNamedstyle();
 void testCharNamedstyle();
@@ -96,6 +97,7 @@ public:
 CPPUNIT_TEST(testParaAutostyleCharProps);
 CPPUNIT_TEST(testMeta);
 CPPUNIT_TEST(testMetaXMP);
+CPPUNIT_TEST(testMetaAPI);
 CPPUNIT_TEST(testCoverImage);
 CPPUNIT_TEST(testParaNamedstyle);
 CPPUNIT_TEST(testCharNamedstyle);
@@ -350,12 +352,33 @@ void EPUBExportTest::testMetaXMP()
 assertXPathContent(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@property='dcterms:modified']", 
"2016-11-20T17:16:07Z");
 }
 
+void EPUBExportTest::testMetaAPI()
+{
+uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
+{
+{"RVNGIdentifier", 
uno::makeAny(OUString("deadc0de-e394-4cd6-9b83-7172794612e5"))},
+{"RVNGTitle", uno::makeAny(OUString("unknown title from api"))},
+{"RVNGInitialCreator", uno::makeAny(OUString("unknown author from 
api"))},
+{"RVNGLanguage", uno::makeAny(OUString("hu"))},
+{"RVNGDate", uno::makeAny(OUString("2015-11-20T17:16:07Z"))}
+}));
+createDoc("meta-xmp.fodt", aFilterData);
+mpXmlDoc = parseExport("OEBPS/content.opf");
+
+// These were values from XMP (deadbeef, etc.), not from API.
+assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:identifier", 
"deadc0de-e394-4cd6-9b83-7172794612e5");
+assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:title", 
"unknown title from api");
+assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:creator", 
"unknown author from api");
+assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:language", 
"hu");
+assertXPathContent(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@property='dcterms:modified']", 
"2015-11-20T17:16:07Z");
+}
+
 void EPUBExportTest::testCoverImage()
 {
 OUString aCoverURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"meta.cover-image.png";
 uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
 {
-{"EPUBCoverImage", uno::makeAny(aCoverURL)}
+{"RVNGCoverImage", uno::makeAny(aCoverURL)}
 }));
 createDoc("hello.fodt", aFilterData);
 mpXmlDoc = parseExport("OEBPS/content.opf");
diff --git a/writerperfect/qa/unit/data/writer/epubexport/meta-xmp.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/meta-xmp.fodt
index b245e9d7abce..9287ecb25a9e 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/meta-xmp.

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source writerperfect/uiconfig

2017-11-30 Thread Miklos Vajna
 writerperfect/qa/uitest/epubexport/epubexport.py |   26 +
 writerperfect/source/writer/EPUBExportDialog.cxx |   24 +
 writerperfect/source/writer/EPUBExportDialog.hxx |5 
 writerperfect/uiconfig/ui/exportepub.ui  |  399 +--
 4 files changed, 364 insertions(+), 90 deletions(-)

New commits:
commit ee74bd73856c355f1491e9ff7c3bbbf74a7858bb
Author: Miklos Vajna 
Date:   Thu Nov 30 08:50:04 2017 +0100

EPUB export: add UI to set custom metadata

The motivation here is that when it comes to date or author, the typical
metata for the Writer document won't match the metadata of the book the
file represents, so allowing a custom override as part of EPUB export
makes sense.

Change-Id: I19aaed83ae0e69bc0dfa3084e1c9dc9cc534328f
Reviewed-on: https://gerrit.libreoffice.org/45553
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py 
b/writerperfect/qa/uitest/epubexport/epubexport.py
index 8db15c5bf891..196556b2fb8d 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -83,4 +83,30 @@ class EPUBExportTest(UITestCase):
 coverImage = [i.Value for i in filterData if i.Name == 
"RVNGCoverImage"][0]
 self.assertEqual("cover.png", coverImage)
 
+def testMeta(self):
+def handleDialog(dialog):
+dialog.getChild("identifier").executeAction("TYPE", 
mkPropertyValues({"TEXT": "baddcafe-e394-4cd6-9b83-7172794612e5"}))
+dialog.getChild("title").executeAction("TYPE", 
mkPropertyValues({"TEXT": "unknown title from ui"}))
+dialog.getChild("author").executeAction("TYPE", 
mkPropertyValues({"TEXT": "unknown author from ui"}))
+dialog.getChild("language").executeAction("TYPE", 
mkPropertyValues({"TEXT": "sk"}))
+dialog.getChild("date").executeAction("TYPE", 
mkPropertyValues({"TEXT": "2013-11-20T17:16:07Z"}))
+dialog.getChild("ok").executeAction("CLICK", tuple())
+
+uiComponent = 
self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent",
 self.ui_test._xContext)
+
+self.ui_test.execute_blocking_action(action=uiComponent.execute, 
dialog_handler=handleDialog)
+propertyValues = uiComponent.getPropertyValues()
+filterData = [i.Value for i in propertyValues if i.Name == 
"FilterData"][0]
+# These keys were missing, EPUBExportDialog::OKClickHdl() did not set 
them.
+identifier = [i.Value for i in filterData if i.Name == 
"RVNGIdentifier"][0]
+self.assertEqual("baddcafe-e394-4cd6-9b83-7172794612e5", identifier)
+title = [i.Value for i in filterData if i.Name == "RVNGTitle"][0]
+self.assertEqual("unknown title from ui", title)
+initialCreator = [i.Value for i in filterData if i.Name == 
"RVNGInitialCreator"][0]
+self.assertEqual("unknown author from ui", initialCreator)
+language = [i.Value for i in filterData if i.Name == "RVNGLanguage"][0]
+self.assertEqual("sk", language)
+date = [i.Value for i in filterData if i.Name == "RVNGDate"][0]
+self.assertEqual("2013-11-20T17:16:07Z", date)
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index da42954a5d02..c0e316e1f32a 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -98,6 +98,12 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsH
 get(m_pCoverButton, "coverbutton");
 m_pCoverButton->SetClickHdl(LINK(this, EPUBExportDialog, CoverClickHdl));
 
+get(m_pIdentifier, "identifier");
+get(m_pTitle, "title");
+get(m_pInitialCreator, "author");
+get(m_pLanguage, "language");
+get(m_pDate, "date");
+
 get(m_pOKButton, "ok");
 m_pOKButton->SetClickHdl(LINK(this, EPUBExportDialog, OKClickHdl));
 }
@@ -124,9 +130,22 @@ IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, Button *, 
void)
 
 IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, Button *, void)
 {
+// General
 if (!m_pCoverPath->GetText().isEmpty())
 mrFilterData["RVNGCoverImage"] <<= m_pCoverPath->GetText();
 
+// Metadata
+if (!m_pIdentifier->GetText().isEmpty())
+mrFilterData["RVNGIdentifier"] <<= m_pIdentifier->GetText();
+if (!m_pTitle->GetText().isEmpty())
+mrFilterData["RVNGTitle"] <<= m_pTitle->GetText();
+if (!m_pInitialCreator->GetText().isEmpty())
+mrFilterData["RVNGInitialCreator"] <<= m_pInitialCreator->GetText();
+if (!m_pLanguage->GetText().isEmpty())
+mrFilterData["RVNGLanguage"] <<= m_pLanguage->GetText();
+if (!m_pDate->GetText().isEmpty())
+mrFilterData["RVNGDate"] <<= m_pDate->GetText();
+
 EndDialog(RET_OK);
 }
 
@@ -142,6 +161,11 @@ void

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source writerperfect/uiconfig

2017-11-29 Thread Miklos Vajna
 writerperfect/qa/uitest/epubexport/epubexport.py |   14 
 writerperfect/source/writer/EPUBExportDialog.cxx |   29 +
 writerperfect/source/writer/EPUBExportDialog.hxx |7 ++
 writerperfect/uiconfig/ui/exportepub.ui  |   73 +++
 4 files changed, 123 insertions(+)

New commits:
commit 06fa42837d8764e10627e7b97c04d0853e9976e3
Author: Miklos Vajna 
Date:   Wed Nov 29 11:46:12 2017 +0100

EPUB export: add UI to set a custom cover image

Sets the EPUBCoverImage filter data key at UNO level.

Change-Id: I46eb3c0df1e6c34af0be070c32f9f37666dc718e
Reviewed-on: https://gerrit.libreoffice.org/45485
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py 
b/writerperfect/qa/uitest/epubexport/epubexport.py
index 4dfeed19e617..aaac6759adac 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -69,4 +69,18 @@ class EPUBExportTest(UITestCase):
 # Make sure that initializing with 2 different versions results in 2 
different widget states.
 self.assertEqual(2, len(set(positions)))
 
+def testCoverImage(self):
+def handleDialog(dialog):
+dialog.getChild("coverpath").executeAction("TYPE", 
mkPropertyValues({"TEXT": "cover.png"}))
+dialog.getChild("ok").executeAction("CLICK", tuple())
+
+uiComponent = 
self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent",
 self.ui_test._xContext)
+
+self.ui_test.execute_blocking_action(action=uiComponent.execute, 
dialog_handler=handleDialog)
+propertyValues = uiComponent.getPropertyValues()
+filterData = [i.Value for i in propertyValues if i.Name == 
"FilterData"][0]
+# The EPUBCoverImage key was missing, EPUBExportDialog::OKClickHdl() 
did not set it.
+coverImage = [i.Value for i in filterData if i.Name == 
"EPUBCoverImage"][0]
+self.assertEqual("cover.png", coverImage)
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 23faa939db31..5c0eb9d1e930 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -9,6 +9,8 @@
 
 #include "EPUBExportDialog.hxx"
 
+#include 
+
 #include "EPUBExportFilter.hxx"
 
 using namespace com::sun::star;
@@ -90,6 +92,14 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsH
 else
 m_pSplit->SelectEntryPos(EPUBExportFilter::GetDefaultSplitMethod());
 m_pSplit->SetSelectHdl(LINK(this, EPUBExportDialog, SplitSelectHdl));
+
+get(m_pCoverPath, "coverpath");
+
+get(m_pCoverButton, "coverbutton");
+m_pCoverButton->SetClickHdl(LINK(this, EPUBExportDialog, CoverClickHdl));
+
+get(m_pOKButton, "ok");
+m_pOKButton->SetClickHdl(LINK(this, EPUBExportDialog, OKClickHdl));
 }
 
 IMPL_LINK_NOARG(EPUBExportDialog, VersionSelectHdl, ListBox &, void)
@@ -104,6 +114,22 @@ IMPL_LINK_NOARG(EPUBExportDialog, SplitSelectHdl, ListBox 
&, void)
 mrFilterData["EPUBSplitMethod"] <<= m_pSplit->GetSelectedEntryPos();
 }
 
+IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, Button *, void)
+{
+SvxOpenGraphicDialog aDlg("Import", this);
+aDlg.EnableLink(false);
+if (aDlg.Execute() == ERRCODE_NONE)
+m_pCoverPath->SetText(aDlg.GetPath());
+}
+
+IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, Button *, void)
+{
+if (!m_pCoverPath->GetText().isEmpty())
+mrFilterData["EPUBCoverImage"] <<= m_pCoverPath->GetText();
+
+EndDialog(RET_OK);
+}
+
 EPUBExportDialog::~EPUBExportDialog()
 {
 disposeOnce();
@@ -113,6 +139,9 @@ void EPUBExportDialog::dispose()
 {
 m_pVersion.clear();
 m_pSplit.clear();
+m_pCoverPath.clear();
+m_pCoverButton.clear();
+m_pOKButton.clear();
 ModalDialog::dispose();
 }
 
diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx 
b/writerperfect/source/writer/EPUBExportDialog.hxx
index bc8e2ed878ce..e211ca3340c7 100644
--- a/writerperfect/source/writer/EPUBExportDialog.hxx
+++ b/writerperfect/source/writer/EPUBExportDialog.hxx
@@ -11,7 +11,9 @@
 #define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTDIALOG_HXX
 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 namespace writerperfect
@@ -28,10 +30,15 @@ public:
 private:
 DECL_LINK(VersionSelectHdl, ListBox &, void);
 DECL_LINK(SplitSelectHdl, ListBox &, void);
+DECL_LINK(CoverClickHdl, Button *, void);
+DECL_LINK(OKClickHdl, Button *, void);
 
 comphelper::SequenceAsHashMap &mrFilterData;
 VclPtr m_pVersion;
 VclPtr m_pSplit;
+VclPtr m_pCoverPath;
+VclPtr m_pCoverButton;
+VclPtr m_pOKButton;
 };
 
 } // namespace writerperfect
diff --git a/writerperfect/uiconfig/ui/exportepub.ui 
b/writerperfect/uiconfig/ui/exportepub.

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-29 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |   19 
 writerperfect/source/writer/exp/xmlimp.cxx |   34 ++---
 2 files changed, 50 insertions(+), 3 deletions(-)

New commits:
commit 612821223c574fe0956d348730d40623943821f3
Author: Miklos Vajna 
Date:   Wed Nov 29 11:45:12 2017 +0100

EPUB export: allow setting a custom cover image explicitly

If not set, fall back to the existing auto-find.

Change-Id: I5df7a535e4132a18a803c10fa0e06352d9b6b533

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index e038a7ef6135..72c9a27dc495 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -61,6 +61,7 @@ public:
 void testSpanAutostyle();
 void testParaAutostyleCharProps();
 void testMeta();
+void testCoverImage();
 void testParaNamedstyle();
 void testCharNamedstyle();
 void testNamedStyleInheritance();
@@ -93,6 +94,7 @@ public:
 CPPUNIT_TEST(testSpanAutostyle);
 CPPUNIT_TEST(testParaAutostyleCharProps);
 CPPUNIT_TEST(testMeta);
+CPPUNIT_TEST(testCoverImage);
 CPPUNIT_TEST(testParaNamedstyle);
 CPPUNIT_TEST(testCharNamedstyle);
 CPPUNIT_TEST(testNamedStyleInheritance);
@@ -333,6 +335,23 @@ void EPUBExportTest::testMeta()
 CPPUNIT_ASSERT(mxZipFile->hasByName("OEBPS/images/image0001.png"));
 }
 
+void EPUBExportTest::testCoverImage()
+{
+OUString aCoverURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"meta.cover-image.png";
+uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
+{
+{"EPUBCoverImage", uno::makeAny(aCoverURL)}
+}));
+createDoc("hello.fodt", aFilterData);
+mpXmlDoc = parseExport("OEBPS/content.opf");
+
+// Make sure that the explicitly set cover image is used.
+// This failed, as the image was not part of the package.
+assertXPath(mpXmlDoc, 
"/opf:package/opf:manifest/opf:item[@href='images/image0001.png']", 
"properties", "cover-image");
+assertXPath(mpXmlDoc, 
"/opf:package/opf:manifest/opf:item[@href='images/image0001.png']", 
"media-type", "image/png");
+CPPUNIT_ASSERT(mxZipFile->hasByName("OEBPS/images/image0001.png"));
+}
+
 void EPUBExportTest::testParaNamedstyle()
 {
 createDoc("para-namedstyle.fodt", {});
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 3d7f99cc399e..bc3b9c7693e4 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -46,10 +46,38 @@ OUString GetMimeType(const OUString &rExtension)
 }
 
 /// Picks up a cover image from the base directory.
-OUString FindCoverImage(const OUString &rDocumentBaseURL, OUString &rMimeType)
+OUString FindCoverImage(const OUString &rDocumentBaseURL, OUString &rMimeType, 
const uno::Sequence &rDescriptor)
 {
 OUString aRet;
 
+// See if filter data contains a cover image explicitly.
+uno::Sequence aFilterData;
+for (sal_Int32 i = 0; i < rDescriptor.getLength(); ++i)
+{
+if (rDescriptor[i].Name == "FilterData")
+{
+rDescriptor[i].Value >>= aFilterData;
+break;
+}
+}
+
+for (sal_Int32 i = 0; i < aFilterData.getLength(); ++i)
+{
+if (aFilterData[i].Name == "EPUBCoverImage")
+{
+aFilterData[i].Value >>= aRet;
+break;
+}
+}
+
+if (!aRet.isEmpty())
+{
+INetURLObject aRetURL(aRet);
+rMimeType = GetMimeType(aRetURL.GetExtension());
+return aRet;
+}
+
+// Not set explicitly, try to pick it up from the base directory.
 if (rDocumentBaseURL.isEmpty())
 return aRet;
 
@@ -142,11 +170,11 @@ rtl::Reference 
XMLOfficeDocContext::CreateChildContext(const O
 return nullptr;
 }
 
-XMLImport::XMLImport(librevenge::RVNGTextInterface &rGenerator, const OUString 
&rURL, const uno::Sequence &/*rDescriptor*/)
+XMLImport::XMLImport(librevenge::RVNGTextInterface &rGenerator, const OUString 
&rURL, const uno::Sequence &rDescriptor)
 : mrGenerator(rGenerator)
 {
 OUString aMimeType;
-OUString aCoverImage = FindCoverImage(rURL, aMimeType);
+OUString aCoverImage = FindCoverImage(rURL, aMimeType, rDescriptor);
 if (!aCoverImage.isEmpty())
 {
 librevenge::RVNGBinaryData aBinaryData;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-27 Thread David Tardon
 0 files changed

New commits:
commit 746b26525b09274832ab17358be843a703129b30
Author: David Tardon 
Date:   Tue Nov 28 08:51:38 2017 +0100

drop executable bit from test files

Change-Id: I72329d6ce5aac146a3e7014ad4a8bf7c20472b2f

diff --git a/writerperfect/qa/unit/data/calc/libwps/pass/Lotus123_3.123 
b/writerperfect/qa/unit/data/calc/libwps/pass/Lotus123_3.123
old mode 100755
new mode 100644
diff --git a/writerperfect/qa/unit/data/calc/libwps/pass/Lotus123_98.123 
b/writerperfect/qa/unit/data/calc/libwps/pass/Lotus123_98.123
old mode 100755
new mode 100644
diff --git a/writerperfect/qa/unit/data/calc/libwps/pass/QuattroPro.wb1 
b/writerperfect/qa/unit/data/calc/libwps/pass/QuattroPro.wb1
old mode 100755
new mode 100644
diff --git a/writerperfect/qa/unit/data/impress/libmwaw/pass/PowerPoint_2.ppt 
b/writerperfect/qa/unit/data/impress/libmwaw/pass/PowerPoint_2.ppt
old mode 100755
new mode 100644
diff --git a/writerperfect/qa/unit/data/impress/libmwaw/pass/PowerPoint_4.ppt 
b/writerperfect/qa/unit/data/impress/libmwaw/pass/PowerPoint_4.ppt
old mode 100755
new mode 100644
diff --git a/writerperfect/qa/unit/data/impress/libmwaw/pass/PowerPoint_7.ppt 
b/writerperfect/qa/unit/data/impress/libmwaw/pass/PowerPoint_7.ppt
old mode 100755
new mode 100644
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-27 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |5 
 writerperfect/qa/unit/data/writer/epubexport/text-box.fodt |7 --
 writerperfect/source/writer/exp/txtparai.cxx   |   15 +
 3 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 944cc09cf76cea46d9f6bd7be14c64f74fe64403
Author: Miklos Vajna 
Date:   Mon Nov 27 08:27:05 2017 +0100

EPUB export: fix char props of  characters

These are typically inherited from parent,  is similar to
e.g.  in this regard.

Change-Id: Ic84f6e2e4fc6866ffca23eef2c932ee63e6978ca
Reviewed-on: https://gerrit.libreoffice.org/45314
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 25d1a35c1873..fb54f5ab25d7 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -578,6 +578,7 @@ void EPUBExportTest::testTextBox()
 createDoc("text-box.fodt", {});
 
 mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+std::map< OUString, std::vector > aCssDoc = 
parseCss("OEBPS/styles/stylesheet.css");
 
 // This failed, image with caption was lost.
 assertXPath(mpXmlDoc, "//xhtml:img", "class", "frame1");
@@ -586,6 +587,10 @@ void EPUBExportTest::testTextBox()
 // 2) "Illustration "
 // 3) The sequence field, this was missing (was ": foo" instead).
 assertXPathContent(mpXmlDoc, "//xhtml:div/xhtml:p/xhtml:span[3]", "1");
+
+OUString aClass = getXPath(mpXmlDoc, "//xhtml:div/xhtml:p/xhtml:span[3]", 
"class");
+// This failed, the 3rd span was not italic.
+CPPUNIT_ASSERT_EQUAL(OUString("italic"), EPUBExportTest::getCss(aCssDoc, 
aClass, "font-style"));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
diff --git a/writerperfect/qa/unit/data/writer/epubexport/text-box.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/text-box.fodt
index dad8d20b149b..d3a1786821f8 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/text-box.fodt
+++ b/writerperfect/qa/unit/data/writer/epubexport/text-box.fodt
@@ -9,6 +9,9 @@
 
   
   
+
+  
+
 
   
 
@@ -24,7 +27,7 @@
 
 
   
-  iVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
+  iVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
   
UkdCAK7OHOkgY0hSTQAAeiYAAICEAAD6gOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
   
AAJiS0dEAACqjSMyCW9GRnMGAAAMc1XTCXBIWXMAAA3XAAAN1wFCKJt4
   
CXZwQWcAAABMQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
@@ -39,7 +42,7 @@
   
hOCNQr34oD4ldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
   
5RscJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
   AABJRU5ErkJggg==
- 
Illustration
 1: 
foobar
+ 
Illustration 1: 
foobar
 
   
 
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 75144f5a1f19..b1359953e325 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -58,19 +58,26 @@ namespace exp
 class XMLTextSequenceContext : public XMLImportContext
 {
 public:
-XMLTextSequenceContext(XMLImport &rImport);
+XMLTextSequenceContext(XMLImport &rImport, const 
librevenge::RVNGPropertyList &rPropertyList);
 
 void SAL_CALL characters(const OUString &rChars) override;
+
+private:
+librevenge::RVNGPropertyList m_aPropertyList;
 };
 
-XMLTextSequenceContext::XMLTextSequenceContext(XMLImport &rImport)
+XMLTextSequenceContext::XMLTextSequenceContext(XMLImport &rImport, const 
librevenge::RVNGPropertyList &rPropertyList)
 : XMLImportContext(rImport)
 {
+// Inherit properties from parent.
+librevenge::RVNGPropertyList::Iter itProp(rPropertyList);
+for (itProp.rewind(); itProp.next();)
+m_aPropertyList.insert(itProp.key(), itProp()->clone());
 }
 
 void XMLTextSequenceContext::characters(const OUString &rChars)
 {
-mrImport.GetGenerator().openSpan(librevenge::RVNGPropertyList());
+mrImport.GetGenerator().openSpan(m_aPropertyList);
 
 OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
 
mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
@@ -349,7 +356,7 @@ rtl::Reference 
CreateParagraphOrSpanChildContext(XMLImport &rI
 if (rName == "draw:frame")
 return new XMLTextFrameContext(rImport);
 if (rName == "text:sequence")
-return new XMLTextSequenceContext(rImport);
+return new XMLTextSequenceContext(rImport, rTextPropertyList);
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-27 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |5 +
 writerperfect/source/writer/exp/txtparai.cxx |   26 ++
 2 files changed, 31 insertions(+)

New commits:
commit cb682e03bd8f1ae852135dc7a68d6926d9356405
Author: Miklos Vajna 
Date:   Mon Nov 27 08:26:34 2017 +0100

EPUB export: handle sequence fields

Just emit their expanded content for now.

Change-Id: Ibca40d201dde9c8d6ef920b5213f786f64d7c027
Reviewed-on: https://gerrit.libreoffice.org/45313
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index fdcafe827147..25d1a35c1873 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -581,6 +581,11 @@ void EPUBExportTest::testTextBox()
 
 // This failed, image with caption was lost.
 assertXPath(mpXmlDoc, "//xhtml:img", "class", "frame1");
+// Expected spans:
+// 1) break after the image
+// 2) "Illustration "
+// 3) The sequence field, this was missing (was ": foo" instead).
+assertXPathContent(mpXmlDoc, "//xhtml:div/xhtml:p/xhtml:span[3]", "1");
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 82d0b8ab6e3d..75144f5a1f19 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -54,6 +54,30 @@ namespace writerperfect
 namespace exp
 {
 
+/// Handler for .
+class XMLTextSequenceContext : public XMLImportContext
+{
+public:
+XMLTextSequenceContext(XMLImport &rImport);
+
+void SAL_CALL characters(const OUString &rChars) override;
+};
+
+XMLTextSequenceContext::XMLTextSequenceContext(XMLImport &rImport)
+: XMLImportContext(rImport)
+{
+}
+
+void XMLTextSequenceContext::characters(const OUString &rChars)
+{
+mrImport.GetGenerator().openSpan(librevenge::RVNGPropertyList());
+
+OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
+
mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+
+mrImport.GetGenerator().closeSpan();
+}
+
 /// Handler for .
 class XMLSpanContext : public XMLImportContext
 {
@@ -324,6 +348,8 @@ rtl::Reference 
CreateParagraphOrSpanChildContext(XMLImport &rI
 return new XMLTabContext(rImport, rTextPropertyList);
 if (rName == "draw:frame")
 return new XMLTextFrameContext(rImport);
+if (rName == "text:sequence")
+return new XMLTextSequenceContext(rImport);
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-27 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |   11 +++
 writerperfect/qa/unit/data/writer/epubexport/image-nospan.fodt |   33 
++
 writerperfect/source/writer/exp/txtparai.cxx   |4 -
 3 files changed, 46 insertions(+), 2 deletions(-)

New commits:
commit 0b3a408cfdd0a212423bb172f091f2a0d1c83423
Author: Miklos Vajna 
Date:   Mon Nov 27 08:19:47 2017 +0100

EPUB export: handle images outside spans

CreateParagraphOrSpanChildContext() is already a factory for
paragraph-or-span parents, just move image handling there.

Change-Id: Ieeb57dc0913a17e92fdc57d79c26326f9cecb6a4
Reviewed-on: https://gerrit.libreoffice.org/45307
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index bddfb8fd2d92..7f155c35de8e 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -72,6 +72,7 @@ public:
 void testList();
 void testImage();
 void testImageBorder();
+void testImageNospan();
 void testTable();
 void testTableRowSpan();
 void testTableCellBorder();
@@ -101,6 +102,7 @@ public:
 CPPUNIT_TEST(testList);
 CPPUNIT_TEST(testImage);
 CPPUNIT_TEST(testImageBorder);
+CPPUNIT_TEST(testImageNospan);
 CPPUNIT_TEST(testTable);
 CPPUNIT_TEST(testTableRowSpan);
 CPPUNIT_TEST(testTableCellBorder);
@@ -459,6 +461,15 @@ void EPUBExportTest::testImageBorder()
 CPPUNIT_ASSERT_EQUAL(OUString("0.99pt dashed #ed1c24"), 
EPUBExportTest::getCss(aCssDoc, aClass, "border"));
 }
 
+void EPUBExportTest::testImageNospan()
+{
+createDoc("image-nospan.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// Image outside a span was lost.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:img", 1);
+}
+
 void EPUBExportTest::testTable()
 {
 createDoc("table.fodt", {});
diff --git a/writerperfect/qa/unit/data/writer/epubexport/image-nospan.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/image-nospan.fodt
new file mode 100644
index ..332052a9eff5
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/image-nospan.fodt
@@ -0,0 +1,33 @@
+
+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:oas
 is: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">
+  
+
+  
+
+  
+  
+
+  
+
+  
+  
+
+  beforeiVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
+
UkdCAK7OHOkgY0hSTQAAeiYAAICEAAD6gOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+
AAJiS0dEAACqjSMyCW9GRnMGAAAMc1XTCXBIWXMAAA3XAAAN1wFCKJt4
+
CXZwQWcAAABMQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+
BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+
cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+
/878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+
QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+
YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+
2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+
cSp6ibfI+wkGADBG

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-24 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |   20 
 writerperfect/qa/unit/data/writer/epubexport/table-row-height.fodt |   42 
++
 writerperfect/source/writer/exp/txtstyli.cxx   |   37 

 writerperfect/source/writer/exp/txtstyli.hxx   |2 
 writerperfect/source/writer/exp/xmlfmt.cxx |   11 ++
 writerperfect/source/writer/exp/xmlfmt.hxx |5 -
 writerperfect/source/writer/exp/xmlimp.cxx |   16 +++
 writerperfect/source/writer/exp/xmlimp.hxx |4 
 writerperfect/source/writer/exp/xmltbli.cxx|   18 ++--
 writerperfect/source/writer/exp/xmltbli.hxx|1 
 10 files changed, 143 insertions(+), 13 deletions(-)

New commits:
commit ed0e7262f859adabc56a4f251f2ef1a66c98c3f5
Author: Miklos Vajna 
Date:   Fri Nov 24 09:13:23 2017 +0100

EPUB export: handle row height

By handling row styles.

Change-Id: Ie845cf9abfb4f6260d9401e81acc6864964b67bb
Reviewed-on: https://gerrit.libreoffice.org/45203
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 411aed3eac6b..49ef7297fa80 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -77,6 +77,7 @@ public:
 void testTableRowSpan();
 void testTableCellBorder();
 void testTableCellWidth();
+void testTableRowHeight();
 void testLink();
 void testLinkCharFormat();
 void testLinkNamedCharFormat();
@@ -103,6 +104,7 @@ public:
 CPPUNIT_TEST(testTableRowSpan);
 CPPUNIT_TEST(testTableCellBorder);
 CPPUNIT_TEST(testTableCellWidth);
+CPPUNIT_TEST(testTableRowHeight);
 CPPUNIT_TEST(testLink);
 CPPUNIT_TEST(testLinkCharFormat);
 CPPUNIT_TEST(testLinkNamedCharFormat);
@@ -510,6 +512,13 @@ double getCellWidth(const OUString &rStyle)
 EPUBExportTest::parseCssStyle(rStyle, aCss);
 return aCss["width"].toDouble();
 }
+
+double getRowHeight(const OUString &rStyle)
+{
+std::map aCss;
+EPUBExportTest::parseCssStyle(rStyle, aCss);
+return aCss["height"].toDouble();
+}
 }
 
 void EPUBExportTest::testTableCellWidth()
@@ -525,6 +534,17 @@ void EPUBExportTest::testTableCellWidth()
 CPPUNIT_ASSERT_GREATER(getCellWidth(aStyle3), getCellWidth(aStyle1));
 }
 
+void EPUBExportTest::testTableRowHeight()
+{
+createDoc("table-row-height.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+OUString aStyle1 = getXPath(mpXmlDoc, 
"//xhtml:table/xhtml:tbody/xhtml:tr[1]", "style");
+OUString aStyle2 = getXPath(mpXmlDoc, 
"//xhtml:table/xhtml:tbody/xhtml:tr[2]", "style");
+// These failed, both heights were 0.
+CPPUNIT_ASSERT_GREATER(getRowHeight(aStyle2), getRowHeight(aStyle1));
+}
+
 void EPUBExportTest::testLink()
 {
 createDoc("link.fodt", {});
diff --git a/writerperfect/qa/unit/data/writer/epubexport/table-row-height.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/table-row-height.fodt
new file mode 100644
index ..28b06a4290da
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/table-row-height.fodt
@@ -0,0 +1,42 @@
+
+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:oas
 is: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-in

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-11-24 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx|   14 ++
 writerperfect/qa/unit/data/writer/epubexport/table-cell-border.fodt |   48 
++
 writerperfect/source/writer/exp/txtparai.cxx|   27 
++---
 writerperfect/source/writer/exp/txtparai.hxx|9 +
 writerperfect/source/writer/exp/txtstyli.cxx|   37 
+++
 writerperfect/source/writer/exp/txtstyli.hxx|2 
 writerperfect/source/writer/exp/xmlfmt.cxx  |   12 ++
 writerperfect/source/writer/exp/xmlfmt.hxx  |6 +
 writerperfect/source/writer/exp/xmlimp.cxx  |   18 +++
 writerperfect/source/writer/exp/xmlimp.hxx  |4 
 writerperfect/source/writer/exp/xmltbli.cxx |   11 +-
 11 files changed, 163 insertions(+), 25 deletions(-)

New commits:
commit de523ce9b834b2d8f29409fe21d68b81ef314fe5
Author: Miklos Vajna 
Date:   Fri Nov 24 09:11:32 2017 +0100

EPUB export: handle cell border size/style/color

By adding support for automatic cell styles.

Change-Id: I31ff2bb6fed3391f571705505ccbbd89087e5972
Reviewed-on: https://gerrit.libreoffice.org/45201
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index b92d5763276a..31ad665a62a0 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -75,6 +75,7 @@ public:
 void testImage();
 void testTable();
 void testTableRowSpan();
+void testTableCellBorder();
 void testLink();
 void testLinkCharFormat();
 void testLinkNamedCharFormat();
@@ -99,6 +100,7 @@ public:
 CPPUNIT_TEST(testImage);
 CPPUNIT_TEST(testTable);
 CPPUNIT_TEST(testTableRowSpan);
+CPPUNIT_TEST(testTableCellBorder);
 CPPUNIT_TEST(testLink);
 CPPUNIT_TEST(testLinkCharFormat);
 CPPUNIT_TEST(testLinkNamedCharFormat);
@@ -486,6 +488,18 @@ void EPUBExportTest::testTableRowSpan()
 assertXPath(mpXmlDoc, "//xhtml:table/xhtml:tbody/xhtml:tr[1]/xhtml:td[1]", 
"rowspan", "2");
 }
 
+void EPUBExportTest::testTableCellBorder()
+{
+createDoc("table-cell-border.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+OUString aStyle = getXPath(mpXmlDoc, 
"//xhtml:table/xhtml:tbody/xhtml:tr[1]/xhtml:td[1]", "style");
+std::map aCss;
+parseCssStyle(aStyle, aCss);
+// This failed, cell border wasn't exported.
+CPPUNIT_ASSERT_EQUAL(OUString("0.05pt solid #00"), 
aCss["border-left"]);
+}
+
 void EPUBExportTest::testLink()
 {
 createDoc("link.fodt", {});
diff --git 
a/writerperfect/qa/unit/data/writer/epubexport/table-cell-border.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/table-cell-border.fodt
new file mode 100644
index ..28beff5ef44f
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/table-cell-border.fodt
@@ -0,0 +1,48 @@
+
+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:oas
 is: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">
+  
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+ 

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source xmlsecurity/source

2017-11-24 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |   34 
+-
 writerperfect/qa/unit/data/writer/epubexport/link-namedcharformat.fodt |   13 
+++
 writerperfect/source/writer/exp/txtparai.cxx   |   13 
+++
 xmlsecurity/source/helper/documentsignaturemanager.cxx |2 
 4 files changed, 58 insertions(+), 4 deletions(-)

New commits:
commit ccd2888110a7074763e6a948f4c5da29f2196d40
Author: Miklos Vajna 
Date:   Thu Nov 23 17:10:53 2017 +0100

EPUB export: implement character properties of links from named styles

ODF allows text properties on hyperlinks directly, librevenge wants an
inner span instead.

Change-Id: I903045a688bf318e7ac7f8cac83bb4d537259969
Reviewed-on: https://gerrit.libreoffice.org/45161
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 74edf831b84b..aba848ce9688 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -17,6 +17,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -53,6 +54,8 @@ public:
 xmlDocPtr parseExport(const OUString &rName);
 /// Loads a CSS representation of the stream named rName in the exported 
package into rTree.
 void parseCssExport(const OUString &rName, std::map< OString, 
std::vector > &rTree);
+/// Loads a CSS style string into a map.
+void parseCssStyle(const OUString &rStyle, std::map 
&rCss);
 void testOutlineLevel();
 void testMimetype();
 void testEPUB2();
@@ -73,6 +76,7 @@ public:
 void testTable();
 void testLink();
 void testLinkCharFormat();
+void testLinkNamedCharFormat();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -95,6 +99,7 @@ public:
 CPPUNIT_TEST(testTable);
 CPPUNIT_TEST(testLink);
 CPPUNIT_TEST(testLinkCharFormat);
+CPPUNIT_TEST(testLinkNamedCharFormat);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -179,6 +184,17 @@ void EPUBExportTest::parseCssExport(const OUString &rName, 
std::map< OString, st
 }
 }
 
+void EPUBExportTest::parseCssStyle(const OUString &rStyle, std::map &rCss)
+{
+for (const auto &rKeyValue : comphelper::string::split(rStyle, ';'))
+{
+OUString aKeyValue = rKeyValue.trim();
+std::vector aTokens = comphelper::string::split(aKeyValue, 
':');
+CPPUNIT_ASSERT_EQUAL(static_cast(2), aTokens.size());
+rCss[aTokens[0].trim()] = aTokens[1].trim();
+}
+}
+
 void EPUBExportTest::testOutlineLevel()
 {
 createDoc("outline-level.fodt", {});
@@ -464,7 +480,7 @@ void EPUBExportTest::testLink()
 createDoc("link.fodt", {});
 
 mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
-assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a", 
"https://libreoffice.org/";);
+assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a/xhtml:span", 
"https://libreoffice.org/";);
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"https://libreoffice.org/";);
 }
 
@@ -478,6 +494,22 @@ void EPUBExportTest::testLinkCharFormat()
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"https://libreoffice.org/";);
 }
 
+void EPUBExportTest::testLinkNamedCharFormat()
+{
+// Character properties from named character style on hyperlink was lost.
+createDoc("link-namedcharformat.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// This failed, there was no span inside the hyperlink.
+assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a/xhtml:span", 
"http://libreoffice.org";);
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"http://libreoffice.org/";);
+
+OUString aStyle = getXPath(mpXmlDoc, "//xhtml:p/xhtml:a/xhtml:span", 
"style");
+std::map aCss;
+parseCssStyle(aStyle, aCss);
+CPPUNIT_ASSERT_EQUAL(OUString("#ff"), aCss["color"]);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git 
a/writerperfect/qa/unit/data/writer/epubexport/link-namedcharformat.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/link-namedcharformat.fodt
new file mode 100644
index ..0e05c8d74d57
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/link-namedcharformat.fodt
@@ -0,0 +1,13 @@
+
+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:oas
 is:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-10-17 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx  |   12 ++
 writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt |   13 ++
 writerperfect/source/writer/exp/txtparai.cxx  |   19 
--
 3 files changed, 41 insertions(+), 3 deletions(-)

New commits:
commit f61acf7ebb2365d29209310b56c371ccf63f153d
Author: Miklos Vajna 
Date:   Tue Oct 17 16:33:06 2017 +0200

EPUB export: handle char format of hyperlinks

 child elements were not handled.

Change-Id: I7db9c005869934456ffbe5c36347b01cc76645b6
Reviewed-on: https://gerrit.libreoffice.org/43462
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 374d9f730c23..850228c0a276 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -72,6 +72,7 @@ public:
 void testImage();
 void testTable();
 void testLink();
+void testLinkCharFormat();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -93,6 +94,7 @@ public:
 CPPUNIT_TEST(testImage);
 CPPUNIT_TEST(testTable);
 CPPUNIT_TEST(testLink);
+CPPUNIT_TEST(testLinkCharFormat);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -466,6 +468,16 @@ void EPUBExportTest::testLink()
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"https://libreoffice.org/";);
 }
 
+void EPUBExportTest::testLinkCharFormat()
+{
+createDoc("link-charformat.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+//  was lost, link text having a char format was missing.
+assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a/xhtml:span", 
"https://libreoffice.org/";);
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"https://libreoffice.org/";);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt
new file mode 100644
index ..b158ce3dbb82
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/link-charformat.fodt
@@ -0,0 +1,13 @@
+
+http://www.w3.org/1999/xlink"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+  
+
+  
+
+  
+  
+
+  Before https://libreoffice.org/";>https://libreoffice.org/ 
after.
+
+  
+
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index fa6f91f0bd7b..c839b8b1bbed 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -214,16 +214,29 @@ void XMLTabContext::startElement(const OUString 
&/*rName*/, const css::uno::Refe
 class XMLHyperlinkContext : public XMLImportContext
 {
 public:
-XMLHyperlinkContext(XMLImport &rImport);
+XMLHyperlinkContext(XMLImport &rImport, const librevenge::RVNGPropertyList 
&rPropertyList);
+rtl::Reference CreateChildContext(const OUString &rName, 
const css::uno::Reference &xAttribs) override;
 
 void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference &xAttribs) override;
 void SAL_CALL endElement(const OUString &rName) override;
 void SAL_CALL characters(const OUString &rChars) override;
+
+private:
+librevenge::RVNGPropertyList m_aPropertyList;
 };
 
-XMLHyperlinkContext::XMLHyperlinkContext(XMLImport &rImport)
+XMLHyperlinkContext::XMLHyperlinkContext(XMLImport &rImport, const 
librevenge::RVNGPropertyList &rPropertyList)
 : XMLImportContext(rImport)
 {
+// Inherit properties from parent.
+librevenge::RVNGPropertyList::Iter itProp(rPropertyList);
+for (itProp.rewind(); itProp.next();)
+m_aPropertyList.insert(itProp.key(), itProp()->clone());
+}
+
+rtl::Reference XMLHyperlinkContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference 
&/*xAttribs*/)
+{
+return CreateParagraphOrSpanChildContext(mrImport, rName, m_aPropertyList);
 }
 
 void XMLHyperlinkContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &xAttribs)
@@ -262,7 +275,7 @@ XMLParaContext::XMLParaContext(XMLImport &rImport)
 rtl::Reference XMLParaContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference 
&/*xAttribs*/)
 {
 if (rName == "text:a")
-return new XMLHyperlinkContext(mrImport);
+return new XMLHyperlinkContext(mrImport, m_aTextPropertyList);
 return CreateParagraphOrSpanChildContext(mrImport, rName, 
m_aTextPropertyList);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-30 Thread Miklos Vajna
 writerperfect/qa/uitest/epubexport/epubexport.py |   28 ++-
 1 file changed, 22 insertions(+), 6 deletions(-)

New commits:
commit 82ae825198ada84049c630ab49f280c8c6f2ad6e
Author: Miklos Vajna 
Date:   Fri Sep 29 17:39:17 2017 +0200

EPUB export dialog: test VersionToPosition()

Fails when the stub version always returned 0.

Change-Id: I2df952d0b7fc1a6171074e6da91584b851ace358
Reviewed-on: https://gerrit.libreoffice.org/42945
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py 
b/writerperfect/qa/uitest/epubexport/epubexport.py
index d5109a4bd395..4dfeed19e617 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -7,19 +7,18 @@
 from com.sun.star.beans import PropertyValue
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
 import uno
 
 
-def handleDialog(dialog):
-# Select the second entry to request EPUB2, not EPUB3.
-dialog.getChild("versionlb").executeAction("SELECT", 
mkPropertyValues({"POS": "1"}))
-dialog.getChild("ok").executeAction("CLICK", tuple())
-
-
 # Test for EPUBExportDialog and EPUBExportUIComponent.
 class EPUBExportTest(UITestCase):
 
 def testUIComponent(self):
+def handleDialog(dialog):
+# Select the second entry to request EPUB2, not EPUB3.
+dialog.getChild("versionlb").executeAction("SELECT", 
mkPropertyValues({"POS": "1"}))
+dialog.getChild("ok").executeAction("CLICK", tuple())
 
 uiComponent = 
self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent",
 self.ui_test._xContext)
 
@@ -53,4 +52,21 @@ class EPUBExportTest(UITestCase):
 epubVersion = [i.Value for i in filterData if i.Name == 
"EPUBVersion"][0]
 self.assertEqual(30, epubVersion)
 
+def testDialogVersionInput(self):
+def handleDialog(dialog):
+versionlb = get_state_as_dict(dialog.getChild("versionlb"))
+# Log the state of the versionlb widget and exit.
+positions.append(versionlb["SelectEntryPos"])
+dialog.getChild("ok").executeAction("CLICK", tuple())
+
+uiComponent = 
self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent",
 self.ui_test._xContext)
+positions = []
+for version in (20, 30):
+filterData = (PropertyValue(Name="EPUBVersion", Value=version),)
+propertyValues = (PropertyValue(Name="FilterData", 
Value=uno.Any("[]com.sun.star.beans.PropertyValue", filterData)),)
+uiComponent.setPropertyValues(propertyValues)
+self.ui_test.execute_blocking_action(action=uiComponent.execute, 
dialog_handler=handleDialog)
+# Make sure that initializing with 2 different versions results in 2 
different widget states.
+self.assertEqual(2, len(set(positions)))
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-27 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |2 ++
 writerperfect/qa/unit/data/writer/epubexport/meta.fodt |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 3d3643491c9b3af082103bbd6bd18994d24cc568
Author: Miklos Vajna 
Date:   Wed Sep 27 12:07:02 2017 +0200

EPUB export: improve metadata tests

This was the last uncovered piece in the ODF -> librevenge converter
part.

Change-Id: Ie9482f30c873deb3ddd601e1183b66706e913f14
Reviewed-on: https://gerrit.libreoffice.org/42848
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index d79a196c7863..374d9f730c23 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -292,6 +292,8 @@ void EPUBExportTest::testMeta()
 // This was "Unknown Author",  was not handled.
 assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:creator", "A U 
Thor");
 assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:title", 
"Title");
+assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:language", 
"hu");
+assertXPathContent(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@property='dcterms:modified']", 
"2017-09-27T09:51:19Z");
 }
 
 void EPUBExportTest::testParaNamedstyle()
diff --git a/writerperfect/qa/unit/data/writer/epubexport/meta.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/meta.fodt
index 4e46fe79fcda..8b1af3e44f5a 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/meta.fodt
+++ b/writerperfect/qa/unit/data/writer/epubexport/meta.fodt
@@ -3,6 +3,8 @@
   
 A U Thor
 Title
+hu
+2017-09-27T09:51:19.243117081
   
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-26 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |   11 +++
 writerperfect/qa/unit/data/writer/epubexport/link.fodt |8 
 2 files changed, 19 insertions(+)

New commits:
commit d81e6184f691cf49abdbf3b3714c507dcca3a50c
Author: Miklos Vajna 
Date:   Tue Sep 26 11:07:13 2017 +0200

EPUB export: test link handling

Fails without commit 9480ff6a2b6057410940ff5c40828d5746898a0e (EPUB
export: implement link support, 2017-08-17).

Change-Id: Icee6ac04ff77d0e9ff66ca1f925d6973b4b342a2
Reviewed-on: https://gerrit.libreoffice.org/42786
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 5b3f4b9a0c27..d79a196c7863 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -71,6 +71,7 @@ public:
 void testList();
 void testImage();
 void testTable();
+void testLink();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -91,6 +92,7 @@ public:
 CPPUNIT_TEST(testList);
 CPPUNIT_TEST(testImage);
 CPPUNIT_TEST(testTable);
+CPPUNIT_TEST(testLink);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -453,6 +455,15 @@ void EPUBExportTest::testTable()
 assertXPath(mpXmlDoc, "//xhtml:table/xhtml:tbody/xhtml:tr/xhtml:td", 4);
 }
 
+void EPUBExportTest::testLink()
+{
+createDoc("link.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a", 
"https://libreoffice.org/";);
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", 
"https://libreoffice.org/";);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/link.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/link.fodt
new file mode 100644
index ..9a2efcc0b7a8
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/link.fodt
@@ -0,0 +1,8 @@
+
+http://www.w3.org/1999/xlink"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+  
+
+  Before https://libreoffice.org/";>https://libreoffice.org/ 
after.
+
+  
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-26 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx   |2 ++
 writerperfect/qa/unit/data/writer/epubexport/list.fodt |   12 
 2 files changed, 14 insertions(+)

New commits:
commit 616fc7a79f35f4db65b58d34ff6d6e806ff9a6ef
Author: Miklos Vajna 
Date:   Tue Sep 26 10:25:17 2017 +0200

EPUB export: test not loosing nested list content

Just focus on the content, no formatting yet.

Change-Id: I109f049bafae6a20d6b617f3be6a9c4f237e782b
Reviewed-on: https://gerrit.libreoffice.org/42785
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 28349d8bf619..5b3f4b9a0c27 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -433,6 +433,8 @@ void EPUBExportTest::testList()
 mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
 // This was "C", i.e. in-list content was ignored.
 assertXPathContent(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "B");
+// Test nested list content.
+assertXPathContent(mpXmlDoc, "//xhtml:p[6]/xhtml:span", "F");
 }
 
 void EPUBExportTest::testImage()
diff --git a/writerperfect/qa/unit/data/writer/epubexport/list.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/list.fodt
index 399ce78b2247..9c02b9d097bc 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/list.fodt
+++ b/writerperfect/qa/unit/data/writer/epubexport/list.fodt
@@ -19,6 +19,18 @@
 
   
   C
+  D
+  
+
+  E
+  
+
+  F
+
+  
+
+  
+  G
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-26 Thread Miklos Vajna
 writerperfect/qa/uitest/epubexport/epubexport.py |   26 +++
 1 file changed, 26 insertions(+)

New commits:
commit 07fd83987a38edb21fc7a8b7d7efe44e0a25e347
Author: Miklos Vajna 
Date:   Mon Sep 25 18:10:31 2017 +0200

EPUB export: add testcase for EPUBExportUIComponent::setPropertyValues()

Making sure python produces sequence and not
sequence is a bit tricky.

Change-Id: I1f3ee4664202576ab6777b719b3712b164c5002d
Reviewed-on: https://gerrit.libreoffice.org/42759
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py 
b/writerperfect/qa/uitest/epubexport/epubexport.py
index 67437b48f827..d5109a4bd395 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -4,8 +4,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
+from com.sun.star.beans import PropertyValue
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.framework import UITestCase
+import uno
 
 
 def handleDialog(dialog):
@@ -20,6 +22,13 @@ class EPUBExportTest(UITestCase):
 def testUIComponent(self):
 
 uiComponent = 
self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent",
 self.ui_test._xContext)
+
+# Make sure we get what we asked for.
+self.assertEqual("com.sun.star.comp.Writer.EPUBExportUIComponent", 
uiComponent.getImplementationName())
+self.assertEqual(True, 
uiComponent.supportsService("com.sun.star.ui.dialogs.FilterOptionsDialog"))
+# Just make sure this doesn't fail.
+uiComponent.setTitle(str())
+
 self.ui_test.execute_blocking_action(action=uiComponent.execute, 
dialog_handler=handleDialog)
 propertyValues = uiComponent.getPropertyValues()
 filterData = [i.Value for i in propertyValues if i.Name == 
"FilterData"][0]
@@ -27,4 +36,21 @@ class EPUBExportTest(UITestCase):
 # This was 30, EPUBExportDialog::VersionSelectHdl() did not set the 
version.
 self.assertEqual(20, epubVersion)
 
+def testCustomProperties(self):
+uiComponent = 
self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent",
 self.ui_test._xContext)
+
+# Make sure that by default the version is not altered.
+propertyValues = uiComponent.getPropertyValues()
+filterData = [i.Value for i in propertyValues if i.Name == 
"FilterData"][0]
+self.assertEqual(0, len([i.Value for i in filterData if i.Name == 
"EPUBVersion"]))
+
+# But if we set it explicitly, then it's retained, even without 
interacting with the UI.
+filterData = (PropertyValue(Name="EPUBVersion", Value=30),)
+propertyValues = (PropertyValue(Name="FilterData", 
Value=uno.Any("[]com.sun.star.beans.PropertyValue", filterData)),)
+uiComponent.setPropertyValues(propertyValues)
+propertyValues = uiComponent.getPropertyValues()
+filterData = [i.Value for i in propertyValues if i.Name == 
"FilterData"][0]
+epubVersion = [i.Value for i in filterData if i.Name == 
"EPUBVersion"][0]
+self.assertEqual(30, epubVersion)
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-22 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx|   10 
 writerperfect/qa/unit/data/writer/epubexport/table.fodt |   39 
 2 files changed, 49 insertions(+)

New commits:
commit df44f5013867047abd9d6ebf02acda5a30873cea
Author: Miklos Vajna 
Date:   Thu Sep 21 14:44:51 2017 +0200

EPUB export: add table testcase

Fails without commit 54ad8ad0f0ce22299d28b4ec09eea26ad2691642 (EPUB
export: initial table support, 2017-08-22).

Change-Id: Ie8d793a8851dba894c57f2071e1b4717fa1e17af
Reviewed-on: https://gerrit.libreoffice.org/42590
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 5697e3c58c64..28349d8bf619 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -70,6 +70,7 @@ public:
 void testSection();
 void testList();
 void testImage();
+void testTable();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -89,6 +90,7 @@ public:
 CPPUNIT_TEST(testSection);
 CPPUNIT_TEST(testList);
 CPPUNIT_TEST(testImage);
+CPPUNIT_TEST(testTable);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -441,6 +443,14 @@ void EPUBExportTest::testImage()
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:img", 1);
 }
 
+void EPUBExportTest::testTable()
+{
+createDoc("table.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+assertXPath(mpXmlDoc, "//xhtml:table/xhtml:tbody/xhtml:tr/xhtml:td", 4);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/table.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/table.fodt
new file mode 100644
index ..9135c902f5fc
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/table.fodt
@@ -0,0 +1,39 @@
+
+
+  
+
+  
+
+
+  
+
+
+  
+
+  
+  
+
+  Before
+  
+
+
+  
+A1
+  
+  
+B1
+  
+
+
+  
+A2
+  
+  
+B2
+  
+
+  
+  After
+
+  
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-21 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx|   22 
 writerperfect/qa/unit/data/writer/epubexport/image.fodt |   28 
 2 files changed, 50 insertions(+)

New commits:
commit e590e4dd5e8d9e2fb94a5fff80fb5fd468a01de4
Author: Miklos Vajna 
Date:   Thu Sep 21 10:00:17 2017 +0200

EPUB export: test image handling

Fails without commit 28102e471d3cb6b6976380ca84b1094078ac1af1 (EPUB
export: handle inline images, 2017-08-17).

Change-Id: Ie96430e9b2d988574464d359111619fc18109566
Reviewed-on: https://gerrit.libreoffice.org/42589
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index f86f6c395d22..5697e3c58c64 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -9,8 +9,10 @@
 
 #include 
 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -67,6 +69,7 @@ public:
 void testParaCharProps();
 void testSection();
 void testList();
+void testImage();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -85,6 +88,7 @@ public:
 CPPUNIT_TEST(testParaCharProps);
 CPPUNIT_TEST(testSection);
 CPPUNIT_TEST(testList);
+CPPUNIT_TEST(testImage);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -202,6 +206,16 @@ void EPUBExportTest::testMimetype()
 // This was just "libepubgen/x.y.z", i.e. the LO version was missing.
 OUString aGenerator = getXPath(mpXmlDoc, 
"/opf:package/opf:metadata/opf:meta[@name='generator']", "content");
 
CPPUNIT_ASSERT(aGenerator.startsWith(utl::DocInfoHelper::GetGeneratorString()));
+
+uno::Reference 
xMSF(mxComponentContext->getServiceManager(), uno::UNO_QUERY);
+const OUString aServiceName("com.sun.star.comp.Writer.EPUBExportFilter");
+uno::Reference 
xFilter(xMSF->createInstance(aServiceName), uno::UNO_QUERY);
+// Should result in no errors.
+xFilter->cancel();
+// We got back what we expected.
+uno::Reference xServiceInfo(xFilter, uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(aServiceName, xServiceInfo->getImplementationName());
+
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.document.ExportFilter"));
 }
 
 void EPUBExportTest::testEPUB2()
@@ -419,6 +433,14 @@ void EPUBExportTest::testList()
 assertXPathContent(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "B");
 }
 
+void EPUBExportTest::testImage()
+{
+createDoc("image.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:img", 1);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/image.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/image.fodt
new file mode 100644
index ..52e6d2b97272
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/image.fodt
@@ -0,0 +1,28 @@
+
+
+  
+
+  
+
+  
+  
+
+  beforeiVBORw0KGgoNSUhEUgAAAEBACAQAYLlVBGdBTUEAALGPC/xhBQFz
+
UkdCAK7OHOkgY0hSTQAAeiYAAICEAAD6gOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
+
AAJiS0dEAACqjSMyCW9GRnMGAAAMc1XTCXBIWXMAAA3XAAAN1wFCKJt4
+
CXZwQWcAAABMQACdMTgbAAABzUlEQVRo3u3ZPU/CQBjA8X+Jxs3ESUDj4iK+LA5+
+
BBfjqBE1cXB2MlFAEqMgxvhNNL4sLsK3UPQL6ObkoAETz+FKW2mxCPRYnucWUu76/OC59C49
+
cGOCKqrD9kHRc6ddPv7oW2WCwMh0nF63Myz7Tm8hPTNu0pgHMER3scepTbgK6enJNND83RLn
+
/878yRaPmgBZFDuMsNLeWB9gmFQHP77MIg9gsYciR50NFKvtjIy10yk84pSZA7DYpwR8scmF
+
QQCMuoQMpzbh0iAARrlnVn90CWHTsZcAiHPPdINQAuqsc2MQAAnKDUKWEhZ10twaBEDSJWQo
+
YlFj7S9CzwEegkXWIbQsRAQASFJhpplwbRAACS+hANRJBxMiAkDcJeQ4sQkBhYgMoJ+Ozlwo
+
2YQ7AJ6CRxyiUGnVy3hVKb0Af9v7hUG2Wy9TEQCUelFTDULB2S+YKYGOMcpM6UIccOQnRA6A
+
cSp6ibfI+wkGADBGpTEd8xz1AaAfTQ7huA8AvUw5hVjuA0D/C5OaMN8XACRZ8F0zCggKAQhA
+
AAIQgAAEIAABCEAAAhCAAAQgAAH4zg3feY4w3Xs44M5+oW0qvCWoGcvaIlM3x/f/ab+O738A
+
hOCNQr34oD4ldEVYdGNyZWF0ZS1kYXRlADIwMTAtMTItMjBUMTc6MDg6MzYrMDE6MDB6
+
5RscJXRFWHRtb2RpZnktZGF0ZQAyMDEwLTEyLTIwVDE3OjA4OjM3KzAxOjAwgyNmnAAA
+AABJRU5ErkJggg==
+   
after
+
+  
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-09-07 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |4 ++-
 writerperfect/qa/unit/data/writer/epubexport/line-break.fodt |   14 ++-
 writerperfect/source/writer/exp/txtparai.cxx |   13 +++---
 writerperfect/source/writer/exp/txtparai.hxx |3 ++
 4 files changed, 28 insertions(+), 6 deletions(-)

New commits:
commit 01cc6e5107c706760939c2331ca57247bd02cb77
Author: Miklos Vajna 
Date:   Thu Sep 7 17:29:18 2017 +0200

EPUB export: handle span-level line break

By pulling out common part of the paragraph/span context factory.

Change-Id: If5fda87ce9f60e7e10d7f9406c30740bc8707143
Reviewed-on: https://gerrit.libreoffice.org/42064
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 3bce1b5a9ba5..0d869737fc8e 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -325,7 +325,9 @@ void EPUBExportTest::testLineBreak()
 
 mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
 // This was 0, line break was not handled.
-assertXPath(mpXmlDoc, "//xhtml:p/xhtml:br", 1);
+assertXPath(mpXmlDoc, "//xhtml:p[1]/xhtml:br", 1);
+// This was 0, line break inside span was not handled.
+assertXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:br", 1);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
diff --git a/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt
index c380f6df0063..1a6fca72b08a 100644
--- a/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt
+++ b/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt
@@ -1,8 +1,20 @@
 
-
+http://openoffice.org/2009/office"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+  
+
+  
+
+
+  
+
+
+  
+
+  
   
 
   ab
+  aabb
 
   
 
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index c476904277e2..b085537cf106 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -103,7 +103,7 @@ XMLImportContext *XMLSpanContext::CreateChildContext(const 
OUString &rName, cons
 return new XMLTextFrameContext(mrImport);
 if (rName == "text:span")
 return new XMLSpanContext(mrImport, &m_aPropertyList);
-return nullptr;
+return writerperfect::exp::CreateChildContext(mrImport, rName);
 }
 
 void XMLSpanContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &xAttribs)
@@ -207,9 +207,7 @@ XMLImportContext *XMLParaContext::CreateChildContext(const 
OUString &rName, cons
 return new XMLSpanContext(mrImport, nullptr);
 if (rName == "text:a")
 return new XMLHyperlinkContext(mrImport);
-if (rName == "text:line-break")
-return new XMLLineBreakContext(mrImport);
-return nullptr;
+return writerperfect::exp::CreateChildContext(mrImport, rName);
 }
 
 void XMLParaContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &xAttribs)
@@ -253,6 +251,13 @@ void XMLParaContext::characters(const OUString &rChars)
 mrImport.GetGenerator().closeSpan();
 }
 
+XMLImportContext *CreateChildContext(XMLImport &rImport, const OUString &rName)
+{
+if (rName == "text:line-break")
+return new XMLLineBreakContext(rImport);
+return nullptr;
+}
+
 } // namespace exp
 } // namespace writerperfect
 
diff --git a/writerperfect/source/writer/exp/txtparai.hxx 
b/writerperfect/source/writer/exp/txtparai.hxx
index 61c3fc5bfc73..52543ffeadde 100644
--- a/writerperfect/source/writer/exp/txtparai.hxx
+++ b/writerperfect/source/writer/exp/txtparai.hxx
@@ -33,6 +33,9 @@ private:
 OUString m_aStyleName;
 };
 
+/// Shared child context factory for paragraph and span contexts.
+XMLImportContext *CreateChildContext(XMLImport &rImport, const OUString 
&rName);
+
 } // namespace exp
 } // namespace writerperfect
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-09-07 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |   11 +
 writerperfect/qa/unit/data/writer/epubexport/line-break.fodt |8 
 writerperfect/source/writer/exp/txtparai.cxx |   21 +++
 3 files changed, 40 insertions(+)

New commits:
commit bf3a87d1ee9106161d26f33c1ccb6b7b0d0aa0b9
Author: Miklos Vajna 
Date:   Thu Sep 7 15:26:21 2017 +0200

EPUB export: handle line break

When it's directly under , as a start.

Change-Id: I05e7decbcfa2f4dae36c01179d7efd7c8645a26b
Reviewed-on: https://gerrit.libreoffice.org/42059
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index a7bb9c322c5e..3bce1b5a9ba5 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -62,6 +62,7 @@ public:
 void testCharNamedstyle();
 void testNamedStyleInheritance();
 void testNestedSpan();
+void testLineBreak();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -75,6 +76,7 @@ public:
 CPPUNIT_TEST(testCharNamedstyle);
 CPPUNIT_TEST(testNamedStyleInheritance);
 CPPUNIT_TEST(testNestedSpan);
+CPPUNIT_TEST(testLineBreak);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -317,6 +319,15 @@ void EPUBExportTest::testNestedSpan()
 assertCss(aCssDoc, aRed, "  font-family: 'Liberation Mono';");
 }
 
+void EPUBExportTest::testLineBreak()
+{
+createDoc("line-break.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// This was 0, line break was not handled.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:br", 1);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt
new file mode 100644
index ..c380f6df0063
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/line-break.fodt
@@ -0,0 +1,8 @@
+
+
+  
+
+  ab
+
+  
+
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 984070ba7fc4..c476904277e2 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -133,6 +133,25 @@ void XMLSpanContext::characters(const OUString &rChars)
 mrImport.GetGenerator().closeSpan();
 }
 
+/// Handler for .
+class XMLLineBreakContext : public XMLImportContext
+{
+public:
+XMLLineBreakContext(XMLImport &rImport);
+
+void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference &xAttribs) override;
+};
+
+XMLLineBreakContext::XMLLineBreakContext(XMLImport &rImport)
+: XMLImportContext(rImport)
+{
+}
+
+void XMLLineBreakContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &/*xAttribs*/)
+{
+mrImport.GetGenerator().insertLineBreak();
+}
+
 /// Handler for .
 class XMLHyperlinkContext : public XMLImportContext
 {
@@ -188,6 +207,8 @@ XMLImportContext *XMLParaContext::CreateChildContext(const 
OUString &rName, cons
 return new XMLSpanContext(mrImport, nullptr);
 if (rName == "text:a")
 return new XMLHyperlinkContext(mrImport);
+if (rName == "text:line-break")
+return new XMLLineBreakContext(mrImport);
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-09-06 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx  |   
41 +++
 writerperfect/qa/unit/data/writer/epubexport/named-style-inheritance.fodt |   
39 +++
 writerperfect/source/writer/exp/txtparai.cxx  |   
54 ++
 writerperfect/source/writer/exp/txtstyli.cxx  |   
11 +-
 4 files changed, 126 insertions(+), 19 deletions(-)

New commits:
commit fe4c6063ec493c986f810ba676e2b12fe7dab7a9
Author: Miklos Vajna 
Date:   Wed Sep 6 15:35:40 2017 +0200

EPUB export: handle style parents for named styles

Character / paragraph formatting from a style hierarchy should be OK
now. Also this time test the actual CSS contents, not just that the rule
name for two paragraphs or spans differs.

Change-Id: I18a9c11aaf16bb3c4b462415b5e819f16de0893c
Reviewed-on: https://gerrit.libreoffice.org/41993
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 1b57655180b0..7b5de434bf8f 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -47,6 +47,8 @@ public:
 void createDoc(const OUString &rFile, const 
uno::Sequence &rFilterData);
 /// Returns an XML representation of the stream named rName in the 
exported package.
 xmlDocPtr parseExport(const OUString &rName);
+/// Loads a CSS representation of the stream named rName in the exported 
package into rTree.
+void parseCssExport(const OUString &rName, std::map< OString, 
std::vector > &rTree);
 void testOutlineLevel();
 void testMimetype();
 void testEPUB2();
@@ -56,6 +58,7 @@ public:
 void testMeta();
 void testParaNamedstyle();
 void testCharNamedstyle();
+void testNamedStyleInheritance();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -67,6 +70,7 @@ public:
 CPPUNIT_TEST(testMeta);
 CPPUNIT_TEST(testParaNamedstyle);
 CPPUNIT_TEST(testCharNamedstyle);
+CPPUNIT_TEST(testNamedStyleInheritance);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -122,6 +126,25 @@ xmlDocPtr EPUBExportTest::parseExport(const OUString 
&rName)
 return parseXmlStream(pStream.get());
 }
 
+void EPUBExportTest::parseCssExport(const OUString &rName, std::map< OString, 
std::vector > &rTree)
+{
+uno::Reference xInputStream(mxZipFile->getByName(rName), 
uno::UNO_QUERY);
+std::shared_ptr 
pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
+
+// Minimal CSS handler till orcus is up to our needs.
+OString aLine;
+OString aRuleName;
+while (!pStream->IsEof())
+{
+pStream->ReadLine(aLine);
+if (aLine.endsWith("{"))
+// '.name {' -> 'name'
+aRuleName = aLine.copy(1, aLine.getLength() - 3);
+else if (aLine.endsWith(";"))
+rTree[aRuleName].push_back(aLine);
+}
+}
+
 void EPUBExportTest::testOutlineLevel()
 {
 createDoc("outline-level.fodt", {});
@@ -246,6 +269,24 @@ void EPUBExportTest::testCharNamedstyle()
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[2]", "class", "span1");
 }
 
+void EPUBExportTest::testNamedStyleInheritance()
+{
+createDoc("named-style-inheritance.fodt", {});
+
+// Find the CSS rule for the blue text.
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+OUString aBlue = getXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:span[2]", "class");
+
+std::map< OString, std::vector > aTree;
+parseCssExport("OEBPS/styles/stylesheet.css", aTree);
+CPPUNIT_ASSERT(aTree.find(aBlue.toUtf8()) != aTree.end());
+const std::vector &rRule = aTree[aBlue.toUtf8()];
+CPPUNIT_ASSERT(std::find(rRule.begin(), rRule.end(), "  color: #ff;") 
!= rRule.end());
+// This failed, the span only had the properties from its style, but not
+// from the style's parent(s).
+CPPUNIT_ASSERT(std::find(rRule.begin(), rRule.end(), "  font-family: 
'Liberation Mono';") != rRule.end());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git 
a/writerperfect/qa/unit/data/writer/epubexport/named-style-inheritance.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/named-style-inheritance.fodt
new file mode 100644
index ..2bd6197774c5
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/named-style-inheritance.fodt
@@ -0,0 +1,39 @@
+
+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:

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-09-06 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx  |   14 
+++
 writerperfect/qa/unit/data/writer/epubexport/char-namedstyle.fodt |   16 

 writerperfect/source/writer/exp/txtparai.cxx  |   20 
+++---
 3 files changed, 45 insertions(+), 5 deletions(-)

New commits:
commit 4f7034b64cd6ae6cd7bc2ef99d29709ab6117a31
Author: Miklos Vajna 
Date:   Tue Sep 5 20:16:49 2017 +0200

EPUB export: handle text properties from text styles

This is the last combination of style -> direct inheritance that was not
handled previously.

Change-Id: Ie92b38b89a13b81f09cd7300b0d1b939cda3d8ff
Reviewed-on: https://gerrit.libreoffice.org/41952
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 8ab03f6df48e..1b57655180b0 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -55,6 +55,7 @@ public:
 void testParaAutostyleCharProps();
 void testMeta();
 void testParaNamedstyle();
+void testCharNamedstyle();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -65,6 +66,7 @@ public:
 CPPUNIT_TEST(testParaAutostyleCharProps);
 CPPUNIT_TEST(testMeta);
 CPPUNIT_TEST(testParaNamedstyle);
+CPPUNIT_TEST(testCharNamedstyle);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -232,6 +234,18 @@ void EPUBExportTest::testParaNamedstyle()
 assertXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "class", "span1");
 }
 
+void EPUBExportTest::testCharNamedstyle()
+{
+createDoc("char-namedstyle.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+
+// Test character properties from named text style.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[1]", "class", "span0");
+// This failed, character properties from text style were not exported.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[2]", "class", "span1");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/char-namedstyle.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/char-namedstyle.fodt
new file mode 100644
index ..5a1b3823dd18
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/char-namedstyle.fodt
@@ -0,0 +1,16 @@
+
+
+  
+
+  
+  
+
+  
+
+  
+  
+
+  Foobar
+
+  
+
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 932ae744f4e9..31ab25f43cad 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -55,13 +55,23 @@ void XMLSpanContext::startElement(const OUString 
&/*rName*/, const css::uno::Ref
 {
 // Reference to an automatic text style, try to look it up.
 auto itStyle = 
mrImport.GetAutomaticTextStyles().find(rAttributeValue);
-if (itStyle == mrImport.GetAutomaticTextStyles().end())
+if (itStyle != mrImport.GetAutomaticTextStyles().end())
+{
+// Apply properties directly, librevenge has no notion of 
automatic styles.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+aPropertyList.insert(itProp.key(), itProp()->clone());
 continue;
+}
 
-// Apply properties directly, librevenge has no notion of 
automatic styles.
-librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
-for (itProp.rewind(); itProp.next();)
-aPropertyList.insert(itProp.key(), itProp()->clone());
+itStyle = mrImport.GetTextStyles().find(rAttributeValue);
+if (itStyle != mrImport.GetTextStyles().end())
+{
+// Apply properties from text style.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+aPropertyList.insert(itProp.key(), itProp()->clone());
+}
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-09-05 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |5 +
 writerperfect/source/writer/exp/txtparai.cxx |   11 +++
 2 files changed, 16 insertions(+)

New commits:
commit 5270eacdbca0347a56392d706e14a7be18704155
Author: Miklos Vajna 
Date:   Tue Sep 5 16:35:11 2017 +0200

EPUB export: handle text properties from paragraph styles

Same as previous EPUB commit, but this time for text properties, not
paragraph ones.

Change-Id: I46d59d92028cf4155bfbbf68805a1b6c259e81e2
Reviewed-on: https://gerrit.libreoffice.org/41945
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 5163c7234074..8ab03f6df48e 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -225,6 +225,11 @@ void EPUBExportTest::testParaNamedstyle()
 assertXPath(mpXmlDoc, "//xhtml:p[1]", "class", "para0");
 // This failed, paragraph properties from style were not exported.
 assertXPath(mpXmlDoc, "//xhtml:p[2]", "class", "para1");
+
+// Test character properties from named paragraph style.
+assertXPath(mpXmlDoc, "//xhtml:p[1]/xhtml:span", "class", "span0");
+// This failed, character properties from paragraph style were not 
exported.
+assertXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "class", "span1");
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index b812549c69b3..932ae744f4e9 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -204,6 +204,17 @@ void XMLParaContext::characters(const OUString &rChars)
 for (itProp.rewind(); itProp.next();)
 aPropertyList.insert(itProp.key(), itProp()->clone());
 }
+else
+{
+itStyle = mrImport.GetTextStyles().find(m_aStyleName);
+if (itStyle != mrImport.GetTextStyles().end())
+{
+// Found a named text style.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+aPropertyList.insert(itProp.key(), itProp()->clone());
+}
+}
 }
 mrImport.GetGenerator().openSpan(aPropertyList);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-09-05 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx  |   12 +
 writerperfect/qa/unit/data/writer/epubexport/para-namedstyle.fodt |   18 

 writerperfect/source/writer/exp/txtparai.cxx  |   22 
+++---
 writerperfect/source/writer/exp/txtstyli.cxx  |   10 ++--
 writerperfect/source/writer/exp/txtstyli.hxx  |5 +-
 writerperfect/source/writer/exp/xmlfmt.cxx|   20 
+++--
 writerperfect/source/writer/exp/xmlfmt.hxx|   14 +-
 writerperfect/source/writer/exp/xmlimp.cxx|   14 +-
 writerperfect/source/writer/exp/xmlimp.hxx|4 +
 9 files changed, 100 insertions(+), 19 deletions(-)

New commits:
commit e808bbe1ce51465e6f3e9dc4fec2ecd263fe0e4b
Author: Miklos Vajna 
Date:   Tue Sep 5 14:48:22 2017 +0200

EPUB export: handle paragraph properties from paragraph styles

This adds support for inheriting paragraph properties from named
paragraph styles.

Change-Id: I3cb787f6704329a5e0d11d3cd0266254749ac5ae
Reviewed-on: https://gerrit.libreoffice.org/41938
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 61a6da2941f0..5163c7234074 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -54,6 +54,7 @@ public:
 void testSpanAutostyle();
 void testParaAutostyleCharProps();
 void testMeta();
+void testParaNamedstyle();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -63,6 +64,7 @@ public:
 CPPUNIT_TEST(testSpanAutostyle);
 CPPUNIT_TEST(testParaAutostyleCharProps);
 CPPUNIT_TEST(testMeta);
+CPPUNIT_TEST(testParaNamedstyle);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -215,6 +217,16 @@ void EPUBExportTest::testMeta()
 assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/dc:title", 
"Title");
 }
 
+void EPUBExportTest::testParaNamedstyle()
+{
+createDoc("para-namedstyle.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+assertXPath(mpXmlDoc, "//xhtml:p[1]", "class", "para0");
+// This failed, paragraph properties from style were not exported.
+assertXPath(mpXmlDoc, "//xhtml:p[2]", "class", "para1");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/para-namedstyle.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/para-namedstyle.fodt
new file mode 100644
index ..887a5c1b2e8c
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/para-namedstyle.fodt
@@ -0,0 +1,18 @@
+
+
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  Heading
+  Text Body
+
+  
+
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 293fb10eb3d3..b812549c69b3 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -156,13 +156,23 @@ void XMLParaContext::startElement(const OUString 
&/*rName*/, const css::uno::Ref
 
 // Reference to an automatic style, try to look it up.
 auto itStyle = 
mrImport.GetAutomaticParagraphStyles().find(m_aStyleName);
-if (itStyle == mrImport.GetAutomaticParagraphStyles().end())
+if (itStyle != mrImport.GetAutomaticParagraphStyles().end())
+{
+// Found an automatic paragraph style.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+aPropertyList.insert(itProp.key(), itProp()->clone());
 continue;
-
-// Found an automatic paragraph style.
-librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
-for (itProp.rewind(); itProp.next();)
-aPropertyList.insert(itProp.key(), itProp()->clone());
+}
+
+itStyle = mrImport.GetParagraphStyles().find(m_aStyleName);
+if (itStyle != mrImport.GetParagraphStyles().end())
+{
+// Found a paragraph style.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+aPropertyList.insert(itProp.key(), itProp()->clone());
+}
 }
 else
 {
diff --git a/writerperfect/source/writer/exp/txtstyli.cxx 
b/writerperfect/source/writer/exp/txtstyli.cxx
index 49c2ccd45aeb..a3e8395d4b43 100644
--- a/writerperfect/source/writer/exp/txtstyli.cxx
+++ b/writerperfect/source/writer/exp/txtstyli.cxx
@@ -9,6 +9,7 @@
 
 #include "txtstyli.hxx"
 
+#include "xmlfmt.hxx"
 #include "xmlimp.hxx"
 
 using namespace com::sun::star;
@@ -74,8 +75,9 @@ void XMLTextPropertiesContext::st

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-08-30 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx|  
 12 +++
 writerperfect/qa/unit/data/writer/epubexport/para-autostyle-char-props.fodt |  
 21 ++
 writerperfect/source/writer/exp/txtparai.cxx|  
 33 +++---
 writerperfect/source/writer/exp/txtparai.hxx|  
  3 
 writerperfect/source/writer/exp/txtstyli.cxx|  
 23 --
 writerperfect/source/writer/exp/txtstyli.hxx|  
  7 +-
 writerperfect/source/writer/exp/xmlimp.cxx  |  
  9 ++
 writerperfect/source/writer/exp/xmlimp.hxx  |  
  6 +
 8 files changed, 93 insertions(+), 21 deletions(-)

New commits:
commit dfdc113bbd852e8f4b4863db457e2938aaad0c64
Author: Miklos Vajna 
Date:   Tue Aug 29 17:56:28 2017 +0200

EPUB export: support char props on text outside a span

The librevenge model is simpler: text is always in a span, and paragraph
(automatic) styles don't contain char props, either. So handle this
complexity on our side.

Change-Id: I017222539d8981d2bbbc632258662444bf3a79c8
Reviewed-on: https://gerrit.libreoffice.org/41705
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 857f6ec85df3..fef1cf19770c 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -52,6 +52,7 @@ public:
 void testEPUB2();
 void testPageBreakSplit();
 void testSpanAutostyle();
+void testParaAutostyleCharProps();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
@@ -59,6 +60,7 @@ public:
 CPPUNIT_TEST(testEPUB2);
 CPPUNIT_TEST(testPageBreakSplit);
 CPPUNIT_TEST(testSpanAutostyle);
+CPPUNIT_TEST(testParaAutostyleCharProps);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -190,6 +192,16 @@ void EPUBExportTest::testSpanAutostyle()
 assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[3]", "class", "span2");
 }
 
+void EPUBExportTest::testParaAutostyleCharProps()
+{
+createDoc("para-autostyle-char-props.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+// This failed, para-level char props were not exported.
+assertXPath(mpXmlDoc, "//xhtml:p[1]/xhtml:span", "class", "span0");
+assertXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "class", "span1");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git 
a/writerperfect/qa/unit/data/writer/epubexport/para-autostyle-char-props.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/para-autostyle-char-props.fodt
new file mode 100644
index ..ceb556940b8f
--- /dev/null
+++ 
b/writerperfect/qa/unit/data/writer/epubexport/para-autostyle-char-props.fodt
@@ -0,0 +1,21 @@
+
+
+  
+
+
+  
+  
+
+  
+
+
+  
+
+  
+  
+
+  This is serif.
+  This is sans.
+
+  
+
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 50ff36352ad5..293fb10eb3d3 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -53,9 +53,9 @@ void XMLSpanContext::startElement(const OUString &/*rName*/, 
const css::uno::Ref
 const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
 if (rAttributeName == "text:style-name")
 {
-// Reference to an automatic style, try to look it up.
-auto itStyle = mrImport.GetAutomaticStyles().find(rAttributeValue);
-if (itStyle == mrImport.GetAutomaticStyles().end())
+// Reference to an automatic text style, try to look it up.
+auto itStyle = 
mrImport.GetAutomaticTextStyles().find(rAttributeValue);
+if (itStyle == mrImport.GetAutomaticTextStyles().end())
 continue;
 
 // Apply properties directly, librevenge has no notion of 
automatic styles.
@@ -152,15 +152,17 @@ void XMLParaContext::startElement(const OUString 
&/*rName*/, const css::uno::Ref
 const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
 if (rAttributeName == "text:style-name")
 {
+m_aStyleName = rAttributeValue;
+
 // Reference to an automatic style, try to look it up.
-auto itStyle = mrImport.GetAutomaticStyles().find(rAttributeValue);
-if (itStyle == mrImport.GetAutomaticStyles().end())
+auto itStyle = 
mrImport.GetAutomaticParagraphStyles().find(m_aStyleName);
+if (itStyle == mrImport.GetAutomaticParagraphStyles().end())
 continue;
 
-// Apply properties directly, librevenge has no notion of 
automatic styles.
+// Found an automatic paragraph style.
 librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
  

[Libreoffice-commits] core.git: writerperfect/qa writerperfect/source

2017-08-29 Thread Miklos Vajna
 writerperfect/qa/unit/EPUBExportTest.cxx |   15 +
 writerperfect/qa/unit/data/writer/epubexport/span-autostyle.fodt |   19 ++
 writerperfect/source/writer/exp/txtparai.cxx |   29 
+
 writerperfect/source/writer/exp/txtstyli.cxx |   30 
++
 4 files changed, 91 insertions(+), 2 deletions(-)

New commits:
commit 2a55916a929524fd4f9e72bb1d7968d73ddc25f4
Author: Miklos Vajna 
Date:   Tue Aug 29 13:39:23 2017 +0200

EPUB export: initial character properties as direct formatting

Handle the case when the formatting comes from an autostyle on the text
span.

Change-Id: I12f9a752c4f2934a3e155a4442ad3db68a43d395
Reviewed-on: https://gerrit.libreoffice.org/41694
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index cf602956c631..857f6ec85df3 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -51,12 +51,14 @@ public:
 void testMimetype();
 void testEPUB2();
 void testPageBreakSplit();
+void testSpanAutostyle();
 
 CPPUNIT_TEST_SUITE(EPUBExportTest);
 CPPUNIT_TEST(testOutlineLevel);
 CPPUNIT_TEST(testMimetype);
 CPPUNIT_TEST(testEPUB2);
 CPPUNIT_TEST(testPageBreakSplit);
+CPPUNIT_TEST(testSpanAutostyle);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -85,6 +87,7 @@ void EPUBExportTest::tearDown()
 void EPUBExportTest::registerNamespaces(xmlXPathContextPtr &pXmlXpathCtx)
 {
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("opf"), 
BAD_CAST("http://www.idpf.org/2007/opf";));
+xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xhtml"), 
BAD_CAST("http://www.w3.org/1999/xhtml";));
 }
 
 void EPUBExportTest::createDoc(const OUString &rFile, const 
uno::Sequence &rFilterData)
@@ -175,6 +178,18 @@ void EPUBExportTest::testPageBreakSplit()
 CPPUNIT_ASSERT(!mxZipFile->hasByName("OEBPS/sections/section0003.xhtml"));
 }
 
+void EPUBExportTest::testSpanAutostyle()
+{
+createDoc("span-autostyle.fodt", {});
+
+mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[1]", "class", "span0");
+// This failed, it was still span1, i.e. the bold and the italic formatting
+// did not differ.
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[2]", "class", "span1");
+assertXPath(mpXmlDoc, "//xhtml:p/xhtml:span[3]", "class", "span2");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/span-autostyle.fodt 
b/writerperfect/qa/unit/data/writer/epubexport/span-autostyle.fodt
new file mode 100644
index ..3122bef8dc46
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/span-autostyle.fodt
@@ -0,0 +1,19 @@
+
+
+  
+
+  
+
+
+  
+
+
+  
+
+  
+  
+
+  Hello world!
+
+  
+
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index e669cf89edf8..50ff36352ad5 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -44,9 +44,34 @@ XMLImportContext *XMLSpanContext::CreateChildContext(const 
OUString &rName, cons
 return nullptr;
 }
 
-void XMLSpanContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &/*xAttribs*/)
+void XMLSpanContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &xAttribs)
 {
-mrImport.GetGenerator().openSpan(librevenge::RVNGPropertyList());
+librevenge::RVNGPropertyList aPropertyList;
+for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
+{
+const OUString &rAttributeName = xAttribs->getNameByIndex(i);
+const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+if (rAttributeName == "text:style-name")
+{
+// Reference to an automatic style, try to look it up.
+auto itStyle = mrImport.GetAutomaticStyles().find(rAttributeValue);
+if (itStyle == mrImport.GetAutomaticStyles().end())
+continue;
+
+// Apply properties directly, librevenge has no notion of 
automatic styles.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+aPropertyList.insert(itProp.key(), itProp()->clone());
+}
+else
+{
+OString sName = OUStringToOString(rAttributeName, 
RTL_TEXTENCODING_UTF8);
+OString sValue = OUStringToOString(rAttributeValue, 
RTL_TEXTENCODING_UTF8);
+aPropertyList.insert(sName.getStr(), sValue.getStr());
+}
+}
+
+mrImport.GetGenerator().openSpan(aPropertyList);
 }
 
 void XMLSpanContext::endElement(const OUString &/*rName*/)
diff --git a/writerperfect/source/writer/exp/txtstyli.cxx 
b/writerperfect/source/writ

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

2017-05-02 Thread David Tardon
 writerperfect/qa/unit/WpftImpressFilterTest.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9daa6e293d24694cb6102a15f228a6c008acf79d
Author: David Tardon 
Date:   Tue May 2 23:07:45 2017 +0200

fix file name

Change-Id: I43f4f0281d83c402fb7ced9fe0b01ef8a59d7aa5

diff --git a/writerperfect/qa/unit/WpftImpressFilterTest.cxx 
b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
index ebcc1f1d2d1d..2da1195d30c5 100644
--- a/writerperfect/qa/unit/WpftImpressFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
@@ -43,7 +43,7 @@ void WpftImpressFilterTest::test()
 {"PowerPoint_Mac_1", REQUIRE_MWAW_VERSION(0, 3, 9)},
 {"PowerPoint_Mac_2", REQUIRE_MWAW_VERSION(0, 3, 9)},
 {"PowerPoint_Mac_3", REQUIRE_MWAW_VERSION(0, 3, 9)},
-{"PowerPoint_Mac_4", REQUIRE_MWAW_VERSION(0, 3, 10)},
+{"PowerPoint_Mac_4.ppt", REQUIRE_MWAW_VERSION(0, 3, 10)},
 {"PowerPoint_2.ppt", REQUIRE_MWAW_VERSION(0, 3, 10)},
 {"PowerPoint_3.ppt", REQUIRE_MWAW_VERSION(0, 3, 9)},
 {"PowerPoint_4.ppt", REQUIRE_MWAW_VERSION(0, 3, 10)},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-21 Thread David Tardon
 writerperfect/qa/unit/SpreadsheetImportTest.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 01946cc7ae7f10e84a2c0eebeb44ee847e6d95b4
Author: David Tardon 
Date:   Tue Mar 21 10:18:52 2017 +0100

fix and enable test

Change-Id: I309b74c19ea076157d1c0b9c0c817ab4055512c3

diff --git a/writerperfect/qa/unit/SpreadsheetImportTest.cxx 
b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
index db787029019c..379f57ae1fd5 100644
--- a/writerperfect/qa/unit/SpreadsheetImportTest.cxx
+++ b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
@@ -84,9 +84,11 @@ void 
SpreadsheetImportFilter::generate(librevenge::RVNGSpreadsheetInterface &rDo
 rDocument.openSheet(RVNGPropertyList());
 rDocument.openSheetRow(RVNGPropertyList());
 rDocument.openSheetCell(RVNGPropertyList());
+rDocument.openParagraph(RVNGPropertyList());
 rDocument.openSpan(RVNGPropertyList());
 rDocument.insertText("My hovercraft is full of eels.");
 rDocument.closeSpan();
+rDocument.closeParagraph();
 rDocument.closeSheetCell();
 rDocument.closeSheetRow();
 rDocument.closeSheet();
@@ -124,10 +126,8 @@ void SpreadsheetImportTest::test()
 CPPUNIT_ASSERT(xSheet.is());
 uno::Reference xCell = xSheet->getCellByPosition(0, 0);
 CPPUNIT_ASSERT(xCell.is());
-#if 0 // broken by commit 8154953add163554c00935486a1cf5677cef2609
 CPPUNIT_ASSERT_EQUAL(table::CellContentType_TEXT, xCell->getType());
-CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels"), 
xCell->getFormula());
-#endif
+CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels."), 
xCell->getFormula());
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SpreadsheetImportTest);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-13 Thread Markus Mohrhard
 writerperfect/qa/unit/wpftimport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4f4edde01364881be483eca9449a32a14093250f
Author: Markus Mohrhard 
Date:   Tue Feb 14 01:25:47 2017 +0100

more windows build fixes

Change-Id: I57b361dea1ee6a5bfdc95ec3632bb42a5941b900
Reviewed-on: https://gerrit.libreoffice.org/34232
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/writerperfect/qa/unit/wpftimport.cxx 
b/writerperfect/qa/unit/wpftimport.cxx
index 27b566c..427cb2c 100644
--- a/writerperfect/qa/unit/wpftimport.cxx
+++ b/writerperfect/qa/unit/wpftimport.cxx
@@ -19,7 +19,7 @@
 
 css::uno::Reference createDummyInput()
 {
-rtl::Reference xDummyInput{new 
comphelper::SequenceInputStream({})};
+rtl::Reference xDummyInput(new 
comphelper::SequenceInputStream(css::uno::Sequence()));
 return xDummyInput.get();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-13 Thread Markus Mohrhard
 writerperfect/qa/unit/TextImportTest.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 33dbfed46d95720c26699e0289ecacd87cd6e0a7
Author: Markus Mohrhard 
Date:   Tue Feb 14 01:21:16 2017 +0100

more build fixes, loplugin:staticmethods

Change-Id: I710182dfe2082b9782076faa27c8bd78e899a7cb

diff --git a/writerperfect/qa/unit/TextImportTest.cxx 
b/writerperfect/qa/unit/TextImportTest.cxx
index 2cb16b6..ba464c6 100644
--- a/writerperfect/qa/unit/TextImportTest.cxx
+++ b/writerperfect/qa/unit/TextImportTest.cxx
@@ -43,12 +43,12 @@ private:
 virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, 
rtl::OUString &rTypeName) override;
 virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, 
OdtGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) override;
 
-void generate(librevenge::RVNGTextInterface &rDocument) const;
+static void generate(librevenge::RVNGTextInterface &rDocument);
 };
 
 bool TextImportFilter::doImportDocument(librevenge::RVNGInputStream &, 
OdtGenerator &rGenerator, utl::MediaDescriptor &)
 {
-generate(rGenerator);
+TextImportFilter::generate(rGenerator);
 return true;
 }
 
@@ -74,7 +74,7 @@ uno::Sequence< rtl::OUString > SAL_CALL 
TextImportFilter::getSupportedServiceNam
 return {"com.sun.star.document.ImportFilter", 
"com.sun.star.document.ExtendedTypeDetection"};
 }
 
-void TextImportFilter::generate(librevenge::RVNGTextInterface &rDocument) const
+void TextImportFilter::generate(librevenge::RVNGTextInterface &rDocument)
 {
 using namespace librevenge;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-13 Thread Markus Mohrhard
 writerperfect/qa/unit/TextImportTest.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a4934eae26d5ec21e21fb6f0a85fd08ad9fd9f3
Author: Markus Mohrhard 
Date:   Tue Feb 14 01:09:34 2017 +0100

fix build

Change-Id: I7b27d5e5b47eb91cfe87918ae335cd228845be17

diff --git a/writerperfect/qa/unit/TextImportTest.cxx 
b/writerperfect/qa/unit/TextImportTest.cxx
index fdd17c1..2cb16b6 100644
--- a/writerperfect/qa/unit/TextImportTest.cxx
+++ b/writerperfect/qa/unit/TextImportTest.cxx
@@ -61,7 +61,7 @@ bool 
TextImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUStri
 // XServiceInfo
 rtl::OUString SAL_CALL TextImportFilter::getImplementationName()
 {
-return "org.libreoffice.comp.Wpft.QA.TextImportFilter";
+return OUString("org.libreoffice.comp.Wpft.QA.TextImportFilter");
 }
 
 sal_Bool SAL_CALL TextImportFilter::supportsService(const rtl::OUString 
&rServiceName)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/qa xmloff/qa

2017-01-06 Thread Miklos Vajna
 writerperfect/qa/unit/DirectoryStreamTest.cxx |2 +-
 writerperfect/qa/unit/WPXSvStreamTest.cxx |   24 
 xmloff/qa/unit/uxmloff.cxx|6 +++---
 3 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit ff8f5e6255ed7b627fb42ecd9ef18293218f
Author: Miklos Vajna 
Date:   Fri Jan 6 08:33:59 2017 +0100

writerperfect, xmloff: fix loplugin:cppunitassertequals warnings

Change-Id: Ie8246433a7cea0886f00d8c76cf6f7d023545417
Reviewed-on: https://gerrit.libreoffice.org/32770
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/qa/unit/DirectoryStreamTest.cxx 
b/writerperfect/qa/unit/DirectoryStreamTest.cxx
index 79646ed..0b347ac 100644
--- a/writerperfect/qa/unit/DirectoryStreamTest.cxx
+++ b/writerperfect/qa/unit/DirectoryStreamTest.cxx
@@ -139,7 +139,7 @@ void lcl_testDataOperations(RVNGInputStream &rStream)
 CPPUNIT_ASSERT_EQUAL(-1, rStream.seek(0, librevenge::RVNG_SEEK_CUR));
 
 unsigned long numBytesRead = 0;
-CPPUNIT_ASSERT(nullptr == rStream.read(1, numBytesRead));
+CPPUNIT_ASSERT(!rStream.read(1, numBytesRead));
 CPPUNIT_ASSERT_EQUAL(0UL, numBytesRead);
 }
 
diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx 
b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index 16d8ebc..70ff441 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -197,7 +197,7 @@ void WPXSvStreamTest::testSeekSet()
 CPPUNIT_ASSERT(!pInput->isEnd());
 
 CPPUNIT_ASSERT_EQUAL(0, pInput->seek(nLen, RVNG_SEEK_SET));
-CPPUNIT_ASSERT(nLen == pInput->tell());
+CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
 CPPUNIT_ASSERT(pInput->isEnd());
 
 // go back to the beginning
@@ -212,7 +212,7 @@ void WPXSvStreamTest::testSeekSet()
 CPPUNIT_ASSERT(!pInput->isEnd());
 
 CPPUNIT_ASSERT(0 != pInput->seek(nLen + 1, RVNG_SEEK_SET));
-CPPUNIT_ASSERT(nLen == pInput->tell());
+CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
 CPPUNIT_ASSERT(pInput->isEnd());
 }
 
@@ -249,7 +249,7 @@ void WPXSvStreamTest::testSeekCur()
 CPPUNIT_ASSERT(!pInput->isEnd());
 
 CPPUNIT_ASSERT(0 != pInput->seek(nLen + 1, RVNG_SEEK_CUR));
-CPPUNIT_ASSERT(nLen == pInput->tell());
+CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
 CPPUNIT_ASSERT(pInput->isEnd());
 }
 
@@ -264,11 +264,11 @@ void WPXSvStreamTest::testSeekEnd()
 
 // valid seeks
 CPPUNIT_ASSERT_EQUAL(0, pInput->seek(0, RVNG_SEEK_END));
-CPPUNIT_ASSERT(nLen == pInput->tell());
+CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
 CPPUNIT_ASSERT(pInput->isEnd());
 
 CPPUNIT_ASSERT_EQUAL(0, pInput->seek(-1, RVNG_SEEK_END));
-CPPUNIT_ASSERT((nLen - 1) == pInput->tell());
+CPPUNIT_ASSERT_EQUAL(pInput->tell(), (nLen - 1));
 CPPUNIT_ASSERT(!pInput->isEnd());
 
 CPPUNIT_ASSERT_EQUAL(0, pInput->seek(-nLen, RVNG_SEEK_END));
@@ -281,7 +281,7 @@ void WPXSvStreamTest::testSeekEnd()
 
 // invalid seeks
 CPPUNIT_ASSERT(0 != pInput->seek(1, RVNG_SEEK_END));
-CPPUNIT_ASSERT(nLen == pInput->tell());
+CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
 CPPUNIT_ASSERT(pInput->isEnd());
 
 CPPUNIT_ASSERT(0 != pInput->seek(-nLen - 1, RVNG_SEEK_END));
@@ -297,7 +297,7 @@ void WPXSvStreamTest::testStructured()
 assert(bool(pInput));
 
 CPPUNIT_ASSERT(pInput->isStructured());
-CPPUNIT_ASSERT(2 == pInput->subStreamCount());
+CPPUNIT_ASSERT_EQUAL(static_cast(2), 
pInput->subStreamCount());
 lcl_testSubStreams(pInput);
 
 // check for existing substream
@@ -318,7 +318,7 @@ void WPXSvStreamTest::testStructured()
 assert(bool(pInput));
 
 CPPUNIT_ASSERT(pInput->isStructured());
-CPPUNIT_ASSERT(9 == pInput->subStreamCount());
+CPPUNIT_ASSERT_EQUAL(static_cast(9), 
pInput->subStreamCount());
 lcl_testSubStreams(pInput);
 
 // check for existing substream
@@ -338,11 +338,11 @@ void WPXSvStreamTest::testStructured()
 const shared_ptr pInput(lcl_createStream());
 
 CPPUNIT_ASSERT(!pInput->isStructured());
-CPPUNIT_ASSERT(0 == pInput->subStreamCount());
+CPPUNIT_ASSERT_EQUAL(static_cast(0), 
pInput->subStreamCount());
 CPPUNIT_ASSERT(!pInput->existsSubStream("foo"));
-CPPUNIT_ASSERT(nullptr == pInput->getSubStreamByName("foo"));
-CPPUNIT_ASSERT(nullptr == pInput->getSubStreamById(42));
-CPPUNIT_ASSERT(nullptr == pInput->subStreamName(42));
+CPPUNIT_ASSERT(!pInput->getSubStreamByName("foo"));
+CPPUNIT_ASSERT(!pInput->getSubStreamById(42));
+CPPUNIT_ASSERT(!pInput->subStreamName(42));
 }
 }
 
diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx
index 7fc606e..baae178 100644
--- a/xmloff/qa/unit/uxmloff.cxx
+++ b/xmloff/qa/unit/uxmloff.cxx
@@ -78,13 +78,13 @@ void Test::testAutoStylePool()
 // not that interesting but worth checking
 bool bHack = (getenv("LIBO_ONEWAY_STAB

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

2016-06-23 Thread David Tardon
 writerperfect/qa/unit/WpftDrawFilterTest.cxx|1 +
 writerperfect/qa/unit/data/draw/libzmf/pass/ZonerDraw_5.zmf |binary
 2 files changed, 1 insertion(+)

New commits:
commit b3b09e461c84a910acb61060647cc476e8f6bae8
Author: David Tardon 
Date:   Thu Jun 23 10:22:18 2016 +0200

add integration test for libzmf

Change-Id: Ic56be82cfc2b2439a4f0e60797796e4583f93554

diff --git a/writerperfect/qa/unit/WpftDrawFilterTest.cxx 
b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
index 56eebec..9dee300 100644
--- a/writerperfect/qa/unit/WpftDrawFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
@@ -50,6 +50,7 @@ void WpftDrawFilterTest::test()
 doTest("com.sun.star.comp.Draw.VisioImportFilter", 
"/writerperfect/qa/unit/data/draw/libvisio/");
 doTest("com.sun.star.comp.Draw.WPGImportFilter", 
"/writerperfect/qa/unit/data/draw/libwpg/");
 doTest("org.libreoffice.comp.Draw.PageMakerImportFilter", 
"/writerperfect/qa/unit/data/draw/libpagemaker/");
+doTest("org.libreoffice.comp.Draw.ZMFImportFilter", 
"/writerperfect/qa/unit/data/draw/libzmf/");
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(WpftDrawFilterTest);
diff --git a/writerperfect/qa/unit/data/draw/libzmf/fail/.gitignore 
b/writerperfect/qa/unit/data/draw/libzmf/fail/.gitignore
new file mode 100644
index 000..e69de29
diff --git a/writerperfect/qa/unit/data/draw/libzmf/indeterminate/.gitignore 
b/writerperfect/qa/unit/data/draw/libzmf/indeterminate/.gitignore
new file mode 100644
index 000..e69de29
diff --git a/writerperfect/qa/unit/data/draw/libzmf/pass/ZonerDraw_5.zmf 
b/writerperfect/qa/unit/data/draw/libzmf/pass/ZonerDraw_5.zmf
new file mode 100644
index 000..fa2a96a
Binary files /dev/null and 
b/writerperfect/qa/unit/data/draw/libzmf/pass/ZonerDraw_5.zmf differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-20 Thread David Tardon
 writerperfect/qa/unit/WPXSvStreamTest.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 4df0412e3afe2e243adf9a32c94267be9ca4721b
Author: David Tardon 
Date:   Sun Sep 20 10:56:04 2015 +0200

remove copypasta

Change-Id: I926abe30b039a1cfde3f09e2694b22a094304751

diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx 
b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index 897fb75..3723d48 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -328,7 +328,6 @@ void WPXSvStreamTest::testStructured()
 CPPUNIT_ASSERT(!pSubStream->isEnd());
 
 // check for not existing substream
-CPPUNIT_ASSERT(pInput->existsSubStream("content.xml"));
 CPPUNIT_ASSERT(!pInput->existsSubStream("foo"));
 pSubStream.reset(pInput->getSubStreamByName("foo"));
 CPPUNIT_ASSERT(!pSubStream);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-28 Thread Caolán McNamara
 writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1759-1.wpd |binary
 1 file changed

New commits:
commit be35344b6bf0b9bfc945b7e8b023b09d7db6f046
Author: Caolán McNamara 
Date:   Fri Aug 28 16:12:26 2015 +0100

add CVE-2015-1759 test case

Change-Id: Ifc3a347f66ab5bdb15a5fcd7ca91fae2df2dfa66

diff --git a/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1759-1.wpd 
b/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1759-1.wpd
new file mode 100644
index 000..9ff9a08
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1759-1.wpd differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-28 Thread Caolán McNamara
 writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-1.wpd |binary
 writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-2.wpd |binary
 2 files changed

New commits:
commit 5be676d052fe7fc2774df2148eb6f2824ad6aa1f
Author: Caolán McNamara 
Date:   Fri Aug 28 16:09:05 2015 +0100

add CVE-2015-1760 test cases

Change-Id: I85b4376b213ce8ab2880d41b5df2e6e003e3ca4d

diff --git a/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-1.wpd 
b/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-1.wpd
new file mode 100644
index 000..23c8aa3
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-1.wpd differ
diff --git a/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-2.wpd 
b/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-2.wpd
new file mode 100644
index 000..cca30a0
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/libwpd/pass/CVE-2015-1760-2.wpd differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-07 Thread Caolán McNamara
 writerperfect/qa/unit/data/draw/libmspub/pass/EDB-29664-1.pub |binary
 1 file changed

New commits:
commit 345e148b8b19c36a57e821b3e95ebe94afacd339
Author: Caolán McNamara 
Date:   Thu Aug 7 21:21:19 2014 +0100

add test-case for EDB-29664

Change-Id: Ib57c7846523f7b8b3b08d19355e10a47c778a524

diff --git a/writerperfect/qa/unit/data/draw/libmspub/pass/EDB-29664-1.pub 
b/writerperfect/qa/unit/data/draw/libmspub/pass/EDB-29664-1.pub
new file mode 100644
index 000..18287fc
Binary files /dev/null and 
b/writerperfect/qa/unit/data/draw/libmspub/pass/EDB-29664-1.pub differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-07 Thread Caolán McNamara
 writerperfect/qa/unit/data/writer/libwpd/pass/EDB-14344-1.wpd |binary
 1 file changed

New commits:
commit fb0fdaaaeb4ebb6b8debbfe9c95ec8e25824edbf
Author: Caolán McNamara 
Date:   Thu Aug 7 20:49:25 2014 +0100

add EDB-14344 testcase

Change-Id: Ia4c6486d2d54103951765ce3e273dece6f022372

diff --git a/writerperfect/qa/unit/data/writer/libwpd/pass/EDB-14344-1.wpd 
b/writerperfect/qa/unit/data/writer/libwpd/pass/EDB-14344-1.wpd
new file mode 100644
index 000..8d2e51d
Binary files /dev/null and 
b/writerperfect/qa/unit/data/writer/libwpd/pass/EDB-14344-1.wpd differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-05 Thread David Tardon
 writerperfect/qa/unit/data/writer/libmwaw/pass/TexEdit_2.0.hqx  |   14 
++
 writerperfect/qa/unit/data/writer/libmwaw/pass/TextEdit_2.0.hqx |   14 
--
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 31d1d684e7d92b45eb896ce974b7b18d435ff955
Author: David Tardon 
Date:   Thu Jun 5 14:12:06 2014 +0200

fix typo in test file name

Change-Id: I12bfa086577fcb56cabffcca2eda675d02791fde

diff --git a/writerperfect/qa/unit/data/writer/libmwaw/pass/TextEdit_2.0.hqx 
b/writerperfect/qa/unit/data/writer/libmwaw/pass/TexEdit_2.0.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/writer/libmwaw/pass/TextEdit_2.0.hqx
rename to writerperfect/qa/unit/data/writer/libmwaw/pass/TexEdit_2.0.hqx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-05 Thread David Tardon
 writerperfect/qa/unit/data/writer/libmwaw/pass/Acta_1.0.hqx |   24 
+
 writerperfect/qa/unit/data/writer/libmwaw/pass/LightWayText_4.0.hqx |   16 +++
 writerperfect/qa/unit/data/writer/libmwaw/pass/MacDoc_1.0.hqx   |   41 
++
 writerperfect/qa/unit/data/writer/libmwaw/pass/SimpleText_1.0.hqx   |   11 ++
 writerperfect/qa/unit/data/writer/libmwaw/pass/TextEdit_2.0.hqx |   14 +++
 writerperfect/qa/unit/data/writer/libmwaw/pass/eDoc_2.0.hqx |   29 
+++
 6 files changed, 135 insertions(+)

New commits:
commit 028bd3f5f59897af4553dc3ee73c431569b51a0d
Author: David Tardon 
Date:   Thu Jun 5 10:17:35 2014 +0200

add more test documents for libmwaw

Change-Id: Id31953720634cbfd838869ac2470b088da09caae

diff --git a/writerperfect/qa/unit/data/writer/libmwaw/pass/Acta_1.0.hqx 
b/writerperfect/qa/unit/data/writer/libmwaw/pass/Acta_1.0.hqx
new file mode 100644
index 000..af338e6
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/libmwaw/pass/Acta_1.0.hqx
@@ -0,0 +1,24 @@
+(This file must be converted with BinHex 4.0)
+:#R4PH(3a,Q&MG'%!Eh4XEN&$9%%!N!3#V3!!!SZ@J`!$!!%!!3!!!"!-!*!
+*%@%JFfeKE'`J3@0dB5"QD@aP&J!"!*!&$J!+!"!-!*!*"J#3"`%!!3!
+!!"!!!3!-!*!*&@*[E'3JDA4KE'PM)(9ZC'9bE'PZC3!!!'B!"3#3"3i!#J!3!3!
+!$!#3#33!$J!+!"!-!*!*"3!1!!S!%!)!!!`!N!N,!!i!#J!3$!#3#3`
+!$J!+!"!%!!!-!*!*"J#3"`%!!3!!!"!5!*!*%c%i)("[D@jdFb!a-L"`EfP
+ZG(-U!!)!N!88!!m!%")!N!N+!!i!#J!3$!#3#3B!N!F"!!%
+@$!%!N!823fpeFQPPFL"$D'PMB@G[+J!#!*!&$!!+!"B-!*!
+*#!!3!!`!N!8-!*!*"J#3"`)!!3%!N!B-!*!*"f&Z)'PdC@d@!!%!N!83!!`
+!N!8-!*!*"J#3#3%F&!!%TD@Pe`!!R!"!J1j)!'PG1!!!S#-!BK&)!'*V!%#!!*!
+&'A6@!!%!D3!!!(@*k!"eF%3!"kSf!*!'(X`!#!#-!'N!N!N#!'*Z`!"LEaJ!D8R
+U!!(qNJ!!!'*V(V`!!"l-!!Kqd!!)!'P'VJ"T4VB!D8Dq!"YB'!#3"4YB'!#
+3#@P+6J!"rMJ!#!!%BJ#3$Zd"!!"16&42$5X!!!%"e3!!!08!!!#f!!!
+!!JCdCA0dE(ID!J!#!&4&@&4-9e4&!3!!R!#+G'9iG$%ZB@0dB3!#!!)!Eh4
+XEN&$9%%!N!J#!'pdE'j"3e4"!*!Bcl8aRJ#3"J+,!*!%%3#3"!),G'9cG%aA4h*
+KF'J#!!)!9%9B9%aA9%8"!!(!!F!!N!3#G!#3"!'m!!!)!*!&!e3!!!J!cP8Urmj
+9+a)!N"B$k3!"!*!)!qd!!3#3$!`!N!3#!J#3"3)8("3!%!!-!*!(%!!
+-!*!0"35PTDAAH!!25!")!*!%![!#32rarqi$#3*5B`)&+!2m!3&
+S!@J!N!31X!Y!!!%"!!"N!!%"!!)"*`m!!3#3$K!!N!N3!2qerkB2,3Z
+D!!J"!*!0'3%)!$B!%J'U!FSB!3#!!*!%%%&MG'%J3faKFh0TBb!a,M!
+!!!%"e3!!!08!!!#f!'*[9"S8(!#f!!C-38*-1P&28&3!!!"'88K
+%8J!!!&*69&)J!!%!AP"6493!!!"f9e0*@J!!!)*fCA*cMJ!!rrm!N!9LD`!
+!!2rr"J"LEaJ!!2rr$!"LDX!!!2rr*!"LDLJ!!Irr+!"LDKJ
+!!2rr-3"LDI`!!2rrV3"LDM3!![rr)!!!Z3"LDL4LL!:
diff --git 
a/writerperfect/qa/unit/data/writer/libmwaw/pass/LightWayText_4.0.hqx 
b/writerperfect/qa/unit/data/writer/libmwaw/pass/LightWayText_4.0.hqx
new file mode 100644
index 000..a1b9c1e
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/libmwaw/pass/LightWayText_4.0.hqx
@@ -0,0 +1,16 @@
+(This file must be converted with BinHex 4.0)
+:#(4PH(3d,Qah!&4&@&4-9e4&!*!&i`!!!XMFSd%JFfeKE'`J6'PRD(4ABANJ9'9
+iG#!d,M80BQpXC#"TG'&XD@-JG@jNCA*XD@jP$6%i)("[D@jdFb`J-6)JF'pTER4
+c$80SD@0KCfmX)%0[GA*TCA)0$5m[)#!YN#S0,bmJ)&4SDA-JC'pMG@ePER3JGf&
+c)'eKC'8JGfPdD#"-D@GSG&GKH94PH(3Z$5m[)#!YN#S0MTi!!!%#EJ!!!@i
+!!!"D!!!S[3C'D@jNCA)!N"8)G'9iG$3ZE(F!!J!!!&4&@&4-9e4&!*!-9%9B9%a
+A9%8!N"M2Y6K"i`!!!XJ!N!`'e58S[3Y0FeG[FQYc8(*PCJ#3&i`P!!!
+!+,d26h"dD@pZFb"N*d9iBf9X!*!5"XdP+,d,8(*PCQ9bC@jMCA-!N"(b!!`
+!N!8,!!N!"!N!N!ND!!X!#3!%!3!!#3#3#4i!#`!*!!3*!*!*(`!,!!N
+!"!)!!!N!N!NP!!X!#3!%#3#3#5B!#`!*!!3%!!!*!*!*,`!,!!N!"!N
+!N!N`!"J!%J!%%J#3#6X!%!!-!!3-!*!*43!3!!`!N!8-!*!*6J!-!!S
+!&J`!N!P@!!`!#J!$#GeV#-)'SJ!!!%J!$%GPEQ9fB3#3'`3!"!!q!!-
+"h!*m!$i!!`(F!N(2Y6K0'3!!!"N!N!NS!*!'!3%!!3-B!Q3!)J!L![B#3J#
+3"!-B!Q3!!3-!!`$5!!!"!Qi!!!&Z@J!Hr83D&"`!@J!#Fh4
+jE"T08&05*NaA8e)b!)$rr`#3#!2Yrrm!!!$f!*!%!qMrr`!!!8)
+!N!65SJ:
diff --git a/writerperfect/qa/unit/data/writer/libmwaw/pass/MacDoc_1.0.hqx 
b/writerperfect/qa/unit/data/writer/libmwaw/pass/MacDoc_1.0.hqx
new file mode 100644
index 000..b60c596
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/libmwaw/pass/MacDoc_1.0.hqx
@@ -0,0 +1,41 @@
+(This file must be converted with BinHex 4.0)
+:#R4PH(3a,QeNEf-!684NBde%GR)!N!J(r$Q"!*!%!3H#!!!'JJ!!!(TKG'0
+[68*-6Im!N"F+G'9iG$%ZE@4[B`!#684NBde%GR)!N!T04'4M684fFJ#3'-q
+e0)3!N!B(r!#3$6BP!@&dBfp8B@*Xr`#3(K)P!@&dBfpA8d98r`#3(UmP!@&dBfp
+PC(4dr`#3'%!"-)!#!!!'GM%Z-bi`-M%Z-b`JU6%j16FJE@&MEQ9dD@-JFfpQG(G
+KFQ8Z)%&XE#"5D@GSG(-J8Q9cCA*fC@3Z,!%`J!)!!!Cf-5ic,M!H3h*PBA4
+PC#"hDA4S)(4SC5"0B@0%Ef-J9h*TG'9br[e8D'Pc)'4[Bh9YC@jd)(GKFb"
+MFQ9KG'9N)(GTG'JJG'KP)%eKBd4[Bb"AFQPdCA)JB@jN)'0KEL"LC5"bC@&N)'&
+ZC#"`FQPZG'9N)(GTG'JJG'KP)%eKBd4[Bb"@D@9hCA)Z$3e'Eh)JCR9bG'KPFL"
+TEQC[FQeKG'P[EL"KBQpeG#"0B@0%Ef-X)("XC@&cC5"fDA0TG#"[GA)JGf9L)(0
+TG'8k)(GhGbjYB@0ZCA4TBbjNC5"[FL"MEfjdB@0d1L!0$8PZG'9bEQ9d1L"TEQC
+[3'eKBfjPG'PM,Q4P$80[EA"e8f9bGQ8k)'eKBfjPG'PMAh0[CR4hBA*P!!!%N!3
+!N!3$'!*N!"%#r``!rri!!!")5!#3"J-B!Q3!N!8b!$Z!!J",Iri!-J!lJ!)
+!5Arq!

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

2014-06-04 Thread David Tardon
 writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_1.0.hqx   |   
44 
 writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_2.0.hqx   |  
104 ++
 writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_P_1.0.hqx |   
98 +
 writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_1.0.hqx|   
44 
 writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_2.0.hqx|  
104 --
 writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_P_1.0.hqx  |   
98 -
 6 files changed, 246 insertions(+), 246 deletions(-)

New commits:
commit 19fd43a0d96928f6c9219ada4cb43a5a74f4e81d
Author: David Tardon 
Date:   Wed Jun 4 20:46:24 2014 +0200

and of course, GreatWorks test files fail to load on Windows

Change-Id: Ic102312af8b3c3218c79b7de9f57126ab4606176

diff --git a/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/.gitignore 
b/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/.gitignore
deleted file mode 100644
index e69de29..000
diff --git a/writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_1.0.hqx 
b/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_1.0.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_1.0.hqx
rename to 
writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_1.0.hqx
diff --git a/writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_2.0.hqx 
b/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_2.0.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_2.0.hqx
rename to 
writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_2.0.hqx
diff --git a/writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_P_1.0.hqx 
b/writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_P_1.0.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/draw/libmwaw/pass/GreatWorks_P_1.0.hqx
rename to 
writerperfect/qa/unit/data/draw/libmwaw/indeterminate/GreatWorks_P_1.0.hqx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-04 Thread David Tardon
 writerperfect/qa/unit/WpftImportTestBase.cxx |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 4df5e1b959fb9e9b2258657f6c7784b04e6c3c6f
Author: David Tardon 
Date:   Wed Jun 4 19:07:31 2014 +0200

pass UCBContent to the filters too

Change-Id: I75e4b3226d47ba9cc19e8c6b0e38938e4d7ceb17

diff --git a/writerperfect/qa/unit/WpftImportTestBase.cxx 
b/writerperfect/qa/unit/WpftImportTestBase.cxx
index 4a05d05..de82980 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.cxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.cxx
@@ -21,9 +21,11 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
+#include 
+
 #include "WpftImportTestBase.hxx"
 
 namespace beans = com::sun::star::beans;
@@ -46,7 +48,6 @@ WpftImportTestBase::WpftImportTestBase(const rtl::OUString 
&rFactoryURL)
 , ::test::BootstrapFixture()
 , m_aFactoryURL(rFactoryURL)
 , m_xDesktop()
-, m_xFileAccess()
 , m_xFilter()
 , m_xTypeMap()
 {
@@ -57,7 +58,6 @@ void WpftImportTestBase::setUp()
 ::test::BootstrapFixture::setUp();
 
 m_xDesktop = frame::theDesktop::get(m_xContext);
-m_xFileAccess = ucb::SimpleFileAccess::create(m_xContext);
 
 const uno::Reference xTypeDetection(
 
m_xFactory->createInstanceWithContext("com.sun.star.document.TypeDetection", 
m_xContext),
@@ -113,13 +113,15 @@ bool WpftImportTestBase::load(const OUString &, const 
OUString &rURL, const OUSt
 
 xImporter->setTargetDocument(xDoc);
 
-uno::Sequence aDescriptor(2);
+uno::Sequence aDescriptor(3);
+ucbhelper::Content aContent(rURL, 
uno::Reference(), m_xContext);
+
 aDescriptor[0].Name = "URL";
 aDescriptor[0].Value <<= rURL;
-
-const uno::Reference 
xInputStream(m_xFileAccess->openFileRead(rURL), uno::UNO_QUERY_THROW);
 aDescriptor[1].Name = "InputStream";
-aDescriptor[1].Value <<= xInputStream;
+aDescriptor[1].Value <<= aContent.openStream();
+aDescriptor[2].Name = "UCBContent";
+aDescriptor[2].Value <<= aContent.get();
 
 const uno::Reference 
xDetector(m_xFilter, uno::UNO_QUERY_THROW);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-03 Thread David Tardon
 writerperfect/qa/unit/data/calc/libmwaw/indeterminate/GreatWorks_2.0.hqx |  
125 ++
 writerperfect/qa/unit/data/calc/libmwaw/pass/GreatWorks_2.0.hqx  |  
125 --
 2 files changed, 125 insertions(+), 125 deletions(-)

New commits:
commit d758fb4d34a6f524b05fca6342a8e6a80e99d9e9
Author: David Tardon 
Date:   Tue Jun 3 12:35:02 2014 +0200

and another one...

Change-Id: I24c146c7372bedf9a70b9739e44968f09b0ba77a

diff --git a/writerperfect/qa/unit/data/calc/libmwaw/pass/GreatWorks_2.0.hqx 
b/writerperfect/qa/unit/data/calc/libmwaw/indeterminate/GreatWorks_2.0.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/calc/libmwaw/pass/GreatWorks_2.0.hqx
rename to 
writerperfect/qa/unit/data/calc/libmwaw/indeterminate/GreatWorks_2.0.hqx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-03 Thread David Tardon
 writerperfect/qa/unit/data/calc/libmwaw/indeterminate/GreatWorks_1.0.hqx |   
61 ++
 writerperfect/qa/unit/data/calc/libmwaw/pass/GreatWorks_1.0.hqx  |   
61 --
 2 files changed, 61 insertions(+), 61 deletions(-)

New commits:
commit 1a6aae7ddd496121d9478d5004c465d0e3b45d38
Author: David Tardon 
Date:   Tue Jun 3 12:30:09 2014 +0200

yet another test file that fails to load on windows

Change-Id: I5e8b171e4603ce45ae8f31c6a3d7264f597d8898

diff --git a/writerperfect/qa/unit/data/calc/libmwaw/indeterminate/.gitignore 
b/writerperfect/qa/unit/data/calc/libmwaw/indeterminate/.gitignore
deleted file mode 100644
index e69de29..000
diff --git a/writerperfect/qa/unit/data/calc/libmwaw/pass/GreatWorks_1.0.hqx 
b/writerperfect/qa/unit/data/calc/libmwaw/indeterminate/GreatWorks_1.0.hqx
similarity index 100%
rename from writerperfect/qa/unit/data/calc/libmwaw/pass/GreatWorks_1.0.hqx
rename to 
writerperfect/qa/unit/data/calc/libmwaw/indeterminate/GreatWorks_1.0.hqx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-31 Thread David Tardon
 writerperfect/qa/unit/WpftImportTestBase.cxx |   48 +++
 1 file changed, 27 insertions(+), 21 deletions(-)

New commits:
commit c6821e66a66bd8fbb2c5a617e49783b7a4fc0724
Author: David Tardon 
Date:   Mon Mar 31 12:36:27 2014 +0200

speed up the import tests

Change-Id: If3f0198d58b6c64a4efd4be294f1d66fb39f2302

diff --git a/writerperfect/qa/unit/WpftImportTestBase.cxx 
b/writerperfect/qa/unit/WpftImportTestBase.cxx
index 773fa3b..4a05d05 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.cxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.cxx
@@ -80,6 +80,30 @@ bool WpftImportTestBase::load(const OUString &, const 
OUString &rURL, const OUSt
 m_xDesktop->loadComponentFromURL(m_aFactoryURL, "_blank", 0, 
uno::Sequence()),
 uno::UNO_QUERY_THROW);
 
+// Find the model and frame. We need them later.
+uno::Reference xFrame(xDoc, uno::UNO_QUERY);
+uno::Reference xModel(xDoc, uno::UNO_QUERY);
+uno::Reference xController(xDoc, uno::UNO_QUERY);
+
+if (xFrame.is())
+{
+xController = xFrame->getController();
+xModel = xController->getModel();
+}
+else if (xModel.is())
+{
+xController = xModel->getCurrentController();
+xFrame = xController->getFrame();
+}
+else if (xController.is())
+{
+xFrame = xController->getFrame();
+xModel = xController->getModel();
+}
+
+if (!xFrame.is() || !xModel.is())
+throw uno::RuntimeException();
+
 bool result = false;
 
 // try to import the document (and load it into the prepared frame)
@@ -105,7 +129,9 @@ bool WpftImportTestBase::load(const OUString &, const 
OUString &rURL, const OUSt
 
 impl_detectFilterName(aDescriptor, aTypeName);
 
+xModel->lockControllers();
 result = m_xFilter->filter(aDescriptor);
+xModel->unlockControllers();
 }
 catch (const uno::Exception &)
 {
@@ -113,29 +139,9 @@ bool WpftImportTestBase::load(const OUString &, const 
OUString &rURL, const OUSt
 }
 
 // close the opened document
-uno::Reference xCloseable(xDoc, uno::UNO_QUERY);
-
-if (!xCloseable.is())
-{
-uno::Reference xController(xDoc, uno::UNO_QUERY);
-
-if (!xController.is())
-{
-const uno::Reference xModel(xDoc, uno::UNO_QUERY);
-if (xModel.is())
-xController = xModel->getCurrentController();
-}
-
-if (xController.is())
-{
-const uno::Reference xFrame = 
xController->getFrame();
-if (xFrame.is())
-xCloseable.set(xFrame, uno::UNO_QUERY);
-}
-}
-
 try
 {
+uno::Reference xCloseable(xFrame, uno::UNO_QUERY);
 if (xCloseable.is())
 xCloseable->close(true);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-30 Thread Stephan Bergmann
 writerperfect/qa/unit/WpftImportTestBase.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 95f52db109094e2a3c8f305986867de253ca23fd
Author: Stephan Bergmann 
Date:   Sun Mar 30 22:08:42 2014 +0200

-Werror,-Wmismatched-tags

Change-Id: I5927d88bee642a047a5282eed2b7ff1327b58a27

diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx 
b/writerperfect/qa/unit/WpftImportTestBase.hxx
index 2024e8f..3aa50a0 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -20,7 +20,7 @@
 #include 
 
 namespace com { namespace sun { namespace star {
-namespace beans { class PropertyValue; }
+namespace beans { struct PropertyValue; }
 namespace container { class XNameAccess; }
 namespace document { class XFilter; }
 namespace frame { class XDesktop2; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-09 Thread Stephan Bergmann
 writerperfect/qa/unit/WPXSvStreamTest.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c42ac01b221292a4480037e145b0d5b11c4d412e
Author: Stephan Bergmann 
Date:   Fri Aug 9 09:27:14 2013 +0200

-Werror=sign-compare

Change-Id: Ibcf2ef9e81befbed56e174c9e33ad27e71c97cb1

diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx 
b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index 287d3fd..1dc6527 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -135,7 +135,7 @@ void WPXSvStreamTest::testRead()
 void WPXSvStreamTest::testSeekSet()
 {
 const shared_ptr pInput(lcl_createStream());
-const size_t nLen = sizeof aText;
+const long nLen = sizeof aText;
 
 // check initial state
 CPPUNIT_ASSERT_EQUAL(0L, pInput->tell());
@@ -173,7 +173,7 @@ void WPXSvStreamTest::testSeekSet()
 void WPXSvStreamTest::testSeekCur()
 {
 const shared_ptr pInput(lcl_createStream());
-const size_t nLen = sizeof aText;
+const long nLen = sizeof aText;
 
 // check initial state
 CPPUNIT_ASSERT(!pInput->atEOS());
@@ -210,7 +210,7 @@ void WPXSvStreamTest::testSeekCur()
 void WPXSvStreamTest::testSeekEnd()
 {
 const shared_ptr pInput(lcl_createStream());
-const size_t nLen = sizeof aText;
+const long nLen = sizeof aText;
 
 // check initial state
 CPPUNIT_ASSERT(!pInput->atEOS());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits