bump product version to 4.1.6.2
[LibreOffice.git] / reportdesign / source / core / api / FixedLine.cxx
blobedfb3b84361f2616e94289393c64a6ca76bba44b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #include "FixedLine.hxx"
20 #include <com/sun/star/beans/PropertyAttribute.hpp>
21 #include "corestrings.hrc"
22 #include "core_resource.hrc"
23 #include "core_resource.hxx"
24 #include <comphelper/sequence.hxx>
25 #include <tools/debug.hxx>
26 #include <comphelper/property.hxx>
27 #include "Tools.hxx"
28 #include "FormatCondition.hxx"
29 #include <com/sun/star/beans/XPropertyState.hpp>
30 #include <com/sun/star/text/ParagraphVertAlign.hpp>
31 #include "ReportHelperImpl.hxx"
33 #define MIN_WIDTH 80
34 #define MIN_HEIGHT 20
35 // =============================================================================
36 namespace reportdesign
38 // =============================================================================
39 using namespace com::sun::star;
40 using namespace comphelper;
41 uno::Sequence< OUString > lcl_getLineOptionals()
43 OUString pProps[] = {
44 OUString(PROPERTY_DATAFIELD)
45 ,OUString(PROPERTY_DEFAULTCONTROL)
46 ,OUString(PROPERTY_CONTROLBORDER)
47 ,OUString(PROPERTY_CONTROLBORDERCOLOR)
48 ,OUString(PROPERTY_CHARCOLOR)
49 ,OUString(PROPERTY_CHAREMPHASIS)
50 ,OUString(PROPERTY_CHARFONTCHARSET)
51 ,OUString(PROPERTY_CHARFONTFAMILY)
52 ,OUString(PROPERTY_CHARFONTNAME)
53 ,OUString(PROPERTY_CHARFONTPITCH)
54 ,OUString(PROPERTY_CHARFONTSTYLENAME)
55 ,OUString(PROPERTY_CHARHEIGHT)
56 ,OUString(PROPERTY_CHARPOSTURE)
57 ,OUString(PROPERTY_CHARRELIEF)
58 ,OUString(PROPERTY_FONTDESCRIPTOR)
59 ,OUString(PROPERTY_FONTDESCRIPTORASIAN)
60 ,OUString(PROPERTY_FONTDESCRIPTORCOMPLEX)
61 ,OUString(PROPERTY_CONTROLTEXTEMPHASISMARK)
62 ,OUString(PROPERTY_CHARROTATION)
63 ,OUString(PROPERTY_CHARSCALEWIDTH)
64 ,OUString(PROPERTY_CHARSTRIKEOUT)
65 ,OUString(PROPERTY_CHARUNDERLINECOLOR)
66 ,OUString(PROPERTY_CHARUNDERLINE)
67 ,OUString(PROPERTY_CHARWEIGHT)
68 ,OUString(PROPERTY_CHARWORDMODE)
69 ,OUString(PROPERTY_CONTROLBACKGROUND)
70 ,OUString(PROPERTY_CONTROLBACKGROUNDTRANSPARENT)
71 ,OUString(PROPERTY_CHARFLASH)
72 ,OUString(PROPERTY_CHARAUTOKERNING)
73 ,OUString(PROPERTY_CHARESCAPEMENTHEIGHT)
74 ,OUString(PROPERTY_CHARLOCALE)
75 ,OUString(PROPERTY_CHARESCAPEMENT)
76 ,OUString(PROPERTY_CHARCASEMAP)
77 ,OUString(PROPERTY_CHARCOMBINEISON)
78 ,OUString(PROPERTY_CHARCOMBINEPREFIX)
79 ,OUString(PROPERTY_CHARCOMBINESUFFIX)
80 ,OUString(PROPERTY_CHARHIDDEN)
81 ,OUString(PROPERTY_CHARSHADOWED)
82 ,OUString(PROPERTY_CHARCONTOURED)
83 ,OUString(PROPERTY_HYPERLINKURL)
84 ,OUString(PROPERTY_HYPERLINKTARGET)
85 ,OUString(PROPERTY_HYPERLINKNAME)
86 ,OUString(PROPERTY_VISITEDCHARSTYLENAME)
87 ,OUString(PROPERTY_UNVISITEDCHARSTYLENAME)
88 ,OUString(PROPERTY_CHARKERNING)
89 ,OUString(PROPERTY_PRINTREPEATEDVALUES)
90 ,OUString(PROPERTY_CONDITIONALPRINTEXPRESSION)
91 ,OUString(PROPERTY_PRINTWHENGROUPCHANGE)
92 ,OUString(PROPERTY_MASTERFIELDS)
93 ,OUString(PROPERTY_DETAILFIELDS)
94 ,OUString(PROPERTY_PARAADJUST)
96 , OUString(PROPERTY_CHAREMPHASISASIAN)
97 , OUString(PROPERTY_CHARFONTNAMEASIAN)
98 , OUString(PROPERTY_CHARFONTSTYLENAMEASIAN)
99 , OUString(PROPERTY_CHARFONTFAMILYASIAN)
100 , OUString(PROPERTY_CHARFONTCHARSETASIAN)
101 , OUString(PROPERTY_CHARFONTPITCHASIAN)
102 , OUString(PROPERTY_CHARHEIGHTASIAN)
103 , OUString(PROPERTY_CHARUNDERLINEASIAN)
104 , OUString(PROPERTY_CHARWEIGHTASIAN)
105 , OUString(PROPERTY_CHARPOSTUREASIAN)
106 , OUString(PROPERTY_CHARWORDMODEASIAN)
107 , OUString(PROPERTY_CHARROTATIONASIAN)
108 , OUString(PROPERTY_CHARSCALEWIDTHASIAN)
109 , OUString(PROPERTY_CHARLOCALEASIAN)
110 , OUString(PROPERTY_CHAREMPHASISCOMPLEX)
111 , OUString(PROPERTY_CHARFONTNAMECOMPLEX)
112 , OUString(PROPERTY_CHARFONTSTYLENAMECOMPLEX)
113 , OUString(PROPERTY_CHARFONTFAMILYCOMPLEX)
114 , OUString(PROPERTY_CHARFONTCHARSETCOMPLEX)
115 , OUString(PROPERTY_CHARFONTPITCHCOMPLEX)
116 , OUString(PROPERTY_CHARHEIGHTCOMPLEX)
117 , OUString(PROPERTY_CHARUNDERLINECOMPLEX)
118 , OUString(PROPERTY_CHARWEIGHTCOMPLEX)
119 , OUString(PROPERTY_CHARPOSTURECOMPLEX)
120 , OUString(PROPERTY_CHARWORDMODECOMPLEX)
121 , OUString(PROPERTY_CHARROTATIONCOMPLEX)
122 , OUString(PROPERTY_CHARSCALEWIDTHCOMPLEX)
123 , OUString(PROPERTY_CHARLOCALECOMPLEX)
127 return uno::Sequence< OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
129 DBG_NAME(rpt_OFixedLine)
130 // -----------------------------------------------------------------------------
131 OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext)
132 :FixedLineBase(m_aMutex)
133 ,FixedLinePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getLineOptionals())
134 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
135 ,m_nOrientation(1)
136 ,m_LineColor(0)
137 ,m_LineTransparence(0)
138 ,m_LineWidth(0)
140 DBG_CTOR(rpt_OFixedLine,NULL);
141 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDLINE,m_aProps.aComponent.m_xContext->getServiceManager());
142 m_aProps.aComponent.m_nWidth = MIN_WIDTH;
144 // -----------------------------------------------------------------------------
145 OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext
146 ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
147 ,uno::Reference< drawing::XShape >& _xShape
148 ,sal_Int32 _nOrientation)
149 :FixedLineBase(m_aMutex)
150 ,FixedLinePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getLineOptionals())
151 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
152 ,m_nOrientation(_nOrientation)
153 ,m_LineColor(0)
154 ,m_LineTransparence(0)
155 ,m_LineWidth(0)
157 DBG_CTOR(rpt_OFixedLine,NULL);
158 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDLINE,m_aProps.aComponent.m_xContext->getServiceManager());
159 m_aProps.aComponent.m_xFactory = _xFactory;
160 osl_atomic_increment( &m_refCount );
163 awt::Size aSize = _xShape->getSize();
164 if ( m_nOrientation == 1 )
166 if ( aSize.Width < MIN_WIDTH )
168 aSize.Width = MIN_WIDTH;
169 _xShape->setSize(aSize);
172 else if ( MIN_HEIGHT > aSize.Height )
174 aSize.Height = MIN_HEIGHT;
175 _xShape->setSize(aSize);
177 m_aProps.aComponent.setShape(_xShape,this,m_refCount);
179 catch(uno::Exception&)
181 OSL_FAIL("OFixedLine::OFixedLine: Exception caught!");
183 osl_atomic_decrement( &m_refCount );
185 // -----------------------------------------------------------------------------
186 OFixedLine::~OFixedLine()
188 DBG_DTOR(rpt_OFixedLine,NULL);
190 // -----------------------------------------------------------------------------
191 IMPLEMENT_FORWARD_REFCOUNT( OFixedLine, FixedLineBase )
192 // --------------------------------------------------------------------------------
193 uno::Any SAL_CALL OFixedLine::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
195 uno::Any aReturn = FixedLineBase::queryInterface(_rType);
196 if ( !aReturn.hasValue() )
197 aReturn = FixedLinePropertySet::queryInterface(_rType);
198 if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
199 return aReturn;
201 return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
203 // -----------------------------------------------------------------------------
204 void SAL_CALL OFixedLine::dispose() throw(uno::RuntimeException)
206 FixedLinePropertySet::dispose();
207 cppu::WeakComponentImplHelperBase::dispose();
209 // -----------------------------------------------------------------------------
210 OUString OFixedLine::getImplementationName_Static( ) throw(uno::RuntimeException)
212 return OUString("com.sun.star.comp.report.OFixedLine");
215 //--------------------------------------------------------------------------
216 OUString SAL_CALL OFixedLine::getImplementationName( ) throw(uno::RuntimeException)
218 return getImplementationName_Static();
220 //--------------------------------------------------------------------------
221 uno::Sequence< OUString > OFixedLine::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
223 uno::Sequence< OUString > aServices(1);
224 aServices.getArray()[0] = SERVICE_FIXEDLINE;
226 return aServices;
228 //------------------------------------------------------------------------------
229 uno::Reference< uno::XInterface > OFixedLine::create(uno::Reference< uno::XComponentContext > const & xContext)
231 return *(new OFixedLine(xContext));
234 //--------------------------------------------------------------------------
235 uno::Sequence< OUString > SAL_CALL OFixedLine::getSupportedServiceNames( ) throw(uno::RuntimeException)
237 return getSupportedServiceNames_Static();
239 //------------------------------------------------------------------------------
240 sal_Bool SAL_CALL OFixedLine::supportsService(const OUString& ServiceName) throw( uno::RuntimeException )
242 return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
244 // -----------------------------------------------------------------------------
245 // XReportComponent
246 REPORTCOMPONENT_IMPL3(OFixedLine,m_aProps.aComponent)
247 REPORTCOMPONENT_NOMASTERDETAIL(OFixedLine)
248 // -----------------------------------------------------------------------------
249 ::sal_Int16 SAL_CALL OFixedLine::getControlBorder( ) throw (beans::UnknownPropertyException, uno::RuntimeException)
251 throw beans::UnknownPropertyException();
253 // -----------------------------------------------------------------------------
254 void SAL_CALL OFixedLine::setControlBorder( ::sal_Int16 /*_border*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
256 throw beans::UnknownPropertyException();
258 // -----------------------------------------------------------------------------
259 ::sal_Int32 SAL_CALL OFixedLine::getControlBorderColor() throw (beans::UnknownPropertyException,uno::RuntimeException)
261 throw beans::UnknownPropertyException();
263 // -----------------------------------------------------------------------------
264 void SAL_CALL OFixedLine::setControlBorderColor( ::sal_Int32 /*_bordercolor*/ ) throw (beans::UnknownPropertyException,lang::IllegalArgumentException,uno::RuntimeException)
266 throw beans::UnknownPropertyException();
268 // -----------------------------------------------------------------------------
269 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFixedLine::getPropertySetInfo( ) throw(uno::RuntimeException)
271 return FixedLinePropertySet::getPropertySetInfo();
273 // -----------------------------------------------------------------------------
274 void SAL_CALL OFixedLine::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
276 FixedLinePropertySet::setPropertyValue( aPropertyName, aValue );
278 // -----------------------------------------------------------------------------
279 uno::Any SAL_CALL OFixedLine::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
281 return FixedLinePropertySet::getPropertyValue( PropertyName);
283 // -----------------------------------------------------------------------------
284 void SAL_CALL OFixedLine::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
286 FixedLinePropertySet::addPropertyChangeListener( aPropertyName, xListener );
288 // -----------------------------------------------------------------------------
289 void SAL_CALL OFixedLine::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
291 FixedLinePropertySet::removePropertyChangeListener( aPropertyName, aListener );
293 // -----------------------------------------------------------------------------
294 void SAL_CALL OFixedLine::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
296 FixedLinePropertySet::addVetoableChangeListener( PropertyName, aListener );
298 // -----------------------------------------------------------------------------
299 void SAL_CALL OFixedLine::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
301 FixedLinePropertySet::removeVetoableChangeListener( PropertyName, aListener );
303 // -----------------------------------------------------------------------------
304 // XReportControlModel
305 OUString SAL_CALL OFixedLine::getDataField() throw (beans::UnknownPropertyException, uno::RuntimeException)
307 throw beans::UnknownPropertyException();
309 // -----------------------------------------------------------------------------
310 void SAL_CALL OFixedLine::setDataField( const OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
312 throw beans::UnknownPropertyException();
314 // -----------------------------------------------------------------------------
315 ::sal_Int32 SAL_CALL OFixedLine::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
317 throw beans::UnknownPropertyException();
319 // -----------------------------------------------------------------------------
320 void SAL_CALL OFixedLine::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException)
322 throw beans::UnknownPropertyException();
324 // -----------------------------------------------------------------------------
325 ::sal_Bool SAL_CALL OFixedLine::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
327 throw beans::UnknownPropertyException();
329 // -----------------------------------------------------------------------------
330 void SAL_CALL OFixedLine::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
332 throw beans::UnknownPropertyException();
334 // -----------------------------------------------------------------------------
335 ::sal_Bool SAL_CALL OFixedLine::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
337 throw beans::UnknownPropertyException();
339 // -----------------------------------------------------------------------------
340 void SAL_CALL OFixedLine::setPrintWhenGroupChange( ::sal_Bool /*_printwhengroupchange*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
342 throw beans::UnknownPropertyException();
344 // -----------------------------------------------------------------------------
345 OUString SAL_CALL OFixedLine::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
347 throw beans::UnknownPropertyException();
349 // -----------------------------------------------------------------------------
350 void SAL_CALL OFixedLine::setConditionalPrintExpression( const OUString& /*_conditionalprintexpression*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
352 throw beans::UnknownPropertyException();
354 // -----------------------------------------------------------------------------
355 // XCloneable
356 uno::Reference< util::XCloneable > SAL_CALL OFixedLine::createClone( ) throw (uno::RuntimeException)
358 uno::Reference< report::XReportComponent> xSource = this;
359 uno::Reference< report::XFixedLine> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FIXEDLINE),uno::UNO_QUERY_THROW);
360 return xSet.get();
362 // -----------------------------------------------------------------------------
364 // XFixedLine
365 // -----------------------------------------------------------------------------
366 ::sal_Int32 SAL_CALL OFixedLine::getOrientation() throw (beans::UnknownPropertyException,uno::RuntimeException)
368 ::osl::MutexGuard aGuard(m_aMutex);
369 return m_nOrientation;
371 // -----------------------------------------------------------------------------
372 void SAL_CALL OFixedLine::setOrientation( ::sal_Int32 _orientation ) throw (beans::UnknownPropertyException,uno::RuntimeException)
374 set(PROPERTY_ORIENTATION,_orientation,m_nOrientation);
376 // -----------------------------------------------------------------------------
377 drawing::LineStyle SAL_CALL OFixedLine::getLineStyle() throw (uno::RuntimeException)
379 ::osl::MutexGuard aGuard(m_aMutex);
380 return m_LineStyle;
382 // -----------------------------------------------------------------------------
383 void SAL_CALL OFixedLine::setLineStyle( drawing::LineStyle _linestyle ) throw (uno::RuntimeException)
385 set(PROPERTY_LINESTYLE,_linestyle,m_LineStyle);
387 // -----------------------------------------------------------------------------
388 drawing::LineDash SAL_CALL OFixedLine::getLineDash() throw (uno::RuntimeException)
390 ::osl::MutexGuard aGuard(m_aMutex);
391 return m_LineDash;
393 // -----------------------------------------------------------------------------
394 void SAL_CALL OFixedLine::setLineDash( const drawing::LineDash& _linedash ) throw (uno::RuntimeException)
396 set(PROPERTY_LINEDASH,_linedash,m_LineDash);
398 // -----------------------------------------------------------------------------
399 ::sal_Int32 SAL_CALL OFixedLine::getLineColor() throw (uno::RuntimeException)
401 ::osl::MutexGuard aGuard(m_aMutex);
402 return m_LineColor;
404 // -----------------------------------------------------------------------------
405 void SAL_CALL OFixedLine::setLineColor( ::sal_Int32 _linecolor ) throw (uno::RuntimeException)
407 set(PROPERTY_LINECOLOR,_linecolor,m_LineColor);
409 // -----------------------------------------------------------------------------
410 ::sal_Int16 SAL_CALL OFixedLine::getLineTransparence() throw (uno::RuntimeException)
412 ::osl::MutexGuard aGuard(m_aMutex);
413 return m_LineTransparence;
415 // -----------------------------------------------------------------------------
416 void SAL_CALL OFixedLine::setLineTransparence( ::sal_Int16 _linetransparence ) throw (uno::RuntimeException)
418 set(PROPERTY_LINETRANSPARENCE,_linetransparence,m_LineTransparence);
420 // -----------------------------------------------------------------------------
421 ::sal_Int32 SAL_CALL OFixedLine::getLineWidth() throw (uno::RuntimeException)
423 ::osl::MutexGuard aGuard(m_aMutex);
424 return m_LineWidth;
426 // -----------------------------------------------------------------------------
427 void SAL_CALL OFixedLine::setLineWidth( ::sal_Int32 _linewidth ) throw (uno::RuntimeException)
429 set(PROPERTY_LINEWIDTH,_linewidth,m_LineWidth);
431 // -----------------------------------------------------------------------------
432 // -----------------------------------------------------------------------------
433 // XChild
434 uno::Reference< uno::XInterface > SAL_CALL OFixedLine::getParent( ) throw (uno::RuntimeException)
436 return OShapeHelper::getParent(this);
438 // -----------------------------------------------------------------------------
439 void SAL_CALL OFixedLine::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
441 OShapeHelper::setParent(Parent,this);
443 // -----------------------------------------------------------------------------
444 uno::Reference< report::XFormatCondition > SAL_CALL OFixedLine::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
446 return new OFormatCondition(m_aProps.aComponent.m_xContext);
448 // -----------------------------------------------------------------------------
449 // XContainer
450 void SAL_CALL OFixedLine::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
452 m_aProps.addContainerListener(xListener);
454 // -----------------------------------------------------------------------------
455 void SAL_CALL OFixedLine::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
457 m_aProps.removeContainerListener(xListener);
459 // -----------------------------------------------------------------------------
460 // XElementAccess
461 uno::Type SAL_CALL OFixedLine::getElementType( ) throw (uno::RuntimeException)
463 return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
465 // -----------------------------------------------------------------------------
466 ::sal_Bool SAL_CALL OFixedLine::hasElements( ) throw (uno::RuntimeException)
468 return m_aProps.hasElements();
470 // -----------------------------------------------------------------------------
471 // XIndexContainer
472 void SAL_CALL OFixedLine::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
474 m_aProps.insertByIndex(Index,Element);
476 // -----------------------------------------------------------------------------
477 void SAL_CALL OFixedLine::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
479 m_aProps.removeByIndex(Index);
481 // -----------------------------------------------------------------------------
482 // XIndexReplace
483 void SAL_CALL OFixedLine::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
485 m_aProps.replaceByIndex(Index,Element);
487 // -----------------------------------------------------------------------------
488 // XIndexAccess
489 ::sal_Int32 SAL_CALL OFixedLine::getCount( ) throw (uno::RuntimeException)
491 return m_aProps.getCount();
493 // -----------------------------------------------------------------------------
494 uno::Any SAL_CALL OFixedLine::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
496 return m_aProps.getByIndex( Index );
498 // -----------------------------------------------------------------------------
499 // XShape
500 awt::Point SAL_CALL OFixedLine::getPosition( ) throw (uno::RuntimeException)
502 return OShapeHelper::getPosition(this);
504 // -----------------------------------------------------------------------------
505 void SAL_CALL OFixedLine::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
507 OShapeHelper::setPosition(aPosition,this);
509 // -----------------------------------------------------------------------------
510 awt::Size SAL_CALL OFixedLine::getSize( ) throw (uno::RuntimeException)
512 return OShapeHelper::getSize(this);
514 // -----------------------------------------------------------------------------
515 void SAL_CALL OFixedLine::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
517 const char hundredthmmC[] = "0\xe2\x80\x89\xC2\xB5""m"; // in UTF-8: 0, thin space, ยต (micro), m (meter)
518 const OUString hundredthmm(hundredthmmC, sizeof(hundredthmmC)-1, RTL_TEXTENCODING_UTF8);
519 if ( aSize.Width < MIN_WIDTH && m_nOrientation == 1 )
520 throw beans::PropertyVetoException("Too small width for FixedLine; minimum is " + OUString::number(MIN_WIDTH) + hundredthmm, static_cast<cppu::OWeakObject*>(this));
521 else if ( aSize.Height < MIN_HEIGHT && m_nOrientation == 0 )
522 throw beans::PropertyVetoException("Too small height for FixedLine; minimum is " + OUString::number(MIN_HEIGHT) + hundredthmm, static_cast<cppu::OWeakObject*>(this));
523 OShapeHelper::setSize(aSize,this);
525 // -----------------------------------------------------------------------------
526 // XShapeDescriptor
527 OUString SAL_CALL OFixedLine::getShapeType( ) throw (uno::RuntimeException)
529 ::osl::MutexGuard aGuard(m_aMutex);
530 if ( m_aProps.aComponent.m_xShape.is() )
531 return m_aProps.aComponent.m_xShape->getShapeType();
532 return OUString("com.sun.star.drawing.ControlShape");
534 // -----------------------------------------------------------------------------
535 OUString SAL_CALL OFixedLine::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException)
537 throw beans::UnknownPropertyException();
539 void SAL_CALL OFixedLine::setHyperLinkURL(const OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)
541 throw beans::UnknownPropertyException();
543 OUString SAL_CALL OFixedLine::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException)
545 throw beans::UnknownPropertyException();
547 void SAL_CALL OFixedLine::setHyperLinkTarget(const OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)
549 throw beans::UnknownPropertyException();
551 OUString SAL_CALL OFixedLine::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException)
553 throw beans::UnknownPropertyException();
555 void SAL_CALL OFixedLine::setHyperLinkName(const OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)
557 throw beans::UnknownPropertyException();
560 NO_REPORTCONTROLFORMAT_IMPL(OFixedLine)
562 ::sal_Bool SAL_CALL OFixedLine::getPrintRepeatedValues() throw (beans::UnknownPropertyException, uno::RuntimeException)
564 throw beans::UnknownPropertyException();
566 void SAL_CALL OFixedLine::setPrintRepeatedValues( ::sal_Bool /*_printrepeatedvalues*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
568 throw beans::UnknownPropertyException();
571 // -----------------------------------------------------------------------------
572 // =============================================================================
573 } // namespace reportdesign
574 // =============================================================================
576 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */