From 01c62797c2c8acf6cb8cdd0f713411dca5411ac3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 11 Feb 2016 17:24:04 +0100 Subject: Simplify ChildrenManager Change-Id: I43762aa8b572651676d8cac4848d4c6d478cf850 --- svx/source/accessibility/ChildrenManager.cxx | 32 +++++++--------------------- 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'svx') diff --git a/svx/source/accessibility/ChildrenManager.cxx b/svx/source/accessibility/ChildrenManager.cxx index 1caeea682580..77beb00aae45 100644 --- a/svx/source/accessibility/ChildrenManager.cxx +++ b/svx/source/accessibility/ChildrenManager.cxx @@ -33,21 +33,17 @@ ChildrenManager::ChildrenManager ( const css::uno::Reference& rxShapeList, const AccessibleShapeTreeInfo& rShapeTreeInfo, AccessibleContextBase& rContext) - : mpImpl (nullptr) + : mpImpl( + new ChildrenManagerImpl( + rxParent, rxShapeList, rShapeTreeInfo, rContext)) { - mpImpl = new ChildrenManagerImpl (rxParent, rxShapeList, rShapeTreeInfo, rContext); - if (mpImpl != nullptr) - mpImpl->Init (); - else - throw uno::RuntimeException( - "ChildrenManager::ChildrenManager can't create implementation object", nullptr); + mpImpl->Init (); } ChildrenManager::~ChildrenManager() { - if (mpImpl != nullptr) - mpImpl->dispose(); + mpImpl->dispose(); // emtpy OSL_TRACE ("~ChildrenManager"); @@ -55,7 +51,6 @@ ChildrenManager::~ChildrenManager() long ChildrenManager::GetChildCount() const throw () { - assert(mpImpl != nullptr); return mpImpl->GetChildCount(); } @@ -63,14 +58,12 @@ css::uno::Reference ChildrenManager::GetChild (long nIndex) throw (css::uno::RuntimeException, css::lang::IndexOutOfBoundsException) { - assert(mpImpl != nullptr); return mpImpl->GetChild (nIndex); } Reference ChildrenManager::GetChild (const Reference& xShape) throw (css::uno::RuntimeException) { - assert(mpImpl != nullptr); return mpImpl->GetChild (xShape); } @@ -78,63 +71,54 @@ css::uno::Reference ChildrenManager::GetChildShape(long nI throw (css::uno::RuntimeException, css::lang::IndexOutOfBoundsException) { - assert(mpImpl != nullptr); return mpImpl->GetChildShape(nIndex); } void ChildrenManager::Update (bool bCreateNewObjectsOnDemand) { - assert(mpImpl != nullptr); mpImpl->Update (bCreateNewObjectsOnDemand); } void ChildrenManager::SetShapeList (const css::uno::Reference& xShapeList) { - assert(mpImpl != nullptr); mpImpl->SetShapeList (xShapeList); } void ChildrenManager::AddAccessibleShape (css::uno::Reference const & shape) { - assert(mpImpl != nullptr); mpImpl->AddAccessibleShape (shape); } void ChildrenManager::ClearAccessibleShapeList() { - assert(mpImpl != nullptr); mpImpl->ClearAccessibleShapeList (); } void ChildrenManager::SetInfo (AccessibleShapeTreeInfo& rShapeTreeInfo) { - assert(mpImpl != nullptr); mpImpl->SetInfo (rShapeTreeInfo); } void ChildrenManager::UpdateSelection() { - assert(mpImpl != nullptr); mpImpl->UpdateSelection (); } bool ChildrenManager::HasFocus() { - assert(mpImpl != nullptr); return mpImpl->HasFocus (); } void ChildrenManager::RemoveFocus() { - assert(mpImpl != nullptr); mpImpl->RemoveFocus (); } // IAccessibleViewForwarderListener -void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType, - const IAccessibleViewForwarder* pViewForwarder) +void ChildrenManager::ViewForwarderChanged( + IAccessibleViewForwarderListener::ChangeType aChangeType, + const IAccessibleViewForwarder* pViewForwarder) { - assert(mpImpl != nullptr); mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder); } -- cgit