qadevOOo/runner/util/SOfficeFactory.java         |    9 +++++++--
 sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java |    4 ++++
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit d19c216f191ca13b7895b69cd5790d526aec2bb5
Author: Kohei Yoshida <kohei.yosh...@collabora.com>
Date:   Tue Jun 10 09:36:54 2014 -0400

    fdo#79676: Fix the Java UNO API test with regard to chart tests.
    
    The Java tests rely on the "undocumented" behavior that, when loading an 
empty
    chart document, the chart automaticallly created a "default chart" which is 
a
    column chart with many of its properties filled.  Unfortunately this 
behavior
    caused ugly side effects when loading documents with charts via flat ODF
    filter.
    
    I believe fixing the test this way is the right fix.
    
    Change-Id: If3e6c8979da9d0731346ebeedc23c0d3363e83fd
    (cherry picked from commit d44b58beed743871df03909e7d9545e488f3d7c8)
    Signed-off-by: Michael Stahl <mst...@redhat.com>

diff --git a/qadevOOo/runner/util/SOfficeFactory.java 
b/qadevOOo/runner/util/SOfficeFactory.java
index 2a0f0ed..f464ea8 100644
--- a/qadevOOo/runner/util/SOfficeFactory.java
+++ b/qadevOOo/runner/util/SOfficeFactory.java
@@ -225,7 +225,12 @@ public class SOfficeFactory {
 
         if (oDoc != null) {
             DesktopTools.bringWindowToFront(oDoc);
-            return UnoRuntime.queryInterface(XChartDocument.class, oDoc);
+            XChartDocument xChartDoc = 
UnoRuntime.queryInterface(XChartDocument.class, oDoc);
+            // Create a default chart which many chart tests rely on.
+            com.sun.star.chart2.XChartDocument xCD2 =
+                
UnoRuntime.queryInterface(com.sun.star.chart2.XChartDocument.class, oDoc);
+            xCD2.createDefaultChart();
+            return xChartDoc;
         } else {
             return null;
         }
@@ -616,4 +621,4 @@ public class SOfficeFactory {
         }
         return null;
     } // finish queryXServiceInfo
-}
\ No newline at end of file
+}
diff --git a/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java 
b/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
index 3eb7d4e..75981d7 100644
--- a/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
+++ b/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
@@ -74,6 +74,10 @@ public class ChartDocumentTest implements DocumentTest
 
         // retrieve the chart model
         XChartDocument chartDoc = UnoRuntime.queryInterface( 
XChartDocument.class, shapeProps.getPropertyValue( "Model" ) );
+        // insert default chart for the test to use.
+        com.sun.star.chart2.XChartDocument xCD2 =
+            
UnoRuntime.queryInterface(com.sun.star.chart2.XChartDocument.class, chartDoc);
+        xCD2.createDefaultChart();
         m_chartDocument = new OfficeDocument( i_orb, chartDoc );
 
         // actually activate the object
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to