LibreOffice Module chart2 (master) 1
WrappedSymbolProperties.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
23#include <ChartType.hxx>
24#include <ChartTypeHelper.hxx>
25#include <com/sun/star/chart2/Symbol.hpp>
26#include <com/sun/star/chart2/SymbolStyle.hpp>
27#include <com/sun/star/awt/Size.hpp>
28#include <com/sun/star/beans/PropertyAttribute.hpp>
29#include <com/sun/star/beans/XPropertyState.hpp>
30#include <com/sun/star/chart/ChartSymbolType.hpp>
31#include <com/sun/star/drawing/LineStyle.hpp>
32#include <vcl/GraphicLoader.hxx>
33
34#include <vcl/graph.hxx>
36
37using namespace ::com::sun::star;
38using ::com::sun::star::uno::Any;
39using ::com::sun::star::uno::Reference;
40using ::com::sun::star::beans::Property;
41
42namespace chart::wrapper
43{
44
45namespace
46{
47
48class WrappedSymbolTypeProperty : public WrappedSeriesOrDiagramProperty< sal_Int32 >
49{
50public:
51 virtual sal_Int32 getValueFromSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet ) const override;
52 virtual void setValueToSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet, const sal_Int32& aNewValue ) const override;
53
54 virtual Any getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const override;
55 virtual beans::PropertyState getPropertyState( const Reference< beans::XPropertyState >& xInnerPropertyState ) const override;
56
57 explicit WrappedSymbolTypeProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
58 tSeriesOrDiagramPropertyType ePropertyType);
59};
60
61class WrappedSymbolBitmapURLProperty : public WrappedSeriesOrDiagramProperty<OUString>
62{
63public:
64 virtual OUString getValueFromSeries(const Reference<beans::XPropertySet>& xSeriesPropertySet) const override;
65 virtual void setValueToSeries(const Reference<beans::XPropertySet> & xSeriesPropertySet, OUString const & xNewGraphicURL) const override;
66
67 explicit WrappedSymbolBitmapURLProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
68 tSeriesOrDiagramPropertyType ePropertyType);
69};
70
71class WrappedSymbolBitmapProperty : public WrappedSeriesOrDiagramProperty<uno::Reference<graphic::XGraphic>>
72{
73public:
74 virtual uno::Reference<graphic::XGraphic> getValueFromSeries(const Reference<beans::XPropertySet>& xSeriesPropertySet) const override;
75 virtual void setValueToSeries(const Reference<beans::XPropertySet> & xSeriesPropertySet, uno::Reference<graphic::XGraphic> const & xNewGraphic) const override;
76
77 explicit WrappedSymbolBitmapProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
78 tSeriesOrDiagramPropertyType ePropertyType);
79};
80
81class WrappedSymbolSizeProperty : public WrappedSeriesOrDiagramProperty< awt::Size >
82{
83public:
84 virtual awt::Size getValueFromSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet ) const override;
85 virtual void setValueToSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet, const awt::Size& aNewSize ) const override;
86 virtual beans::PropertyState getPropertyState( const Reference< beans::XPropertyState >& xInnerPropertyState ) const override;
87
88 explicit WrappedSymbolSizeProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
89 tSeriesOrDiagramPropertyType ePropertyType);
90};
91
92class WrappedSymbolAndLinesProperty : public WrappedSeriesOrDiagramProperty< bool >
93{
94public:
95 virtual bool getValueFromSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet ) const override;
96 virtual void setValueToSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet, const bool& bDrawLines ) const override;
97 virtual beans::PropertyState getPropertyState( const Reference< beans::XPropertyState >& xInnerPropertyState ) const override;
98
99 explicit WrappedSymbolAndLinesProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
100 tSeriesOrDiagramPropertyType ePropertyType);
101};
102
103enum
104{
105 //symbol properties
106 PROP_CHART_SYMBOL_TYPE = FAST_PROPERTY_ID_START_CHART_SYMBOL_PROP,
107 PROP_CHART_SYMBOL_BITMAP_URL,
108 PROP_CHART_SYMBOL_BITMAP,
109 PROP_CHART_SYMBOL_SIZE,
110 PROP_CHART_SYMBOL_AND_LINES
111};
112
113sal_Int32 lcl_getSymbolType( const css::chart2::Symbol& rSymbol )
114{
115 sal_Int32 nSymbol = css::chart::ChartSymbolType::NONE;
116 switch( rSymbol.Style )
117 {
118 case chart2::SymbolStyle_NONE:
119 break;
120 case chart2::SymbolStyle_AUTO:
121 nSymbol = css::chart::ChartSymbolType::AUTO;
122 break;
123 case chart2::SymbolStyle_STANDARD:
124 nSymbol = rSymbol.StandardSymbol%15;
125 break;
126 case chart2::SymbolStyle_POLYGON://new feature
127 nSymbol = css::chart::ChartSymbolType::AUTO;
128 break;
129 case chart2::SymbolStyle_GRAPHIC:
130 nSymbol = css::chart::ChartSymbolType::BITMAPURL;
131 break;
132 default:
133 nSymbol = css::chart::ChartSymbolType::AUTO;
134 break;
135 }
136 return nSymbol;
137}
138void lcl_setSymbolTypeToSymbol( sal_Int32 nSymbolType, chart2::Symbol& rSymbol )
139{
140 switch( nSymbolType )
141 {
142 case css::chart::ChartSymbolType::NONE:
143 rSymbol.Style = chart2::SymbolStyle_NONE;
144 break;
145 case css::chart::ChartSymbolType::AUTO:
146 rSymbol.Style = chart2::SymbolStyle_AUTO;
147 break;
148 case css::chart::ChartSymbolType::BITMAPURL:
149 rSymbol.Style = chart2::SymbolStyle_GRAPHIC;
150 break;
151 default:
152 rSymbol.Style = chart2::SymbolStyle_STANDARD;
153 rSymbol.StandardSymbol = nSymbolType;
154 break;
155 }
156}
157
158void lcl_addWrappedProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList
159 , const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact
160 , tSeriesOrDiagramPropertyType ePropertyType )
161{
162 rList.emplace_back( new WrappedSymbolTypeProperty( spChart2ModelContact, ePropertyType ) );
163 rList.emplace_back( new WrappedSymbolBitmapURLProperty( spChart2ModelContact, ePropertyType ) );
164 rList.emplace_back( new WrappedSymbolBitmapProperty( spChart2ModelContact, ePropertyType ) );
165 rList.emplace_back( new WrappedSymbolSizeProperty( spChart2ModelContact, ePropertyType ) );
166 rList.emplace_back( new WrappedSymbolAndLinesProperty( spChart2ModelContact, ePropertyType ) );
167}
168
169}//anonymous namespace
170
171void WrappedSymbolProperties::addProperties( std::vector< Property > & rOutProperties )
172{
173 rOutProperties.emplace_back( "SymbolType",
174 PROP_CHART_SYMBOL_TYPE,
176 beans::PropertyAttribute::BOUND
177 | beans::PropertyAttribute::MAYBEDEFAULT );
178
179 rOutProperties.emplace_back( "SymbolBitmapURL",
180 PROP_CHART_SYMBOL_BITMAP_URL,
182 beans::PropertyAttribute::BOUND
183 | beans::PropertyAttribute::MAYBEDEFAULT );
184
185 rOutProperties.emplace_back( "SymbolBitmap",
186 PROP_CHART_SYMBOL_BITMAP,
188 beans::PropertyAttribute::BOUND
189 | beans::PropertyAttribute::MAYBEDEFAULT );
190
191 rOutProperties.emplace_back( "SymbolSize",
192 PROP_CHART_SYMBOL_SIZE,
194 beans::PropertyAttribute::BOUND
195 | beans::PropertyAttribute::MAYBEDEFAULT );
196
197 rOutProperties.emplace_back( "Lines",
198 PROP_CHART_SYMBOL_AND_LINES,
200 beans::PropertyAttribute::BOUND
201 | beans::PropertyAttribute::MAYBEDEFAULT );
202}
203
204void WrappedSymbolProperties::addWrappedPropertiesForSeries( std::vector< std::unique_ptr<WrappedProperty> >& rList
205 , const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact )
206{
207 lcl_addWrappedProperties( rList, spChart2ModelContact, DATA_SERIES );
208}
209
210void WrappedSymbolProperties::addWrappedPropertiesForDiagram( std::vector< std::unique_ptr<WrappedProperty> >& rList
211 , const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact )
212{
213 lcl_addWrappedProperties( rList, spChart2ModelContact, DIAGRAM );
214}
215
216WrappedSymbolTypeProperty::WrappedSymbolTypeProperty(
217 const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
218 tSeriesOrDiagramPropertyType ePropertyType )
219 : WrappedSeriesOrDiagramProperty< sal_Int32 >( "SymbolType"
220 , uno::Any( css::chart::ChartSymbolType::NONE )
221 , spChart2ModelContact
222 , ePropertyType )
223{
224}
225
226sal_Int32 WrappedSymbolTypeProperty::getValueFromSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet ) const
227{
228 sal_Int32 aRet = 0;
229 m_aDefaultValue >>= aRet;
230 chart2::Symbol aSymbol;
231 if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol ) )
232 aRet = lcl_getSymbolType( aSymbol );
233 return aRet;
234}
235
236void WrappedSymbolTypeProperty::setValueToSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet, const sal_Int32& nSymbolType ) const
237{
238 if(!xSeriesPropertySet.is())
239 return;
240
241 chart2::Symbol aSymbol;
242 xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol;
243
244 lcl_setSymbolTypeToSymbol( nSymbolType, aSymbol );
245 xSeriesPropertySet->setPropertyValue( "Symbol", uno::Any( aSymbol ) );
246}
247
248Any WrappedSymbolTypeProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
249{
250 //the old chart (< OOo 2.3) needs symbol-type="automatic" at the plot-area if any of the series should be able to have symbols
251 if( m_ePropertyType == DIAGRAM )
252 {
253 bool bHasAmbiguousValue = false;
254 sal_Int32 aValue = 0;
255 if( detectInnerValue( aValue, bHasAmbiguousValue ) )
256 {
257 if(bHasAmbiguousValue)
258 {
259 m_aOuterValue <<= css::chart::ChartSymbolType::AUTO;
260 }
261 else
262 {
263 if( aValue == css::chart::ChartSymbolType::NONE )
264 m_aOuterValue <<= css::chart::ChartSymbolType::NONE;
265 else
266 m_aOuterValue <<= css::chart::ChartSymbolType::AUTO;
267 }
268 }
269 return m_aOuterValue;
270 }
271 else
272 {
273 css::uno::Any aRet( m_aDefaultValue );
274 aRet <<= getValueFromSeries( xInnerPropertySet );
275 return aRet;
276 }
277}
278
279beans::PropertyState WrappedSymbolTypeProperty::getPropertyState( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
280{
281 //the special situation for this property here is that the diagram default can be
282 //different from the normal default and different from all singles series values
283 //so we need to return PropertyState_DIRECT_VALUE for more cases
284
285 if( m_ePropertyType == DATA_SERIES && //single series or point
287 {
289 rtl::Reference< ::chart::DataSeries > xSeries( dynamic_cast<DataSeries*>(xInnerPropertyState.get()) );
290 rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xSeries ) );
292 return beans::PropertyState_DIRECT_VALUE;
293 }
294 return WrappedProperty::getPropertyState( xInnerPropertyState );
295}
296
297WrappedSymbolBitmapURLProperty::WrappedSymbolBitmapURLProperty(
298 const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
299 tSeriesOrDiagramPropertyType ePropertyType )
300 : WrappedSeriesOrDiagramProperty<OUString>("SymbolBitmapURL",
301 uno::Any(OUString()), spChart2ModelContact, ePropertyType)
302{
303}
304
305OUString WrappedSymbolBitmapURLProperty::getValueFromSeries(const Reference< beans::XPropertySet >& /*xSeriesPropertySet*/) const
306{
307 return OUString();
308}
309
310void WrappedSymbolBitmapURLProperty::setValueToSeries(
311 const Reference< beans::XPropertySet >& xSeriesPropertySet,
312 OUString const & xNewGraphicURL) const
313{
314 if (!xSeriesPropertySet.is())
315 return;
316
317 chart2::Symbol aSymbol;
318 if (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
319 {
320 if (!xNewGraphicURL.isEmpty())
321 {
322 Graphic aGraphic = vcl::graphic::loadFromURL(xNewGraphicURL);
323 aSymbol.Graphic.set(aGraphic.GetXGraphic());
324 xSeriesPropertySet->setPropertyValue("Symbol", uno::Any(aSymbol));
325 }
326 }
327}
328
329WrappedSymbolBitmapProperty::WrappedSymbolBitmapProperty(
330 const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
331 tSeriesOrDiagramPropertyType ePropertyType )
332 : WrappedSeriesOrDiagramProperty<uno::Reference<graphic::XGraphic>>("SymbolBitmap",
333 uno::Any(uno::Reference<graphic::XGraphic>()), spChart2ModelContact, ePropertyType)
334{
335}
336
337uno::Reference<graphic::XGraphic> WrappedSymbolBitmapProperty::getValueFromSeries(const Reference< beans::XPropertySet >& xSeriesPropertySet) const
338{
339 uno::Reference<graphic::XGraphic> xGraphic;
340 m_aDefaultValue >>= xGraphic;
341
342 chart2::Symbol aSymbol;
343 if (xSeriesPropertySet.is() && (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
344 && aSymbol.Graphic.is())
345 {
346 xGraphic = aSymbol.Graphic;
347 }
348 return xGraphic;
349}
350
351void WrappedSymbolBitmapProperty::setValueToSeries(
352 const Reference< beans::XPropertySet >& xSeriesPropertySet,
353 uno::Reference<graphic::XGraphic> const & xNewGraphic) const
354{
355 if (!xSeriesPropertySet.is())
356 return;
357
358 chart2::Symbol aSymbol;
359 if (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
360 {
361 if (xNewGraphic.is())
362 {
363 aSymbol.Graphic.set(xNewGraphic);
364 xSeriesPropertySet->setPropertyValue("Symbol", uno::Any(aSymbol));
365 }
366 }
367}
368
369namespace
370{
371
372void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol )
373{
374 if( rSymbol.Style != chart2::SymbolStyle_GRAPHIC )
375 return;
376 if( rSymbol.Size.Width != -1 )
377 return;
378 if( rSymbol.Size.Height != -1 )
379 return;
380
381 //find a good automatic size
382 try
383 {
384 const awt::Size aDefaultSize(250,250);
385 awt::Size aSize = aDefaultSize;
386 uno::Reference< beans::XPropertySet > xProp( rSymbol.Graphic, uno::UNO_QUERY );
387 if( xProp.is() )
388 {
389 bool bFoundSize = false;
390 try
391 {
392 if( xProp->getPropertyValue( "Size100thMM" ) >>= aSize )
393 {
394 if( aSize.Width == 0 && aSize.Height == 0 )
395 aSize = aDefaultSize;
396 else
397 bFoundSize = true;
398 }
399 }
400 catch( const uno::Exception& )
401 {
402 TOOLS_WARN_EXCEPTION("chart2", "" );
403 }
404
405 if(!bFoundSize)
406 {
407 awt::Size aAWTPixelSize(10,10);
408 if( xProp->getPropertyValue( "SizePixel" ) >>= aAWTPixelSize )
409 {
410 Size aPixelSize(aAWTPixelSize.Width,aAWTPixelSize.Height);
412
413 aSize = awt::Size( aNewSize.Width(), aNewSize.Height() );
414
415 if( aSize.Width == 0 && aSize.Height == 0 )
416 aSize = aDefaultSize;
417 }
418 }
419 }
420 rSymbol.Size = aSize;
421 }
422 catch( const uno::Exception& )
423 {
424 TOOLS_WARN_EXCEPTION("chart2", "" );
425 }
426}
427
428}//end anonymous namespace
429
430WrappedSymbolSizeProperty::WrappedSymbolSizeProperty(
431 const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
432 tSeriesOrDiagramPropertyType ePropertyType )
433 : WrappedSeriesOrDiagramProperty< awt::Size >( "SymbolSize"
434 , uno::Any( awt::Size(250,250) ), spChart2ModelContact, ePropertyType )
435{
436}
437
438awt::Size WrappedSymbolSizeProperty::getValueFromSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet ) const
439{
440 awt::Size aRet;
441 m_aDefaultValue >>= aRet;
442 chart2::Symbol aSymbol;
443 if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol ))
444 aRet = aSymbol.Size;
445 return aRet;
446}
447
448void WrappedSymbolSizeProperty::setValueToSeries(
449 const Reference< beans::XPropertySet >& xSeriesPropertySet,
450 const awt::Size& aNewSize ) const
451{
452 if(!xSeriesPropertySet.is())
453 return;
454
455 chart2::Symbol aSymbol;
456 if( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol )
457 {
458 aSymbol.Size = aNewSize;
459 lcl_correctSymbolSizeForBitmaps(aSymbol);
460 xSeriesPropertySet->setPropertyValue( "Symbol", uno::Any( aSymbol ) );
461 }
462}
463
464beans::PropertyState WrappedSymbolSizeProperty::getPropertyState( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
465{
466 //only export symbol size if necessary
467 if( m_ePropertyType == DIAGRAM )
468 return beans::PropertyState_DEFAULT_VALUE;
469
470 try
471 {
472 chart2::Symbol aSymbol;
473 Reference< beans::XPropertySet > xSeriesPropertySet( xInnerPropertyState, uno::UNO_QUERY );
474 if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol ))
475 {
476 if( aSymbol.Style != chart2::SymbolStyle_NONE )
477 return beans::PropertyState_DIRECT_VALUE;
478 }
479 }
480 catch( const uno::Exception & )
481 {
482 DBG_UNHANDLED_EXCEPTION("chart2");
483 }
484 return beans::PropertyState_DEFAULT_VALUE;
485}
486
487WrappedSymbolAndLinesProperty::WrappedSymbolAndLinesProperty(
488 const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
489 tSeriesOrDiagramPropertyType ePropertyType )
490 : WrappedSeriesOrDiagramProperty< bool >( "Lines"
491 , uno::Any( true ), spChart2ModelContact, ePropertyType )
492{
493}
494
495bool WrappedSymbolAndLinesProperty::getValueFromSeries( const Reference< beans::XPropertySet >& /*xSeriesPropertySet*/ ) const
496{
497 //do not export this property anymore, instead use a linestyle none for no lines
498 return true;
499}
500
501void WrappedSymbolAndLinesProperty::setValueToSeries(
502 const Reference< beans::XPropertySet >& xSeriesPropertySet,
503 const bool& bDrawLines ) const
504{
505 if(!xSeriesPropertySet.is())
506 return;
507
508 drawing::LineStyle eOldLineStyle( drawing::LineStyle_SOLID );
509 xSeriesPropertySet->getPropertyValue( "LineStyle" ) >>= eOldLineStyle;
510 if( bDrawLines )
511 {
512 //#i114298# don't overwrite dashed lines with solid lines here
513 if( eOldLineStyle == drawing::LineStyle_NONE )
514 xSeriesPropertySet->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) );
515 }
516 else
517 {
518 if( eOldLineStyle != drawing::LineStyle_NONE )
519 xSeriesPropertySet->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ) );
520 }
521}
522
523beans::PropertyState WrappedSymbolAndLinesProperty::getPropertyState( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
524{
525 //do not export this property anymore, instead use a linestyle none for no lines
526 return beans::PropertyState_DEFAULT_VALUE;
527}
528
529} //namespace chart
530
531/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
Any m_aOuterValue
css::uno::Any m_aDefaultValue
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static bool isSupportingSymbolProperties(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount)
virtual css::beans::PropertyState getPropertyState(const css::uno::Reference< css::beans::XPropertyState > &xInnerPropertyState) const
static void addProperties(std::vector< css::beans::Property > &rOutProperties)
static void addWrappedPropertiesForSeries(std::vector< std::unique_ptr< WrappedProperty > > &rList, const std::shared_ptr< Chart2ModelContact > &spChart2ModelContact)
static void addWrappedPropertiesForDiagram(std::vector< std::unique_ptr< WrappedProperty > > &rList, const std::shared_ptr< Chart2ModelContact > &spChart2ModelContact)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
NONE
@ FAST_PROPERTY_ID_START_CHART_SYMBOL_PROP
Reference
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
Graphic loadFromURL(OUString const &rURL, weld::Window *pParentWin)