1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #include "precompiled_reportdesign.hxx" 24 #include "propbrw.hxx" 25 #include "RptObject.hxx" 26 #include "ReportController.hxx" 27 #include <cppuhelper/component_context.hxx> 28 #ifndef _REPORT_DLGRESID_HRC 29 #include <RptResId.hrc> 30 #endif 31 #ifndef _RPTUI_SLOTID_HRC_ 32 #include "rptui_slotid.hrc" 33 #endif 34 #include <tools/debug.hxx> 35 #include <com/sun/star/awt/XLayoutConstrains.hpp> 36 #include <com/sun/star/inspection/ObjectInspector.hpp> 37 #include <com/sun/star/inspection/DefaultHelpProvider.hpp> 38 #ifndef _SVX_SVXIDS_HRC 39 #include <svx/svxids.hrc> 40 #endif 41 #include <vcl/stdtext.hxx> 42 #include <svx/svdview.hxx> 43 #include <svx/svdogrp.hxx> 44 #include <svx/svdpage.hxx> 45 #include <svx/svditer.hxx> 46 47 #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ 48 #include <toolkit/unohlp.hxx> 49 #endif 50 #include <comphelper/property.hxx> 51 #include <comphelper/namecontainer.hxx> 52 #include <comphelper/composedprops.hxx> 53 #include <comphelper/stl_types.hxx> 54 #include <comphelper/types.hxx> 55 #include <comphelper/sequence.hxx> 56 #include <com/sun/star/beans/PropertyValue.hpp> 57 #include <com/sun/star/awt/PosSize.hpp> 58 #include <com/sun/star/lang/XServiceInfo.hpp> 59 #include <com/sun/star/report/inspection/DefaultComponentInspectorModel.hpp> 60 #include <comphelper/processfactory.hxx> 61 #include "SectionView.hxx" 62 #include "ReportSection.hxx" 63 #ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC 64 #include "uistrings.hrc" 65 #endif 66 #include "DesignView.hxx" 67 #include "ViewsWindow.hxx" 68 #include "UITools.hxx" 69 #include <unotools/confignode.hxx> 70 71 namespace rptui 72 { 73 #define STD_WIN_SIZE_X 300 74 #define STD_WIN_SIZE_Y 350 75 76 using namespace ::com::sun::star; 77 using namespace uno; 78 using namespace lang; 79 using namespace frame; 80 using namespace beans; 81 using namespace container; 82 using namespace ::comphelper; 83 84 //---------------------------------------------------------------------------- 85 //----------------------------------------------------------------------- 86 namespace 87 { 88 static bool lcl_shouldEnableHelpSection( const Reference< XMultiServiceFactory >& _rxFactory ) 89 { 90 const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign/PropertyBrowser/" ) ); 91 const ::rtl::OUString sPropertyName( RTL_CONSTASCII_USTRINGPARAM( "DirectHelp" ) ); 92 93 ::utl::OConfigurationTreeRoot aConfiguration( 94 ::utl::OConfigurationTreeRoot::createWithServiceFactory( _rxFactory, sConfigName ) ); 95 96 bool bEnabled = false; 97 OSL_VERIFY( aConfiguration.getNodeValue( sPropertyName ) >>= bEnabled ); 98 return bEnabled; 99 } 100 } 101 //----------------------------------------------------------------------- 102 //============================================================================ 103 // PropBrw 104 //============================================================================ 105 106 DBG_NAME( rpt_PropBrw ) 107 108 //---------------------------------------------------------------------------- 109 110 PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParent,ODesignView* _pDesignView) 111 :DockingWindow(pParent,WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE)) 112 ,m_xORB(_xORB) 113 ,m_pDesignView(_pDesignView) 114 ,m_pView( NULL ) 115 ,m_bInitialStateChange(sal_True) 116 { 117 DBG_CTOR( rpt_PropBrw,NULL); 118 119 Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y); 120 SetOutputSizePixel(aPropWinSize); 121 122 try 123 { 124 // create a frame wrapper for myself 125 m_xMeAsFrame = Reference< XFrame >(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame"))), UNO_QUERY); 126 if (m_xMeAsFrame.is()) 127 { 128 m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); 129 m_xMeAsFrame->setName(::rtl::OUString::createFromAscii("report property browser")); // change name! 130 } 131 } 132 catch (Exception&) 133 { 134 DBG_ERROR("PropBrw::PropBrw: could not create/initialize my frame!"); 135 m_xMeAsFrame.clear(); 136 } 137 138 if (m_xMeAsFrame.is()) 139 { 140 Reference< XComponentContext > xOwnContext; 141 try 142 { 143 // our own component context 144 Reference< XPropertySet > xFactoryProperties( m_xORB, UNO_QUERY_THROW ); 145 xOwnContext.set( 146 xFactoryProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), 147 UNO_QUERY_THROW ); 148 149 /*uno::Reference< XComponent> xModel = new OContextHelper(m_xORB,uno::Reference< XComponent>(m_pDesignView->getController().getModel(),uno::UNO_QUERY) ); 150 uno::Reference< XComponent> xDialogParentWindow = new OContextHelper(m_xORB,uno::Reference< XComponent>(VCLUnoHelper::GetInterface ( this ),uno::UNO_QUERY) ); 151 uno::Reference< XComponent> xConnection = new OContextHelper(m_xORB,uno::Reference< XComponent>(m_pDesignView->getController().getConnection(),uno::UNO_QUERY) );*/ 152 // a ComponentContext for the 153 ::cppu::ContextEntry_Init aHandlerContextInfo[] = 154 { 155 ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ), makeAny( m_pDesignView->getController().getModel() )), 156 ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ), makeAny( VCLUnoHelper::GetInterface ( this ) )), 157 ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ), makeAny( m_pDesignView->getController().getConnection() ) ), 158 }; 159 m_xInspectorContext.set( 160 ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), 161 xOwnContext ) ); 162 // create a property browser controller 163 bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB ); 164 Reference< inspection::XObjectInspectorModel> xInspectorModel( bEnableHelpSection 165 ? report::inspection::DefaultComponentInspectorModel::createWithHelpSection( m_xInspectorContext, 3, 8 ) 166 : report::inspection::DefaultComponentInspectorModel::createDefault( m_xInspectorContext ) ); 167 168 m_xBrowserController = inspection::ObjectInspector::createWithModel(m_xInspectorContext, xInspectorModel); 169 if ( !m_xBrowserController.is() ) 170 { 171 const ::rtl::OUString sServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.inspection.ObjectInspector" ) ); 172 ShowServiceNotAvailableError(pParent, sServiceName, sal_True); 173 } 174 else 175 { 176 m_xBrowserController->attachFrame(m_xMeAsFrame); 177 m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow(); 178 OSL_ENSURE(m_xBrowserComponentWindow.is(), "PropBrw::PropBrw: attached the controller, but have no component window!"); 179 if ( bEnableHelpSection ) 180 { 181 uno::Reference< inspection::XObjectInspector > xInspector( m_xBrowserController, uno::UNO_QUERY_THROW ); 182 uno::Reference< inspection::XObjectInspectorUI > xInspectorUI( xInspector->getInspectorUI() ); 183 uno::Reference< uno::XInterface > xDefaultHelpProvider( inspection::DefaultHelpProvider::create( m_xInspectorContext, xInspectorUI ) ); 184 } 185 } 186 xFactoryProperties->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ,makeAny(xOwnContext)); 187 } 188 catch (Exception&) 189 { 190 DBG_ERROR("PropBrw::PropBrw: could not create/initialize the browser controller!"); 191 try 192 { 193 ::comphelper::disposeComponent(m_xBrowserController); 194 ::comphelper::disposeComponent(m_xBrowserComponentWindow); 195 Reference< XPropertySet > xFactoryProperties( m_xORB, UNO_QUERY_THROW ); 196 if ( xOwnContext.is() ) 197 xFactoryProperties->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ,makeAny(xOwnContext)); 198 } 199 catch(Exception&) { } 200 m_xBrowserController.clear(); 201 m_xBrowserComponentWindow.clear(); 202 } 203 } 204 205 if (m_xBrowserComponentWindow.is()) 206 { 207 208 m_xBrowserComponentWindow->setPosSize(0, 0, aPropWinSize.Width(), aPropWinSize.Height(), 209 awt::PosSize::WIDTH | awt::PosSize::HEIGHT | awt::PosSize::X | awt::PosSize::Y); 210 Resize(); 211 m_xBrowserComponentWindow->setVisible(sal_True); 212 } 213 ::rptui::notifySystemWindow(pParent,this,::comphelper::mem_fun(&TaskPaneList::AddWindow)); 214 } 215 216 //---------------------------------------------------------------------------- 217 218 PropBrw::~PropBrw() 219 { 220 if (m_xBrowserController.is()) 221 implDetachController(); 222 223 try 224 { 225 uno::Reference<container::XNameContainer> xName(m_xInspectorContext,uno::UNO_QUERY); 226 if ( xName.is() ) 227 { 228 const ::rtl::OUString pProps[] = { ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ) 229 , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ) 230 , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) )}; 231 for (size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i) 232 xName->removeByName(pProps[i]); 233 } 234 } 235 catch(Exception&) 236 {} 237 238 ::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); 239 240 DBG_DTOR( rpt_PropBrw,NULL); 241 } 242 // ----------------------------------------------------------------------------- 243 void PropBrw::setCurrentPage(const ::rtl::OUString& _sLastActivePage) 244 { 245 m_sLastActivePage = _sLastActivePage; 246 } 247 //---------------------------------------------------------------------------- 248 249 void PropBrw::implDetachController() 250 { 251 m_sLastActivePage = getCurrentPage(); 252 implSetNewObject( ); 253 254 if ( m_xMeAsFrame.is() ) 255 m_xMeAsFrame->setComponent( NULL, NULL ); 256 257 if ( m_xBrowserController.is() ) 258 m_xBrowserController->attachFrame( NULL ); 259 260 m_xMeAsFrame.clear(); 261 m_xBrowserController.clear(); 262 m_xBrowserComponentWindow.clear(); 263 } 264 //----------------------------------------------------------------------- 265 ::rtl::OUString PropBrw::getCurrentPage() const 266 { 267 ::rtl::OUString sCurrentPage; 268 try 269 { 270 if ( m_xBrowserController.is() ) 271 { 272 OSL_VERIFY( m_xBrowserController->getViewData() >>= sCurrentPage ); 273 } 274 275 if ( !sCurrentPage.getLength() ) 276 sCurrentPage = m_sLastActivePage; 277 } 278 catch( const Exception& ) 279 { 280 OSL_ENSURE( sal_False, "PropBrw::getCurrentPage: caught an exception while retrieving the current page!" ); 281 } 282 return sCurrentPage; 283 } 284 //---------------------------------------------------------------------------- 285 286 sal_Bool PropBrw::Close() 287 { 288 m_xLastSection.clear(); 289 // suspend the controller (it is allowed to veto) 290 if ( m_xMeAsFrame.is() ) 291 { 292 try 293 { 294 Reference< XController > xController( m_xMeAsFrame->getController() ); 295 if ( xController.is() && !xController->suspend( sal_True ) ) 296 return sal_False; 297 } 298 catch( const Exception& ) 299 { 300 OSL_ENSURE( sal_False, "FmPropBrw::Close: caught an exception while asking the controller!" ); 301 } 302 } 303 implDetachController(); 304 305 if( IsRollUp() ) 306 RollDown(); 307 308 m_pDesignView->getController().executeUnChecked(SID_PROPERTYBROWSER_LAST_PAGE,uno::Sequence< beans::PropertyValue>()); 309 310 return sal_True; 311 } 312 313 //---------------------------------------------------------------------------- 314 315 uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const SdrMarkList& _rMarkList) 316 { 317 sal_uInt32 nMarkCount = _rMarkList.GetMarkCount(); 318 ::std::vector< uno::Reference< uno::XInterface> > aSets; 319 aSets.reserve(nMarkCount); 320 321 for(sal_uInt32 i=0;i<nMarkCount;++i) 322 { 323 SdrObject* pCurrent = _rMarkList.GetMark(i)->GetMarkedSdrObj(); 324 325 ::std::auto_ptr<SdrObjListIter> pGroupIterator; 326 if (pCurrent->IsGroupObject()) 327 { 328 pGroupIterator.reset(new SdrObjListIter(*pCurrent->GetSubList())); 329 pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL; 330 } 331 332 while (pCurrent) 333 { 334 OObjectBase* pObj = dynamic_cast<OObjectBase*>(pCurrent); 335 if ( pObj ) 336 aSets.push_back(CreateComponentPair(pObj)); 337 338 // next element 339 pCurrent = pGroupIterator.get() && pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL; 340 } 341 } 342 Reference<uno::XInterface> *pSets = aSets.empty() ? NULL : &aSets[0]; 343 return uno::Sequence< Reference<uno::XInterface> >(pSets, aSets.size()); 344 } 345 //---------------------------------------------------------------------------- 346 void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> >& _aObjects ) 347 { 348 if ( m_xBrowserController.is() ) 349 { 350 try 351 { 352 m_xBrowserController->inspect(uno::Sequence< Reference<uno::XInterface> >()); 353 m_xBrowserController->inspect(_aObjects); 354 } 355 catch( const Exception& ) 356 { 357 OSL_ENSURE( sal_False, "FmPropBrw::StateChanged: caught an exception while setting the initial page!" ); 358 } 359 360 //Resize(); 361 } 362 SetText( GetHeadlineName(_aObjects) ); 363 } 364 365 //---------------------------------------------------------------------------- 366 367 ::rtl::OUString PropBrw::GetHeadlineName( const uno::Sequence< Reference<uno::XInterface> >& _aObjects ) 368 { 369 ::rtl::OUString aName; 370 if ( !_aObjects.getLength() ) 371 { 372 aName = String(ModuleRes(RID_STR_BRWTITLE_NO_PROPERTIES)); 373 } 374 else if ( _aObjects.getLength() == 1 ) // single selection 375 { 376 sal_uInt16 nResId = 0; 377 aName = String(ModuleRes(RID_STR_BRWTITLE_PROPERTIES)); 378 379 uno::Reference< container::XNameContainer > xNameCont(_aObjects[0],uno::UNO_QUERY); 380 Reference< lang::XServiceInfo > xServiceInfo( xNameCont->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent"))), UNO_QUERY ); 381 if ( xServiceInfo.is() ) 382 { 383 if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT ) ) 384 { 385 nResId = RID_STR_PROPTITLE_FIXEDTEXT; 386 } 387 else if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL ) ) 388 { 389 nResId = RID_STR_PROPTITLE_IMAGECONTROL; 390 } 391 else if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD ) ) 392 { 393 nResId = RID_STR_PROPTITLE_FORMATTED; 394 } 395 else if ( xServiceInfo->supportsService( SERVICE_SHAPE ) ) 396 { 397 nResId = RID_STR_PROPTITLE_SHAPE; 398 } 399 else if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) ) 400 { 401 nResId = RID_STR_PROPTITLE_REPORT; 402 } 403 else if ( xServiceInfo->supportsService( SERVICE_SECTION ) ) 404 { 405 nResId = RID_STR_PROPTITLE_SECTION; 406 } 407 else if ( xServiceInfo->supportsService( SERVICE_FUNCTION ) ) 408 { 409 nResId = RID_STR_PROPTITLE_FUNCTION; 410 } 411 else if ( xServiceInfo->supportsService( SERVICE_GROUP ) ) 412 { 413 nResId = RID_STR_PROPTITLE_GROUP; 414 } 415 else if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE ) ) 416 { 417 nResId = RID_STR_PROPTITLE_FIXEDLINE; 418 } 419 else 420 { 421 OSL_ENSURE(0,"Unknown service name!"); 422 nResId = RID_STR_CLASS_FORMATTEDFIELD; 423 } 424 425 if (nResId) 426 { 427 aName += String(ModuleRes(nResId)); 428 } 429 } 430 } 431 else // multiselection 432 { 433 aName = String(ModuleRes(RID_STR_BRWTITLE_PROPERTIES)); 434 aName += String(ModuleRes(RID_STR_BRWTITLE_MULTISELECT)); 435 } 436 437 return aName; 438 } 439 // ----------------------------------------------------------------------------- 440 uno::Reference< uno::XInterface> PropBrw::CreateComponentPair(OObjectBase* _pObj) 441 { 442 _pObj->initializeOle(); 443 return CreateComponentPair(_pObj->getAwtComponent(),_pObj->getReportComponent()); 444 } 445 //---------------------------------------------------------------------------- 446 uno::Reference< uno::XInterface> PropBrw::CreateComponentPair(const uno::Reference< uno::XInterface>& _xFormComponent 447 ,const uno::Reference< uno::XInterface>& _xReportComponent) 448 { 449 uno::Reference< container::XNameContainer > xNameCont = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast<Reference<XInterface> * >(NULL))); 450 xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormComponent")),uno::makeAny(_xFormComponent)); 451 xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent")),uno::makeAny(_xReportComponent)); 452 xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowSet")) 453 ,uno::makeAny(uno::Reference< uno::XInterface>(m_pDesignView->getController().getRowSet()))); 454 455 return xNameCont.get(); 456 } 457 // ----------------------------------------------------------------------------- 458 ::Size PropBrw::getMinimumSize() const 459 { 460 ::Size aSize; 461 Reference< awt::XLayoutConstrains > xLayoutConstrains( m_xBrowserController, UNO_QUERY ); 462 if( xLayoutConstrains.is() ) 463 { 464 awt::Size aMinSize = xLayoutConstrains->getMinimumSize(); 465 aMinSize.Height += 4; 466 aMinSize.Width += 4; 467 aSize.setHeight( aMinSize.Height ); 468 aSize.setWidth( aMinSize.Width ); 469 } 470 return aSize; 471 } 472 //---------------------------------------------------------------------------- 473 void PropBrw::Resize() 474 { 475 Window::Resize(); 476 477 Reference< awt::XLayoutConstrains > xLayoutConstrains( m_xBrowserController, UNO_QUERY ); 478 if( xLayoutConstrains.is() ) 479 { 480 ::Size aMinSize = getMinimumSize(); 481 SetMinOutputSizePixel( aMinSize ); 482 ::Size aSize = GetOutputSizePixel(); 483 sal_Bool bResize = sal_False; 484 if( aSize.Width() < aMinSize.Width() ) 485 { 486 aSize.setWidth( aMinSize.Width() ); 487 bResize = sal_True; 488 } 489 if( aSize.Height() < aMinSize.Height() ) 490 { 491 aSize.setHeight( aMinSize.Height() ); 492 bResize = sal_True; 493 } 494 if( bResize ) 495 SetOutputSizePixel( aSize ); 496 } 497 // adjust size 498 if (m_xBrowserComponentWindow.is()) 499 { 500 Size aSize = GetOutputSizePixel(); 501 m_xBrowserComponentWindow->setPosSize(0, 0, aSize.Width(), aSize.Height(), 502 awt::PosSize::WIDTH | awt::PosSize::HEIGHT); 503 } 504 } 505 //---------------------------------------------------------------------------- 506 void PropBrw::Update( OSectionView* pNewView ) 507 { 508 try 509 { 510 if ( m_pView ) 511 { 512 EndListening( *(m_pView->GetModel()) ); 513 m_pView = NULL; 514 } 515 516 // set focus on initialization 517 if ( m_bInitialStateChange ) 518 { 519 // if we're just newly created, we want to have the focus 520 PostUserEvent( LINK( this, PropBrw, OnAsyncGetFocus ) ); 521 m_bInitialStateChange = sal_False; 522 // and additionally, we want to show the page which was active during 523 // our previous incarnation 524 if ( m_sLastActivePage.getLength() && m_xBrowserController.is() ) 525 { 526 try 527 { 528 m_xBrowserController->restoreViewData( makeAny( m_sLastActivePage ) ); 529 } 530 catch( const Exception& ) 531 { 532 OSL_ENSURE( sal_False, "FmPropBrw::StateChanged: caught an exception while setting the initial page!" ); 533 } 534 } 535 } 536 537 if ( !pNewView ) 538 return; 539 else 540 m_pView = pNewView; 541 542 uno::Sequence< Reference<uno::XInterface> > aMarkedObjects; 543 OViewsWindow* pViews = m_pView->getReportSection()->getSectionWindow()->getViewsWindow(); 544 const sal_uInt16 nSectionCount = pViews->getSectionCount(); 545 for (sal_uInt16 i = 0; i < nSectionCount; ++i) 546 { 547 ::boost::shared_ptr<OSectionWindow> pSectionWindow = pViews->getSectionWindow(i); 548 if ( pSectionWindow ) 549 { 550 const SdrMarkList& rMarkList = pSectionWindow->getReportSection().getSectionView().GetMarkedObjectList(); 551 aMarkedObjects = ::comphelper::concatSequences(aMarkedObjects,CreateCompPropSet( rMarkList )); 552 } 553 } 554 555 if ( aMarkedObjects.getLength() ) // multiple selection 556 { 557 m_xLastSection.clear(); 558 implSetNewObject( aMarkedObjects ); 559 } 560 else if ( m_xLastSection != m_pView->getReportSection()->getSection() ) 561 { 562 uno::Reference< uno::XInterface> xTemp(m_pView->getReportSection()->getSection()); 563 m_xLastSection = xTemp; 564 uno::Reference< container::XNameContainer > xNameCont = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast<Reference<XInterface> * >(NULL))); 565 xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent")),uno::makeAny(xTemp)); 566 xTemp = xNameCont; 567 568 implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) ); 569 } 570 571 StartListening( *(m_pView->GetModel()) ); 572 } 573 catch ( Exception& ) 574 { 575 DBG_ERROR( "PropBrw::Update: Exception occured!" ); 576 } 577 } 578 //---------------------------------------------------------------------------- 579 void PropBrw::Update( const uno::Reference< uno::XInterface>& _xReportComponent) 580 { 581 if ( m_xLastSection != _xReportComponent ) 582 { 583 m_xLastSection = _xReportComponent; 584 try 585 { 586 if ( m_pView ) 587 { 588 EndListening( *(m_pView->GetModel()) ); 589 m_pView = NULL; 590 } // if ( m_pView ) 591 592 uno::Reference< uno::XInterface> xTemp(CreateComponentPair(_xReportComponent,_xReportComponent)); 593 implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) ); 594 } 595 catch ( Exception& ) 596 { 597 DBG_ERROR( "PropBrw::Update: Exception occured!" ); 598 } 599 } 600 } 601 //----------------------------------------------------------------------- 602 IMPL_LINK( PropBrw, OnAsyncGetFocus, void*, ) 603 { 604 if (m_xBrowserComponentWindow.is()) 605 m_xBrowserComponentWindow->setFocus(); 606 return 0L; 607 } 608 //---------------------------------------------------------------------------- 609 void PropBrw::LoseFocus() 610 { 611 DockingWindow::LoseFocus(); 612 m_pDesignView->getController().InvalidateAll(); 613 } 614 //---------------------------------------------------------------------------- 615 } 616