sd/source/ui/inc/unomodel.hxx | 5 sd/source/ui/inc/unopage.hxx | 3 sd/source/ui/unoidl/unomodel.cxx | 269 +++++++++++++++++------------------- sd/source/ui/unoidl/unopage.cxx | 11 - svtools/source/control/valueacc.cxx | 9 - svtools/source/control/valueimp.hxx | 5 svtools/source/control/valueset.cxx | 21 +- 7 files changed, 156 insertions(+), 167 deletions(-)
New commits: commit 36d4938894a0c4ac3fecd2fe00991328560d4b8a Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Oct 2 21:37:35 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Oct 3 14:08:07 2024 +0200 use more concrete UNO class in SdXImpressDocument Change-Id: I61fb3e0c5f76fd6208255dc1f1bc403c25221ba6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 02f1ee19ceb7..3141abd46bc9 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -59,6 +59,7 @@ class SdMasterPagesAccess; class SdLayerManager; class SdXCustomPresentationAccess; class SdDocLinkTargets; +class SdGenericDrawPage; namespace sd { class DrawDocShell; @@ -304,6 +305,8 @@ public: /// @see vcl::ITiledRenderable::renderNextSlideLayer(). bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) override; + rtl::Reference< SdDrawPagesAccess > getSdDrawPages(); + // XComponent /** This dispose implementation releases the resources held by the @@ -355,6 +358,8 @@ public: virtual void SAL_CALL dispose( ) override; virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + + SdGenericDrawPage* getDrawPageByIndex( sal_Int32 Index ); }; /*********************************************************************** diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx index 534aa8c1c6a4..f27b79ad4ce8 100644 --- a/sd/source/ui/inc/unopage.hxx +++ b/sd/source/ui/inc/unopage.hxx @@ -38,6 +38,7 @@ class SdrObject; class SdXImpressDocument; +class SdMasterPage; class SdGenericDrawPage : public SvxDrawPage, public SdUnoSearchReplaceShape, @@ -211,6 +212,8 @@ public: // XShapes virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override; virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + + SdMasterPage* getSdMasterPage(); }; /*********************************************************************** diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 9a8b17c65cdb..b5e2bb9dbf0b 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1561,6 +1561,11 @@ uno::Reference< drawing::XDrawPages > SAL_CALL SdXImpressDocument::getDrawPages( { ::SolarMutexGuard aGuard; + return getSdDrawPages(); +} + +rtl::Reference< SdDrawPagesAccess > SdXImpressDocument::getSdDrawPages() +{ if( nullptr == mpDoc ) throw lang::DisposedException(); @@ -3759,157 +3764,142 @@ OString SdXImpressDocument::getPresentationInfo() const try { - uno::Reference<drawing::XDrawPages> xDrawPages = const_cast<SdXImpressDocument*>(this)->getDrawPages(); - uno::Reference<container::XIndexAccess> xSlides(xDrawPages, uno::UNO_QUERY_THROW); - if (xSlides.is()) + rtl::Reference<SdDrawPagesAccess> xDrawPages = const_cast<SdXImpressDocument*>(this)->getSdDrawPages(); + // size in twips + Size aDocSize = const_cast<SdXImpressDocument*>(this)->getDocumentSize(); + aJsonWriter.put("docWidth", aDocSize.getWidth()); + aJsonWriter.put("docHeight", aDocSize.getHeight()); + + auto aSlideList = aJsonWriter.startArray("slides"); + sal_Int32 nSlideCount = xDrawPages->getCount(); + for (sal_Int32 i = 0; i < nSlideCount; ++i) { - // size in twips - Size aDocSize = const_cast<SdXImpressDocument*>(this)->getDocumentSize(); - aJsonWriter.put("docWidth", aDocSize.getWidth()); - aJsonWriter.put("docHeight", aDocSize.getHeight()); - - auto aSlideList = aJsonWriter.startArray("slides"); - sal_Int32 nSlideCount = xSlides->getCount(); - for (sal_Int32 i = 0; i < nSlideCount; ++i) + SdGenericDrawPage* pSlide(xDrawPages->getDrawPageByIndex(i)); + bool bIsVisible = true; // default visible + pSlide->getPropertyValue("Visible") >>= bIsVisible; + if (bIsVisible) { - uno::Reference<drawing::XDrawPage> xSlide(xSlides->getByIndex(i), uno::UNO_QUERY_THROW); - if (xSlide.is()) - { - uno::Reference<XPropertySet> xPropSet(xSlide, uno::UNO_QUERY); - if (xPropSet.is()) - { - bool bIsVisible = true; // default visible - xPropSet->getPropertyValue("Visible") >>= bIsVisible; - if (bIsVisible) - { - SdrPage* pPage = SdPage::getImplementation(xSlide); - - auto aSlideNode = aJsonWriter.startStruct(); - std::string sSlideHash = GetInterfaceHash(xSlide); - aJsonWriter.put("hash", sSlideHash); - aJsonWriter.put("index", i); + SdrPage* pPage = pSlide->GetSdrPage(); - uno::Reference<drawing::XShapes> xSlideShapes(xSlide, uno::UNO_QUERY_THROW); - bool bIsDrawPageEmpty = true; - if (xSlideShapes.is()) { - bIsDrawPageEmpty = xSlideShapes->getCount() == 0; - } - aJsonWriter.put("empty", bIsDrawPageEmpty); + auto aSlideNode = aJsonWriter.startStruct(); + std::string sSlideHash = GetInterfaceHash(cppu::getXWeak(pSlide)); + aJsonWriter.put("hash", sSlideHash); + aJsonWriter.put("index", i); - uno::Reference<drawing::XDrawPage> xMasterPage; - uno::Reference<drawing::XMasterPageTarget> xMasterPageTarget(xSlide, uno::UNO_QUERY); - if (xMasterPageTarget.is()) - { - xMasterPage = xMasterPageTarget->getMasterPage(); - if (xMasterPage.is()) - { - std::string sMPHash = GetInterfaceHash(xMasterPage); - aJsonWriter.put("masterPage", sMPHash); + bool bIsDrawPageEmpty = pSlide->getCount() == 0; + aJsonWriter.put("empty", bIsDrawPageEmpty); - bool bBackgroundObjectsVisibility = true; // default visible - xPropSet->getPropertyValue("IsBackgroundObjectsVisible") >>= bBackgroundObjectsVisibility; - aJsonWriter.put("masterPageObjectsVisibility", bBackgroundObjectsVisibility); - } - } + SdMasterPage* pMasterPage = nullptr; + SdDrawPage* pMasterPageTarget(dynamic_cast<SdDrawPage*>(pSlide)); + if (pMasterPageTarget) + { + pMasterPage = pMasterPageTarget->getSdMasterPage(); + if (pMasterPage) + { + std::string sMPHash = GetInterfaceHash(cppu::getXWeak(pMasterPage)); + aJsonWriter.put("masterPage", sMPHash); - bool bBackgroundVisibility = true; // default visible - xPropSet->getPropertyValue("IsBackgroundVisible") >>= bBackgroundVisibility; - if (bBackgroundVisibility) - { - SlideBackgroundInfo aSlideBackgroundInfo(xSlide, xMasterPage); - if (aSlideBackgroundInfo.hasBackground()) - { - auto aBackgroundNode = aJsonWriter.startNode("background"); - aJsonWriter.put("isCustom", aSlideBackgroundInfo.slideHasOwnBackground()); - if (aSlideBackgroundInfo.isSolidColor()) - { - aJsonWriter.put("fillColor", aSlideBackgroundInfo.getFillColorAsRGBA()); - } - } - } + bool bBackgroundObjectsVisibility = true; // default visible + pSlide->getPropertyValue("IsBackgroundObjectsVisible") >>= bBackgroundObjectsVisibility; + aJsonWriter.put("masterPageObjectsVisibility", bBackgroundObjectsVisibility); + } + } - { - auto aVideoList = aJsonWriter.startArray("videos"); - SdrObjListIter aIterator(pPage, SdrIterMode::DeepWithGroups); - while (aIterator.IsMore()) - { - auto* pObject = aIterator.Next(); - if (pObject->GetObjIdentifier() == SdrObjKind::Media) - { - auto aVideosNode = aJsonWriter.startStruct(); - auto* pMediaObject = static_cast<SdrMediaObj*>(pObject); - auto const& rRectangle = pMediaObject->GetLogicRect(); - auto aRectangle = o3tl::convert(rRectangle, o3tl::Length::mm100, o3tl::Length::twip); - aJsonWriter.put("id", reinterpret_cast<sal_uInt64>(pMediaObject)); - aJsonWriter.put("url", pMediaObject->getTempURL()); - aJsonWriter.put("x", aRectangle.Left()); - aJsonWriter.put("y", aRectangle.Top()); - aJsonWriter.put("width", aRectangle.GetWidth()); - aJsonWriter.put("height", aRectangle.GetHeight()); - } - } - } + bool bBackgroundVisibility = true; // default visible + pSlide->getPropertyValue("IsBackgroundVisible") >>= bBackgroundVisibility; + if (bBackgroundVisibility) + { + SlideBackgroundInfo aSlideBackgroundInfo(pSlide, static_cast<SvxDrawPage*>(pMasterPage)); + if (aSlideBackgroundInfo.hasBackground()) + { + auto aBackgroundNode = aJsonWriter.startNode("background"); + aJsonWriter.put("isCustom", aSlideBackgroundInfo.slideHasOwnBackground()); + if (aSlideBackgroundInfo.isSolidColor()) + { + aJsonWriter.put("fillColor", aSlideBackgroundInfo.getFillColorAsRGBA()); + } + } + } - sal_Int32 nTransitionType = 0; - xPropSet->getPropertyValue("TransitionType") >>= nTransitionType; + { + auto aVideoList = aJsonWriter.startArray("videos"); + SdrObjListIter aIterator(pPage, SdrIterMode::DeepWithGroups); + while (aIterator.IsMore()) + { + auto* pObject = aIterator.Next(); + if (pObject->GetObjIdentifier() == SdrObjKind::Media) + { + auto aVideosNode = aJsonWriter.startStruct(); + auto* pMediaObject = static_cast<SdrMediaObj*>(pObject); + auto const& rRectangle = pMediaObject->GetLogicRect(); + auto aRectangle = o3tl::convert(rRectangle, o3tl::Length::mm100, o3tl::Length::twip); + aJsonWriter.put("id", reinterpret_cast<sal_uInt64>(pMediaObject)); + aJsonWriter.put("url", pMediaObject->getTempURL()); + aJsonWriter.put("x", aRectangle.Left()); + aJsonWriter.put("y", aRectangle.Top()); + aJsonWriter.put("width", aRectangle.GetWidth()); + aJsonWriter.put("height", aRectangle.GetHeight()); + } + } + } - if (nTransitionType != 0) - { - auto iterator = constTransitionTypeToString.find(nTransitionType); + sal_Int32 nTransitionType = 0; + pSlide->getPropertyValue("TransitionType") >>= nTransitionType; - if (iterator != constTransitionTypeToString.end()) - { - aJsonWriter.put("transitionType", iterator->second); + if (nTransitionType != 0) + { + auto iterator = constTransitionTypeToString.find(nTransitionType); - sal_Int32 nTransitionSubtype = 0; - xPropSet->getPropertyValue("TransitionSubtype") >>= nTransitionSubtype; + if (iterator != constTransitionTypeToString.end()) + { + aJsonWriter.put("transitionType", iterator->second); - auto iteratorSubType = constTransitionSubTypeToString.find(nTransitionSubtype); - if (iteratorSubType != constTransitionSubTypeToString.end()) - { - aJsonWriter.put("transitionSubtype", iteratorSubType->second); - } - else - { - SAL_WARN("sd", "Transition sub-type unknown: " << nTransitionSubtype); - } + sal_Int32 nTransitionSubtype = 0; + pSlide->getPropertyValue("TransitionSubtype") >>= nTransitionSubtype; - bool nTransitionDirection = false; - xPropSet->getPropertyValue("TransitionDirection") >>= nTransitionDirection; - aJsonWriter.put("transitionDirection", nTransitionDirection); - } + auto iteratorSubType = constTransitionSubTypeToString.find(nTransitionSubtype); + if (iteratorSubType != constTransitionSubTypeToString.end()) + { + aJsonWriter.put("transitionSubtype", iteratorSubType->second); + } + else + { + SAL_WARN("sd", "Transition sub-type unknown: " << nTransitionSubtype); + } - double nTransitionDuration(0.0); - if( xPropSet->getPropertySetInfo()->hasPropertyByName( "TransitionDuration" ) && - (xPropSet->getPropertyValue( "TransitionDuration" ) >>= nTransitionDuration ) && nTransitionDuration != 0.0 ) - { - // convert transitionDuration time to ms - aJsonWriter.put("transitionDuration", nTransitionDuration * 1000); - } + bool nTransitionDirection = false; + pSlide->getPropertyValue("TransitionDirection") >>= nTransitionDirection; + aJsonWriter.put("transitionDirection", nTransitionDirection); + } - sal_Int32 nChange(0); - if( xPropSet->getPropertySetInfo()->hasPropertyByName( "Change" ) && - (xPropSet->getPropertyValue( "Change" ) >>= nChange ) && nChange == 1 ) - { - double fSlideDuration(0); - if( xPropSet->getPropertySetInfo()->hasPropertyByName( "HighResDuration" ) && - (xPropSet->getPropertyValue( "HighResDuration" ) >>= fSlideDuration) ) - { - // convert slide duration time to ms - aJsonWriter.put("nextSlideDuration", fSlideDuration * 1000); - } - } - } + double nTransitionDuration(0.0); + if( pSlide->getPropertySetInfo()->hasPropertyByName( "TransitionDuration" ) && + (pSlide->getPropertyValue( "TransitionDuration" ) >>= nTransitionDuration ) && nTransitionDuration != 0.0 ) + { + // convert transitionDuration time to ms + aJsonWriter.put("transitionDuration", nTransitionDuration * 1000); + } - AnimationsExporter aAnimationExporter(aJsonWriter, xSlide); - if (aAnimationExporter.hasEffects()) - { - auto aAnimationsNode = aJsonWriter.startNode("animations"); - aAnimationExporter.exportAnimations(); - } + sal_Int32 nChange(0); + if( pSlide->getPropertySetInfo()->hasPropertyByName( "Change" ) && + (pSlide->getPropertyValue( "Change" ) >>= nChange ) && nChange == 1 ) + { + double fSlideDuration(0); + if( pSlide->getPropertySetInfo()->hasPropertyByName( "HighResDuration" ) && + (pSlide->getPropertyValue( "HighResDuration" ) >>= fSlideDuration) ) + { + // convert slide duration time to ms + aJsonWriter.put("nextSlideDuration", fSlideDuration * 1000); } } } + + AnimationsExporter aAnimationExporter(aJsonWriter, pSlide); + if (aAnimationExporter.hasEffects()) + { + auto aAnimationsNode = aJsonWriter.startNode("animations"); + aAnimationExporter.exportAnimations(); + } } } } @@ -4066,25 +4056,26 @@ sal_Int32 SAL_CALL SdDrawPagesAccess::getCount() } uno::Any SAL_CALL SdDrawPagesAccess::getByIndex( sal_Int32 Index ) +{ + uno::Reference< drawing::XDrawPage > xDrawPage( getDrawPageByIndex(Index) ); + return uno::Any(xDrawPage); +} + +SdGenericDrawPage* SdDrawPagesAccess::getDrawPageByIndex( sal_Int32 Index ) { ::SolarMutexGuard aGuard; if( nullptr == mpModel ) throw lang::DisposedException(); - uno::Any aAny; - if( (Index < 0) || (Index >= mpModel->mpDoc->GetSdPageCount( PageKind::Standard ) ) ) throw lang::IndexOutOfBoundsException(); SdPage* pPage = mpModel->mpDoc->GetSdPage( static_cast<sal_uInt16>(Index), PageKind::Standard ); if( pPage ) - { - uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY ); - aAny <<= xDrawPage; - } + return dynamic_cast<SdGenericDrawPage*>( pPage->getUnoPage().get() ); - return aAny; + return nullptr; } // XNameAccess diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index d4878a84e4df..c3d60bd59daf 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2343,6 +2343,11 @@ OUString SAL_CALL SdDrawPage::getName() // XMasterPageTarget Reference< drawing::XDrawPage > SAL_CALL SdDrawPage::getMasterPage( ) +{ + return static_cast<SdGenericDrawPage*>(getSdMasterPage()); +} + +SdMasterPage* SdDrawPage::getSdMasterPage() { ::SolarMutexGuard aGuard; @@ -2350,15 +2355,11 @@ Reference< drawing::XDrawPage > SAL_CALL SdDrawPage::getMasterPage( ) if(GetPage()) { - Reference< drawing::XDrawPage > xPage; - if(SvxDrawPage::mpPage->TRG_HasMasterPage()) { SdrPage& rMasterPage = SvxDrawPage::mpPage->TRG_GetMasterPage(); - xPage.set( rMasterPage.getUnoPage(), uno::UNO_QUERY ); + return dynamic_cast<SdMasterPage*>(rMasterPage.getUnoPage().get()); } - - return xPage; } return nullptr; } commit 9b26255f03d6049bb9c7eeed4b63da070849d7be Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Oct 2 19:57:36 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Oct 3 14:07:57 2024 +0200 use more concrete UNO class in ValueSetAcc Change-Id: I9d6c31ccda4ff05f33d437ab064a2a55d84627b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174411 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index cec532a39a71..f29da058aa4e 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -53,7 +53,7 @@ ValueSetItem::~ValueSetItem() } } -uno::Reference< accessibility::XAccessible > ValueSetItem::GetAccessible( bool bIsTransientChildrenDisabled ) +rtl::Reference< ValueItemAcc > ValueSetItem::GetAccessible( bool bIsTransientChildrenDisabled ) { if( !mxAcc.is() ) mxAcc = new ValueItemAcc( this, bIsTransientChildrenDisabled ); @@ -77,13 +77,6 @@ void ValueItemAcc::ParentDestroyed() mpParent = nullptr; } -ValueItemAcc* ValueItemAcc::getImplementation( const uno::Reference< uno::XInterface >& rxData ) - noexcept -{ - return dynamic_cast<ValueItemAcc*>(rxData.get()); -} - - uno::Reference< accessibility::XAccessibleContext > SAL_CALL ValueItemAcc::getAccessibleContext() { return this; diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx index 61e849cc1acd..f0902c8efdd9 100644 --- a/svtools/source/control/valueimp.hxx +++ b/svtools/source/control/valueimp.hxx @@ -61,8 +61,7 @@ struct ValueSetItem explicit ValueSetItem( ValueSet& rParent ); ~ValueSetItem(); - css::uno::Reference< css::accessibility::XAccessible > - GetAccessible( bool bIsTransientChildrenDisabled ); + rtl::Reference< ValueItemAcc > GetAccessible( bool bIsTransientChildrenDisabled ); }; typedef comphelper::WeakComponentImplHelper< @@ -206,8 +205,6 @@ public: void FireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue ); - static ValueItemAcc* getImplementation( const css::uno::Reference< css::uno::XInterface >& rxData ) noexcept; - public: // XAccessible diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index c80fc3f3e69a..05988353341a 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -142,7 +142,7 @@ void ValueSet::ImplDeleteItems() Any aOldAny; Any aNewAny; - aOldAny <<= pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ ); + aOldAny <<= Reference< XAccessible >(pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ )); ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny); } @@ -792,14 +792,14 @@ void ValueSet::SelectItem( sal_uInt16 nItemId ) if( nPos != VALUESET_ITEM_NOTFOUND ) { - ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation( - mItemList[nPos]->GetAccessible( false/*bIsTransientChildrenDisabled*/ ) ); + rtl::Reference<ValueItemAcc> pItemAcc = + mItemList[nPos]->GetAccessible( false/*bIsTransientChildrenDisabled*/ ); if( pItemAcc ) { Any aOldAny; Any aNewAny; - aOldAny <<= Reference(getXWeak(pItemAcc)); + aOldAny <<= Reference(getXWeak(pItemAcc.get())); ImplFireAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny ); } } @@ -818,8 +818,8 @@ void ValueSet::SelectItem( sal_uInt16 nItemId ) ValueItemAcc* pItemAcc = nullptr; if (pItem != nullptr) - pItemAcc = ValueItemAcc::getImplementation( - pItem->GetAccessible(false /*bIsTransientChildrenDisabled*/)); + pItemAcc = + pItem->GetAccessible(false /*bIsTransientChildrenDisabled*/).get(); if (pItemAcc) { @@ -1109,7 +1109,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) Any aOldAny; Any aNewAny; - aNewAny <<= pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/); + aNewAny <<= Reference<XAccessible>(pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/)); ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny); } @@ -1131,7 +1131,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) Any aOldAny; Any aNewAny; - aOldAny <<= pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/); + aOldAny <<= Reference<XAccessible>(pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/)); ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny); } @@ -1907,9 +1907,8 @@ void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText) if (ImplHasAccessibleListeners()) { - Reference<XAccessible> xAccessible(pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/)); - ValueItemAcc* pValueItemAcc = static_cast<ValueItemAcc*>(xAccessible.get()); - pValueItemAcc->FireAccessibleEvent(AccessibleEventId::NAME_CHANGED, aOldName, aNewName); + rtl::Reference<ValueItemAcc> xAccessible(pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/)); + xAccessible->FireAccessibleEvent(AccessibleEventId::NAME_CHANGED, aOldName, aNewName); } }