Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / svx / source / form / fmPropBrw.cxx
blobdbe759e29791d184ffb49f0337b04ccc495520f0
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 .
21 #include <sal/macros.h>
23 #include "fmhelp.hrc"
24 #include "fmprop.hrc"
25 #include "fmPropBrw.hxx"
26 #include "svx/fmresids.hrc"
27 #include "fmservs.hxx"
28 #include "fmshimp.hxx"
29 #include "fmpgeimp.hxx"
31 #include "svx/dialmgr.hxx"
32 #include "svx/fmpage.hxx"
33 #include "svx/fmshell.hxx"
34 #include "svx/sdrpagewindow.hxx"
35 #include "svx/svdpagv.hxx"
36 #include "svx/svxids.hrc"
38 #include <com/sun/star/awt/XLayoutConstrains.hpp>
39 #include <com/sun/star/awt/XControlContainer.hpp>
40 #include <com/sun/star/awt/PosSize.hpp>
41 #include <com/sun/star/beans/PropertyValue.hpp>
42 #include <com/sun/star/container/XChild.hpp>
43 #include <com/sun/star/form/XForm.hpp>
44 #include <com/sun/star/form/FormComponentType.hpp>
45 #include <com/sun/star/form/inspection/DefaultFormComponentInspectorModel.hpp>
46 #include <com/sun/star/frame/Frame.hpp>
47 #include <com/sun/star/inspection/ObjectInspector.hpp>
48 #include <com/sun/star/inspection/ObjectInspectorModel.hpp>
49 #include <com/sun/star/inspection/XObjectInspectorUI.hpp>
50 #include <com/sun/star/inspection/DefaultHelpProvider.hpp>
52 #include <comphelper/processfactory.hxx>
53 #include <comphelper/property.hxx>
54 #include <cppuhelper/component_context.hxx>
55 #include <sfx2/bindings.hxx>
56 #include <sfx2/childwin.hxx>
57 #include <sfx2/dispatch.hxx>
58 #include <sfx2/objitem.hxx>
59 #include <sfx2/objsh.hxx>
60 #include <sfx2/viewfrm.hxx>
61 #include <toolkit/helper/vclunohelper.hxx>
62 #include <tools/debug.hxx>
63 #include <tools/diagnose_ex.h>
64 #include <tools/shl.hxx>
65 #include <unotools/confignode.hxx>
66 #include <vcl/stdtext.hxx>
68 #include <algorithm>
70 using namespace ::com::sun::star;
71 using namespace ::com::sun::star::uno;
72 using namespace ::com::sun::star::util;
73 using namespace ::com::sun::star::inspection;
74 using namespace ::com::sun::star::form::inspection;
75 using ::com::sun::star::awt::XWindow;
77 /*************************************************************************/
79 //= FmPropBrwMgr
82 SFX_IMPL_FLOATINGWINDOW(FmPropBrwMgr, SID_FM_SHOW_PROPERTIES)
85 FmPropBrwMgr::FmPropBrwMgr( Window* _pParent, sal_uInt16 _nId,
86 SfxBindings* _pBindings, SfxChildWinInfo* _pInfo)
87 :SfxChildWindow(_pParent, _nId)
89 pWindow = new FmPropBrw( ::comphelper::getProcessComponentContext(), _pBindings, this, _pParent, _pInfo );
90 eChildAlignment = SFX_ALIGN_NOALIGNMENT;
91 ((SfxFloatingWindow*)pWindow)->Initialize( _pInfo );
96 const long STD_WIN_SIZE_X = 300;
97 const long STD_WIN_SIZE_Y = 350;
99 const long STD_MIN_SIZE_X = 250;
100 const long STD_MIN_SIZE_Y = 250;
102 using namespace ::com::sun::star::uno;
103 using namespace ::com::sun::star::lang;
104 using namespace ::com::sun::star::form;
105 using namespace ::com::sun::star::frame;
106 using namespace ::com::sun::star::beans;
107 using namespace ::com::sun::star::container;
108 using namespace ::svxform;
110 OUString GetUIHeadlineName(sal_Int16 nClassId, const Any& aUnoObj)
112 sal_uInt16 nClassNameResourceId = 0;
114 switch ( nClassId )
116 case FormComponentType::TEXTFIELD:
118 Reference< XInterface > xIFace;
119 aUnoObj >>= xIFace;
120 nClassNameResourceId = RID_STR_PROPTITLE_EDIT;
121 if (xIFace.is())
122 { // we have a chance to check if it's a formatted field model
123 Reference< XServiceInfo > xInfo(xIFace, UNO_QUERY);
124 if (xInfo.is() && (xInfo->supportsService(FM_SUN_COMPONENT_FORMATTEDFIELD)))
125 nClassNameResourceId = RID_STR_PROPTITLE_FORMATTED;
126 else if (!xInfo.is())
128 // couldn't distinguish between formatted and edit with the service name, so try with the properties
129 Reference< XPropertySet > xProps(xIFace, UNO_QUERY);
130 if (xProps.is())
132 Reference< XPropertySetInfo > xPropsInfo = xProps->getPropertySetInfo();
133 if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(FM_PROP_FORMATSSUPPLIER))
134 nClassNameResourceId = RID_STR_PROPTITLE_FORMATTED;
139 break;
141 case FormComponentType::COMMANDBUTTON:
142 nClassNameResourceId = RID_STR_PROPTITLE_PUSHBUTTON; break;
143 case FormComponentType::RADIOBUTTON:
144 nClassNameResourceId = RID_STR_PROPTITLE_RADIOBUTTON; break;
145 case FormComponentType::CHECKBOX:
146 nClassNameResourceId = RID_STR_PROPTITLE_CHECKBOX; break;
147 case FormComponentType::LISTBOX:
148 nClassNameResourceId = RID_STR_PROPTITLE_LISTBOX; break;
149 case FormComponentType::COMBOBOX:
150 nClassNameResourceId = RID_STR_PROPTITLE_COMBOBOX; break;
151 case FormComponentType::GROUPBOX:
152 nClassNameResourceId = RID_STR_PROPTITLE_GROUPBOX; break;
153 case FormComponentType::IMAGEBUTTON:
154 nClassNameResourceId = RID_STR_PROPTITLE_IMAGEBUTTON; break;
155 case FormComponentType::FIXEDTEXT:
156 nClassNameResourceId = RID_STR_PROPTITLE_FIXEDTEXT; break;
157 case FormComponentType::GRIDCONTROL:
158 nClassNameResourceId = RID_STR_PROPTITLE_DBGRID; break;
159 case FormComponentType::FILECONTROL:
160 nClassNameResourceId = RID_STR_PROPTITLE_FILECONTROL; break;
161 case FormComponentType::DATEFIELD:
162 nClassNameResourceId = RID_STR_PROPTITLE_DATEFIELD; break;
163 case FormComponentType::TIMEFIELD:
164 nClassNameResourceId = RID_STR_PROPTITLE_TIMEFIELD; break;
165 case FormComponentType::NUMERICFIELD:
166 nClassNameResourceId = RID_STR_PROPTITLE_NUMERICFIELD; break;
167 case FormComponentType::CURRENCYFIELD:
168 nClassNameResourceId = RID_STR_PROPTITLE_CURRENCYFIELD; break;
169 case FormComponentType::PATTERNFIELD:
170 nClassNameResourceId = RID_STR_PROPTITLE_PATTERNFIELD; break;
171 case FormComponentType::IMAGECONTROL:
172 nClassNameResourceId = RID_STR_PROPTITLE_IMAGECONTROL; break;
173 case FormComponentType::HIDDENCONTROL:
174 nClassNameResourceId = RID_STR_PROPTITLE_HIDDEN; break;
175 case FormComponentType::SCROLLBAR:
176 nClassNameResourceId = RID_STR_PROPTITLE_SCROLLBAR; break;
177 case FormComponentType::SPINBUTTON:
178 nClassNameResourceId = RID_STR_PROPTITLE_SPINBUTTON; break;
179 case FormComponentType::NAVIGATIONBAR:
180 nClassNameResourceId = RID_STR_PROPTITLE_NAVBAR; break;
181 case FormComponentType::CONTROL:
182 default:
183 nClassNameResourceId = RID_STR_CONTROL; break;
186 return SVX_RESSTR(nClassNameResourceId);
190 // class FmPropBrw
193 FmPropBrw::FmPropBrw( const Reference< XComponentContext >& _xORB, SfxBindings* _pBindings,
194 SfxChildWindow* _pMgr, Window* _pParent, const SfxChildWinInfo* _pInfo )
195 :SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE) )
196 ,SfxControllerItem(SID_FM_PROPERTY_CONTROL, *_pBindings)
197 ,m_bInitialStateChange(true)
198 ,m_bInStateChange( false )
199 ,m_xORB(_xORB)
202 ::Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y);
203 SetMinOutputSizePixel(::Size(STD_MIN_SIZE_X,STD_MIN_SIZE_Y));
204 SetOutputSizePixel(aPropWinSize);
205 SetUniqueId(UID_FORMPROPBROWSER_FRAME);
209 // create a frame wrapper for myself
210 m_xMeAsFrame = Frame::create(m_xORB);
212 // create an intermediate window, which is to be the container window of the frame
213 // Do *not* use |this| as container window for the frame, this would result in undefined
214 // responsibility for this window (as soon as we initialize a frame with a window, the frame
215 // is responsible for its life time, but |this| is controlled by the belonging SfxChildWindow)
216 // #i34249#
217 Window* pContainerWindow = new Window( this );
218 pContainerWindow->Show();
219 m_xFrameContainerWindow = VCLUnoHelper::GetInterface ( pContainerWindow );
221 m_xMeAsFrame->initialize( m_xFrameContainerWindow );
222 m_xMeAsFrame->setName("form property browser");
224 catch (Exception&)
226 OSL_FAIL("FmPropBrw::FmPropBrw: could not create/initialize my frame!");
227 m_xMeAsFrame.clear();
230 if (m_xMeAsFrame.is())
231 _pMgr->SetFrame( Reference<XFrame>(m_xMeAsFrame,UNO_QUERY_THROW) );
234 if ( m_xBrowserComponentWindow.is() )
235 m_xBrowserComponentWindow->setVisible( sal_True );
237 if ( _pInfo )
238 m_sLastActivePage = _pInfo->aExtraString;
242 void FmPropBrw::Resize()
244 SfxFloatingWindow::Resize();
246 if ( m_xFrameContainerWindow.is() )
250 ::Size aOutputSize( GetOutputSizePixel() );
251 m_xFrameContainerWindow->setPosSize( 0, 0, aOutputSize.Width(), aOutputSize.Height(), awt::PosSize::POSSIZE );
253 catch( const Exception& )
255 OSL_FAIL( "FmPropBrw::Resize: caught an exception!" );
261 FmPropBrw::~FmPropBrw()
263 if (m_xBrowserController.is())
264 implDetachController();
267 // remove our own properties from the component context. We cannot ensure that the component context
268 // is freed (there might be refcount problems :-\), so at least ensure the context itself
269 // does hold the objects anymore
270 Reference<XNameContainer> xName(m_xInspectorContext,uno::UNO_QUERY);
271 if ( xName.is() )
273 const OUString pProps[] = { OUString( "ContextDocument" )
274 , OUString( "DialogParentWindow" )
275 , OUString( "ControlContext" )
276 , OUString( "ControlShapeAccess" ) };
277 for ( size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i )
278 xName->removeByName( pProps[i] );
281 catch (const Exception& )
283 DBG_UNHANDLED_EXCEPTION();
288 OUString FmPropBrw::getCurrentPage() const
290 OUString sCurrentPage;
293 if ( m_xBrowserController.is() )
295 OSL_VERIFY( m_xBrowserController->getViewData() >>= sCurrentPage );
298 if ( sCurrentPage.isEmpty() )
299 sCurrentPage = m_sLastActivePage;
301 catch( const Exception& )
303 OSL_FAIL( "FmPropBrw::getCurrentPage: caught an exception while retrieving the current page!" );
305 return sCurrentPage;
309 void FmPropBrw::implDetachController()
311 m_sLastActivePage = getCurrentPage();
313 implSetNewSelection( InterfaceBag() );
315 if ( m_xMeAsFrame.is() )
319 m_xMeAsFrame->setComponent(NULL, NULL);
321 catch( const Exception& )
323 OSL_FAIL( "FmPropBrw::implDetachController: caught an exception while resetting the component!" );
327 // we attached a frame to the controller manually, so we need to manually tell it that it's detached, too
328 if ( m_xBrowserController.is() )
329 m_xBrowserController->attachFrame( NULL );
331 m_xBrowserController.clear();
332 m_xInspectorModel.clear();
333 m_xMeAsFrame.clear();
337 bool FmPropBrw::Close()
339 // suspend the controller (it is allowed to veto)
340 if ( m_xMeAsFrame.is() )
344 Reference< XController > xController( m_xMeAsFrame->getController() );
345 if ( xController.is() && !xController->suspend( sal_True ) )
346 return false;
348 catch( const Exception& )
350 OSL_FAIL( "FmPropBrw::Close: caught an exception while asking the controller!" );
354 implDetachController();
356 if( IsRollUp() )
357 RollDown();
359 // remember our bindings: while we're closed, we're deleted, too, so accessing the bindings after this
360 // would be deadly
361 // 10/19/00 - 79321 - FS
362 SfxBindings& rBindings = SfxControllerItem::GetBindings();
364 bool bClose = SfxFloatingWindow::Close();
366 if (bClose)
368 rBindings.Invalidate(SID_FM_CTL_PROPERTIES);
369 rBindings.Invalidate(SID_FM_PROPERTIES);
372 return bClose;
376 bool FmPropBrw::implIsReadOnlyModel() const
380 if ( m_xInspectorModel.is() )
381 return m_xInspectorModel->getIsReadOnly();
382 return false;
384 catch( const Exception& )
386 DBG_UNHANDLED_EXCEPTION();
388 return true;
392 void FmPropBrw::implSetNewSelection( const InterfaceBag& _rSelection )
394 if ( m_xBrowserController.is() )
398 Reference< XObjectInspector > xInspector( m_xBrowserController, UNO_QUERY_THROW );
400 // tell it the objects to inspect
401 Sequence< Reference< XInterface > > aSelection( _rSelection.size() );
402 ::std::copy( _rSelection.begin(), _rSelection.end(), aSelection.getArray() );
404 xInspector->inspect( aSelection );
406 catch( const VetoException& )
408 return;
410 catch( const Exception& )
412 OSL_FAIL( "FmPropBrw::implSetNewSelection: caught an unexpected exception!" );
413 return;
416 // set the new title according to the selected object
417 OUString sTitle;
419 if ( _rSelection.empty() )
421 sTitle = SVX_RESSTR(RID_STR_NO_PROPERTIES);
423 else if ( _rSelection.size() > 1 )
425 // no form component and (no form or no name) -> Multiselection
426 sTitle = SVX_RESSTR(RID_STR_PROPERTIES_CONTROL);
427 sTitle += SVX_RESSTR(RID_STR_PROPTITLE_MULTISELECT);
429 else
431 Reference< XPropertySet > xSingleSelection( *_rSelection.begin(), UNO_QUERY);
432 if ( ::comphelper::hasProperty( FM_PROP_CLASSID, xSingleSelection ) )
434 sal_Int16 nClassID = FormComponentType::CONTROL;
435 xSingleSelection->getPropertyValue( FM_PROP_CLASSID ) >>= nClassID;
437 sTitle = SVX_RESSTR(RID_STR_PROPERTIES_CONTROL);
438 sTitle += GetUIHeadlineName(nClassID, makeAny(xSingleSelection));
440 else if ( Reference< XForm >( xSingleSelection, UNO_QUERY ).is() )
441 sTitle = SVX_RESSTR(RID_STR_PROPERTIES_FORM);
444 if ( implIsReadOnlyModel() )
445 sTitle += SVX_RESSTR(RID_STR_READONLY_VIEW);
447 SetText( sTitle );
449 // #95343# ---------------------------------
450 Reference< ::com::sun::star::awt::XLayoutConstrains > xLayoutConstrains( m_xBrowserController, UNO_QUERY );
451 if( xLayoutConstrains.is() )
453 ::Size aConstrainedSize;
454 ::com::sun::star::awt::Size aMinSize = xLayoutConstrains->getMinimumSize();
456 sal_Int32 nLeft(0), nTop(0), nRight(0), nBottom(0);
457 GetBorder( nLeft, nTop, nRight, nBottom );
458 aMinSize.Width += nLeft + nRight + 8;
459 aMinSize.Height += nTop + nBottom + 8;
461 aConstrainedSize.setHeight( aMinSize.Height );
462 aConstrainedSize.setWidth( aMinSize.Width );
463 SetMinOutputSizePixel( aConstrainedSize );
464 aConstrainedSize = GetOutputSizePixel();
465 bool bResize = false;
466 if( aConstrainedSize.Width() < aMinSize.Width )
468 aConstrainedSize.setWidth( aMinSize.Width );
469 bResize = true;
471 if( aConstrainedSize.Height() < aMinSize.Height )
473 aConstrainedSize.setHeight( aMinSize.Height );
474 bResize = true;
476 if( bResize )
477 SetOutputSizePixel( aConstrainedSize );
483 void FmPropBrw::FillInfo( SfxChildWinInfo& rInfo ) const
485 rInfo.bVisible = false;
486 rInfo.aExtraString = getCurrentPage();
490 IMPL_LINK( FmPropBrw, OnAsyncGetFocus, void*, /*NOTINTERESTEDIN*/ )
492 if (m_xBrowserComponentWindow.is())
493 m_xBrowserComponentWindow->setFocus();
494 return 0L;
498 namespace
500 static bool lcl_shouldEnableHelpSection( const Reference< XComponentContext >& _rxContext )
502 const OUString sConfigName( "/org.openoffice.Office.Common/Forms/PropertyBrowser/" );
503 const OUString sPropertyName( "DirectHelp" );
505 ::utl::OConfigurationTreeRoot aConfiguration(
506 ::utl::OConfigurationTreeRoot::createWithComponentContext( _rxContext, sConfigName ) );
508 bool bEnabled = false;
509 OSL_VERIFY( aConfiguration.getNodeValue( sPropertyName ) >>= bEnabled );
510 return bEnabled;
514 void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell )
516 // the document in which we live
517 Reference< XInterface > xDocument;
518 if ( _pFormShell && _pFormShell->GetObjectShell() )
519 xDocument = _pFormShell->GetObjectShell()->GetModel();
521 // the context of the controls in our document
522 Reference< awt::XControlContainer > xControlContext;
523 if ( _pFormShell && _pFormShell->GetFormView() )
525 SdrPageView* pPageView = _pFormShell->GetFormView()->GetSdrPageView();
527 if(pPageView)
529 SdrPageWindow* pPageWindow = pPageView->GetPageWindow(0L);
531 if(pPageWindow)
533 xControlContext = pPageWindow->GetControlContainer();
538 // the default parent window for message boxes
539 Reference< XWindow > xParentWindow( VCLUnoHelper::GetInterface ( this ) );
541 // the mapping from control models to control shapes
542 Reference< XMap > xControlMap;
543 FmFormPage* pFormPage = _pFormShell ? _pFormShell->GetCurPage() : NULL;
544 if ( pFormPage )
545 xControlMap = pFormPage->GetImpl().getControlToShapeMap();
547 // our own component context
549 // a ComponentContext for the
550 ::cppu::ContextEntry_Init aHandlerContextInfo[] =
552 ::cppu::ContextEntry_Init( OUString( "ContextDocument" ), makeAny( xDocument ) ),
553 ::cppu::ContextEntry_Init( OUString( "DialogParentWindow" ), makeAny( xParentWindow ) ),
554 ::cppu::ContextEntry_Init( OUString( "ControlContext" ), makeAny( xControlContext ) ),
555 ::cppu::ContextEntry_Init( OUString( "ControlShapeAccess" ), makeAny( xControlMap ) )
557 m_xInspectorContext.set(
558 ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ),
559 m_xORB ) );
561 bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB );
563 // an object inspector model
564 m_xInspectorModel =
565 bEnableHelpSection
566 ? DefaultFormComponentInspectorModel::createWithHelpSection( m_xInspectorContext, 3, 5 )
567 : DefaultFormComponentInspectorModel::createDefault( m_xInspectorContext );
569 // an object inspector
570 m_xBrowserController = m_xBrowserController.query(
571 ObjectInspector::createWithModel(
572 m_xInspectorContext, m_xInspectorModel
573 ) );
575 if ( !m_xBrowserController.is() )
577 OUString sServiceName( "com.sun.star.inspection.ObjectInspector" );
578 ShowServiceNotAvailableError( GetParent(), sServiceName, true );
580 else
582 m_xBrowserController->attachFrame( Reference<XFrame>(m_xMeAsFrame,UNO_QUERY_THROW) );
583 m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow();
584 DBG_ASSERT( m_xBrowserComponentWindow.is(), "FmPropBrw::impl_createPropertyBrowser_throw: attached the controller, but have no component window!" );
587 if ( bEnableHelpSection )
589 Reference< XObjectInspector > xInspector( m_xBrowserController, UNO_QUERY_THROW );
590 Reference< XObjectInspectorUI > xInspectorUI( xInspector->getInspectorUI() );
591 Reference< XInterface > xDefaultHelpProvider( DefaultHelpProvider::create( m_xInspectorContext, xInspectorUI ) );
596 void FmPropBrw::impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell )
598 // the document in which we live
599 Reference< XInterface > xDocument;
600 SfxObjectShell* pObjectShell = _pFormShell ? _pFormShell->GetObjectShell() : NULL;
601 if ( pObjectShell )
602 xDocument = pObjectShell->GetModel();
603 if ( ( xDocument == m_xLastKnownDocument ) && m_xBrowserController.is() )
604 // nothing to do
605 return;
609 // clean up any previous instances of the object inspector
610 if ( m_xMeAsFrame.is() )
611 m_xMeAsFrame->setComponent( NULL, NULL );
612 else
613 ::comphelper::disposeComponent( m_xBrowserController );
614 m_xBrowserController.clear();
615 m_xInspectorModel.clear();
616 m_xBrowserComponentWindow.clear();
618 // and create a new one
619 impl_createPropertyBrowser_throw( _pFormShell );
621 catch( const Exception& )
623 DBG_UNHANDLED_EXCEPTION();
625 m_xLastKnownDocument = xDocument;
629 void FmPropBrw::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState)
631 if (!pState || SID_FM_PROPERTY_CONTROL != nSID)
632 return;
634 m_bInStateChange = true;
637 if (eState >= SFX_ITEM_AVAILABLE)
639 FmFormShell* pShell = PTR_CAST(FmFormShell,((SfxObjectItem*)pState)->GetShell());
640 InterfaceBag aSelection;
641 if ( pShell )
642 pShell->GetImpl()->getCurrentSelection( aSelection );
644 impl_ensurePropertyBrowser_nothrow( pShell );
646 // set the new object to inspect
647 implSetNewSelection( aSelection );
649 // if this is the first time we're here, some additional things need to be done ...
650 if ( m_bInitialStateChange )
652 // if we're just newly created, we want to have the focus
653 PostUserEvent( LINK( this, FmPropBrw, OnAsyncGetFocus ) );
655 // and additionally, we want to show the page which was active during
656 // our previous incarnation
657 if ( !m_sLastActivePage.isEmpty() )
661 if ( m_xBrowserController.is() )
662 m_xBrowserController->restoreViewData( makeAny( m_sLastActivePage ) );
664 catch( const Exception& )
666 OSL_FAIL( "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
670 m_bInitialStateChange = false;
674 else
676 implSetNewSelection( InterfaceBag() );
679 catch (Exception&)
681 OSL_FAIL("FmPropBrw::StateChanged: Exception occurred!");
683 m_bInStateChange = false;
686 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */