[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa

2017-02-13 Thread Michael Stahl
 sd/qa/unit/data/odg/ooo124143-1.odg |binary
 sd/qa/unit/import-tests.cxx |   49 
 sd/qa/unit/sdmodeltestbase.hxx  |4 ++
 3 files changed, 52 insertions(+), 1 deletion(-)

New commits:
commit c11b40c5eb32a8b3bb78621983d70d43d6c9b276
Author: Michael Stahl 
Date:   Thu Feb 9 13:08:13 2017 +0100

i#124243 sd: add unit test for ODF import of glue points on SVG shape

Change-Id: Ib6434063f4dfebb5f3e180c7136b411dbf0d94d0
(cherry picked from commit dbc31190532be3d3f0d8fb313b9d7247c2eb6135)
Reviewed-on: https://gerrit.libreoffice.org/34089
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sd/qa/unit/data/odg/ooo124143-1.odg 
b/sd/qa/unit/data/odg/ooo124143-1.odg
new file mode 100644
index 000..8e341cb
Binary files /dev/null and b/sd/qa/unit/data/odg/ooo124143-1.odg differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 204574f..6ed765f 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -48,6 +48,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -127,6 +130,7 @@ public:
 void testTdf99030();
 void testTdf49561();
 void testTdf103473();
+void testAoo124143();
 void testTdf103567();
 void testTdf103792();
 void testTdf103876();
@@ -184,6 +188,7 @@ public:
 CPPUNIT_TEST(testTdf99030);
 CPPUNIT_TEST(testTdf49561);
 CPPUNIT_TEST(testTdf103473);
+CPPUNIT_TEST(testAoo124143);
 CPPUNIT_TEST(testTdf103567);
 CPPUNIT_TEST(testTdf103792);
 CPPUNIT_TEST(testTdf103876);
@@ -1447,6 +1452,50 @@ void SdImportTest::testTdf103473()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testAoo124143()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odg/ooo124143-1.odg"), 
ODG);
+
+uno::Reference const xImage(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const xGPS(xImage, 
uno::UNO_QUERY);
+uno::Reference const 
xGluePoints(xGPS->getGluePoints(), uno::UNO_QUERY);
+
+uno::Sequence const ids(xGluePoints->getIdentifiers());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(6), ids.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ids[0]);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), ids[1]);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), ids[2]);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), ids[3]);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(4), ids[4]);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5), ids[5]);
+
+// interesting ones are custom 4, 5
+drawing::GluePoint2 glue4;
+xGluePoints->getByIdentifier(4) >>= glue4;
+CPPUNIT_ASSERT_EQUAL(sal_Int32( 2470), glue4.Position.X);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1810), glue4.Position.Y);
+
+drawing::GluePoint2 glue5;
+xGluePoints->getByIdentifier(5) >>= glue5;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-2975), glue5.Position.X);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-2165), glue5.Position.Y);
+
+// now check connectors
+uno::Reference const xEllipse(getShapeFromPage(1, 0, 
xDocShRef));
+uno::Reference const xConn1(getShapeFromPage(2, 0, 
xDocShRef));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), 
xConn1->getPropertyValue("StartGluePointIndex").get());
+CPPUNIT_ASSERT_EQUAL(xEllipse, 
xConn1->getPropertyValue("StartShape").get());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(4), 
xConn1->getPropertyValue("EndGluePointIndex").get());
+CPPUNIT_ASSERT_EQUAL(xImage, 
xConn1->getPropertyValue("EndShape").get());
+uno::Reference const xConn2(getShapeFromPage(3, 0, 
xDocShRef));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), 
xConn2->getPropertyValue("StartGluePointIndex").get());
+CPPUNIT_ASSERT_EQUAL(xEllipse, 
xConn2->getPropertyValue("StartShape").get());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5), 
xConn2->getPropertyValue("EndGluePointIndex").get());
+CPPUNIT_ASSERT_EQUAL(xImage, 
xConn2->getPropertyValue("EndShape").get());
+
+xDocShRef->DoClose();
+}
+
 void SdImportTest::testTdf103567()
 {
 sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf103567.odp"), ODP);
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 9532cb2..795e237 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -71,6 +71,7 @@ FileFormat aFileFormats[] =
 { "fodg",  "OpenDocument Drawing Flat XML", "Flat XML ODF Drawing", "", 
FODG_FORMAT_TYPE },
 { "fodp",  "OpenDocument Presentation Flat XML", "Flat XML ODF 
Presentation", "", FODP_FORMAT_TYPE },
 { "sxi",  "StarOffice XML (Impress)", "OpenOffice.org 1.0 Presentation", 
"", SXI_FORMAT_TYPE },
+{ "odg",  "draw8", "draw8", "", ODP_FORMAT_TYPE },
 { nullptr, nullptr, nullptr, nullptr, SfxFilterFlags::NONE }
 };
 
@@ -82,6 +83,7 @@ FileFormat aFileFormats[] =
 #define FODG 5
 #define FODP 6
 #define SXI 7

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa xmloff/source

2017-02-10 Thread Michael Stahl
 sd/qa/unit/data/odp/tdf103567.odp  |binary
 sd/qa/unit/import-tests.cxx|   47 +
 xmloff/source/core/xmlmultiimagehelper.cxx |3 +
 xmloff/source/draw/ximpshap.cxx|   10 ++
 4 files changed, 60 insertions(+)

New commits:
commit bee00eafcf4ade2b5d9139ac751d39429fb52311
Author: Michael Stahl 
Date:   Wed Feb 8 18:30:42 2017 +0100

tdf#103567 xmloff: ODF import: fix loss of events on SVG multi-image

For SVG there are 2 draw:image children in the draw:frame, and the
SdXMLEventContext::EndElement() applies the content of
office:event-listeners to the shape created from the last draw:image
and then MultiImageImportHelper::solveMultipleImages() throws
it away because it's the bitmap fallback of the SVG.

Avoid that problem by calling solveMultipleImages earlier:
The ODF schema ensures that all the draw:image elements occur before
the optional property-bearing child elements of draw:frame,
so we just call solveMultipleImages on the first such optional
element, so that all subsequent properties get applied to the one
surviving shape.

(likely regression from 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70)

(cherry picked from commit 791431d7e2485652c96fac7c15f47aa125271ee0)

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

diff --git a/sd/qa/unit/data/odp/tdf103567.odp 
b/sd/qa/unit/data/odp/tdf103567.odp
new file mode 100644
index 000..a6f72c4
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf103567.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 49b7d25..204574f 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -42,6 +42,8 @@
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,6 +69,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -124,6 +127,7 @@ public:
 void testTdf99030();
 void testTdf49561();
 void testTdf103473();
+void testTdf103567();
 void testTdf103792();
 void testTdf103876();
 void testTdf104015();
@@ -180,6 +184,7 @@ public:
 CPPUNIT_TEST(testTdf99030);
 CPPUNIT_TEST(testTdf49561);
 CPPUNIT_TEST(testTdf103473);
+CPPUNIT_TEST(testTdf103567);
 CPPUNIT_TEST(testTdf103792);
 CPPUNIT_TEST(testTdf103876);
 CPPUNIT_TEST(testTdf104015);
@@ -1442,6 +1447,48 @@ void SdImportTest::testTdf103473()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf103567()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf103567.odp"), ODP);
+for (int i = 0; i < 4; ++i)
+{
+uno::Reference const xShape(getShapeFromPage(i, 
0, xDocShRef));
+uno::Reference const 
xEventsSupplier(xShape, uno::UNO_QUERY);
+uno::Reference const 
xEvents(xEventsSupplier->getEvents());
+OString const msg("shape " + OString::number(i) + ": ");
+
+CPPUNIT_ASSERT(xEvents->hasByName("OnClick"));
+uno::Sequence props;
+xEvents->getByName("OnClick") >>= props;
+comphelper::SequenceAsHashMap const map(props);
+{
+auto iter(map.find("EventType"));
+CPPUNIT_ASSERT_MESSAGE(OString(msg + "no EventType").getStr(), 
iter != map.end());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), 
OUString("Presentation"), iter->second.get());
+}
+{
+auto iter(map.find("ClickAction"));
+CPPUNIT_ASSERT_MESSAGE(OString(msg + "no ClickAction").getStr(), 
iter != map.end());
+if (i % 2 == 0)
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), 
css::presentation::ClickAction_DOCUMENT, 
iter->second.get());
+}
+else
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), 
css::presentation::ClickAction_NEXTPAGE, 
iter->second.get());
+}
+}
+if (i % 2 == 0)
+{
+auto iter(map.find("Bookmark"));
+CPPUNIT_ASSERT_MESSAGE(OString(msg + "no Bookmark").getStr(), iter 
!= map.end());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), 
OUString("http://example.com/;), iter->second.get());
+}
+}
+
+xDocShRef->DoClose();
+}
+
 void SdImportTest::testTdf103792()
 {
 // Title text shape on the actual slide contained no text neither a 
placeholder text.
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx 
b/xmloff/source/core/xmlmultiimagehelper.cxx
index e7eeb62..9c70c07 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -125,6 +125,9 @@ SvXMLImportContextRef 
MultiImageImportHelper::solveMultipleImages()
 
 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa

2017-01-03 Thread Tor Lillqvist
 sd/qa/unit/import-tests.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8fdb960a4fca24ae4ef3e9706218ca00cb7f4fd0
Author: Tor Lillqvist 
Date:   Wed Jun 22 15:34:16 2016 +0300

tdf#93124: The arbitrary number 100 seems to be too high, let's try 50

The test fails on a tinderbox. Adding a temporary printf shows that
the number there is 71.

Change-Id: Ic8fbaab9e3d3434e20ba6aef5cc1acd66b5f4283
(cherry picked from commit 9c07735a0160864c949ac27de1821d6967181516)
Reviewed-on: https://gerrit.libreoffice.org/32693
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 0defbc4..49b7d25 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1327,7 +1327,7 @@ void SdImportTest::testTdf93124()
 ++nNonWhiteCount;
 }
 }
-CPPUNIT_ASSERT_MESSAGE("Tdf93124: vertical alignment of text is 
incorrect!", nNonWhiteCount>100);
+CPPUNIT_ASSERT_MESSAGE("Tdf93124: vertical alignment of text is 
incorrect!", nNonWhiteCount>50);
 }
 xDocShRef->DoClose();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa

2017-01-03 Thread Tomaž Vajngerl
 sd/qa/unit/import-tests.cxx |   23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 441e79dc9e7a1ef8db30ed6a8dc0a5872ff3bf4b
Author: Tomaž Vajngerl 
Date:   Tue Jun 7 18:07:43 2016 +0900

sd: make test "testTdf93124" more robust

Check that the bitmap ihas been exported and imported correctly
instead of seg. fault.

+ use ScopedReadAccess

Change-Id: Ib79b5beddef5dc4f7c3435bae94c2f6a26f8ac10
(cherry picked from commit f08e1630ae56e6f3335a11020e6d2c33c4ce2863)
Reviewed-on: https://gerrit.libreoffice.org/32692
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index b639c19..0defbc4 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1310,18 +1310,25 @@ void SdImportTest::testTdf93124()
 SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ);
 vcl::PNGReader aPNGReader(aFileStream);
 BitmapEx aBMPEx = aPNGReader.Read();
+
+// make sure the bitmap is not empty and correct size (PNG export->import 
was successful)
+CPPUNIT_ASSERT_EQUAL(Size(320, 180), aBMPEx.GetSizePixel());
 Bitmap aBMP = aBMPEx.GetBitmap();
-BitmapReadAccess* pRead = aBMP.AcquireReadAccess();
-int nNonWhiteCount = 0;
-// The word "Top" should be in rectangle 34,4 - 76,30. If text alignment 
is wrong, the rectangle will be white.
-for (long nX = 34; nX < (34 + 43); ++nX)
+{
+Bitmap::ScopedReadAccess pReadAccess(aBMP);
+int nNonWhiteCount = 0;
+// The word "Top" should be in rectangle 34,4 - 76,30. If text 
alignment is wrong, the rectangle will be white.
 for (long nY = 4; nY < (4 + 26); ++nY)
 {
-const Color aColor = pRead->GetColor(nY, nX);
-if ((aColor.GetRed() != 0xff) || (aColor.GetGreen() != 0xff) || 
(aColor.GetBlue() != 0xff))
-++nNonWhiteCount;
+for (long nX = 34; nX < (34 + 43); ++nX)
+{
+const Color aColor = pReadAccess->GetColor(nY, nX);
+if ((aColor.GetRed() != 0xff) || (aColor.GetGreen() != 0xff) 
|| (aColor.GetBlue() != 0xff))
+++nNonWhiteCount;
+}
 }
-CPPUNIT_ASSERT_MESSAGE("Tdf93124: vertical alignment of text is 
incorrect!", nNonWhiteCount>100);
+CPPUNIT_ASSERT_MESSAGE("Tdf93124: vertical alignment of text is 
incorrect!", nNonWhiteCount>100);
+}
 xDocShRef->DoClose();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa svx/source

2016-11-05 Thread Mike Kaganski
 sd/qa/unit/data/pptx/tdf103473.pptx |binary
 sd/qa/unit/import-tests.cxx |   18 ++
 svx/source/svdraw/svdotext.cxx  |   14 +++---
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit 92d0b2bc79033e8f2cd70c298ad746b38b4eea03
Author: Mike Kaganski 
Date:   Sat Oct 29 15:31:29 2016 +0300

tdf#103473: Ensure positive rectangle size

Also remove conversion of both negative scales into rotation,
because it is handled by flip; use strict comparison instead of
approximate float less because it's correct here, and also because
basegfx::fTools::less ultimately uses rtl_math_approxEqual, which
description states: attention
approxEqual( value!=0.0, 0.0 ) _never_ yields true.

Unit test included.

Change-Id: Ia878fce360cf8aed539d95f2d4a1a3ad94379978
Reviewed-on: https://gerrit.libreoffice.org/30373
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 1c708eee636c0cdf3da2ec62849618f3262044bc)
Reviewed-on: https://gerrit.libreoffice.org/30378

diff --git a/sd/qa/unit/data/pptx/tdf103473.pptx 
b/sd/qa/unit/data/pptx/tdf103473.pptx
new file mode 100644
index 000..5b31b76
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf103473.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 93dca4c..da809a2 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -122,6 +122,7 @@ public:
 void testTdf95932();
 void testTdf99030();
 void testTdf49561();
+void testTdf103473();
 
 CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -172,6 +173,7 @@ public:
 CPPUNIT_TEST(testTdf95932);
 CPPUNIT_TEST(testTdf99030);
 CPPUNIT_TEST(testTdf49561);
+CPPUNIT_TEST(testTdf103473);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1406,6 +1408,22 @@ void SdImportTest::testTdf49561()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf103473()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf103473.pptx"), 
PPTX);
+
+const SdrPage *pPage = GetPage(1, xDocShRef);
+SdrTextObj *const pObj = dynamic_cast(pPage->GetObj(0));
+CPPUNIT_ASSERT(pObj);
+Rectangle aRect = pObj->GetGeoRect();
+CPPUNIT_ASSERT_EQUAL(3629L, aRect.Left());
+CPPUNIT_ASSERT_EQUAL(4431L, aRect.Top());
+CPPUNIT_ASSERT_EQUAL(8353L, aRect.Right());
+CPPUNIT_ASSERT_EQUAL(9155L, aRect.Bottom());
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 151ff79..b7ef71a 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1703,17 +1703,17 @@ void SdrTextObj::TRSetBaseGeometry(const 
basegfx::B2DHomMatrix& rMatrix, const b
 double fShearX(0.0);
 rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
 
-// #i75086# Old DrawingLayer (GeoStat and geometry) does not support 
holding negative scalings
-// in X and Y which equal a 180 degree rotation. Recognize it and react 
accordingly
-if(basegfx::fTools::less(aScale.getX(), 0.0) && 
basegfx::fTools::less(aScale.getY(), 0.0))
+// flip?
+bool bFlipX = aScale.getX() < 0.0,
+ bFlipY = aScale.getY() < 0.0;
+if (bFlipX)
 {
 aScale.setX(fabs(aScale.getX()));
+}
+if (bFlipY)
+{
 aScale.setY(fabs(aScale.getY()));
-fRotate = fmod(fRotate + F_PI, F_2PI);
 }
-// flip?
-bool bFlipX = basegfx::fTools::less(aScale.getX(), 0.0),
- bFlipY = basegfx::fTools::less(aScale.getY(), 0.0);
 
 // reset object shear and rotations
 aGeo.nRotationAngle = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa sd/source

2016-10-25 Thread Noel Grandin
 sd/qa/unit/tiledrendering/data/tdf103083.fodp |  932 ++
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   70 +
 sd/source/ui/view/sdview.cxx  |   43 -
 3 files changed, 1009 insertions(+), 36 deletions(-)

New commits:
commit c6b34fd6db956a7b3e695c412131715f32a6e2a9
Author: Noel Grandin 
Date:   Fri Oct 14 16:38:57 2016 +0200

tdf#103083 - EDITING: Cut and Paste changes bullet point formatting

The bug is that, on paste, the incorrect stylesheet is set on a paragraph
node, leading to the loss of bullet formatting information.

There are two copies of this style-resetting code, one in
   sd::View::OnEndPasteOrDrop
and the other in
Outliner::ImplSetLevelDependendStyleSheet.

The first one was introduced by:
commit 8aa3d1214b17873f6c3d79d95da8bc33d78298c4
Author: Rüdiger Timm 
Date:   Fri Jun 6 11:11:54 2008 +
INTEGRATION: CWS impressodf12 (1.62.4); FILE MERGED

And the second one by:
   commit a6b3e8c1495151b99c3f2f0eadf5881654cbd3b3
   Author: Rüdiger Timm 
   Date:   Fri Jun 6 11:30:58 2008 +
   INTEGRATION: CWS impressodf12 (1.70.350); FILE MERGED

The second one appears to do the right thing, and fixes this bug,
so I am deleting the first one.

Reviewed-on: https://gerrit.libreoffice.org/30009
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 
(cherry picked from commit 7e4887679924df28da2083735e0367ecccb8180b)

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

diff --git a/sd/qa/unit/tiledrendering/data/tdf103083.fodp 
b/sd/qa/unit/tiledrendering/data/tdf103083.fodp
new file mode 100644
index 000..8de5e37
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/tdf103083.fodp
@@ -0,0 +1,932 @@
+
+
+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:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation: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:scr
 ipt="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:ooow="http://openoffice.org/2004/writer; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" 
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 
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:xml
 ns: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.presentation">
+ 
+2016-10-03T11:33:02.159552013
+PT21M51S
+2
+LibreOfficeDev/5.3.0.0.alpha0$Linux_X86_64 
LibreOffice_project/36b8fd83a57132f486d918e5ab39a6e8898bb630
+2016-10-03T11:33:43.592997719
+ 
+  
+   -275
+   -1323
+   28053
+   19616
+   
+
+ view1
+ false
+ false
+ true
+ true
+ true
+ true
+ false
+ false
+ true
+ 1500
+ false
+ //8=
+ //8=
+ 
+ false
+ true
+ V2278V23104H18449H578V627V24757H4049H2466H17561
+ true
+ 0
+ 0
+ false
+ true
+ false
+ 4
+ 0
+ -275
+ -1323
+ 28057
+ 19620
+ 2540
+ 2540
+ 254
+ 254
+ 254
+ 1
+ 254
+ 1
+ false
+ 1500
+ true
+ true
+
+   
+  
+  
+   true
+   

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa svx/source

2016-09-21 Thread Noel Grandin
 sd/qa/unit/tiledrendering/data/tdf102223.odp |binary
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   47 +++
 svx/source/table/svdotable.cxx   |   18 +-
 3 files changed, 49 insertions(+), 16 deletions(-)

New commits:
commit 6a361f874debed3863b55f741552faf8170d19bc
Author: Noel Grandin 
Date:   Fri Sep 16 13:20:18 2016 +0200

tdf#102223 EDITING Deleting all content from a cell changes font formatting

The code in question was added in:
  commit 48ea88c8c8194d65105aa22108583369575926e1
  Author: Rüdiger Timm 
  Date:   Wed Mar 12 09:02:20 2008 +
  INTEGRATION: CWS impresstables2 (1.1.2); FILE ADDED

So hard to tell what its original purpose was. Probably trying to clean
up the model, but had the unintended side effect of removing styles.

Change-Id: I7d774706c22cf72e914b356df9bbc5947ee2c1a5
Reviewed-on: https://gerrit.libreoffice.org/28950
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/29086
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sd/qa/unit/tiledrendering/data/tdf102223.odp 
b/sd/qa/unit/tiledrendering/data/tdf102223.odp
new file mode 100644
index 000..6b8570f
Binary files /dev/null and b/sd/qa/unit/tiledrendering/data/tdf102223.odp differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index b4b2ec6..73e246c 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -19,7 +19,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -64,6 +68,7 @@ public:
 void testPartHash();
 void testResizeTable();
 void testResizeTableColumn();
+void testTdf102223();
 #endif
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
@@ -85,6 +90,7 @@ public:
 CPPUNIT_TEST(testPartHash);
 CPPUNIT_TEST(testResizeTable);
 CPPUNIT_TEST(testResizeTableColumn);
+CPPUNIT_TEST(testTdf102223);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -815,6 +821,47 @@ void SdTiledRenderingTest::testResizeTableColumn()
 comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SdTiledRenderingTest::testTdf102223()
+{
+// Load the document.
+comphelper::LibreOfficeKit::setActive();
+SdXImpressDocument* pXImpressDocument = createDoc("tdf102223.odp");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+SdPage* pActualPage = pViewShell->GetActualPage();
+auto pTableObject = 
dynamic_cast(pActualPage->GetObj(2));
+CPPUNIT_ASSERT(pTableObject);
+SdrView* pView = pViewShell->GetView();
+
+// select contents of cell
+Rectangle aRect = pTableObject->GetCurrentBoundRect();
+pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
+  convertMm100ToTwip(aRect.getX() + 2), 
convertMm100ToTwip(aRect.getY() + 2),
+  1, MOUSE_LEFT, 0);
+pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
+  convertMm100ToTwip(aRect.getX() + 2), 
convertMm100ToTwip(aRect.getY() + 2),
+  1, MOUSE_LEFT, 0);
+pView->SdrBeginTextEdit(pTableObject);
+CPPUNIT_ASSERT(pView->GetTextEditObject());
+EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
+rEditView.SetSelection(ESelection(0, 0, 0, 3)); // start para, start char, 
end para, end char.
+CPPUNIT_ASSERT_EQUAL(OUString("Red"), rEditView.GetSelected());
+const SvxFontHeightItem& rItem = static_cast(rEditView.GetAttribs().Get(EE_CHAR_FONTHEIGHT));
+CPPUNIT_ASSERT_EQUAL((int)1411, (int)rItem.GetHeight());
+
+// cut contents of cell
+uno::Sequence aArgs;
+comphelper::dispatchCommand(".uno:Cut", aArgs);
+
+pView->SdrBeginTextEdit(pTableObject);
+CPPUNIT_ASSERT(pView->GetTextEditObject());
+EditView& rEditView2 = pView->GetTextEditOutlinerView()->GetEditView();
+rEditView2.SetSelection(ESelection(0, 0, 0, 1)); // start para, start 
char, end para, end char.
+const SvxFontHeightItem& rItem2 = static_cast(rEditView2.GetAttribs().Get(EE_CHAR_FONTHEIGHT));
+CPPUNIT_ASSERT_EQUAL((int)1411, (int)rItem2.GetHeight());
+
+comphelper::LibreOfficeKit::setActive(false);
+}
+
 #endif
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 8793f83..f828907 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1826,25 +1826,11 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
 
 if(p1stPara)
 {
-if(nParaAnz == 1)

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/qa

2016-06-06 Thread Tor Lillqvist
 sd/qa/unit/export-tests.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit a7df5753d91c17fb102cf9783e34cf0f60178a51
Author: Tor Lillqvist 
Date:   Fri Jun 3 16:49:30 2016 +0300

Try to fix tinderbox build running in RDP session from Linux on Windows 
pre-10

It is a complicated scenario, but I think something like this is going
on:

Before Windows 10, only OpenGL 1.1 was supported in RDP sessions. Our
code detects RDP and tries to disable the use of OpenGL in that
case. This code for this is in the neighbourhood of the blacklisting
of OpenGL implementations. But the use of OpenGL in GLTF and chart2
does not go through code paths that would take that into
consideration, so it tries to use OpenGL anyway, and eventually we end
up in InitGLEW(), where the recently added check for OpenGL 3.0 or
newer causes an (intentional) abrupt termination of the process.

Change-Id: Ia57bfc8d2cefe4e6d7a00282973608d17967d3fd
(cherry picked from commit f062b89b277a0830f038cafdd13bd074b5188455)
Reviewed-on: https://gerrit.libreoffice.org/25955
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 624d290..1665ac2 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -30,7 +30,6 @@
 
 #include 
 
-
 #include 
 #include 
 #include 
@@ -44,6 +43,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -443,6 +444,9 @@ void SdExportTest::testTransparentBackground()
 
 void SdExportTest::testMediaEmbedding()
 {
+if (!OpenGLWrapper::isVCLOpenGLEnabled())
+return;
+
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"), 
ODP);
 
 #if HAVE_FEATURE_GLTF
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits