kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0036-fdo-79676-Fix-the-Java-UNO-API-test-with-regard-to-c.patch

f085be
From d19c216f191ca13b7895b69cd5790d526aec2bb5 Mon Sep 17 00:00:00 2001
f085be
From: Kohei Yoshida <kohei.yoshida@collabora.com>
f085be
Date: Tue, 10 Jun 2014 09:36:54 -0400
f085be
Subject: [PATCH 036/137] fdo#79676: Fix the Java UNO API test with regard to
f085be
 chart tests.
f085be
f085be
The Java tests rely on the "undocumented" behavior that, when loading an empty
f085be
chart document, the chart automaticallly created a "default chart" which is a
f085be
column chart with many of its properties filled.  Unfortunately this behavior
f085be
caused ugly side effects when loading documents with charts via flat ODF
f085be
filter.
f085be
f085be
I believe fixing the test this way is the right fix.
f085be
f085be
Change-Id: If3e6c8979da9d0731346ebeedc23c0d3363e83fd
f085be
(cherry picked from commit d44b58beed743871df03909e7d9545e488f3d7c8)
f085be
Signed-off-by: Michael Stahl <mstahl@redhat.com>
f085be
---
f085be
 qadevOOo/runner/util/SOfficeFactory.java         | 9 +++++++--
f085be
 sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java | 4 ++++
f085be
 2 files changed, 11 insertions(+), 2 deletions(-)
f085be
f085be
diff --git a/qadevOOo/runner/util/SOfficeFactory.java b/qadevOOo/runner/util/SOfficeFactory.java
f085be
index 2a0f0ed..f464ea8 100644
f085be
--- a/qadevOOo/runner/util/SOfficeFactory.java
f085be
+++ b/qadevOOo/runner/util/SOfficeFactory.java
f085be
@@ -225,7 +225,12 @@ public class SOfficeFactory {
f085be
 
f085be
         if (oDoc != null) {
f085be
             DesktopTools.bringWindowToFront(oDoc);
f085be
-            return UnoRuntime.queryInterface(XChartDocument.class, oDoc);
f085be
+            XChartDocument xChartDoc = UnoRuntime.queryInterface(XChartDocument.class, oDoc);
f085be
+            // Create a default chart which many chart tests rely on.
f085be
+            com.sun.star.chart2.XChartDocument xCD2 =
f085be
+                UnoRuntime.queryInterface(com.sun.star.chart2.XChartDocument.class, oDoc);
f085be
+            xCD2.createDefaultChart();
f085be
+            return xChartDoc;
f085be
         } else {
f085be
             return null;
f085be
         }
f085be
@@ -616,4 +621,4 @@ public class SOfficeFactory {
f085be
         }
f085be
         return null;
f085be
     } // finish queryXServiceInfo
f085be
-}
f085be
\ No newline at end of file
f085be
+}
f085be
diff --git a/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java b/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
f085be
index 3eb7d4e..75981d7 100644
f085be
--- a/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
f085be
+++ b/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
f085be
@@ -74,6 +74,10 @@ public class ChartDocumentTest implements DocumentTest
f085be
 
f085be
         // retrieve the chart model
f085be
         XChartDocument chartDoc = UnoRuntime.queryInterface( XChartDocument.class, shapeProps.getPropertyValue( "Model" ) );
f085be
+        // insert default chart for the test to use.
f085be
+        com.sun.star.chart2.XChartDocument xCD2 =
f085be
+            UnoRuntime.queryInterface(com.sun.star.chart2.XChartDocument.class, chartDoc);
f085be
+        xCD2.createDefaultChart();
f085be
         m_chartDocument = new OfficeDocument( i_orb, chartDoc );
f085be
 
f085be
         // actually activate the object
f085be
-- 
f085be
1.9.3
f085be