1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #include "FixedLine.hxx" 28 #include <com/sun/star/beans/PropertyAttribute.hpp> 29 #ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC 30 #include "corestrings.hrc" 31 #endif 32 #ifndef REPORTDESIGN_CORE_RESOURCE_HRC_ 33 #include "core_resource.hrc" 34 #endif 35 #include "core_resource.hxx" 36 #include <comphelper/sequence.hxx> 37 #include <tools/debug.hxx> 38 #include <comphelper/property.hxx> 39 #include "Tools.hxx" 40 #include "FormatCondition.hxx" 41 #include <com/sun/star/beans/XPropertyState.hpp> 42 #include <com/sun/star/text/ParagraphVertAlign.hpp> 43 #include <boost/bind.hpp> 44 #include "ReportHelperImpl.hxx" 45 46 #define MIN_WIDTH 80 47 #define MIN_HEIGHT 20 48 // ============================================================================= 49 namespace reportdesign 50 { 51 // ============================================================================= 52 using namespace com::sun::star; 53 using namespace comphelper; 54 uno::Sequence< ::rtl::OUString > lcl_getLineOptionals() 55 { 56 ::rtl::OUString pProps[] = { 57 PROPERTY_DATAFIELD 58 ,PROPERTY_DEFAULTCONTROL 59 ,PROPERTY_CONTROLBORDER 60 ,PROPERTY_CONTROLBORDERCOLOR 61 ,PROPERTY_CHARCOLOR 62 ,PROPERTY_CHAREMPHASIS 63 ,PROPERTY_CHARFONTCHARSET 64 ,PROPERTY_CHARFONTFAMILY 65 ,PROPERTY_CHARFONTNAME 66 ,PROPERTY_CHARFONTPITCH 67 ,PROPERTY_CHARFONTSTYLENAME 68 ,PROPERTY_CHARHEIGHT 69 ,PROPERTY_CHARPOSTURE 70 ,PROPERTY_CHARRELIEF 71 ,PROPERTY_FONTDESCRIPTOR 72 ,PROPERTY_FONTDESCRIPTORASIAN 73 ,PROPERTY_FONTDESCRIPTORCOMPLEX 74 ,PROPERTY_CONTROLTEXTEMPHASISMARK 75 ,PROPERTY_CHARROTATION 76 ,PROPERTY_CHARSCALEWIDTH 77 ,PROPERTY_CHARSTRIKEOUT 78 ,PROPERTY_CHARUNDERLINECOLOR 79 ,PROPERTY_CHARUNDERLINE 80 ,PROPERTY_CHARWEIGHT 81 ,PROPERTY_CHARWORDMODE 82 ,PROPERTY_CONTROLBACKGROUND 83 ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT 84 ,PROPERTY_CHARFLASH 85 ,PROPERTY_CHARAUTOKERNING 86 ,PROPERTY_CHARESCAPEMENTHEIGHT 87 ,PROPERTY_CHARLOCALE 88 ,PROPERTY_CHARESCAPEMENT 89 ,PROPERTY_CHARCASEMAP 90 ,PROPERTY_CHARCOMBINEISON 91 ,PROPERTY_CHARCOMBINEPREFIX 92 ,PROPERTY_CHARCOMBINESUFFIX 93 ,PROPERTY_CHARHIDDEN 94 ,PROPERTY_CHARSHADOWED 95 ,PROPERTY_CHARCONTOURED 96 ,PROPERTY_HYPERLINKURL 97 ,PROPERTY_HYPERLINKTARGET 98 ,PROPERTY_HYPERLINKNAME 99 ,PROPERTY_VISITEDCHARSTYLENAME 100 ,PROPERTY_UNVISITEDCHARSTYLENAME 101 ,PROPERTY_CHARKERNING 102 ,PROPERTY_PRINTREPEATEDVALUES 103 ,PROPERTY_CONDITIONALPRINTEXPRESSION 104 ,PROPERTY_PRINTWHENGROUPCHANGE 105 ,PROPERTY_MASTERFIELDS 106 ,PROPERTY_DETAILFIELDS 107 ,PROPERTY_PARAADJUST 108 109 , PROPERTY_CHAREMPHASISASIAN 110 , PROPERTY_CHARFONTNAMEASIAN 111 , PROPERTY_CHARFONTSTYLENAMEASIAN 112 , PROPERTY_CHARFONTFAMILYASIAN 113 , PROPERTY_CHARFONTCHARSETASIAN 114 , PROPERTY_CHARFONTPITCHASIAN 115 , PROPERTY_CHARHEIGHTASIAN 116 , PROPERTY_CHARUNDERLINEASIAN 117 , PROPERTY_CHARWEIGHTASIAN 118 , PROPERTY_CHARPOSTUREASIAN 119 , PROPERTY_CHARWORDMODEASIAN 120 , PROPERTY_CHARROTATIONASIAN 121 , PROPERTY_CHARSCALEWIDTHASIAN 122 , PROPERTY_CHARLOCALEASIAN 123 , PROPERTY_CHAREMPHASISCOMPLEX 124 , PROPERTY_CHARFONTNAMECOMPLEX 125 , PROPERTY_CHARFONTSTYLENAMECOMPLEX 126 , PROPERTY_CHARFONTFAMILYCOMPLEX 127 , PROPERTY_CHARFONTCHARSETCOMPLEX 128 , PROPERTY_CHARFONTPITCHCOMPLEX 129 , PROPERTY_CHARHEIGHTCOMPLEX 130 , PROPERTY_CHARUNDERLINECOMPLEX 131 , PROPERTY_CHARWEIGHTCOMPLEX 132 , PROPERTY_CHARPOSTURECOMPLEX 133 , PROPERTY_CHARWORDMODECOMPLEX 134 , PROPERTY_CHARROTATIONCOMPLEX 135 , PROPERTY_CHARSCALEWIDTHCOMPLEX 136 , PROPERTY_CHARLOCALECOMPLEX 137 138 139 }; 140 return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0])); 141 } 142 DBG_NAME(rpt_OFixedLine) 143 // ----------------------------------------------------------------------------- 144 OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext) 145 :FixedLineBase(m_aMutex) 146 ,FixedLinePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getLineOptionals()) 147 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext) 148 ,m_nOrientation(1) 149 ,m_LineColor(0) 150 ,m_LineTransparence(0) 151 ,m_LineWidth(0) 152 { 153 DBG_CTOR(rpt_OFixedLine,NULL); 154 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDLINE,m_aProps.aComponent.m_xContext->getServiceManager()); 155 m_aProps.aComponent.m_nWidth = MIN_WIDTH; 156 } 157 // ----------------------------------------------------------------------------- 158 OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext 159 ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory 160 ,uno::Reference< drawing::XShape >& _xShape 161 ,sal_Int32 _nOrientation) 162 :FixedLineBase(m_aMutex) 163 ,FixedLinePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getLineOptionals()) 164 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext) 165 ,m_nOrientation(_nOrientation) 166 ,m_LineColor(0) 167 ,m_LineTransparence(0) 168 ,m_LineWidth(0) 169 { 170 DBG_CTOR(rpt_OFixedLine,NULL); 171 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDLINE,m_aProps.aComponent.m_xContext->getServiceManager()); 172 m_aProps.aComponent.m_xFactory = _xFactory; 173 osl_incrementInterlockedCount( &m_refCount ); 174 try 175 { 176 awt::Size aSize = _xShape->getSize(); 177 if ( m_nOrientation == 1 ) 178 { 179 if ( aSize.Width < MIN_WIDTH ) 180 { 181 aSize.Width = MIN_WIDTH; 182 _xShape->setSize(aSize); 183 } 184 } 185 else if ( MIN_HEIGHT > aSize.Height ) 186 { 187 aSize.Height = MIN_HEIGHT; 188 _xShape->setSize(aSize); 189 } 190 m_aProps.aComponent.setShape(_xShape,this,m_refCount); 191 } 192 catch(uno::Exception&) 193 { 194 OSL_ENSURE(0,"OFixedLine::OFixedLine: Exception caught!"); 195 } 196 osl_decrementInterlockedCount( &m_refCount ); 197 } 198 // ----------------------------------------------------------------------------- 199 OFixedLine::~OFixedLine() 200 { 201 DBG_DTOR(rpt_OFixedLine,NULL); 202 } 203 // ----------------------------------------------------------------------------- 204 //IMPLEMENT_FORWARD_XINTERFACE2(OFixedLine,FixedLineBase,FixedLinePropertySet) 205 IMPLEMENT_FORWARD_REFCOUNT( OFixedLine, FixedLineBase ) 206 // -------------------------------------------------------------------------------- 207 uno::Any SAL_CALL OFixedLine::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) 208 { 209 uno::Any aReturn = FixedLineBase::queryInterface(_rType); 210 if ( !aReturn.hasValue() ) 211 aReturn = FixedLinePropertySet::queryInterface(_rType); 212 if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) ) 213 return aReturn; 214 215 return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn); 216 } 217 // ----------------------------------------------------------------------------- 218 void SAL_CALL OFixedLine::dispose() throw(uno::RuntimeException) 219 { 220 FixedLinePropertySet::dispose(); 221 cppu::WeakComponentImplHelperBase::dispose(); 222 } 223 // ----------------------------------------------------------------------------- 224 ::rtl::OUString OFixedLine::getImplementationName_Static( ) throw(uno::RuntimeException) 225 { 226 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFixedLine")); 227 } 228 229 //-------------------------------------------------------------------------- 230 ::rtl::OUString SAL_CALL OFixedLine::getImplementationName( ) throw(uno::RuntimeException) 231 { 232 return getImplementationName_Static(); 233 } 234 //-------------------------------------------------------------------------- 235 uno::Sequence< ::rtl::OUString > OFixedLine::getSupportedServiceNames_Static( ) throw(uno::RuntimeException) 236 { 237 uno::Sequence< ::rtl::OUString > aServices(1); 238 aServices.getArray()[0] = SERVICE_FIXEDLINE; 239 240 return aServices; 241 } 242 //------------------------------------------------------------------------------ 243 uno::Reference< uno::XInterface > OFixedLine::create(uno::Reference< uno::XComponentContext > const & xContext) 244 { 245 return *(new OFixedLine(xContext)); 246 } 247 248 //-------------------------------------------------------------------------- 249 uno::Sequence< ::rtl::OUString > SAL_CALL OFixedLine::getSupportedServiceNames( ) throw(uno::RuntimeException) 250 { 251 return getSupportedServiceNames_Static(); 252 } 253 //------------------------------------------------------------------------------ 254 sal_Bool SAL_CALL OFixedLine::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException ) 255 { 256 return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static()); 257 } 258 // ----------------------------------------------------------------------------- 259 // XReportComponent 260 REPORTCOMPONENT_IMPL3(OFixedLine,m_aProps.aComponent) 261 REPORTCOMPONENT_NOMASTERDETAIL(OFixedLine) 262 // ----------------------------------------------------------------------------- 263 ::sal_Int16 SAL_CALL OFixedLine::getControlBorder( ) throw (beans::UnknownPropertyException, uno::RuntimeException) 264 { 265 throw beans::UnknownPropertyException(); 266 } 267 // ----------------------------------------------------------------------------- 268 void SAL_CALL OFixedLine::setControlBorder( ::sal_Int16 /*_border*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException) 269 { 270 throw beans::UnknownPropertyException(); 271 } 272 // ----------------------------------------------------------------------------- 273 ::sal_Int32 SAL_CALL OFixedLine::getControlBorderColor() throw (beans::UnknownPropertyException,uno::RuntimeException) 274 { 275 throw beans::UnknownPropertyException(); 276 } 277 // ----------------------------------------------------------------------------- 278 void SAL_CALL OFixedLine::setControlBorderColor( ::sal_Int32 /*_bordercolor*/ ) throw (beans::UnknownPropertyException,lang::IllegalArgumentException,uno::RuntimeException) 279 { 280 throw beans::UnknownPropertyException(); 281 } 282 // ----------------------------------------------------------------------------- 283 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFixedLine::getPropertySetInfo( ) throw(uno::RuntimeException) 284 { 285 return FixedLinePropertySet::getPropertySetInfo(); 286 } 287 // ----------------------------------------------------------------------------- 288 void SAL_CALL OFixedLine::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) 289 { 290 FixedLinePropertySet::setPropertyValue( aPropertyName, aValue ); 291 } 292 // ----------------------------------------------------------------------------- 293 uno::Any SAL_CALL OFixedLine::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 294 { 295 return FixedLinePropertySet::getPropertyValue( PropertyName); 296 } 297 // ----------------------------------------------------------------------------- 298 void SAL_CALL OFixedLine::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 299 { 300 FixedLinePropertySet::addPropertyChangeListener( aPropertyName, xListener ); 301 } 302 // ----------------------------------------------------------------------------- 303 void SAL_CALL OFixedLine::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 304 { 305 FixedLinePropertySet::removePropertyChangeListener( aPropertyName, aListener ); 306 } 307 // ----------------------------------------------------------------------------- 308 void SAL_CALL OFixedLine::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 309 { 310 FixedLinePropertySet::addVetoableChangeListener( PropertyName, aListener ); 311 } 312 // ----------------------------------------------------------------------------- 313 void SAL_CALL OFixedLine::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 314 { 315 FixedLinePropertySet::removeVetoableChangeListener( PropertyName, aListener ); 316 } 317 // ----------------------------------------------------------------------------- 318 // XReportControlModel 319 ::rtl::OUString SAL_CALL OFixedLine::getDataField() throw (beans::UnknownPropertyException, uno::RuntimeException) 320 { 321 throw beans::UnknownPropertyException(); 322 } 323 // ----------------------------------------------------------------------------- 324 void SAL_CALL OFixedLine::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException) 325 { 326 throw beans::UnknownPropertyException(); 327 } 328 // ----------------------------------------------------------------------------- 329 ::sal_Int32 SAL_CALL OFixedLine::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException) 330 { 331 throw beans::UnknownPropertyException(); 332 } 333 // ----------------------------------------------------------------------------- 334 void SAL_CALL OFixedLine::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException) 335 { 336 throw beans::UnknownPropertyException(); 337 } 338 // ----------------------------------------------------------------------------- 339 ::sal_Bool SAL_CALL OFixedLine::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException) 340 { 341 throw beans::UnknownPropertyException(); 342 } 343 // ----------------------------------------------------------------------------- 344 void SAL_CALL OFixedLine::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException) 345 { 346 throw beans::UnknownPropertyException(); 347 } 348 // ----------------------------------------------------------------------------- 349 ::sal_Bool SAL_CALL OFixedLine::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException) 350 { 351 throw beans::UnknownPropertyException(); 352 } 353 // ----------------------------------------------------------------------------- 354 void SAL_CALL OFixedLine::setPrintWhenGroupChange( ::sal_Bool /*_printwhengroupchange*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException) 355 { 356 throw beans::UnknownPropertyException(); 357 } 358 // ----------------------------------------------------------------------------- 359 ::rtl::OUString SAL_CALL OFixedLine::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException) 360 { 361 throw beans::UnknownPropertyException(); 362 } 363 // ----------------------------------------------------------------------------- 364 void SAL_CALL OFixedLine::setConditionalPrintExpression( const ::rtl::OUString& /*_conditionalprintexpression*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException) 365 { 366 throw beans::UnknownPropertyException(); 367 } 368 // ----------------------------------------------------------------------------- 369 // XCloneable 370 uno::Reference< util::XCloneable > SAL_CALL OFixedLine::createClone( ) throw (uno::RuntimeException) 371 { 372 uno::Reference< report::XReportComponent> xSource = this; 373 uno::Reference< report::XFixedLine> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FIXEDLINE),uno::UNO_QUERY_THROW); 374 return xSet.get(); 375 } 376 // ----------------------------------------------------------------------------- 377 378 // XFixedLine 379 // ----------------------------------------------------------------------------- 380 ::sal_Int32 SAL_CALL OFixedLine::getOrientation() throw (beans::UnknownPropertyException,uno::RuntimeException) 381 { 382 ::osl::MutexGuard aGuard(m_aMutex); 383 return m_nOrientation; 384 } 385 // ----------------------------------------------------------------------------- 386 void SAL_CALL OFixedLine::setOrientation( ::sal_Int32 _orientation ) throw (beans::UnknownPropertyException,uno::RuntimeException) 387 { 388 set(PROPERTY_ORIENTATION,_orientation,m_nOrientation); 389 } 390 // ----------------------------------------------------------------------------- 391 drawing::LineStyle SAL_CALL OFixedLine::getLineStyle() throw (uno::RuntimeException) 392 { 393 ::osl::MutexGuard aGuard(m_aMutex); 394 return m_LineStyle; 395 } 396 // ----------------------------------------------------------------------------- 397 void SAL_CALL OFixedLine::setLineStyle( drawing::LineStyle _linestyle ) throw (uno::RuntimeException) 398 { 399 set(PROPERTY_LINESTYLE,_linestyle,m_LineStyle); 400 } 401 // ----------------------------------------------------------------------------- 402 drawing::LineDash SAL_CALL OFixedLine::getLineDash() throw (uno::RuntimeException) 403 { 404 ::osl::MutexGuard aGuard(m_aMutex); 405 return m_LineDash; 406 } 407 // ----------------------------------------------------------------------------- 408 void SAL_CALL OFixedLine::setLineDash( const drawing::LineDash& _linedash ) throw (uno::RuntimeException) 409 { 410 set(PROPERTY_LINEDASH,_linedash,m_LineDash); 411 } 412 // ----------------------------------------------------------------------------- 413 ::sal_Int32 SAL_CALL OFixedLine::getLineColor() throw (uno::RuntimeException) 414 { 415 ::osl::MutexGuard aGuard(m_aMutex); 416 return m_LineColor; 417 } 418 // ----------------------------------------------------------------------------- 419 void SAL_CALL OFixedLine::setLineColor( ::sal_Int32 _linecolor ) throw (uno::RuntimeException) 420 { 421 set(PROPERTY_LINECOLOR,_linecolor,m_LineColor); 422 } 423 // ----------------------------------------------------------------------------- 424 ::sal_Int16 SAL_CALL OFixedLine::getLineTransparence() throw (uno::RuntimeException) 425 { 426 ::osl::MutexGuard aGuard(m_aMutex); 427 return m_LineTransparence; 428 } 429 // ----------------------------------------------------------------------------- 430 void SAL_CALL OFixedLine::setLineTransparence( ::sal_Int16 _linetransparence ) throw (uno::RuntimeException) 431 { 432 set(PROPERTY_LINETRANSPARENCE,_linetransparence,m_LineTransparence); 433 } 434 // ----------------------------------------------------------------------------- 435 ::sal_Int32 SAL_CALL OFixedLine::getLineWidth() throw (uno::RuntimeException) 436 { 437 ::osl::MutexGuard aGuard(m_aMutex); 438 return m_LineWidth; 439 } 440 // ----------------------------------------------------------------------------- 441 void SAL_CALL OFixedLine::setLineWidth( ::sal_Int32 _linewidth ) throw (uno::RuntimeException) 442 { 443 set(PROPERTY_LINEWIDTH,_linewidth,m_LineWidth); 444 } 445 // ----------------------------------------------------------------------------- 446 // ----------------------------------------------------------------------------- 447 // XChild 448 uno::Reference< uno::XInterface > SAL_CALL OFixedLine::getParent( ) throw (uno::RuntimeException) 449 { 450 return OShapeHelper::getParent(this); 451 } 452 // ----------------------------------------------------------------------------- 453 void SAL_CALL OFixedLine::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException) 454 { 455 OShapeHelper::setParent(Parent,this); 456 } 457 // ----------------------------------------------------------------------------- 458 uno::Reference< report::XFormatCondition > SAL_CALL OFixedLine::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException) 459 { 460 return new OFormatCondition(m_aProps.aComponent.m_xContext); 461 } 462 // ----------------------------------------------------------------------------- 463 // XContainer 464 void SAL_CALL OFixedLine::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException) 465 { 466 m_aProps.addContainerListener(xListener); 467 } 468 // ----------------------------------------------------------------------------- 469 void SAL_CALL OFixedLine::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException) 470 { 471 m_aProps.removeContainerListener(xListener); 472 } 473 // ----------------------------------------------------------------------------- 474 // XElementAccess 475 uno::Type SAL_CALL OFixedLine::getElementType( ) throw (uno::RuntimeException) 476 { 477 return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL)); 478 } 479 // ----------------------------------------------------------------------------- 480 ::sal_Bool SAL_CALL OFixedLine::hasElements( ) throw (uno::RuntimeException) 481 { 482 return m_aProps.hasElements(); 483 } 484 // ----------------------------------------------------------------------------- 485 // XIndexContainer 486 void SAL_CALL OFixedLine::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) 487 { 488 m_aProps.insertByIndex(Index,Element); 489 } 490 // ----------------------------------------------------------------------------- 491 void SAL_CALL OFixedLine::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) 492 { 493 m_aProps.removeByIndex(Index); 494 } 495 // ----------------------------------------------------------------------------- 496 // XIndexReplace 497 void SAL_CALL OFixedLine::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) 498 { 499 m_aProps.replaceByIndex(Index,Element); 500 } 501 // ----------------------------------------------------------------------------- 502 // XIndexAccess 503 ::sal_Int32 SAL_CALL OFixedLine::getCount( ) throw (uno::RuntimeException) 504 { 505 return m_aProps.getCount(); 506 } 507 // ----------------------------------------------------------------------------- 508 uno::Any SAL_CALL OFixedLine::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) 509 { 510 return m_aProps.getByIndex( Index ); 511 } 512 // ----------------------------------------------------------------------------- 513 // XShape 514 awt::Point SAL_CALL OFixedLine::getPosition( ) throw (uno::RuntimeException) 515 { 516 return OShapeHelper::getPosition(this); 517 } 518 // ----------------------------------------------------------------------------- 519 void SAL_CALL OFixedLine::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException) 520 { 521 OShapeHelper::setPosition(aPosition,this); 522 } 523 // ----------------------------------------------------------------------------- 524 awt::Size SAL_CALL OFixedLine::getSize( ) throw (uno::RuntimeException) 525 { 526 return OShapeHelper::getSize(this); 527 } 528 // ----------------------------------------------------------------------------- 529 void SAL_CALL OFixedLine::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException) 530 { 531 if ( (aSize.Width < MIN_WIDTH && m_nOrientation == 1) || (aSize.Height < MIN_HEIGHT && m_nOrientation == 0) ) 532 throw beans::PropertyVetoException(); 533 OShapeHelper::setSize(aSize,this); 534 } 535 // ----------------------------------------------------------------------------- 536 // XShapeDescriptor 537 ::rtl::OUString SAL_CALL OFixedLine::getShapeType( ) throw (uno::RuntimeException) 538 { 539 ::osl::MutexGuard aGuard(m_aMutex); 540 if ( m_aProps.aComponent.m_xShape.is() ) 541 return m_aProps.aComponent.m_xShape->getShapeType(); 542 return ::rtl::OUString(); 543 } 544 // ----------------------------------------------------------------------------- 545 ::rtl::OUString SAL_CALL OFixedLine::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException) 546 { 547 throw beans::UnknownPropertyException(); 548 } 549 void SAL_CALL OFixedLine::setHyperLinkURL(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) 550 { 551 throw beans::UnknownPropertyException(); 552 } 553 ::rtl::OUString SAL_CALL OFixedLine::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException) 554 { 555 throw beans::UnknownPropertyException(); 556 } 557 void SAL_CALL OFixedLine::setHyperLinkTarget(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) 558 { 559 throw beans::UnknownPropertyException(); 560 } 561 ::rtl::OUString SAL_CALL OFixedLine::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException) 562 { 563 throw beans::UnknownPropertyException(); 564 } 565 void SAL_CALL OFixedLine::setHyperLinkName(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) 566 { 567 throw beans::UnknownPropertyException(); 568 } 569 570 NO_REPORTCONTROLFORMAT_IMPL(OFixedLine) 571 572 ::sal_Bool SAL_CALL OFixedLine::getPrintRepeatedValues() throw (beans::UnknownPropertyException, uno::RuntimeException) 573 { 574 throw beans::UnknownPropertyException(); 575 } 576 void SAL_CALL OFixedLine::setPrintRepeatedValues( ::sal_Bool /*_printrepeatedvalues*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException) 577 { 578 throw beans::UnknownPropertyException(); 579 } 580 581 // ----------------------------------------------------------------------------- 582 // ============================================================================= 583 } // namespace reportdesign 584 // ============================================================================= 585 586