summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/charthelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/charthelper.cxx')
-rw-r--r--svx/source/svdraw/charthelper.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/svx/source/svdraw/charthelper.cxx b/svx/source/svdraw/charthelper.cxx
index 9d4c52023595..0676f964d33f 100644
--- a/svx/source/svdraw/charthelper.cxx
+++ b/svx/source/svdraw/charthelper.cxx
@@ -29,6 +29,9 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/graphic/PrimitiveFactory2D.hpp>
#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
using namespace ::com::sun::star;
@@ -118,4 +121,35 @@ drawinglayer::primitive2d::Primitive2DSequence ChartHelper::tryToGetChartContent
return aRetval;
}
+void ChartHelper::AdaptDefaultsForChart(
+ const uno::Reference < embed::XEmbeddedObject > & xEmbObj,
+ bool /* bNoFillStyle */,
+ bool /* bNoLineStyle */)
+{
+ if( xEmbObj.is())
+ {
+ uno::Reference< chart2::XChartDocument > xChartDoc( xEmbObj->getComponent(), uno::UNO_QUERY );
+ OSL_ENSURE( xChartDoc.is(), "Trying to set chart property to non-chart OLE" );
+ if( !xChartDoc.is())
+ return;
+
+ try
+ {
+ // set background to transparent (none)
+ uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground());
+ if( xPageProp.is())
+ xPageProp->setPropertyValue( "FillStyle",
+ uno::makeAny( drawing::FillStyle_NONE ));
+ // set no border
+ if( xPageProp.is())
+ xPageProp->setPropertyValue( "LineStyle",
+ uno::makeAny( drawing::LineStyle_NONE ));
+ }
+ catch( const uno::Exception & )
+ {
+ OSL_FAIL( "Exception caught in AdaptDefaultsForChart" );
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */