summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-06-06 12:51:32 +0000
committerRüdiger Timm <rt@openoffice.org>2008-06-06 12:51:32 +0000
commit90ffd2210a4a99656ccd66099fb8c65d9c91e729 (patch)
treea67129c859cd745b226075fb14b63385b69ee6e6
parent0fe6659892fe019a7a21d871f3f3c942bebe72e9 (diff)
INTEGRATION: CWS dba30c (1.66.126); FILE MERGED
2008/04/16 06:46:25 fs 1.66.126.2: RESYNC: (1.66-1.67); FILE MERGED 2008/04/02 10:49:07 fs 1.66.126.1: #i87728# updateTabOrder: when we already have a controller, delegate the request. this way the tab order is still valid if an XControl is inserted while we are already in alive mode
-rw-r--r--svx/source/form/fmvwimp.cxx63
1 files changed, 29 insertions, 34 deletions
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 68f8f193eeab..b7e34fa786a5 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: fmvwimp.cxx,v $
- * $Revision: 1.68 $
+ * $Revision: 1.69 $
*
* This file is part of OpenOffice.org.
*
@@ -364,44 +364,39 @@ void FmXPageViewWinRec::setController(const Reference< XForm > & xForm, FmXForm
void FmXPageViewWinRec::updateTabOrder( const Reference< XControl > & xControl,
const Reference< XControlContainer >& /*_rxCC*/ )
{
- // Das TabControllerModel der ::com::sun::star::form ermitteln, in der das Control
- // enthalten ist ...
- Reference< XFormComponent > xFormComp(xControl->getModel(), UNO_QUERY);
- if (!xFormComp.is())
- return;
+ try
+ {
+ Reference< XFormComponent > xControlModel( xControl->getModel(), UNO_QUERY_THROW );
+ Reference< XForm > xForm( xControlModel->getParent(), UNO_QUERY_THROW );
- Reference< XForm > xForm(xFormComp->getParent(), UNO_QUERY);
- if (!xForm.is())
- return;
+ Reference< XTabController > xTabCtrl( getController( xForm ), UNO_QUERY );
+ if ( xTabCtrl.is() )
+ { // if there already is a TabController for this form, then delegate the "updateTabOrder" request
+ xTabCtrl->activateTabOrder();
+ }
+ else
+ { // otherwise, create a TabController
- Reference< XTabController > xTabCtrl(getController( xForm ), UNO_QUERY);
- // Wenn es fuer dieses Formular noch keinen Tabcontroller gibt,
- // dann einen neuen anlegen
- if (!xTabCtrl.is())
- {
- // ist es ein Unterformular?
- // dann muss ein Tabcontroller fuer den Parent existieren
- // wichtig da ein hierarchischer Aufbau vorliegt
- Reference< XForm > xParentForm(Reference< XChild > (xForm, UNO_QUERY)->getParent(), UNO_QUERY);
- FmXFormController* pFormController = NULL;
- // zugehoerigen controller suchen
- if (xParentForm.is())
- xTabCtrl = Reference< XTabController >(getController(xParentForm), UNO_QUERY);
-
- if (xTabCtrl.is())
- {
- Reference< XUnoTunnel > xTunnel(xTabCtrl,UNO_QUERY);
- DBG_ASSERT(xTunnel.is(), "FmPropController::ChangeFormatProperty : xTunnel is invalid!");
- if(xTunnel.is())
+ // if it's a sub form, then we must ensure there exist TabControllers
+ // for all its ancestors, too
+ Reference< XForm > xParentForm( xForm->getParent(), UNO_QUERY );
+ FmXFormController* pFormController = NULL;
+ // there is a parent form -> look for the respective controller
+ if ( xParentForm.is() )
+ xTabCtrl = Reference< XTabController >( getController( xParentForm ), UNO_QUERY );
+
+ if ( xTabCtrl.is() )
{
- pFormController = reinterpret_cast<FmXFormController*>(xTunnel->getSomething(FmXFormController::getUnoTunnelImplementationId()));
+ Reference< XUnoTunnel > xTunnel( xTabCtrl, UNO_QUERY_THROW );
+ pFormController = reinterpret_cast< FmXFormController* >( xTunnel->getSomething( FmXFormController::getUnoTunnelImplementationId() ) );
}
- // ::comphelper::getImplementation(pFormController, xTunnel);
- }
- // Es gibt noch keinen TabController fuer das Formular, also muss
- // ein neuer angelegt werden.
- setController( xForm, pFormController );
+ setController( xForm, pFormController );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
}
}