Kaydet (Commit) d44b58be authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 9455b4eb
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment