summaryrefslogtreecommitdiff
path: root/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/toolpanel/ToolPanelViewShell.cxx')
-rw-r--r--sd/source/ui/toolpanel/ToolPanelViewShell.cxx48
1 files changed, 18 insertions, 30 deletions
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
index 00c4f2edfad4..4b2918583cd0 100644
--- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
+++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
@@ -513,13 +513,18 @@ ToolPanelViewShell::ToolPanelViewShell( SfxViewFrame* pFrame, ViewShellBase& rVi
SetName( String( RTL_CONSTASCII_USTRINGPARAM( "ToolPanelViewShell" ) ) );
- // Some recent changes to the toolpanel make it necessary to create the
- // accessibility object now. Creating it on demand would lead to a
- // pointer cycle in the tree of accessibility objects and would lead
- // e.g. the accerciser AT tool into an infinite loop.
- // It would be nice to get rid of this workaround in the future.
+ // enforce the creation of the Accessible object here.
+ // In some not-always-to-reproduce situations, creating the accessible on demand only leads to some
+ // cycliy parenthood references between the involved objects, which make some AT tools (accerciser, in particular)
+ // loop (which is /not/ a bug in the tool, of course).
+ // However, since those situations were not reproducible anymore, we deliberately leave the Accessible creation
+ // (which originally was intended as a workaround) herein. Better to be safe ...
+ // Note that this is not a performance problem: The implementation of the ToolPanelDeck's Accessible
+ // is separated from the implementation of its AccessibleContext (which even is in a separate library) - we only
+ // create the former here, the latter is still created on demand, when somebody requests it.
+ // #i113671# / 2010-09-17 / frank.schoenheit@oracle.com
if (mpContentWindow.get())
- mpContentWindow->SetAccessible(mpImpl->CreateAccessible(*mpContentWindow));
+ mpContentWindow->GetAccessible( sal_True );
// For accessibility we have to shortly hide the content window. This
// triggers the construction of a new accessibility object for the new
@@ -608,18 +613,6 @@ SdPage* ToolPanelViewShell::getCurrentPage() const
}
// ---------------------------------------------------------------------------------------------------------------------
-void ToolPanelViewShell::Execute( SfxRequest& )
-{
- OSL_ENSURE( false, "ToolPanelViewShell::Execute: not to be called! (right?)" );
-}
-
-// ---------------------------------------------------------------------------------------------------------------------
-void ToolPanelViewShell::GetState( SfxItemSet& )
-{
- OSL_ENSURE( false, "ToolPanelViewShell::GetState: not to be called! (right?)" );
-}
-
-// ---------------------------------------------------------------------------------------------------------------------
TaskPaneShellManager& ToolPanelViewShell::GetSubShellManager() const
{
return *mpSubShellManager.get();
@@ -642,12 +635,7 @@ DockingWindow* ToolPanelViewShell::GetDockingWindow()
Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* i_pWindow )
{
ENSURE_OR_RETURN( i_pWindow, "ToolPanelViewShell::CreateAccessibleDocumentView: illegal window!", NULL );
- // As said above, we have to create the accessibility object
- // (unconditionally) in the constructor, not here on demand, or
- // otherwise we would create a cycle in the tree of accessible objects
- // which could lead to infinite loops in AT tools.
- // return mpImpl->CreateAccessible( *i_pWindow );
- return Reference<XAccessible>();
+ return mpImpl->CreateAccessible( *i_pWindow );
}
// ---------------------------------------------------------------------------------------------------------------------
@@ -694,10 +682,10 @@ namespace
struct PanelFactory
{
ControlFactoryFactory pFactory;
- ULONG nHelpID;
- PanelFactory( const ControlFactoryFactory i_pFactory, const ULONG i_nHelpID )
+ rtl::OString sHelpID;
+ PanelFactory( const ControlFactoryFactory i_pFactory, const rtl::OString& i_nHelpID )
:pFactory( i_pFactory )
- ,nHelpID( i_nHelpID )
+ ,sHelpID( i_nHelpID )
{
}
};
@@ -735,7 +723,7 @@ Reference< XUIElement > ToolPanelViewShell::CreatePanelUIElement( const Referenc
::std::auto_ptr< TreeNode > pNode( pControlFactory->CreateControl( mpImpl->GetToolPanelDeck().GetPanelWindowAnchor() ) );
ENSURE_OR_THROW( ( pNode.get() != NULL ) && ( pNode->GetWindow() != NULL ),
"illegal node returned by the control factory" );
- pNode->GetWindow()->SetHelpId( aPanelFactory.nHelpID );
+ pNode->GetWindow()->SetHelpId( aPanelFactory.sHelpID );
// create an XToolPanel
Reference< XToolPanel > xPanel( new ToolPanel( pNode ) );
@@ -894,7 +882,7 @@ void ToolPanelViewShell_Impl::ConnectToDockingWindow()
// ---------------------------------------------------------------------------------------------------------------------
Reference< XAccessible > ToolPanelViewShell_Impl::CreateAccessible( ::sd::Window& i_rWindow )
{
- Reference< XAccessible > xAccessible( GetToolPanelDeck().GetAccessible( FALSE ) );
+ Reference< XAccessible > xAccessible( GetToolPanelDeck().GetAccessible( sal_False ) );
if ( !xAccessible.is() )
{
// determine the XAccessible which is the parent of the to-be-created object
@@ -902,7 +890,7 @@ Reference< XAccessible > ToolPanelViewShell_Impl::CreateAccessible( ::sd::Window
OSL_ENSURE( pAccessibleParent, "ToolPanelViewShell_Impl::CreateAccessible: illegal accessible parent provided by the sd::Window!" );
GetToolPanelDeck().SetAccessibleParentWindow( pAccessibleParent );
- xAccessible = GetToolPanelDeck().GetAccessible( TRUE );
+ xAccessible = GetToolPanelDeck().GetAccessible( sal_True );
ENSURE_OR_RETURN( xAccessible.is(), "ToolPanelViewShell_Impl::CreateAccessible: illegal ToolPanelDeck accessible!", NULL );
OSL_ENSURE( xAccessible->getAccessibleContext().is()
&& xAccessible->getAccessibleContext()->getAccessibleParent() == pAccessibleParent->GetAccessible(),