diff options
Diffstat (limited to 'sc/source/ui/Accessibility')
12 files changed, 114 insertions, 124 deletions
diff --git a/sc/source/ui/Accessibility/AccessibilityHints.cxx b/sc/source/ui/Accessibility/AccessibilityHints.cxx index 5dd4f22784fb..f7309f6010ff 100644 --- a/sc/source/ui/Accessibility/AccessibilityHints.cxx +++ b/sc/source/ui/Accessibility/AccessibilityHints.cxx @@ -21,8 +21,6 @@ using namespace ::com::sun::star; -TYPEINIT1(ScAccWinFocusLostHint, SfxHint); - // ScAccWinFocusLostHint - the current window lost its focus (to another application, view or document) ScAccWinFocusLostHint::ScAccWinFocusLostHint( @@ -36,8 +34,6 @@ ScAccWinFocusLostHint::~ScAccWinFocusLostHint() { } -TYPEINIT1(ScAccWinFocusGotHint, SfxHint); - // ScAccWinFocusGotHint - the window got the focus (from another application, view or document) ScAccWinFocusGotHint::ScAccWinFocusGotHint( @@ -51,8 +47,6 @@ ScAccWinFocusGotHint::~ScAccWinFocusGotHint() { } -TYPEINIT1(ScAccGridWinFocusLostHint, SfxHint); - // ScAccGridWinFocusLostHint - the current grid window lost its focus (to another application, view or document) ScAccGridWinFocusLostHint::ScAccGridWinFocusLostHint(ScSplitPos eOld, @@ -67,8 +61,6 @@ ScAccGridWinFocusLostHint::~ScAccGridWinFocusLostHint() { } -TYPEINIT1(ScAccGridWinFocusGotHint, SfxHint); - // ScAccGridWinFocusGotHint - the grid window got the focus (from another application, view or document) ScAccGridWinFocusGotHint::ScAccGridWinFocusGotHint(ScSplitPos eNew, diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 1ad86a414267..445fba0f8041 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -127,10 +127,10 @@ void SAL_CALL ScAccessibleContextBase::release() void ScAccessibleContextBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - if (rRef.GetId() == SFX_HINT_DYING) + if (pSimpleHint->GetId() == SFX_HINT_DYING) { // it seems the Broadcaster is dying, since the view is dying dispose(); diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index c38a8dc4df76..17fee2ad72d3 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -405,48 +405,45 @@ void ScChildrenShapes::SetDrawBroadcaster() void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint) { - if ( rHint.ISA( SdrHint ) ) + const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint); + if (pSdrHint) { - const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ); - if (pSdrHint) + SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()); + if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->GetPage() == GetDrawPage()) && + (pObj->GetPage() == pObj->GetObjList()) ) //only do something if the object lies direct on the page { - SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()); - if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->GetPage() == GetDrawPage()) && - (pObj->GetPage() == pObj->GetObjList()) ) //only do something if the object lies direct on the page + switch (pSdrHint->GetKind()) { - switch (pSdrHint->GetKind()) + case HINT_OBJCHG : // Objekt geaendert { - case HINT_OBJCHG : // Objekt geaendert + uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); + if (xShape.is()) { - uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); - if (xShape.is()) - { - ScShapeDataLess aLess; - std::sort(maZOrderedShapes.begin(), maZOrderedShapes.end(), aLess); // sort, because the z index or layer could be changed - CheckWhetherAnchorChanged(xShape); - } - } - break; - case HINT_OBJINSERTED : // Neues Zeichenobjekt eingefuegt - { - uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); - if (xShape.is()) - AddShape(xShape, true); - } - break; - case HINT_OBJREMOVED : // Zeichenobjekt aus Liste entfernt - { - uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); - if (xShape.is()) - RemoveShape(xShape); - } - break; - default : - { - // other events are not interesting + ScShapeDataLess aLess; + std::sort(maZOrderedShapes.begin(), maZOrderedShapes.end(), aLess); // sort, because the z index or layer could be changed + CheckWhetherAnchorChanged(xShape); } - break; } + break; + case HINT_OBJINSERTED : // Neues Zeichenobjekt eingefuegt + { + uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); + if (xShape.is()) + AddShape(xShape, true); + } + break; + case HINT_OBJREMOVED : // Zeichenobjekt aus Liste entfernt + { + uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); + if (xShape.is()) + RemoveShape(xShape); + } + break; + default : + { + // other events are not interesting + } + break; } } } @@ -1516,10 +1513,10 @@ IMPL_LINK( ScAccessibleDocument, WindowChildEventListener, VclSimpleEvent*, pEve void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( ScAccGridWinFocusLostHint ) ) + if (dynamic_cast<const ScAccGridWinFocusLostHint*>(&rHint) ) { - const ScAccGridWinFocusLostHint& rRef = (const ScAccGridWinFocusLostHint&)rHint; - if (rRef.GetOldGridWin() == meSplitPos) + const ScAccGridWinFocusLostHint* pFocusLostHint = static_cast<const ScAccGridWinFocusLostHint *>(&rHint); + if (pFocusLostHint->GetOldGridWin() == meSplitPos) { if (mxTempAcc.is() && mpTempAccEdit) mpTempAccEdit->LostFocus(); @@ -1529,10 +1526,10 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) CommitFocusLost(); } } - else if (rHint.ISA( ScAccGridWinFocusGotHint ) ) + else if (dynamic_cast<const ScAccGridWinFocusGotHint*>(&rHint) ) { - const ScAccGridWinFocusGotHint& rRef = (const ScAccGridWinFocusGotHint&)rHint; - if (rRef.GetNewGridWin() == meSplitPos) + const ScAccGridWinFocusGotHint* pFocusGotHint = static_cast<const ScAccGridWinFocusGotHint*>(&rHint); + if (pFocusGotHint->GetNewGridWin() == meSplitPos) { uno::Reference<XAccessible> xAccessible; if (mpChildrenShapes) @@ -1560,11 +1557,11 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } } } - else if (rHint.ISA( SfxSimpleHint )) + else if (dynamic_cast<const SfxSimpleHint*>(&rHint)) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; + const SfxSimpleHint* pSimpleHint = static_cast<const SfxSimpleHint*>(&rHint); // only notify if child exist, otherwise it is not necessary - if ((rRef.GetId() == SC_HINT_ACC_TABLECHANGED) && + if ((pSimpleHint->GetId() == SC_HINT_ACC_TABLECHANGED) && mpAccessibleSpreadsheet) { FreeAccessibleSpreadsheet(); @@ -1588,12 +1585,12 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if (mpAccessibleSpreadsheet) mpAccessibleSpreadsheet->FireFirstCellFocus(); } - else if (rRef.GetId() == SC_HINT_ACC_MAKEDRAWLAYER) + else if (pSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER) { if (mpChildrenShapes) mpChildrenShapes->SetDrawBroadcaster(); } - else if ((rRef.GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell + else if ((pSimpleHint->GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell { if (mpViewShell->GetViewData().HasEditView(meSplitPos)) { @@ -1617,7 +1614,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } } } - else if (rRef.GetId() == SC_HINT_ACC_LEAVEEDITMODE) + else if (pSimpleHint->GetId() == SC_HINT_ACC_LEAVEEDITMODE) { if (mxTempAcc.is()) { @@ -1632,7 +1629,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) CommitFocusGained(); } } - else if ((rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) || (rRef.GetId() == SC_HINT_ACC_WINDOWRESIZED)) + else if ((pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) || (pSimpleHint->GetId() == SC_HINT_ACC_WINDOWRESIZED)) { Rectangle aOldVisArea(maVisArea); maVisArea = GetVisibleArea_Impl(); diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 1afaa5bfe0af..d4d7251a45d5 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -748,26 +748,23 @@ void ScShapeChildren::SetDrawBroadcaster() void ScShapeChildren::Notify(SfxBroadcaster&, const SfxHint& rHint) { - if ( rHint.ISA( SdrHint ) ) + const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint ); + if (pSdrHint) { - const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ); - if (pSdrHint) + SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()); + if (pObj && (pObj->GetPage() == GetDrawPage())) { - SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()); - if (pObj && (pObj->GetPage() == GetDrawPage())) + switch (pSdrHint->GetKind()) { - switch (pSdrHint->GetKind()) + case HINT_OBJCHG : // Objekt geaendert { - case HINT_OBJCHG : // Objekt geaendert - { - } - break; - default : - { - // other events are not interesting - } - break; } + break; + default : + { + // other events are not interesting + } + break; } } } @@ -1298,11 +1295,11 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing() void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; // only notify if child exist, otherwise it is not necessary - if ((rRef.GetId() == SC_HINT_DATACHANGED)) + if (pSimpleHint->GetId() == SC_HINT_DATACHANGED) { if (mpTable) // if there is no table there is nothing to notify, because no one recongnizes the change { @@ -1352,11 +1349,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint } } } - else if (rRef.GetId() == SC_HINT_ACC_MAKEDRAWLAYER) + else if (pSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER) { GetShapeChildren()->SetDrawBroadcaster(); } - else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) { Size aOutputSize; Window* pSizeWindow = mpViewShell->GetWindow(); @@ -1374,11 +1371,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint CommitChange(aEvent); } } - else if ( rHint.ISA(ScAccWinFocusLostHint) ) + else if ( dynamic_cast<const ScAccWinFocusLostHint*>(&rHint) ) { CommitFocusLost(); } - else if ( rHint.ISA(ScAccWinFocusGotHint) ) + else if ( dynamic_cast<const ScAccWinFocusGotHint*>(&rHint) ) { CommitFocusGained(); } diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index cd202683ba61..4eafb7a46005 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -123,11 +123,11 @@ void SAL_CALL ScAccessiblePageHeader::disposing() void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint ); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; // only notify if child exist, otherwise it is not necessary - if ((rRef.GetId() == SC_HINT_DATACHANGED)) + if (pSimpleHint->GetId() == SC_HINT_DATACHANGED) { ScHFAreas aOldAreas(maAreas); std::for_each(aOldAreas.begin(), aOldAreas.end(), Acquire()); @@ -161,7 +161,7 @@ void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } std::for_each(aOldAreas.begin(), aOldAreas.end(), Release()); } - else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) { AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED; diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 78f8579726b5..68682e0675c2 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -90,11 +90,11 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing() void ScAccessiblePageHeaderArea::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; // only notify if child exist, otherwise it is not necessary - if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) { if (mpTextHelper) mpTextHelper->UpdateChildren(); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index d2cc20171cf3..3f6b018126b1 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -81,14 +81,11 @@ void SAL_CALL ScAccessiblePreviewCell::disposing() void ScAccessiblePreviewCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint )) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint && pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) - { - if (mpTextHelper) - mpTextHelper->UpdateChildren(); - } + if (mpTextHelper) + mpTextHelper->UpdateChildren(); } ScAccessibleContextBase::Notify(rBC, rHint); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index fdfa6eeb2834..12221e5d0117 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -115,10 +115,10 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing() void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint )) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - sal_uLong nId = rRef.GetId(); + sal_uLong nId = pSimpleHint->GetId(); if (nId == SC_HINT_ACC_VISAREACHANGED) { if (mpTextHelper) diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index f8e0e99726a8..79a67150840b 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -87,17 +87,17 @@ void SAL_CALL ScAccessiblePreviewTable::disposing() void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint )) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - sal_uLong nId = rRef.GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DATACHANGED ) { // column / row layout may change with any document change, // so it must be invalidated DELETEZ( mpTableInfo ); } - else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) { AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED; diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index ef9b834054e5..896d2bd6abee 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -418,10 +418,10 @@ void ScAccessibleSpreadsheet::VisAreaChanged() void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if (pSimpleHint) { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - if ((rRef.GetId() == SC_HINT_ACC_CURSORCHANGED)) + if (pSimpleHint->GetId() == SC_HINT_ACC_CURSORCHANGED) { if (mpViewShell) { @@ -432,7 +432,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint { NotifyRefMode(); m_bFormulaLastMode = true; - return ; + return; } if (m_bFormulaLastMode) {//Last Notify Mode Is Formula Mode. @@ -599,7 +599,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint m_LastMarkedRanges = *mpMarkedRanges; } } - else if ((rRef.GetId() == SC_HINT_DATACHANGED)) + else if (pSimpleHint->GetId() == SC_HINT_DATACHANGED) { if (!mbDelIns) CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE); @@ -657,9 +657,9 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint } }*/ } - else if (rHint.ISA( ScUpdateRefHint )) + else if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) ) { - const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint; + const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint); if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //test whether table is inserted or deleted { if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) && diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index a6bf37e629f8..3dc8ba52fdd7 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -729,9 +729,10 @@ ScAccessibleCellTextData::~ScAccessibleCellTextData() void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { mpViewShell = NULL; // invalid now @@ -991,9 +992,10 @@ ScAccessibleEditObjectTextData::~ScAccessibleEditObjectTextData() void ScAccessibleEditObjectTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { mpWindow = NULL; @@ -1254,9 +1256,10 @@ ScAccessiblePreviewCellTextData::~ScAccessiblePreviewCellTextData() void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { mpViewShell = NULL; // invalid now @@ -1331,9 +1334,10 @@ ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData() void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { mpViewShell = NULL; // invalid now @@ -1453,9 +1457,10 @@ ScAccessibleTextData* ScAccessibleHeaderTextData::Clone() const void ScAccessibleHeaderTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { mpViewShell = NULL;// invalid now @@ -1567,9 +1572,10 @@ ScAccessibleTextData* ScAccessibleNoteTextData::Clone() const void ScAccessibleNoteTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { mpViewShell = NULL;// invalid now @@ -1707,9 +1713,10 @@ ScAccessibleCsvTextData::~ScAccessibleCsvTextData() void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.ISA( SfxSimpleHint ) ) + const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); + if ( pSimpleHint ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = pSimpleHint->GetId(); if( nId == SFX_HINT_DYING ) { mpWindow = NULL; diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx index 56c028b17ba2..844bf114e222 100644 --- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx +++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx @@ -54,7 +54,7 @@ void SAL_CALL ScDrawModelBroadcaster::removeEventListener( const uno::Reference< void ScDrawModelBroadcaster::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - const SdrHint *pSdrHint = PTR_CAST( SdrHint, &rHint ); + const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint); if( !pSdrHint ) return; |