Update ooo320-m1
[ooovba.git] / chart2 / workbench / addin / sampleaddin.cxx
blob8fabce6459c15704de984338338b0ae9388cf862
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sampleaddin.cxx,v $
10 * $Revision: 1.3.44.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #include "sampleaddin.hxx"
32 #include <cppuhelper/factory.hxx>
33 #include <osl/diagnose.h>
35 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
36 #include <com/sun/star/drawing/XDrawPage.hpp>
37 #include <com/sun/star/chart/XChartDataArray.hpp>
38 #include <com/sun/star/text/XTextRange.hpp>
39 #include <com/sun/star/chart/X3DDisplay.hpp>
41 using namespace com::sun::star;
42 using namespace rtl;
44 // code for creating instances of SampleAddIn
46 extern "C" {
48 void SAL_CALL component_getImplementationEnvironment(
49 const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
51 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
54 sal_Bool SAL_CALL component_writeInfo(
55 void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey )
57 if( pRegistryKey )
59 try
61 OUString aImpl = OUString::createFromAscii( "/" );
62 aImpl += SampleAddIn::getImplementationName_Static();
63 aImpl += OUString::createFromAscii( "/UNO/SERVICES" );
65 uno::Reference< registry::XRegistryKey> xNewKey(
66 reinterpret_cast<registry::XRegistryKey*>( pRegistryKey )->createKey( aImpl ) );
68 uno::Sequence< OUString > aSequ = SampleAddIn::getSupportedServiceNames_Static();
69 const OUString * pArray = aSequ.getConstArray();
70 for( sal_Int32 i = 0; i < aSequ.getLength(); i++ )
71 xNewKey->createKey( pArray[i] );
73 return sal_True;
75 catch( registry::InvalidRegistryException& )
77 OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
80 return sal_False;
83 void * SAL_CALL component_getFactory(
84 const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
86 void* pRet = 0;
88 if ( pServiceManager &&
89 OUString::createFromAscii( pImplName ) == SampleAddIn::getImplementationName_Static() )
91 uno::Reference< lang::XSingleServiceFactory> xFactory( cppu::createSingleFactory(
92 reinterpret_cast<lang::XMultiServiceFactory*>( pServiceManager ),
93 SampleAddIn::getImplementationName_Static(),
94 SampleAddIn_CreateInstance,
95 SampleAddIn::getSupportedServiceNames_Static() ) );
97 if( xFactory.is())
99 xFactory->acquire();
100 pRet = xFactory.get();
104 return pRet;
107 } // extern C
110 // --------------------
111 // class SampleAddIn
112 // --------------------
114 SampleAddIn::SampleAddIn()
119 SampleAddIn::~SampleAddIn()
123 // this functionality should be provided by the chart API some day
124 sal_Bool SampleAddIn::getLogicalPosition( uno::Reference< drawing::XShape >& xAxis,
125 double fValue,
126 sal_Bool bVertical,
127 awt::Point& aOutPosition )
129 sal_Bool bRet = sal_False;
131 if( xAxis.is())
133 awt::Size aSize = xAxis->getSize();
134 sal_Int32 nLength = bVertical? aSize.Height: aSize.Width;
136 uno::Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
137 if( xProp.is())
141 double fMin, fMax;
142 uno::Any aAny = xProp->getPropertyValue( OUString::createFromAscii( "Min" ));
143 aAny >>= fMin;
144 aAny = xProp->getPropertyValue( OUString::createFromAscii( "Max" ));
145 aAny >>= fMax;
147 double fRange = fMax - fMin;
148 if( fMin <= fValue && fValue <= fMax &&
149 fRange != 0.0 )
151 double fPercentage = (fValue - fMin) / fRange;
152 awt::Point aPos = xAxis->getPosition();
154 if( bVertical )
156 aOutPosition.X = aPos.X;
157 aOutPosition.Y = static_cast<sal_Int32>(aPos.Y + nLength * (1.0 - fPercentage)); // y scale goes from top to bottom
159 else
161 aOutPosition.X = static_cast<sal_Int32>(aPos.X + nLength * fPercentage);
162 aOutPosition.Y = aPos.Y;
164 bRet = sal_True;
167 catch( beans::UnknownPropertyException )
169 // the shape xAxis was no chart axis
174 return bRet;
177 OUString SampleAddIn::getImplementationName_Static()
179 return OUString::createFromAscii( "SampleAddIn" );
182 uno::Sequence< ::rtl::OUString > SampleAddIn::getSupportedServiceNames_Static()
184 uno::Sequence< OUString > aSeq( 4 );
186 aSeq[ 0 ] = OUString::createFromAscii( "com.sun.star.chart.ChartAxisXSupplier" );
187 aSeq[ 1 ] = OUString::createFromAscii( "com.sun.star.chart.ChartAxisYSupplier" );
188 aSeq[ 2 ] = OUString::createFromAscii( "com.sun.star.chart.Diagram" );
189 aSeq[ 3 ] = OUString::createFromAscii( "com.sun.star.chart.SampleAddIn" );
191 return aSeq;
194 uno::Reference< uno::XInterface > SAL_CALL SampleAddIn_CreateInstance(
195 const uno::Reference< lang::XMultiServiceFactory >& )
197 uno::Reference< uno::XInterface > xInst = (cppu::OWeakObject*)new SampleAddIn();
199 return xInst;
202 // implementation of interface methods
204 // XInitialization
205 void SAL_CALL SampleAddIn::initialize( const uno::Sequence< uno::Any >& aArguments )
206 throw( uno::Exception, uno::RuntimeException )
208 // first argument should be the XChartDocument
209 OSL_ENSURE( aArguments.getLength() > 0, "Please initialize Chart AddIn with ChartDocument!" );
211 if( aArguments.getLength())
213 aArguments[ 0 ] >>= mxChartDoc;
214 OSL_ENSURE( mxChartDoc.is(), "First argument in initialization is not an XChartDocument!" );
216 // set XY chart as base type to be drawn
217 uno::Reference< beans::XPropertySet > xDocProp( mxChartDoc, uno::UNO_QUERY );
218 if( xDocProp.is())
220 uno::Any aBaseType;
221 aBaseType <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.XYDiagram" ));
224 xDocProp->setPropertyValue( rtl::OUString::createFromAscii( "BaseDiagram" ), aBaseType );
226 catch( ... )
230 // change background of plot area to light blue
231 uno::Reference< chart::X3DDisplay > xWallSupplier( mxChartDoc->getDiagram(), uno::UNO_QUERY );
232 if( xWallSupplier.is())
234 uno::Reference< beans::XPropertySet > xDiaProp( xWallSupplier->getWall(), uno::UNO_QUERY );
235 uno::Reference< beans::XPropertySet > xLegendProp( mxChartDoc->getLegend(), uno::UNO_QUERY );
236 if( xDiaProp.is() &&
237 xLegendProp.is())
239 uno::Any aAny;
240 aAny <<= (sal_Int32)( 0xe0e0f0 );
241 xDiaProp->setPropertyValue( OUString::createFromAscii( "FillColor" ), aAny );
242 xLegendProp->setPropertyValue( OUString::createFromAscii( "FillColor" ), aAny );
248 // XRefreshable
249 /********************************************************************************
251 * The method refresh is the most important method - here all objects that
252 * are necessary for the chart are created
254 * in the first implementation you will have to insert everything in this
255 * routine - all old objects are deleted beforehand
257 ********************************************************************************/
258 void SAL_CALL SampleAddIn::refresh() throw( uno::RuntimeException )
260 if( ! mxChartDoc.is())
261 return;
263 // first of all get the draw page
264 uno::Reference< drawing::XDrawPageSupplier > xPageSupp( mxChartDoc, uno::UNO_QUERY );
265 uno::Reference< lang::XMultiServiceFactory > xFactory( mxChartDoc, uno::UNO_QUERY );
266 if( xPageSupp.is() &&
267 xFactory.is() )
269 uno::Reference< drawing::XDrawPage > xPage = xPageSupp->getDrawPage();
270 if( xPage.is())
272 // now we have the page to insert objects
274 // add a horizontal line at the middle value of the first series
275 // -------------------------------------------------------------
278 // get the logical position from the coordinate
279 // get x- and y-axis
280 uno::Reference< drawing::XShape > xYAxisShape( getYAxis(), uno::UNO_QUERY );
281 uno::Reference< drawing::XShape > xXAxisShape( getXAxis(), uno::UNO_QUERY );
283 if( xXAxisShape.is() &&
284 xYAxisShape.is() )
286 // create line first time
287 if( ! mxMyRedLine.is())
289 mxMyRedLine = uno::Reference< drawing::XShape >(
290 xFactory->createInstance( OUString::createFromAscii( "com.sun.star.drawing.LineShape" )),
291 uno::UNO_QUERY );
292 xPage->add( mxMyRedLine );
294 // make line red and thick
295 uno::Reference< beans::XPropertySet > xShapeProp( mxMyRedLine, uno::UNO_QUERY );
296 if( xShapeProp.is())
298 uno::Any aColor, aWidth;
299 aColor <<= (sal_Int32)(0xe01010);
300 aWidth <<= (sal_Int32)(50); // 0.5 mm
303 xShapeProp->setPropertyValue( OUString::createFromAscii( "LineColor" ), aColor );
304 xShapeProp->setPropertyValue( OUString::createFromAscii( "LineWidth" ), aWidth );
306 catch( ... )
310 // create text object first time
311 if( ! mxMyText.is())
313 mxMyText = uno::Reference< drawing::XShape >(
314 xFactory->createInstance( OUString::createFromAscii( "com.sun.star.drawing.TextShape" )),
315 uno::UNO_QUERY );
316 xPage->add( mxMyText );
318 // change text
319 OUString aText;
320 // if( maLocale.Language.equalsIgnoreCase( OUString::createFromAscii("DE")))
321 // aText = OUString::createFromAscii( "Kleines Beispiel" );
322 // else
323 aText = OUString::createFromAscii( "Little Example" );
325 uno::Reference< beans::XPropertySet > xTextProp( mxMyText, uno::UNO_QUERY );
326 if( xTextProp.is())
328 uno::Any aTrueAny;
329 aTrueAny <<= (sal_Bool)(sal_True);
332 xTextProp->setPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowWidth" ), aTrueAny );
334 catch( ... )
338 uno::Reference< text::XTextRange > xTextRange( mxMyText, uno::UNO_QUERY );
339 if( xTextRange.is())
341 xTextRange->setString( aText );
346 // position line and text
348 // get the array. Note: the first dimension is the length
349 // of each series and the second one is the number of series
350 // this should be changed in the future
351 uno::Sequence< uno::Sequence< double > > aData;
352 uno::Reference< chart::XChartData > xData = mxChartDoc->getData();
353 uno::Reference< chart::XChartDataArray > xDataArray( xData, uno::UNO_QUERY );
354 if( xDataArray.is())
355 aData = xDataArray->getData();
357 // get row count == length of each series
358 sal_Int32 nSize = aData.getLength();
359 sal_Int32 nMiddle = nSize / 2;
360 // get value for first series
361 double fMiddleVal = xData->getNotANumber(); // set to NaN
362 if( aData[ nMiddle ].getLength()) // we have at least one series
363 fMiddleVal = aData[ nMiddle ][ 0 ];
365 awt::Point aPos;
366 getLogicalPosition( xYAxisShape, fMiddleVal, sal_True, aPos );
367 awt::Size aSize = xXAxisShape->getSize();
369 if( mxMyRedLine.is())
371 awt::Point aEnd = aPos;
372 aEnd.X += aSize.Width;
374 uno::Sequence< uno::Sequence< awt::Point > > aPtSeq( 1 );
375 aPtSeq[ 0 ].realloc( 2 );
376 aPtSeq[ 0 ][ 0 ] = aPos;
377 aPtSeq[ 0 ][ 1 ] = aEnd;
379 uno::Reference< beans::XPropertySet > xShapeProp( mxMyRedLine, uno::UNO_QUERY );
380 if( xShapeProp.is())
382 uno::Any aAny;
383 aAny <<= aPtSeq;
384 xShapeProp->setPropertyValue( rtl::OUString::createFromAscii( "PolyPolygon" ), aAny );
387 if( mxMyText.is())
389 // put the text centered below the red line
390 aPos.X += ( aSize.Width - mxMyRedLine->getPosition().X ) / 2;
391 aPos.Y += 1000;
392 aPos.Y += static_cast<sal_Int32>(0.1 * xYAxisShape->getSize().Height);
393 mxMyText->setPosition( aPos );
399 // set axis scale to 200
400 // uno::Reference< beans::XPropertySet > xXAxis( getXAxis(), uno::UNO_QUERY );
401 // if( xXAxis.is())
402 // {
403 // uno::Any aAny;
404 // aAny <<= (sal_Bool)(sal_False);
405 // xXAxis->setPropertyValue( rtl::OUString::createFromAscii( "AutoStepMain" ),
406 // aAny );
407 // aAny <<= (double)(200.0);
408 // xXAxis->setPropertyValue( rtl::OUString::createFromAscii( "StepMain" ),
409 // aAny );
410 // }
412 // try setting symbols
413 // uno::Reference< beans::XPropertySet > xProp = getDataRowProperties( 0 );
414 // if( xProp.is())
415 // {
416 // uno::Any aAny;
417 // aAny <<= (sal_Int32)(-1);
418 // xProp->setPropertyValue( OUString::createFromAscii( "SymbolType" ), aAny );
419 // aAny <<= rtl::OUString::createFromAscii( "http://mib-1168/www/images/go.gif" );
420 // xProp->setPropertyValue( OUString::createFromAscii( "SymbolBitmapURL" ), aAny );
421 // }
424 void SAL_CALL SampleAddIn::addRefreshListener( const uno::Reference< util::XRefreshListener >& )
425 throw( uno::RuntimeException )
427 // not implemented - this is not necessary
428 // (this method exists just because the interface requires it)
431 void SAL_CALL SampleAddIn::removeRefreshListener( const uno::Reference< util::XRefreshListener >& )
432 throw( uno::RuntimeException )
434 // not implemented - this is not necessary
435 // (this method exists just because the interface requires it)
438 // XDiagram
439 OUString SAL_CALL SampleAddIn::getDiagramType() throw( uno::RuntimeException )
441 return OUString::createFromAscii( "com.sun.star.chart.SampleDiagram" );
444 // the following methods just delegate to the "parent diagram" (which in the future might no longer exist)
446 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getDataRowProperties( sal_Int32 nRow )
447 throw( lang::IndexOutOfBoundsException,
448 uno::RuntimeException )
450 if( mxChartDoc.is())
452 uno::Reference< chart::XDiagram > xDia = mxChartDoc->getDiagram();
453 if( xDia.is())
454 return xDia->getDataRowProperties( nRow );
457 return uno::Reference< beans::XPropertySet >();
460 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
461 throw( lang::IndexOutOfBoundsException,
462 uno::RuntimeException )
464 if( mxChartDoc.is())
466 uno::Reference< chart::XDiagram > xDia = mxChartDoc->getDiagram();
467 if( xDia.is())
468 return xDia->getDataPointProperties( nCol, nRow );
471 return uno::Reference< beans::XPropertySet >();
474 // XShape ( ::XDiagram )
475 awt::Size SAL_CALL SampleAddIn::getSize()
476 throw( uno::RuntimeException )
478 if( mxChartDoc.is())
480 uno::Reference< drawing::XShape > xShape( mxChartDoc->getDiagram(), uno::UNO_QUERY );
481 if( xShape.is())
482 return xShape->getSize();
485 return awt::Size();
488 void SAL_CALL SampleAddIn::setSize( const awt::Size& aSize )
489 throw( beans::PropertyVetoException, uno::RuntimeException )
491 if( mxChartDoc.is())
493 uno::Reference< drawing::XShape > xShape( mxChartDoc->getDiagram(), uno::UNO_QUERY );
494 if( xShape.is())
495 xShape->setSize( aSize );
499 awt::Point SAL_CALL SampleAddIn::getPosition()
500 throw( uno::RuntimeException )
502 if( mxChartDoc.is())
504 uno::Reference< drawing::XShape > xShape( mxChartDoc->getDiagram(), uno::UNO_QUERY );
505 if( xShape.is())
506 return xShape->getPosition();
509 return awt::Point();
512 void SAL_CALL SampleAddIn::setPosition( const awt::Point& aPos )
513 throw( uno::RuntimeException )
515 if( mxChartDoc.is())
517 uno::Reference< drawing::XShape > xShape( mxChartDoc->getDiagram(), uno::UNO_QUERY );
518 if( xShape.is())
519 xShape->setPosition( aPos );
523 // XShapeDescriptor ( ::XShape ::XDiagram )
524 rtl::OUString SAL_CALL SampleAddIn::getShapeType() throw( com::sun::star::uno::RuntimeException )
526 return OUString::createFromAscii( "com.sun.star.chart.SampleAddinShape" );
529 // XAxisXSupplier
530 uno::Reference< drawing::XShape > SAL_CALL SampleAddIn::getXAxisTitle()
531 throw( uno::RuntimeException )
533 if( mxChartDoc.is())
535 uno::Reference< chart::XAxisXSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
536 if( xAxisSupp.is())
537 return xAxisSupp->getXAxisTitle();
540 return uno::Reference< drawing::XShape >();
543 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getXAxis()
544 throw( uno::RuntimeException )
546 if( mxChartDoc.is())
548 uno::Reference< chart::XAxisXSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
549 if( xAxisSupp.is())
550 return xAxisSupp->getXAxis();
553 return uno::Reference< beans::XPropertySet >();
556 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getXMainGrid()
557 throw( uno::RuntimeException )
559 if( mxChartDoc.is())
561 uno::Reference< chart::XAxisXSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
562 if( xAxisSupp.is())
563 return xAxisSupp->getXMainGrid();
566 return uno::Reference< beans::XPropertySet >();
569 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getXHelpGrid()
570 throw( uno::RuntimeException )
572 if( mxChartDoc.is())
574 uno::Reference< chart::XAxisXSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
575 if( xAxisSupp.is())
576 return xAxisSupp->getXHelpGrid();
579 return uno::Reference< beans::XPropertySet >();
582 // XAxisYSupplier
583 uno::Reference< drawing::XShape > SAL_CALL SampleAddIn::getYAxisTitle()
584 throw( uno::RuntimeException )
586 if( mxChartDoc.is())
588 uno::Reference< chart::XAxisYSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
589 if( xAxisSupp.is())
590 return xAxisSupp->getYAxisTitle();
593 return uno::Reference< drawing::XShape >();
596 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getYAxis()
597 throw( uno::RuntimeException )
599 if( mxChartDoc.is())
601 uno::Reference< chart::XAxisYSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
602 if( xAxisSupp.is())
603 return xAxisSupp->getYAxis();
606 return uno::Reference< beans::XPropertySet >();
609 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getYMainGrid()
610 throw( uno::RuntimeException )
612 if( mxChartDoc.is())
614 uno::Reference< chart::XAxisYSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
615 if( xAxisSupp.is())
616 return xAxisSupp->getYMainGrid();
619 return uno::Reference< beans::XPropertySet >();
622 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getYHelpGrid()
623 throw( uno::RuntimeException )
625 if( mxChartDoc.is())
627 uno::Reference< chart::XAxisYSupplier > xAxisSupp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
628 if( xAxisSupp.is())
629 return xAxisSupp->getYHelpGrid();
632 return uno::Reference< beans::XPropertySet >();
635 // XStatisticDisplay
636 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getUpBar()
637 throw( uno::RuntimeException )
639 if( mxChartDoc.is())
641 uno::Reference< chart::XStatisticDisplay > xStatDisp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
642 if( xStatDisp.is())
643 return xStatDisp->getUpBar();
646 return uno::Reference< beans::XPropertySet >();
649 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getDownBar()
650 throw( uno::RuntimeException )
652 if( mxChartDoc.is())
654 uno::Reference< chart::XStatisticDisplay > xStatDisp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
655 if( xStatDisp.is())
656 return xStatDisp->getDownBar();
659 return uno::Reference< beans::XPropertySet >();
662 uno::Reference< beans::XPropertySet > SAL_CALL SampleAddIn::getMinMaxLine()
663 throw( uno::RuntimeException )
665 if( mxChartDoc.is())
667 uno::Reference< chart::XStatisticDisplay > xStatDisp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
668 if( xStatDisp.is())
669 return xStatDisp->getMinMaxLine();
672 return uno::Reference< beans::XPropertySet >();
675 // XServiceName
676 OUString SAL_CALL SampleAddIn::getServiceName() throw( uno::RuntimeException )
678 return OUString::createFromAscii( "com.sun.star.chart.SampleAddIn" );
681 // XServiceInfo
682 OUString SAL_CALL SampleAddIn::getImplementationName() throw( uno::RuntimeException )
684 return getImplementationName_Static();
687 sal_Bool SAL_CALL SampleAddIn::supportsService( const OUString& ServiceName )
688 throw( uno::RuntimeException )
690 uno::Sequence< OUString > aServiceSeq = getSupportedServiceNames_Static();
692 sal_Int32 nLength = aServiceSeq.getLength();
693 for( sal_Int32 i=0; i < nLength; i++ )
695 if( ServiceName.equals( aServiceSeq[ i ] ))
696 return sal_True;
699 return sal_False;
702 uno::Sequence< OUString > SAL_CALL SampleAddIn::getSupportedServiceNames()
703 throw( uno::RuntimeException )
705 return getSupportedServiceNames_Static();
708 // XLocalizable
709 void SAL_CALL SampleAddIn::setLocale( const lang::Locale& eLocale )
710 throw( uno::RuntimeException )
712 maLocale = eLocale;
715 lang::Locale SAL_CALL SampleAddIn::getLocale()
716 throw( uno::RuntimeException )
718 return maLocale;