summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-27 16:57:21 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-09-06 15:47:44 -0500
commit5bce32904091ffe28884fd5c0f4801ee82bad101 (patch)
treefc2573078a858de456a0dc7b7810176d433241c7 /sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
parent10143717834d8401d85fdf9564e782a58b9983ec (diff)
SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify where the if statement had the check the wrong way around. Change-Id: I611e8929c65818191e36bd80f2b985820ada4411 Reviewed-on: https://gerrit.libreoffice.org/11147 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx41
1 files changed, 19 insertions, 22 deletions
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();
}